diff --git a/Dockerfile b/Dockerfile index 9e98a73ee..8309c2585 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 ARG index_advisor_release=0.2.0 -ARG supautils_release=2.2.1 +ARG supautils_release=2.5.0 ARG wal_g_release=2.0.1 #################### diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh index ea7217fcc..e9e3afe8a 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -456,7 +456,10 @@ begin foreach obj in array functions loop if obj->>'owner' = 'postgres' then - execute(format('alter routine %s(%s) owner to postgres;', (obj->>'oid')::regproc, pg_get_function_identity_arguments((obj->>'oid')::regproc))); + execute(format('alter %s %s(%s) owner to postgres;' + , case when obj->>'kind' = 'p' then 'procedure' else 'function' end + , (obj->>'oid')::regproc + , pg_get_function_identity_arguments((obj->>'oid')::regproc))); end if; for rec in select grantor, grantee, privilege_type, is_grantable diff --git a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql new file mode 100644 index 000000000..8b126d403 --- /dev/null +++ b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql @@ -0,0 +1,19 @@ +do $$ +declare + extoid oid := (select oid from pg_extension where extname = 'pgmq'); + r record; +begin + set local search_path = ''; + update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq'; + for r in (select * from pg_depend where refobjid = extoid) loop + if r.classid = 'pg_type'::regclass then + execute(format('alter type %s owner to postgres;', r.objid::regtype)); + elsif r.classid = 'pg_proc'::regclass then + execute(format('alter function %s(%s) owner to postgres;', r.objid::regproc, pg_get_function_identity_arguments(r.objid))); + elsif r.classid = 'pg_class'::regclass then + execute(format('alter table %s owner to postgres;', r.objid::regclass)); + else + raise exception 'error on pgmq after-create script: unexpected object type %', r.classid; + end if; + end loop; +end $$; diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 93f0e15c5..5c1c65053 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -18,26 +18,10 @@ - name: gotrue - download commit archive get_url: url: "https://github.com/supabase/gotrue/releases/download/v{{ gotrue_release }}/auth-v{{ gotrue_release }}-arm64.tar.gz" - dest: /tmp/gotrue.tar.gz + dest: /tmp/auth-v{{ gotrue_release }}-arm64.tar.gz checksum: "{{ gotrue_release_checksum }}" timeout: 60 - - name: gotrue - create /tmp/gotrue - file: - path: /tmp/gotrue - state: directory - mode: 0775 - - - name: gotrue - unpack archive in /tmp/gotrue - unarchive: - remote_src: yes - src: /tmp/gotrue.tar.gz - dest: /tmp/gotrue - - - name: gotrue - pack archive - shell: | - cd /tmp && tar -cJf gotrue-v{{ gotrue_release }}-arm64.tar.xz gotrue - - name: PostgREST - download ubuntu binary archive (arm) get_url: url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz" @@ -82,7 +66,7 @@ aws s3 cp /tmp/{{ item.file }} s3://{{ internal_artifacts_bucket }}/upgrades/{{ item.service }}/{{ item.file }} with_items: - service: gotrue - file: gotrue-v{{ gotrue_release }}-arm64.tar.xz + file: auth-v{{ gotrue_release }}-arm64.tar.gz - service: postgrest file: postgrest-{{ postgrest_release }}-arm64.tar.xz - service: supabase-admin-api diff --git a/ansible/vars.yml b/ansible/vars.yml index dff487733..588ac1e95 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.007-orioledb" - postgres15: "15.8.1.017" - postgres16: "16.3.1.023" + postgresorioledb-17: "17.0.1.008-orioledb" + postgres15: "15.8.1.018" + postgres16: "16.3.1.024" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -92,10 +92,10 @@ timescaledb_release_checksum: sha256:883638f2e79d25ec88ee58f603f3c81c999b6364cb4 wal2json_release: "2_5" wal2json_release_checksum: sha256:b516653575541cf221b99cf3f8be9b6821f6dbcfc125675c85f35090f824f00e -supautils_release: "2.2.1" -supautils_release_arm64_deb_checksum: sha256:1a2d2b8fe604d38921ed9cf3a0d56dd142a274035d0dca17ad21cdc81ddd9569 -supautils_release_amd64_deb_checksum: sha256:4674fac146976dc179f5871271830718112f5eaa853bc461df9e303c8df2e1ab -supautils_release_tar_checksum: sha256:f1f33371390322ac830645b8b0b8e249cb8ca10b19fdeae917f383014ed01b5d +supautils_release: "2.5.0" +supautils_release_arm64_deb_checksum: sha256:406e4a816f719bd6c4b2143e9bb38078fbe60d7e85018ec0aed5d76924e28000 +supautils_release_amd64_deb_checksum: sha256:71f182b478d8aaf167609dd382875cdce3fbe992e888988b3d51cdad39e08202 +supautils_release_tar_checksum: sha256:07c41244e4374248da9c2df2822152f3ae8f1e74c8a92d361300480193219b63 pljava_release: master pljava_release_checksum: sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6 diff --git a/docker/orioledb/Dockerfile b/docker/orioledb/Dockerfile index 72bc9ba62..7adb7d74a 100644 --- a/docker/orioledb/Dockerfile +++ b/docker/orioledb/Dockerfile @@ -36,7 +36,7 @@ ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 ARG index_advisor_release=0.2.0 -ARG supautils_release=2.2.1 +ARG supautils_release=2.5.0 ARG wal_g_release=2.0.1 #################### diff --git a/flake.nix b/flake.nix index b2a42c5f8..0ef79e1d0 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,7 @@ ourExtensions = [ ./nix/ext/rum.nix ./nix/ext/timescaledb.nix + ./nix/ext/timescaledb-2.9.1.nix ./nix/ext/pgroonga.nix ./nix/ext/index_advisor.nix ./nix/ext/wal2json.nix @@ -144,7 +145,8 @@ #we're not using timescaledb in the orioledb version of supabase extensions orioleFilteredExtensions = builtins.filter ( x: - x != ./nix/ext/timescaledb.nix && + x != ./nix/ext/timescaledb.nix && + x != ./nix/ext/timescaledb-2.9.1.nix && x != ./nix/ext/plv8.nix && x != ./nix/ext/postgis.nix && x != ./nix/ext/pgrouting.nix && @@ -153,7 +155,10 @@ ) ourExtensions; orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - + pg16Extensions = builtins.filter ( + x: + x != ./nix/ext/timescaledb-2.9.1.nix + ) ourExtensions; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way @@ -197,6 +202,8 @@ postgresql = getPostgresqlPackage version; extensionsToUse = if (builtins.elem version ["orioledb-16" "orioledb-17"]) then orioledbExtensions + else if version == "16" + then pg16Extensions else ourExtensions; in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index a72f3bf48..7203eaa54 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -43,6 +43,7 @@ create extension pg_graphql; create extension pg_freespacemap; create extension pg_hashids; create extension pg_prewarm; +create extension pgmq; create extension pg_jsonschema; create extension pg_repack; create extension pg_stat_monitor; @@ -54,7 +55,6 @@ create extension pg_visibility; create extension pg_walinspect; create extension pgaudit; create extension pgcrypto; -create extension pgmq; create extension pgtap; create extension pgjwt; create extension pgroonga;