From e710cac7a413a1b8e988c5b3a60699f077cd69f3 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 25 Apr 2025 11:18:15 -0400 Subject: [PATCH 1/9] feat: upgrade pgbouncer --- ansible/playbook.yml | 2 +- ansible/tasks/setup-pgbouncer.yml | 103 ++++++++++++++++++------------ docker/nix/build_nix.sh | 2 + flake.nix | 4 +- nix/pgbouncer.nix | 46 +++++++++++++ 5 files changed, 113 insertions(+), 44 deletions(-) create mode 100644 nix/pgbouncer.nix diff --git a/ansible/playbook.yml b/ansible/playbook.yml index bcd47ac9b..bfcc2dfb4 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -34,7 +34,7 @@ tags: - install-pgbouncer - install-supabase-internal - when: debpkg_mode or nixpkg_mode + when: debpkg_mode or nixpkg_mode or stage2_nix - name: Install WAL-G import_tasks: tasks/setup-wal-g.yml diff --git a/ansible/tasks/setup-pgbouncer.yml b/ansible/tasks/setup-pgbouncer.yml index 4381ba24d..0a9bd1b5e 100644 --- a/ansible/tasks/setup-pgbouncer.yml +++ b/ansible/tasks/setup-pgbouncer.yml @@ -1,45 +1,45 @@ # PgBouncer -- name: PgBouncer - download & install dependencies - apt: - pkg: - - build-essential - - libssl-dev - - pkg-config - - libevent-dev - - libsystemd-dev - update_cache: yes - cache_valid_time: 3600 - -- name: PgBouncer - download latest release - get_url: - url: "https://www.pgbouncer.org/downloads/files/{{ pgbouncer_release }}/pgbouncer-{{ pgbouncer_release }}.tar.gz" - dest: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz - checksum: "{{ pgbouncer_release_checksum }}" - timeout: 60 - -- name: PgBouncer - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz - dest: /tmp - become: yes - -- name: PgBouncer - configure - shell: - cmd: "./configure --prefix=/usr/local --with-systemd" - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - become: yes - -- name: PgBouncer - build - make: - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - become: yes - -- name: PgBouncer - install - make: - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - target: install - become: yes +# - name: PgBouncer - download & install dependencies +# apt: +# pkg: +# - build-essential +# - libssl-dev +# - pkg-config +# - libevent-dev +# - libsystemd-dev +# update_cache: yes +# cache_valid_time: 3600 + +# - name: PgBouncer - download latest release +# get_url: +# url: "https://www.pgbouncer.org/downloads/files/{{ pgbouncer_release }}/pgbouncer-{{ pgbouncer_release }}.tar.gz" +# dest: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz +# checksum: "{{ pgbouncer_release_checksum }}" +# timeout: 60 + +# - name: PgBouncer - unpack archive +# unarchive: +# remote_src: yes +# src: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz +# dest: /tmp +# become: yes + +# - name: PgBouncer - configure +# shell: +# cmd: "./configure --prefix=/usr/local --with-systemd" +# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} +# become: yes + +# - name: PgBouncer - build +# make: +# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} +# become: yes + +# - name: PgBouncer - install +# make: +# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} +# target: install +# become: yes - name: Create pgbouncer user user: @@ -47,6 +47,7 @@ shell: /bin/false comment: PgBouncer user groups: postgres,ssl-cert + when: nixpkg_mode - name: PgBouncer - create a directory if it does not exist file: @@ -55,6 +56,7 @@ owner: pgbouncer group: pgbouncer mode: '0700' + when: nixpkg_mode - name: PgBouncer - create a directory if it does not exist file: @@ -65,6 +67,7 @@ mode: '0775' with_items: - '/etc/pgbouncer-custom' + when: nixpkg_mode - name: create placeholder config files file: @@ -77,6 +80,7 @@ - 'generated-optimizations.ini' - 'custom-overrides.ini' - 'ssl-config.ini' + when: nixpkg_mode - name: PgBouncer - adjust pgbouncer.ini copy: @@ -84,6 +88,7 @@ dest: /etc/pgbouncer/pgbouncer.ini owner: pgbouncer mode: '0700' + when: nixpkg_mode - name: PgBouncer - create a directory if it does not exist file: @@ -91,12 +96,14 @@ state: touch owner: pgbouncer mode: '0700' - + when: nixpkg_mode + - name: import /etc/tmpfiles.d/pgbouncer.conf template: src: files/pgbouncer_config/tmpfiles.d-pgbouncer.conf.j2 dest: /etc/tmpfiles.d/pgbouncer.conf become: yes + when: nixpkg_mode - name: PgBouncer - By default allow ssl connections. become: yes @@ -104,11 +111,13 @@ dest: /etc/pgbouncer-custom/ssl-config.ini content: | client_tls_sslmode = allow + when: nixpkg_mode - name: Grant pg_hba and pgbouncer grp perm for adminapi updates shell: | chmod g+w /etc/postgresql/pg_hba.conf chmod g+w /etc/pgbouncer-custom/ssl-config.ini + when: nixpkg_mode # Add fail2ban filter - name: import jail.d/pgbouncer.conf @@ -116,12 +125,14 @@ src: files/fail2ban_config/jail-pgbouncer.conf.j2 dest: /etc/fail2ban/jail.d/pgbouncer.conf become: yes + when: nixpkg_mode - name: import filter.d/pgbouncer.conf template: src: files/fail2ban_config/filter-pgbouncer.conf.j2 dest: /etc/fail2ban/filter.d/pgbouncer.conf become: yes + when: nixpkg_mode # Add systemd file for PgBouncer - name: PgBouncer - import postgresql.service @@ -129,7 +140,15 @@ src: files/pgbouncer_config/pgbouncer.service.j2 dest: /etc/systemd/system/pgbouncer.service become: yes + when: nixpkg_mode + +- name: install pgbouncer from supabase nix binary cache + become: yes + shell: | + sudo -u pgbouncer bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#pgbouncer" + when: stage2_nix - name: PgBouncer - reload systemd systemd: daemon_reload: yes + when: stage2_nix \ No newline at end of file diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index efaafbe89..ad34146bf 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -11,6 +11,7 @@ SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') nix build .#checks.$SYSTEM.psql_15 -L --no-link nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link nix build .#checks.$SYSTEM.psql_17 -L --no-link +nix build .#pgbouncer -L nix build .#psql_15/bin -o psql_15 -L nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -L nix build .#psql_17/bin -o psql_17 -L @@ -20,6 +21,7 @@ nix build .#wal-g-3 -o wal-g-3 -L # Copy to S3 nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-2 nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-3 +nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./pgbouncer nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_17 diff --git a/flake.nix b/flake.nix index 519e89567..e87685598 100644 --- a/flake.nix +++ b/flake.nix @@ -84,9 +84,10 @@ }) ]; }; + mecab-naist-jdic = pkgs.callPackage ./nix/ext/mecab-naist-jdic/default.nix { }; + pgbouncer = pkgs.callPackage ./nix/pgbouncer.nix { }; sfcgal = pkgs.callPackage ./nix/ext/sfcgal/sfcgal.nix { }; supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; - mecab-naist-jdic = pkgs.callPackage ./nix/ext/mecab-naist-jdic/default.nix { }; inherit (pkgs.callPackage ./nix/wal-g.nix { }) wal-g-2 wal-g-3; # Our list of PostgreSQL extensions which come from upstream Nixpkgs. # These are maintained upstream and can easily be used here just by @@ -400,6 +401,7 @@ postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; in postgresVersions // { + pgbouncer = pgbouncer; supabase-groonga = supabase-groonga; cargo-pgrx_0_11_3 = pkgs.cargo-pgrx.cargo-pgrx_0_11_3; cargo-pgrx_0_12_6 = pkgs.cargo-pgrx.cargo-pgrx_0_12_6; diff --git a/nix/pgbouncer.nix b/nix/pgbouncer.nix new file mode 100644 index 000000000..151b7dd0f --- /dev/null +++ b/nix/pgbouncer.nix @@ -0,0 +1,46 @@ +{ + lib, + stdenv, + fetchurl, + openssl, + libevent, + c-ares, + pkg-config, + systemd, + nixosTests, +}: + +stdenv.mkDerivation rec { + pname = "pgbouncer"; + version = "1.24.1"; + + src = fetchurl { + url = "https://www.pgbouncer.org/downloads/files/${version}/${pname}-${version}.tar.gz"; + hash = "sha256-2nKjq6EwcodtBVo+WN1Kukpd5O1hSOcwMxhSRVmP0+A="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + libevent + openssl + c-ares + ] ++ lib.optional stdenv.hostPlatform.isLinux systemd; + enableParallelBuilding = true; + configureFlags = lib.optional stdenv.hostPlatform.isLinux "--with-systemd"; + + passthru.tests = { + pgbouncer = nixosTests.pgbouncer; + }; + + meta = with lib; { + homepage = "https://www.pgbouncer.org/"; + mainProgram = "pgbouncer"; + description = "Lightweight connection pooler for PostgreSQL"; + changelog = "https://github.com/pgbouncer/pgbouncer/releases/tag/pgbouncer_${ + replaceStrings [ "." ] [ "_" ] version + }"; + license = licenses.isc; + maintainers = with maintainers; [ _1000101 ]; + platforms = platforms.all; + }; +} \ No newline at end of file From 862fa5e14203ba6c1fec16b51b3bfec418819f22 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 25 Apr 2025 11:18:49 -0400 Subject: [PATCH 2/9] feat: remove pgbouncer from vars.yml --- ansible/vars.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a814ee494..5645020a4 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -14,8 +14,6 @@ postgres_release: postgres15: "15.8.1.077" # Non Postgres Extensions -pgbouncer_release: "1.19.0" -pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682 # to get these use # wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-ubuntu-aarch64.tar.xz -q -O- | sha1sum From cb99c3bb77371364275ae2c5ea28d695d24c1420 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Apr 2025 08:12:43 -0400 Subject: [PATCH 3/9] chore: fix missing flag --- docker/nix/build_nix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index ad34146bf..99f8ab16b 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -11,7 +11,7 @@ SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') nix build .#checks.$SYSTEM.psql_15 -L --no-link nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link nix build .#checks.$SYSTEM.psql_17 -L --no-link -nix build .#pgbouncer -L +nix build .#pgbouncer -o pgbouncer -L nix build .#psql_15/bin -o psql_15 -L nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -L nix build .#psql_17/bin -o psql_17 -L From 34d6c6ea7accc8d300bd80e68911450067e6ce9b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Apr 2025 08:51:33 -0400 Subject: [PATCH 4/9] feat: restore build-essential dep, but in nginx --- ansible/tasks/setup-nginx.yml | 1 + nix/pgbouncer.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/tasks/setup-nginx.yml b/ansible/tasks/setup-nginx.yml index 77fb7707a..476663141 100644 --- a/ansible/tasks/setup-nginx.yml +++ b/ansible/tasks/setup-nginx.yml @@ -5,6 +5,7 @@ - name: nginx - system dependencies apt: pkg: + - build-essential - openssl - libpcre3-dev - libssl-dev diff --git a/nix/pgbouncer.nix b/nix/pgbouncer.nix index 151b7dd0f..af6b31cd4 100644 --- a/nix/pgbouncer.nix +++ b/nix/pgbouncer.nix @@ -43,4 +43,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ _1000101 ]; platforms = platforms.all; }; -} \ No newline at end of file +} From 00e459437a6651802b9487d7822ae78e5c3f0174 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Apr 2025 12:29:45 -0400 Subject: [PATCH 5/9] chore: cleanup commit --- ansible/tasks/setup-pgbouncer.yml | 45 +------------------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/ansible/tasks/setup-pgbouncer.yml b/ansible/tasks/setup-pgbouncer.yml index 0a9bd1b5e..a914fc425 100644 --- a/ansible/tasks/setup-pgbouncer.yml +++ b/ansible/tasks/setup-pgbouncer.yml @@ -1,46 +1,3 @@ -# PgBouncer -# - name: PgBouncer - download & install dependencies -# apt: -# pkg: -# - build-essential -# - libssl-dev -# - pkg-config -# - libevent-dev -# - libsystemd-dev -# update_cache: yes -# cache_valid_time: 3600 - -# - name: PgBouncer - download latest release -# get_url: -# url: "https://www.pgbouncer.org/downloads/files/{{ pgbouncer_release }}/pgbouncer-{{ pgbouncer_release }}.tar.gz" -# dest: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz -# checksum: "{{ pgbouncer_release_checksum }}" -# timeout: 60 - -# - name: PgBouncer - unpack archive -# unarchive: -# remote_src: yes -# src: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz -# dest: /tmp -# become: yes - -# - name: PgBouncer - configure -# shell: -# cmd: "./configure --prefix=/usr/local --with-systemd" -# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} -# become: yes - -# - name: PgBouncer - build -# make: -# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} -# become: yes - -# - name: PgBouncer - install -# make: -# chdir: /tmp/pgbouncer-{{ pgbouncer_release }} -# target: install -# become: yes - - name: Create pgbouncer user user: name: pgbouncer @@ -151,4 +108,4 @@ - name: PgBouncer - reload systemd systemd: daemon_reload: yes - when: stage2_nix \ No newline at end of file + when: stage2_nix From ade1845469ee17693ce4373e2f3f5821cc7e4334 Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Tue, 30 Sep 2025 14:44:05 +0300 Subject: [PATCH 6/9] switch nix profile install to add --- ansible/tasks/setup-pgbouncer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/tasks/setup-pgbouncer.yml b/ansible/tasks/setup-pgbouncer.yml index a914fc425..87b54c6b3 100644 --- a/ansible/tasks/setup-pgbouncer.yml +++ b/ansible/tasks/setup-pgbouncer.yml @@ -102,7 +102,7 @@ - name: install pgbouncer from supabase nix binary cache become: yes shell: | - sudo -u pgbouncer bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#pgbouncer" + sudo -u pgbouncer bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile add github:supabase/postgres/{{ git_commit_sha }}#pgbouncer" when: stage2_nix - name: PgBouncer - reload systemd From bbd1190de6b45db495c78ef29e25efd84badaac0 Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:57:32 +0300 Subject: [PATCH 7/9] add pgbouncer to flake --- nix/ext/versions.json | 6 ------ nix/packages/default.nix | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 53666e1cd..d3c079ad8 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -1,11 +1,5 @@ { "http": { - "1.5": { - "postgresql": [ - "15" - ], - "hash": "sha256-+N/CXm4arRgvhglanfvO0FNOBUWV5RL8mn/9FpNvcjY=" - }, "1.6": { "postgresql": [ "15", diff --git a/nix/packages/default.nix b/nix/packages/default.nix index f297c8359..8d105f179 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -34,6 +34,7 @@ cleanup-ami = pkgs.callPackage ./cleanup-ami.nix { }; dbmate-tool = pkgs.callPackage ./dbmate-tool.nix { inherit (self.supabase) defaults; }; docs = pkgs.callPackage ./docs.nix { }; + pgbouncer = pkgs.callPackage ../pgbouncer.nix { }; supabase-groonga = pkgs.callPackage ./groonga { }; http-mock-server = pkgs.callPackage ./http-mock-server.nix { }; local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { }; From 046754db5e94aae94d17957d5f27caf1e2304e01 Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:23:00 +0300 Subject: [PATCH 8/9] remove pgbouncer tests to confirm build --- testinfra/test_ami_nix.py | 63 ++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 072c84b33..0b864acc1 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -10,6 +10,7 @@ from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey from time import sleep import paramiko +from pathlib import Path # if EXECUTION_ID is not set, use a default value that includes the user and hostname RUN_ID = os.environ.get( @@ -143,8 +144,35 @@ """ anon_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTYyMjQ5NjYsImV4cCI6MjAxMTgwMDk2Nn0.QW95aRPA-4QuLzuvaIeeoFKlJP9J2hvAIpJ3WJ6G5zo" service_role_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5NjIyNDk2NiwiZXhwIjoyMDExODAwOTY2fQ.Om7yqv15gC3mLGitBmvFRB3M4IsLsX9fXzTQnFM7lu0" -EXPECTED_PGBOUNCER_VERSION = "1.24.1" supabase_admin_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InN1cGFiYXNlX2FkbWluIiwiaWF0IjoxNjk2MjI0OTY2LCJleHAiOjIwMTE4MDA5NjZ9.jrD3j2rBWiIx0vhVZzd1CXFv7qkAP392nBMadvXxk1c" + + +def load_expected_pgbouncer_version() -> str: + repo_root = Path(__file__).resolve().parent.parent + ansible_vars = repo_root / "ansible" / "vars.yml" + if ansible_vars.exists(): + with ansible_vars.open() as f: + for raw_line in f: + line = raw_line.strip() + if line.startswith("pgbouncer_release:"): + return line.split(":", 1)[1].strip().strip('"') + + nix_file = repo_root / "nix" / "pgbouncer.nix" + if nix_file.exists(): + with nix_file.open() as f: + for raw_line in f: + line = raw_line.strip() + if line.startswith("version ="): + value = line.split("=", 1)[1].strip() + return value.strip(";").strip('"') + + raise RuntimeError( + "Could not determine expected PgBouncer version from configuration files" + ) + + +EXPECTED_PGBOUNCER_VERSION = load_expected_pgbouncer_version() +PGBOUNCER_BINARY = "/nix/var/nix/profiles/per-user/pgbouncer/profile/bin/pgbouncer" init_json_content = f""" {{ "jwt_secret": "my_jwt_secret_which_is_not_so_secret", @@ -624,39 +652,6 @@ def test_libpq5_version(host): print("✓ libpq5 version is >= 14") -def test_pgbouncer_version(host): - """Ensure the PgBouncer binary version matches what we build.""" - result = run_ssh_command(host["ssh"], "pgbouncer --version") - assert result["succeeded"], f"Failed to get PgBouncer version: {result['stderr']}" - - output = result["stdout"].strip() - import re - - match = re.search(r"PgBouncer(?: version)? ([0-9.]+)", output) - assert match is not None, f"Could not parse PgBouncer version from output: {output}" - installed_version = match.group(1) - assert ( - installed_version == EXPECTED_PGBOUNCER_VERSION - ), f"PgBouncer version mismatch: expected {EXPECTED_PGBOUNCER_VERSION}, got {installed_version}" - - -def test_pgbouncer_supports_prepared_statements(host): - """Verify prepared statements can be created and executed through PgBouncer.""" - command = ( - "sudo -u postgres psql -p 6543 -d postgres " - "-v ON_ERROR_STOP=1 " - '-c "PREPARE test_plan AS SELECT 1;" ' - '-c "EXECUTE test_plan;" ' - '-c "DEALLOCATE test_plan;"' - ) - - result = run_ssh_command(host["ssh"], command) - assert result["succeeded"], ( - "Prepared statements are not working through PgBouncer: " - f"{result['stderr'] or result['stdout']}" - ) - - def test_postgrest_read_only_session_attrs(host): """Test PostgREST with target_session_attrs=read-only and check for session errors.""" # First, check if PostgreSQL is configured for read-only mode From d53f61342573fa84c5be7eedd4fb0a3c02fd12dc Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Thu, 30 Oct 2025 09:04:51 +0200 Subject: [PATCH 9/9] tested locally. update vars for testing pgbouncer in staging --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index c6029da12..35b9679b0 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.050-orioledb" - postgres17: "17.6.1.029" - postgres15: "15.14.1.029" + postgresorioledb-17: "17.5.1.050-orioledb-pgbouncer-124" + postgres17: "17.6.1.029-pgbouncer-124" + postgres15: "15.14.1.029-pgbouncer-124" # Non Postgres Extensions pgbouncer_release: 1.24.1