diff -Nru postgresql-plproxy-2.10.0/.github/workflows/ci.yml postgresql-plproxy-2.11.0/.github/workflows/ci.yml --- postgresql-plproxy-2.10.0/.github/workflows/ci.yml 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/.github/workflows/ci.yml 2023-09-15 13:52:25.000000000 +0000 @@ -22,26 +22,33 @@ strategy: matrix: test: - - {pgver: "9.3", os: "ubuntu-16.04"} - - {pgver: "9.4", os: "ubuntu-16.04"} - - {pgver: "9.5", os: "ubuntu-18.04"} - - {pgver: "9.6", os: "ubuntu-18.04"} - - {pgver: "10", os: "ubuntu-20.04"} - - {pgver: "11", os: "ubuntu-20.04"} - - {pgver: "12", os: "ubuntu-20.04"} - - {pgver: "13", os: "ubuntu-20.04"} - - {pgver: "11", os: "macos-10.15"} - - {pgver: "12", os: "macos-10.15"} + - {pgver: "9.4", os: "ubuntu-latest"} + - {pgver: "9.5", os: "ubuntu-latest"} + - {pgver: "9.6", os: "ubuntu-latest"} + - {pgver: "10", os: "ubuntu-latest"} + - {pgver: "11", os: "ubuntu-latest"} + - {pgver: "12", os: "ubuntu-latest"} + - {pgver: "13", os: "ubuntu-latest"} + - {pgver: "14", os: "ubuntu-latest"} + - {pgver: "15", os: "ubuntu-latest"} + - {pgver: "16", os: "ubuntu-latest"} + - {pgver: "14", os: "macos-latest"} + - {pgver: "15", os: "macos-latest"} steps: - name: "Checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "InstallDB / Linux" if: ${{runner.os == 'Linux'}} run: | echo "::group::apt-get-update" - echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.test.pgver}}" \ - | sudo tee /etc/apt/sources.list.d/pgdg.list + sudo -nH apt-get -q update + sudo -nH apt-get -q install curl ca-certificates gnupg + curl https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | gpg --dearmor \ + | sudo -nH tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg + echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.test.PG}}" \ + | sudo -nH tee /etc/apt/sources.list.d/pgdg.list sudo -nH apt-get -q update echo "::endgroup::" @@ -58,9 +65,9 @@ echo "::endgroup::" # tune environment - echo "::add-path::/usr/lib/postgresql/${{matrix.test.pgver}}/bin" - echo "::set-env name=PGHOST::/tmp" - echo "::set-env name=SED::sed" + echo "/usr/lib/postgresql/${{matrix.test.pgver}}/bin" >> $GITHUB_PATH + echo "PGHOST=/tmp" >> $GITHUB_ENV + echo "SED=sed" >> $GITHUB_ENV dpkg -l postgres\* libpq\* bison\* flex\* gcc\* clang\* libllvm\* @@ -70,10 +77,10 @@ echo "::group::install" brew install patchutils bison flex gnu-sed postgresql@${{matrix.test.pgver}} echo "::endgroup::" - echo "::add-path::/usr/local/opt/flex/bin" - echo "::add-path::/usr/local/opt/bison/bin" - echo "::add-path::/usr/local/opt/postgresql@${{matrix.test.pgver}}/bin" - echo "::set-env name=SED::gsed" + echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH + echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH + echo "/usr/local/opt/postgresql@${{matrix.test.pgver}}/bin" >> $GITHUB_PATH + echo "SED=gsed" >> $GITHUB_ENV - name: "Build" run: make BISON=bison FLEX=flex @@ -103,26 +110,31 @@ strategy: matrix: test: - - {os: "windows-2016", arch: i686, mingw: mingw32} - - {os: "windows-2019", arch: x86_64, mingw: mingw64} + #- {os: "windows-latest", arch: i686, mingw: mingw32} + - {os: "windows-latest", arch: x86_64, mingw: mingw64} steps: - name: "Checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Setup MSYS" shell: cmd run: | - echo ::add-path::C:\msys64\usr\bin - echo ::add-path::C:\msys64\${{matrix.test.mingw}}\bin + echo C:\msys64\usr\bin>> %GITHUB_PATH% + echo C:\msys64\${{matrix.test.mingw}}\bin>> %GITHUB_PATH% - name: "InstallDB / mingw / ${{matrix.test.arch}}" shell: bash run: | - pacman -S --noconfirm --needed mingw-w64-${{matrix.test.arch}}-postgresql + pacman -S --noconfirm --needed \ + flex bison \ + mingw-w64-${{matrix.test.arch}}-gettext \ + mingw-w64-${{matrix.test.arch}}-postgresql - name: "Build" shell: bash - run: make + run: | + export EXTRA_CPPFLAGS="-fstack-check=no -fno-stack-protector" # enabled by default but broken + make FLEX=flex BISON=bison - name: "Install" shell: bash @@ -149,14 +161,14 @@ name: pgxn-tools, PostgreSQL ${{ matrix.pg }} strategy: matrix: - pg: [12, 11] - runs-on: ubuntu-20.04 + pg: ["16", "14", "10", "9.6"] + runs-on: ubuntu-latest container: pgxn/pgxn-tools steps: - name: Start PostgreSQL ${{matrix.pg}} run: LANG=C LC_ALL=C pg-start ${{matrix.pg}} bison flex - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Test on PostgreSQL ${{matrix.pg}} run: pg-build-test diff -Nru postgresql-plproxy-2.10.0/.github/workflows/release.yml postgresql-plproxy-2.11.0/.github/workflows/release.yml --- postgresql-plproxy-2.10.0/.github/workflows/release.yml 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/.github/workflows/release.yml 2023-09-15 13:52:25.000000000 +0000 @@ -8,12 +8,12 @@ jobs: release: name: Release - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout code id: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build tarball id: build @@ -21,47 +21,36 @@ make checkver make dist make doc/note.md - EXTENSION=$(grep ^EXTENSION Makefile | sed 's/.*= *//') - EXT_VERSION=$(grep ^EXTVERSION Makefile | sed 's/.*= *//') - test "${{github.ref}}" = "refs/tags/v${EXT_VERSION}" || { echo "ERR: tag mismatch"; exit 1; } - echo "::set-env name=EXTENSION::${EXTENSION}" - echo "::set-env name=EXT_VERSION::${EXT_VERSION}" - echo "::set-env name=TGZ::${EXTENSION}-${EXT_VERSION}.tar.gz" + PACKAGE=$(grep ^EXTENSION Makefile | sed 's/.*= *//') + VERSION=$(grep ^EXTVERSION Makefile | sed 's/.*= *//') + test "${{github.ref}}" = "refs/tags/v${VERSION}" || { echo "ERR: tag mismatch"; exit 1; } + echo "PACKAGE=${PACKAGE}" >> $GITHUB_ENV + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "TGZ=${PACKAGE}-${VERSION}.tar.gz" >> $GITHUB_ENV + echo "DRAFT=false" >> $GITHUB_ENV + echo "PRERELEASE=false" >> $GITHUB_ENV - - name: Create release - id: release - uses: actions/create-release@v1 + - name: "Create Github release" env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - tag_name: ${{github.ref}} - release_name: ${{github.event.repository.name}} v${{env.EXT_VERSION}} - body_path: doc/note.md - draft: false - prerelease: false - - - name: Upload source - id: upload - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - upload_url: ${{steps.release.outputs.upload_url}} - asset_path: ${{env.TGZ}} - asset_name: ${{env.TGZ}} - asset_content_type: application/x-gzip + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + title="${EXT_VERSION} v${VERSION}" + ghf="--notes-file=doc/note.md" + if test "${DRAFT}" = "true"; then ghf="${ghf} --draft"; fi + if test "${PRERELEASE}" = "true"; then ghf="${ghf} --prerelease"; fi + gh release create "v${VERSION}" "${TGZ}" --title="${title}" ${ghf} pgxn_upload: name: Upload to PGXN needs: [release] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest container: image: pgxn/pgxn-tools env: PGXN_USERNAME: ${{secrets.PGXN_USERNAME}} PGXN_PASSWORD: ${{secrets.PGXN_PASSWORD}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: pgxn-bundle - run: pgxn-release diff -Nru postgresql-plproxy-2.10.0/META.json postgresql-plproxy-2.11.0/META.json --- postgresql-plproxy-2.10.0/META.json 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/META.json 2023-09-15 13:52:25.000000000 +0000 @@ -2,7 +2,7 @@ "name": "plproxy", "abstract": "Database partitioning implemented as procedural language", "description": "PL/Proxy is database partitioning system implemented as PL language.", - "version": "2.10.0", + "version": "2.11.0", "maintainer": [ "Marko Kreen " ], @@ -14,7 +14,7 @@ "abstract": "Database partitioning implemented as procedural language", "file": "sql/pgxn.sql", "docfile": "doc/tutorial.md", - "version": "2.10.0" + "version": "2.11.0" } }, "prereqs": { diff -Nru postgresql-plproxy-2.10.0/Makefile postgresql-plproxy-2.11.0/Makefile --- postgresql-plproxy-2.10.0/Makefile 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/Makefile 2023-09-15 13:52:25.000000000 +0000 @@ -1,8 +1,8 @@ EXTENSION = plproxy # sync with NEWS, META.json, plproxy.control -EXTVERSION = 2.10.0 -UPGRADE_VERS = 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.9.0 +EXTVERSION = 2.11.0 +UPGRADE_VERS = 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.9.0 2.10.0 DISTVERSION = $(EXTVERSION) # set to 1 to disallow functions containing SELECT @@ -26,7 +26,7 @@ # Server include must come before client include, because there could # be mismatching libpq-dev and postgresql-server-dev installed. -PG_CPPFLAGS = -I$(PQINCSERVER) -I$(PQINC) -DNO_SELECT=$(NO_SELECT) +PG_CPPFLAGS = -I$(PQINCSERVER) -I$(PQINC) -DNO_SELECT=$(NO_SELECT) $(EXTRA_CPPFLAGS) ifdef VPATH PG_CPPFLAGS += -I$(VPATH)/src diff -Nru postgresql-plproxy-2.10.0/NEWS.md postgresql-plproxy-2.11.0/NEWS.md --- postgresql-plproxy-2.10.0/NEWS.md 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/NEWS.md 2023-09-15 13:52:25.000000000 +0000 @@ -1,6 +1,14 @@ # PL/Proxy Changelog +**2023-09-15 - PL/Proxy 2.11.0 - "Reverse vacuum"** + +- Fixes: + + * Support PG16 - use `object_aclcheck()`. + * Support PG15+ on win32 - use `pg_prng.h` if available. + * Tests: work around noisy messages from libpq. + **2020-09-26 - PL/Proxy 2.10.0 - "Webscale omelet"** - Features: diff -Nru postgresql-plproxy-2.10.0/debian/changelog postgresql-plproxy-2.11.0/debian/changelog --- postgresql-plproxy-2.10.0/debian/changelog 2022-10-24 14:12:01.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/changelog 2023-09-18 19:47:19.000000000 +0000 @@ -1,3 +1,24 @@ +postgresql-plproxy (2.11.0-11) unstable; urgency=medium + + * Upload for PostgreSQL 16. + * Use ${postgresql:Depends}. + + -- Christoph Berg Mon, 18 Sep 2023 21:47:19 +0200 + +postgresql-plproxy (2.11.0-10) unstable; urgency=medium + + * New upstream version. + * Drop build-time tests, don't work without access to /var/run/postgresql. + * Update homepage. + + -- Christoph Berg Fri, 15 Sep 2023 16:27:10 +0200 + +postgresql-plproxy (2.10.0-9) unstable; urgency=medium + + * Remove newpid from test dependencies. + + -- Christoph Berg Mon, 04 Sep 2023 10:26:19 +0000 + postgresql-plproxy (2.10.0-8) unstable; urgency=medium * Upload for PostgreSQL 15. diff -Nru postgresql-plproxy-2.10.0/debian/control postgresql-plproxy-2.11.0/debian/control --- postgresql-plproxy-2.10.0/debian/control 2022-10-24 14:12:01.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/control 2023-09-18 19:47:19.000000000 +0000 @@ -4,19 +4,18 @@ Maintainer: Debian PostgreSQL Maintainers Uploaders: Christoph Berg , Peter Eisentraut Build-Depends: debhelper-compat (= 13), - flex, bison, asciidoc, - newpid [linux-any], - postgresql-all (>= 217~), -Standards-Version: 4.6.1 + flex, bison, + postgresql-server-dev-all (>= 217~), +Standards-Version: 4.6.2 Rules-Requires-Root: no -Homepage: https://pgfoundry.org/projects/plproxy/ +Homepage: https://plproxy.github.io/ Vcs-Git: https://salsa.debian.org/postgresql/postgresql-plproxy.git Vcs-Browser: https://salsa.debian.org/postgresql/postgresql-plproxy -Package: postgresql-15-plproxy +Package: postgresql-16-plproxy Architecture: any -Depends: postgresql-15, ${misc:Depends}, ${shlibs:Depends} -Description: database partitioning system for PostgreSQL 15 +Depends: ${postgresql:Depends}, ${misc:Depends}, ${shlibs:Depends} +Description: database partitioning system for PostgreSQL 16 PL/Proxy is a database partitioning system implemented as a PL language. Main idea is that proxy functions are created with same signature as the remote functions to be called, so only destination info needs to be specified inside diff -Nru postgresql-plproxy-2.10.0/debian/control.in postgresql-plproxy-2.11.0/debian/control.in --- postgresql-plproxy-2.10.0/debian/control.in 2022-10-24 14:12:01.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/control.in 2023-09-18 19:47:19.000000000 +0000 @@ -4,18 +4,17 @@ Maintainer: Debian PostgreSQL Maintainers Uploaders: Christoph Berg , Peter Eisentraut Build-Depends: debhelper-compat (= 13), - flex, bison, asciidoc, - newpid [linux-any], - postgresql-all (>= 217~), -Standards-Version: 4.6.1 + flex, bison, + postgresql-server-dev-all (>= 217~), +Standards-Version: 4.6.2 Rules-Requires-Root: no -Homepage: https://pgfoundry.org/projects/plproxy/ +Homepage: https://plproxy.github.io/ Vcs-Git: https://salsa.debian.org/postgresql/postgresql-plproxy.git Vcs-Browser: https://salsa.debian.org/postgresql/postgresql-plproxy Package: postgresql-PGVERSION-plproxy Architecture: any -Depends: postgresql-PGVERSION, ${misc:Depends}, ${shlibs:Depends} +Depends: ${postgresql:Depends}, ${misc:Depends}, ${shlibs:Depends} Description: database partitioning system for PostgreSQL PGVERSION PL/Proxy is a database partitioning system implemented as a PL language. Main idea is that proxy functions are created with same signature as the remote diff -Nru postgresql-plproxy-2.10.0/debian/copyright postgresql-plproxy-2.11.0/debian/copyright --- postgresql-plproxy-2.10.0/debian/copyright 2013-01-08 16:18:38.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/copyright 2023-09-15 11:07:29.000000000 +0000 @@ -1,8 +1,6 @@ This package was debianized by Fernando Ike de Oliveira on Tue, 05 Jun 2007 23:19:56 -0300. -It was downloaded from . - Upstream Authors: Sven Suursoho , Marko Kreen diff -Nru postgresql-plproxy-2.10.0/debian/patches/localhost postgresql-plproxy-2.11.0/debian/patches/localhost --- postgresql-plproxy-2.10.0/debian/patches/localhost 2020-10-09 09:31:04.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/patches/localhost 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -Run tests via localhost so the unix socket location doesn't matter - ---- a/test/expected/plproxy_test.out -+++ b/test/expected/plproxy_test.out -@@ -244,7 +244,7 @@ select * from test_types2('types', NULL, - - -- test CONNECT - create function test_connect1() returns text --as $$ connect 'dbname=test_part'; select current_database(); $$ language plproxy; -+as $$ connect 'dbname=test_part host=localhost'; select current_database(); $$ language plproxy; - select * from test_connect1(); - test_connect1 - --------------- -@@ -254,7 +254,7 @@ select * from test_connect1(); - -- test CONNECT $argument - create function test_connect2(connstr text) returns text - as $$ connect connstr; select current_database(); $$ language plproxy; --select * from test_connect2('dbname=test_part'); -+select * from test_connect2('dbname=test_part host=localhost'); - test_connect2 - --------------- - test_part -@@ -263,7 +263,7 @@ select * from test_connect2('dbname=test - -- test CONNECT function($argument) - create function test_connect3(connstr text) returns text - as $$ connect text(connstr); select current_database(); $$ language plproxy; --select * from test_connect3('dbname=test_part'); -+select * from test_connect3('dbname=test_part host=localhost'); - test_connect3 - --------------- - test_part -@@ -409,7 +409,7 @@ NOTICE: PL/Proxy: dropping stale conn - ERROR: public.test_error2(0): [test_part] REMOTE ERROR: column "err" does not exist at character 8 - create function test_error3() returns int4 - as $$ -- connect 'dbname=test_part'; -+ connect 'dbname=test_part host=localhost'; - $$ language plproxy; - select * from test_error3(); - ERROR: public.test_error3(0): [test_part] REMOTE ERROR: function public.test_error3() does not exist at character 21 -@@ -423,7 +423,7 @@ ERROR: PL/Proxy function public.test_ba - - create function test_bad_db2() returns int4 - as $$ -- connect 'dbname=wrong_name_db'; -+ connect 'dbname=wrong_name_db host=localhost'; - $$ language plproxy; - select * from test_bad_db2(); - ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist ---- a/test/sql/plproxy_test.sql -+++ b/test/sql/plproxy_test.sql -@@ -145,18 +145,18 @@ select * from test_types2('types', NULL, - - -- test CONNECT - create function test_connect1() returns text --as $$ connect 'dbname=test_part'; select current_database(); $$ language plproxy; -+as $$ connect 'dbname=test_part host=localhost'; select current_database(); $$ language plproxy; - select * from test_connect1(); - - -- test CONNECT $argument - create function test_connect2(connstr text) returns text - as $$ connect connstr; select current_database(); $$ language plproxy; --select * from test_connect2('dbname=test_part'); -+select * from test_connect2('dbname=test_part host=localhost'); - - -- test CONNECT function($argument) - create function test_connect3(connstr text) returns text - as $$ connect text(connstr); select current_database(); $$ language plproxy; --select * from test_connect3('dbname=test_part'); -+select * from test_connect3('dbname=test_part host=localhost'); - - -- test quoting function - create type "RetWeird" as ( -@@ -272,7 +272,7 @@ select * from test_error2(); - - create function test_error3() returns int4 - as $$ -- connect 'dbname=test_part'; -+ connect 'dbname=test_part host=localhost'; - $$ language plproxy; - select * from test_error3(); - -@@ -285,7 +285,7 @@ select * from test_bad_db(); - - create function test_bad_db2() returns int4 - as $$ -- connect 'dbname=wrong_name_db'; -+ connect 'dbname=wrong_name_db host=localhost'; - $$ language plproxy; - select * from test_bad_db2(); - diff -Nru postgresql-plproxy-2.10.0/debian/patches/localhost-pg14 postgresql-plproxy-2.11.0/debian/patches/localhost-pg14 --- postgresql-plproxy-2.10.0/debian/patches/localhost-pg14 2021-10-01 11:55:37.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/patches/localhost-pg14 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ ---- a/test/expected/plproxy_test.out -+++ b/test/expected/plproxy_test.out -@@ -413,18 +413,18 @@ as $$ - $$ language plproxy; - select * from test_error3(); - ERROR: public.test_error3(0): [test_part] REMOTE ERROR: function public.test_error3() does not exist at character 21 -+-- error messages below contain hostname+IP in PG14+, mute here so we don't need 2^N output files -+/* - -- test invalid db - create function test_bad_db() returns int4 - as $$ - cluster 'badcluster'; - $$ language plproxy; - select * from test_bad_db(); --ERROR: PL/Proxy function public.test_bad_db(0): [nonex_db] PQconnectPoll: FATAL: database "nonex_db" does not exist - - create function test_bad_db2() returns int4 - as $$ - connect 'dbname=wrong_name_db host=localhost'; - $$ language plproxy; - select * from test_bad_db2(); --ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist -- -+*/ ---- a/test/expected/plproxy_test_1.out -+++ b/test/expected/plproxy_test_1.out -@@ -413,18 +413,18 @@ as $$ - $$ language plproxy; - select * from test_error3(); - ERROR: public.test_error3(0): [test_part] REMOTE ERROR: function public.test_error3() does not exist at character 21 -+-- error messages below contain hostname+IP in PG14+, mute here so we don't need 2^N output files -+/* - -- test invalid db - create function test_bad_db() returns int4 - as $$ - cluster 'badcluster'; - $$ language plproxy; - select * from test_bad_db(); --ERROR: PL/Proxy function public.test_bad_db(0): [nonex_db] PQconnectPoll: FATAL: database "nonex_db" does not exist - - create function test_bad_db2() returns int4 - as $$ - connect 'dbname=wrong_name_db host=localhost'; - $$ language plproxy; - select * from test_bad_db2(); --ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist -- -+*/ ---- a/test/sql/plproxy_test.sql -+++ b/test/sql/plproxy_test.sql -@@ -276,6 +276,8 @@ as $$ - $$ language plproxy; - select * from test_error3(); - -+-- error messages below contain hostname+IP in PG14+, mute here so we don't need 2^N output files -+/* - -- test invalid db - create function test_bad_db() returns int4 - as $$ -@@ -288,5 +290,5 @@ as $$ - connect 'dbname=wrong_name_db host=localhost'; - $$ language plproxy; - select * from test_bad_db2(); -- -+*/ - diff -Nru postgresql-plproxy-2.10.0/debian/patches/series postgresql-plproxy-2.11.0/debian/patches/series --- postgresql-plproxy-2.10.0/debian/patches/series 2021-09-13 07:47:46.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -localhost -localhost-pg14 diff -Nru postgresql-plproxy-2.10.0/debian/rules postgresql-plproxy-2.11.0/debian/rules --- postgresql-plproxy-2.10.0/debian/rules 2021-09-13 07:47:46.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/rules 2023-09-18 19:47:19.000000000 +0000 @@ -9,10 +9,7 @@ dh_installdocs -a --all AUTHORS doc/*.md override_dh_pgxs_test: -ifeq ($(DEB_HOST_ARCH_OS), linux) - newnet pg_buildext -o 'port=5432' -c '--locale=C' -i '--auth=trust' \ - -o "unix_socket_directories=/tmp" installcheck . test postgresql-%v-plproxy -endif + # defer testing to autopkgtest %: dh $@ --with pgxs diff -Nru postgresql-plproxy-2.10.0/debian/tests/control postgresql-plproxy-2.11.0/debian/tests/control --- postgresql-plproxy-2.10.0/debian/tests/control 2021-09-13 07:47:46.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/tests/control 2023-09-04 10:22:10.000000000 +0000 @@ -1,3 +1,3 @@ Tests: installcheck -Depends: @, make, newpid, postgresql-common (>= 217~) -Restrictions: allow-stderr +Depends: @, make, postgresql-common (>= 217~) +Restrictions: allow-stderr, needs-root diff -Nru postgresql-plproxy-2.10.0/debian/tests/installcheck postgresql-plproxy-2.11.0/debian/tests/installcheck --- postgresql-plproxy-2.10.0/debian/tests/installcheck 2020-10-09 09:50:14.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/tests/installcheck 2023-09-18 19:47:19.000000000 +0000 @@ -1,4 +1,7 @@ #!/bin/sh -newnet pg_buildext -o 'port=5432' -c '--locale=C' -i '--auth=trust' \ - -o "unix_socket_directories=/tmp" installcheck . test +# make 5432 available +service postgresql stop + +pg_buildext -o 'port=5432' -c '--locale=C' -i '--auth=trust' \ + installcheck . test diff -Nru postgresql-plproxy-2.10.0/debian/watch postgresql-plproxy-2.11.0/debian/watch --- postgresql-plproxy-2.10.0/debian/watch 2016-10-13 14:48:22.000000000 +0000 +++ postgresql-plproxy-2.11.0/debian/watch 2023-09-18 19:47:19.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 -https://plproxy.github.io/ .*/plproxy-([0-9.]+).tar.gz +version=4 +https://github.com/plproxy/plproxy/tags .*/v([0-9.]+).tar.gz diff -Nru postgresql-plproxy-2.10.0/plproxy.control postgresql-plproxy-2.11.0/plproxy.control --- postgresql-plproxy-2.10.0/plproxy.control 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/plproxy.control 2023-09-15 13:52:25.000000000 +0000 @@ -1,6 +1,6 @@ # plproxy extension comment = 'Database partitioning implemented as procedural language' -default_version = '2.10.0' +default_version = '2.11.0' module_pathname = '$libdir/plproxy' relocatable = false # schema = pg_catalog diff -Nru postgresql-plproxy-2.10.0/src/cluster.c postgresql-plproxy-2.11.0/src/cluster.c --- postgresql-plproxy-2.10.0/src/cluster.c 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/src/cluster.c 2023-09-15 13:52:25.000000000 +0000 @@ -24,6 +24,11 @@ #include "plproxy.h" +#if PG_VERSION_NUM >= 160000 +#define pg_foreign_server_aclcheck(srv, role, mode) \ + object_aclcheck(ForeignServerRelationId, srv, role, mode) +#endif + /* Permanent memory area for cluster info structures */ static MemoryContext cluster_mem; diff -Nru postgresql-plproxy-2.10.0/src/execute.c postgresql-plproxy-2.11.0/src/execute.c --- postgresql-plproxy-2.10.0/src/execute.c 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/src/execute.c 2023-09-15 13:52:25.000000000 +0000 @@ -37,6 +37,27 @@ #error "PL/Proxy requires poll() API" #endif +#if PG_VERSION_NUM >= 150000 + +#include "common/pg_prng.h" + +static int64 +plproxy_random(void) +{ + return pg_prng_uint32(&pg_global_prng_state) & 0x7FFFFFFF; +} + +#else + +static int64 +plproxy_random(void) +{ + return random(); +} + +#endif + + /* some error happened */ static void conn_error(ProxyFunction *func, ProxyConnection *conn, const char *desc) @@ -899,7 +920,7 @@ tag_part(cluster, i, tag); break; case R_ANY: - tag_part(cluster, random(), tag); + tag_part(cluster, plproxy_random(), tag); break; default: plproxy_error(func, "uninitialized run_type"); diff -Nru postgresql-plproxy-2.10.0/test/expected/plproxy_test.out postgresql-plproxy-2.11.0/test/expected/plproxy_test.out --- postgresql-plproxy-2.10.0/test/expected/plproxy_test.out 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/test/expected/plproxy_test.out 2023-09-15 13:52:25.000000000 +0000 @@ -239,7 +239,7 @@ select * from test_types2('types', NULL, NULL, NULL); v_posint | v_struct | arr ----------+----------+----- - | (,) | + | | (1 row) -- test CONNECT @@ -418,13 +418,25 @@ as $$ cluster 'badcluster'; $$ language plproxy; -select * from test_bad_db(); -ERROR: PL/Proxy function public.test_bad_db(0): [nonex_db] PQconnectPoll: FATAL: database "nonex_db" does not exist - +do $$ + begin + select * from test_bad_db(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql; +ERROR: connection failed create function test_bad_db2() returns int4 as $$ connect 'dbname=wrong_name_db'; $$ language plproxy; -select * from test_bad_db2(); -ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist - +do $$ + begin + select * from test_bad_db2(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql; +ERROR: connection failed diff -Nru postgresql-plproxy-2.10.0/test/expected/plproxy_test_1.out postgresql-plproxy-2.11.0/test/expected/plproxy_test_1.out --- postgresql-plproxy-2.10.0/test/expected/plproxy_test_1.out 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/test/expected/plproxy_test_1.out 2023-09-15 13:52:25.000000000 +0000 @@ -239,12 +239,12 @@ select * from test_types2('types', NULL, NULL, NULL); v_posint | v_struct | arr ----------+----------+----- - | | + | (,) | (1 row) -- test CONNECT create function test_connect1() returns text -as $$ connect 'dbname=test_part host=localhost'; select current_database(); $$ language plproxy; +as $$ connect 'dbname=test_part'; select current_database(); $$ language plproxy; select * from test_connect1(); test_connect1 --------------- @@ -254,7 +254,7 @@ -- test CONNECT $argument create function test_connect2(connstr text) returns text as $$ connect connstr; select current_database(); $$ language plproxy; -select * from test_connect2('dbname=test_part host=localhost'); +select * from test_connect2('dbname=test_part'); test_connect2 --------------- test_part @@ -263,7 +263,7 @@ -- test CONNECT function($argument) create function test_connect3(connstr text) returns text as $$ connect text(connstr); select current_database(); $$ language plproxy; -select * from test_connect3('dbname=test_part host=localhost'); +select * from test_connect3('dbname=test_part'); test_connect3 --------------- test_part @@ -409,7 +409,7 @@ ERROR: public.test_error2(0): [test_part] REMOTE ERROR: column "err" does not exist at character 8 create function test_error3() returns int4 as $$ - connect 'dbname=test_part host=localhost'; + connect 'dbname=test_part'; $$ language plproxy; select * from test_error3(); ERROR: public.test_error3(0): [test_part] REMOTE ERROR: function public.test_error3() does not exist at character 21 @@ -418,13 +418,25 @@ as $$ cluster 'badcluster'; $$ language plproxy; -select * from test_bad_db(); -ERROR: PL/Proxy function public.test_bad_db(0): [nonex_db] PQconnectPoll: FATAL: database "nonex_db" does not exist - +do $$ + begin + select * from test_bad_db(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql; +ERROR: connection failed create function test_bad_db2() returns int4 as $$ - connect 'dbname=wrong_name_db host=localhost'; + connect 'dbname=wrong_name_db'; $$ language plproxy; -select * from test_bad_db2(); -ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist - +do $$ + begin + select * from test_bad_db2(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql; +ERROR: connection failed diff -Nru postgresql-plproxy-2.10.0/test/expected/plproxy_test_2.out postgresql-plproxy-2.11.0/test/expected/plproxy_test_2.out --- postgresql-plproxy-2.10.0/test/expected/plproxy_test_2.out 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/test/expected/plproxy_test_2.out 1970-01-01 00:00:00.000000000 +0000 @@ -1,430 +0,0 @@ -\set VERBOSITY terse --- test normal function -create function testfunc(username text, id integer, data text) -returns text as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function testfunc(username text, id integer, data text) -returns text as $$ begin return 'username=' || username; end; $$ language plpgsql; -\c regression -select * from testfunc('user', 1, 'foo'); - testfunc ---------------- - username=user -(1 row) - -select * from testfunc('user', 1, 'foo'); - testfunc ---------------- - username=user -(1 row) - -select * from testfunc('user', 1, 'foo'); - testfunc ---------------- - username=user -(1 row) - --- test setof text -create function test_set(username text, num integer) -returns setof text as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_set(username text, num integer) -returns setof text as $$ -declare i integer; -begin - i := 0; - while i < num loop - return next 'username=' || username || ' row=' || i; - i := i + 1; - end loop; - return; -end; $$ language plpgsql; -\c regression -select * from test_set('user', 1); - test_set ---------------------- - username=user row=0 -(1 row) - -select * from test_set('user', 0); - test_set ----------- -(0 rows) - -select * from test_set('user', 3); - test_set ---------------------- - username=user row=0 - username=user row=1 - username=user row=2 -(3 rows) - --- test record -create type ret_test_rec as ( id integer, dat text); -create function test_record(username text, num integer) -returns ret_test_rec as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create type ret_test_rec as ( id integer, dat text); -create function test_record(username text, num integer) -returns ret_test_rec as $$ -declare ret ret_test_rec%rowtype; -begin - ret := (num, username); - return ret; -end; $$ language plpgsql; -\c regression -select * from test_record('user', 3); - id | dat -----+------ - 3 | user -(1 row) - --- test setof record -create function test_record_set(username text, num integer) -returns setof ret_test_rec as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_record_set(username text, num integer) -returns setof ret_test_rec as $$ -declare ret ret_test_rec%rowtype; i integer; -begin - i := 0; - while i < num loop - ret := (i, username); - i := i + 1; - return next ret; - end loop; - return; -end; $$ language plpgsql; -\c regression -select * from test_record_set('user', 1); - id | dat -----+------ - 0 | user -(1 row) - -select * from test_record_set('user', 0); - id | dat -----+----- -(0 rows) - -select * from test_record_set('user', 3); - id | dat -----+------ - 0 | user - 1 | user - 2 | user -(3 rows) - --- test void -create function test_void(username text, num integer) -returns void as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_void(username text, num integer) -returns void as $$ -begin - return; -end; $$ language plpgsql; --- look what void actually looks -select * from test_void('void', 2); - test_void ------------ - -(1 row) - -select test_void('void', 2); - test_void ------------ - -(1 row) - -\c regression -select * from test_void('user', 1); - test_void ------------ - -(1 row) - -select * from test_void('user', 3); - test_void ------------ - -(1 row) - -select test_void('user', 3); - test_void ------------ - -(1 row) - -select test_void('user', 3); - test_void ------------ - -(1 row) - --- test normal outargs -create function test_out1(username text, id integer, out data text) -as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_out1(username text, id integer, out data text) -returns text as $$ begin data := 'username=' || username; return; end; $$ language plpgsql; -\c regression -select * from test_out1('user', 1); - data ---------------- - username=user -(1 row) - --- test complicated outargs -create function test_out2(username text, id integer, out out_id integer, xdata text, inout xdata2 text, out odata text) -as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_out2(username text, id integer, out out_id integer, xdata text, inout xdata2 text, out odata text) -as $$ begin - out_id = id; - xdata2 := xdata2 || xdata; - odata := 'username=' || username; - return; -end; $$ language plpgsql; -\c regression -select * from test_out2('user', 1, 'xdata', 'xdata2'); - out_id | xdata2 | odata ---------+-------------+--------------- - 1 | xdata2xdata | username=user -(1 row) - --- test various types -create function test_types(username text, inout vbool boolean, inout xdate timestamp, inout bin bytea) -as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create function test_types(username text, inout vbool boolean, inout xdate timestamp, inout bin bytea) -as $$ begin return; end; $$ language plpgsql; -\c regression -select 1 from (select set_config(name, 'escape', false) as ignore - from pg_settings where name = 'bytea_output') x -where x.ignore = 'foo'; - ?column? ----------- -(0 rows) - -select * from test_types('types', true, '2009-11-04 12:12:02', E'a\\000\\001\\002b'); - vbool | xdate | bin --------+--------------------------+---------------- - t | Wed Nov 04 12:12:02 2009 | a\000\001\002b -(1 row) - -select * from test_types('types', NULL, NULL, NULL); - vbool | xdate | bin --------+-------+----- - | | -(1 row) - --- test user defined types -create domain posint as int4 check (value > 0); -create type struct as (id int4, data text); -create function test_types2(username text, inout v_posint posint, inout v_struct struct, inout arr int8[]) -as $$ cluster 'testcluster'; $$ language plproxy; -\c test_part -create domain posint as int4 check (value > 0); -create type struct as (id int4, data text); -create function test_types2(username text, inout v_posint posint, inout v_struct struct, inout arr int8[]) -as $$ begin return; end; $$ language plpgsql; -\c regression -select * from test_types2('types', 4, (2, 'asd'), array[1,2,3]); - v_posint | v_struct | arr -----------+----------+--------- - 4 | (2,asd) | {1,2,3} -(1 row) - -select * from test_types2('types', NULL, NULL, NULL); - v_posint | v_struct | arr -----------+----------+----- - | | -(1 row) - --- test CONNECT -create function test_connect1() returns text -as $$ connect 'dbname=test_part'; select current_database(); $$ language plproxy; -select * from test_connect1(); - test_connect1 ---------------- - test_part -(1 row) - --- test CONNECT $argument -create function test_connect2(connstr text) returns text -as $$ connect connstr; select current_database(); $$ language plproxy; -select * from test_connect2('dbname=test_part'); - test_connect2 ---------------- - test_part -(1 row) - --- test CONNECT function($argument) -create function test_connect3(connstr text) returns text -as $$ connect text(connstr); select current_database(); $$ language plproxy; -select * from test_connect3('dbname=test_part'); - test_connect3 ---------------- - test_part -(1 row) - --- test quoting function -create type "RetWeird" as ( - "ColId" int4, - "ColData" text -); -create function "testQuoting"(username text, id integer, data text) -returns "RetWeird" as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create type "RetWeird" as ( - "ColId" int4, - "ColData" text -); -create function "testQuoting"(username text, id integer, data text) -returns "RetWeird" as $$ select 1::int4, 'BazOoka'::text $$ language sql; -\c regression -select * from "testQuoting"('user', '1', 'dat'); - ColId | ColData --------+--------- - 1 | BazOoka -(1 row) - --- test arg type quoting -create domain "bad type" as text; -create function test_argq(username text, "some arg" integer, "other arg" "bad type", - out "bad out" text, out "bad out2" "bad type") -as $$ cluster 'testcluster'; run on hashtext(username); $$ language plproxy; -\c test_part -create domain "bad type" as text; -create function test_argq(username text, "some arg" integer, "other arg" "bad type", - out "bad out" text, out "bad out2" "bad type") - as $$ begin return; end; $$ language plpgsql; -\c regression -select * from test_argq('user', 1, 'q'); - bad out | bad out2 ----------+---------- - | -(1 row) - --- test hash types function -create or replace function t_hash16(int4) returns int2 as $$ -declare - res int2; -begin - res = $1::int2; - return res; -end; -$$ language plpgsql; -create or replace function t_hash64(int4) returns int8 as $$ -declare - res int8; -begin - res = $1; - return res; -end; -$$ language plpgsql; -create function test_hash16(id integer, data text) -returns text as $$ cluster 'testcluster'; run on t_hash16(id); select data; $$ language plproxy; -select * from test_hash16('0', 'hash16'); - test_hash16 -------------- - hash16 -(1 row) - -create function test_hash64(id integer, data text) -returns text as $$ cluster 'testcluster'; run on t_hash64(id); select data; $$ language plproxy; -select * from test_hash64('0', 'hash64'); - test_hash64 -------------- - hash64 -(1 row) - --- test argument difference -\c test_part -create function test_difftypes(username text, out val1 int2, out val2 float8) -as $$ begin val1 = 1; val2 = 3;return; end; $$ language plpgsql; -\c regression -create function test_difftypes(username text, out val1 int4, out val2 float4) -as $$ cluster 'testcluster'; run on 0; $$ language plproxy; -select * from test_difftypes('types'); - val1 | val2 -------+------ - 1 | 3 -(1 row) - --- test simple hash -\c test_part -create function test_simple(partno int4) returns int4 -as $$ begin return $1; end; $$ language plpgsql; -\c regression -create function test_simple(partno int4) returns int4 -as $$ - cluster 'testcluster'; - run on $1; -$$ language plproxy; -select * from test_simple(0); - test_simple -------------- - 0 -(1 row) - -drop function test_simple(int4); -create function test_simple(partno int4) returns int4 -as $$ - cluster 'testcluster'; - run on partno; -$$ language plproxy; -select * from test_simple(0); - test_simple -------------- - 0 -(1 row) - --- test error passing -\c test_part -create function test_error1() returns int4 -as $$ -begin - select line2err; - return 0; -end; -$$ language plpgsql; -\c regression -create function test_error1() returns int4 -as $$ - cluster 'testcluster'; - run on 0; -$$ language plproxy; -select * from test_error1(); -ERROR: public.test_error1(0): [test_part] REMOTE ERROR: column "line2err" does not exist at character 8 -create function test_error2() returns int4 -as $$ - cluster 'testcluster'; - run on 0; - select err; -$$ language plproxy; -select * from test_error2(); -NOTICE: PL/Proxy: dropping stale conn -ERROR: public.test_error2(0): [test_part] REMOTE ERROR: column "err" does not exist at character 8 -create function test_error3() returns int4 -as $$ - connect 'dbname=test_part'; -$$ language plproxy; -select * from test_error3(); -ERROR: public.test_error3(0): [test_part] REMOTE ERROR: function public.test_error3() does not exist at character 21 --- test invalid db -create function test_bad_db() returns int4 -as $$ - cluster 'badcluster'; -$$ language plproxy; -select * from test_bad_db(); -ERROR: PL/Proxy function public.test_bad_db(0): [nonex_db] PQconnectPoll: FATAL: database "nonex_db" does not exist - -create function test_bad_db2() returns int4 -as $$ - connect 'dbname=wrong_name_db'; -$$ language plproxy; -select * from test_bad_db2(); -ERROR: PL/Proxy function public.test_bad_db2(0): [wrong_name_db] PQconnectPoll: FATAL: database "wrong_name_db" does not exist - diff -Nru postgresql-plproxy-2.10.0/test/sql/plproxy_test.sql postgresql-plproxy-2.11.0/test/sql/plproxy_test.sql --- postgresql-plproxy-2.10.0/test/sql/plproxy_test.sql 2020-09-26 15:46:00.000000000 +0000 +++ postgresql-plproxy-2.11.0/test/sql/plproxy_test.sql 2023-09-15 13:52:25.000000000 +0000 @@ -281,12 +281,27 @@ as $$ cluster 'badcluster'; $$ language plproxy; -select * from test_bad_db(); + +do $$ + begin + select * from test_bad_db(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql; create function test_bad_db2() returns int4 as $$ connect 'dbname=wrong_name_db'; $$ language plproxy; -select * from test_bad_db2(); +do $$ + begin + select * from test_bad_db2(); + exception + when sqlstate 'XX000' then + raise exception 'connection failed'; + end; +$$ language plpgsql;