diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 4ed3772..26da2b1 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - pgver: [12, 13, 14, 15, 16] + pgver: [12, 13, 14, 15, 16, 17beta2] steps: - name: Checkout set_user repo @@ -30,7 +30,9 @@ jobs: - name: Set DEVPKG to pgver if unset if: ${{ env.DEVPKG == '' }} run: | - echo "DEVPKG=${{ matrix.pgver }}" >> $GITHUB_ENV; + # Cut off label and leave only major version number (17beta2 -> 17) + DEVPKG=$(echo ${{ matrix.pgver }} | sed 's/^\([0-9]\{2\}\).*/\1/') + echo "DEVPKG=$DEVPKG" >> $GITHUB_ENV; - name: Build set_user run: | diff --git a/src/compatibility.h b/src/compatibility.h index 558e807..0b5a6c2 100644 --- a/src/compatibility.h +++ b/src/compatibility.h @@ -16,6 +16,20 @@ #define NO_ASSERT_AUTH_UID_ONCE !USE_ASSERT_CHECKING #endif +/* + * PostgreSQL version 17+ + * + * - Sets bypass_login_check parameter to false in InitializeSessionUserId funcion + */ +#if PG_VERSION_NUM >= 170000 + +#ifndef INITSESSIONUSER +#define INITSESSIONUSER +#define _InitializeSessionUserId(name,ouserid) InitializeSessionUserId(name,ouserid,false) +#endif + +#endif /* 17+ */ + /* * PostgreSQL version 14+ * @@ -135,8 +149,10 @@ _heap_tuple_get_oid(HeapTuple tuple, Oid catalogID) #if PG_VERSION_NUM >= 90500 #define GETUSERNAMEFROMID(ouserid) GetUserNameFromId(ouserid, false) +#ifndef INITSESSIONUSER #define INITSESSIONUSER #define _InitializeSessionUserId(name,ouserid) InitializeSessionUserId(name,ouserid) +#endif #endif /* 9.5+ */