Skip to content

Commit

Permalink
Build PG17
Browse files Browse the repository at this point in the history
  • Loading branch information
kathia-barahona committed Aug 16, 2024
1 parent 1da6e18 commit b0eaf3b
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
pg-version: [11, 12, 13, 14, 15, 16]
pg-version: [11, 12, 13, 14, 15, 16, 17]
steps:
- id: install
run: |
Expand All @@ -25,7 +25,7 @@ jobs:
# Get the postgresql gpg key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8
# Setup the Postgres repositories
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main ${{ matrix.pg-version }}" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
# Install build deps
sudo apt-get install -y postgresql-server-dev-${{ matrix.pg-version }}
Expand Down
68 changes: 68 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/aiven_gatekeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@

PG_MODULE_MAGIC;

/* Check the PostgreSQL version */
#if PG_VERSION_NUM >= 170000
/* For PostgreSQL 17 and later, use current_role_is_superuser */
#define SUPERUSER_CHECK current_role_is_superuser
#else
/* For earlier versions, use session_auth_is_superuser */
#define SUPERUSER_CHECK session_auth_is_superuser
#endif


void _PG_init(void);
void _PG_fini(void);

Expand Down Expand Up @@ -141,7 +151,7 @@ is_elevated(void)
is_superuser = superuser_arg(currentUserId);

/* elevated to supersuser when the session auth user does not have superuser privileges */
return is_superuser && !session_auth_is_superuser;
return is_superuser && !SUPERUSER_CHECK();
}

static bool
Expand Down

0 comments on commit b0eaf3b

Please sign in to comment.