From b3d22287aeb40c7d523075870c40ba650f922790 Mon Sep 17 00:00:00 2001 From: Bruno Andrade <1145012+bmpandrade@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:38:17 +0100 Subject: [PATCH 001/271] chore: add pgrest v12.2 metrics endpoint as adminapi upstream source on AIO (#1233) --- README.md | 2 +- docker/all-in-one/etc/adminapi/adminapi.yaml | 7 +++++++ testinfra/test_ami.py | 4 ++++ testinfra/test_ami_nix.py | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca794fc22..074a42ec7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Aside from having [ufw](https://help.ubuntu.com/community/UFW),[fail2ban](https: | Goodie | Version | Description | | ------------- | :-------------: | ------------- | | [PgBouncer](https://www.pgbouncer.org/) | [1.16.1](http://www.pgbouncer.org/changelog.html#pgbouncer-116x) | Set up Connection Pooling. | -| [PostgREST](https://postgrest.org/en/stable/) | [v10.1.1](https://github.com/PostgREST/postgrest/releases/tag/v10.1.1) | Instantly transform your database into an RESTful API. | +| [PostgREST](https://postgrest.org/en/stable/) | [v12.2.3](https://github.com/PostgREST/postgrest/releases/tag/v12.2.3) | Instantly transform your database into an RESTful API. | | [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | ## Install diff --git a/docker/all-in-one/etc/adminapi/adminapi.yaml b/docker/all-in-one/etc/adminapi/adminapi.yaml index 6eaf643e1..7784fd7d4 100644 --- a/docker/all-in-one/etc/adminapi/adminapi.yaml +++ b/docker/all-in-one/etc/adminapi/adminapi.yaml @@ -42,6 +42,13 @@ upstream_metrics_sources: value: {{ .ProjectRef }} - name: service_type value: gotrue + - name: postgrest + url: "http://localhost:3001/metrics" + labels_to_attach: + - name: supabase_project_ref + value: {{ .ProjectRef }} + - name: service_type + value: postgrest monitoring: disk_usage: enabled: true diff --git a/testinfra/test_ami.py b/testinfra/test_ami.py index 05ec773b8..403641dac 100644 --- a/testinfra/test_ami.py +++ b/testinfra/test_ami.py @@ -65,6 +65,10 @@ name: gotrue url: 'http://localhost:9122/metrics' labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: gotrue}] + - + name: postgrest + url: 'http://localhost:3001/metrics' + labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: postgrest}] monitoring: disk_usage: enabled: true diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 18a366b34..cd58859fc 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -65,6 +65,10 @@ name: gotrue url: 'http://localhost:9122/metrics' labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: gotrue}] + - + name: postgrest + url: 'http://localhost:3001/metrics' + labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: postgrest}] monitoring: disk_usage: enabled: true From eea5ee0ff3d00fa3008a82fce2911b529c272265 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 26 Sep 2024 13:53:44 +0100 Subject: [PATCH 002/271] fix: account for `public` grantee --- ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 e978b2a54..4c776844b 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -356,6 +356,7 @@ begin end , case when rec.grantee = 'postgres'::regrole then 'supabase_admin' when rec.grantee = 'supabase_admin'::regrole then 'postgres' + when rec.grantee = 0 then 'public' else rec.grantee::regrole end )); @@ -382,7 +383,7 @@ begin when obj->>'objtype' = 'T' then 'types' when obj->>'objtype' = 'n' then 'schemas' end - , rec.grantee::regrole + , case when rec.grantee = 0 then 'public' else rec.grantee::regrole end , case when rec.is_grantable then 'with grant option' else '' end )); end if; From 092d9702ac7cffd8938f24fcbcd131b1aa470333 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:19:38 +0100 Subject: [PATCH 003/271] fix(ci): respect postgresVersion input (#1237) --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 5d373ad8f..eb5f7a755 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -72,6 +72,9 @@ jobs: id: process_release_version run: | VERSION=$(grep 'postgres-version' common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + if [[ "${{ inputs.postgresVersion }}" != "" ]]; then + VERSION=${{ inputs.postgresVersion }} + fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Create a tarball containing pg_upgrade scripts From 349cc83621bcaa6a8e6f721c0d5ea274ff250907 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 26 Sep 2024 11:59:16 -0400 Subject: [PATCH 004/271] feat: package gdal + fix basePackages to switch pg version correctly (#1231) Co-authored-by: Sam Rose --- flake.nix | 41 +++++++++++++++++----- nix/ext/gdal.nix | 69 +++++++++++++++++++++++++++++++++++++ nix/ext/postgis.nix | 3 +- nix/overlays/gdal-small.nix | 14 -------- 4 files changed, 102 insertions(+), 25 deletions(-) create mode 100644 nix/ext/gdal.nix delete mode 100644 nix/overlays/gdal-small.nix diff --git a/flake.nix b/flake.nix index 1f9d5f64d..03106015b 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,6 @@ # want to have an arbitrary order, since it might matter. being # explicit is better. (import ./nix/overlays/cargo-pgrx.nix) - (import ./nix/overlays/gdal-small.nix) (import ./nix/overlays/psql_16-oriole.nix) ]; @@ -68,15 +67,10 @@ }; }) (import ./nix/overlays/cargo-pgrx-0-11-3.nix) - # (import ./nix/overlays/postgis.nix) - #(import ./nix/overlays/gdal-small.nix) - ]; }; postgresql_15 = pkgs.postgresql.postgresql_15; - postgresql = pkgs.postgresql.postgresql_15; sfcgal = pkgs.callPackage ./nix/ext/sfcgal/sfcgal.nix { }; - pg_regress = pkgs.callPackage ./nix/ext/pg_regress.nix { inherit postgresql; }; supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; mecab-naist-jdic = pkgs.callPackage ./nix/ext/mecab-naist-jdic/default.nix { }; # Our list of PostgreSQL extensions which come from upstream Nixpkgs. @@ -284,14 +278,41 @@ # be used with 'nix build'. Don't use the names listed below; check the # name in 'nix flake show' in order to make sure exactly what name you # want. - basePackages = { + basePackages = let + # Function to get the PostgreSQL version from the attribute name + getVersion = name: + let + match = builtins.match "psql_([0-9]+)" name; + in + if match == null then null else builtins.head match; + + # Define the available PostgreSQL versions + postgresVersions = { + psql_15 = makePostgres "15"; + # Uncomment the line below to enable PostgreSQL 16 + # psql_16 = makePostgres "16"; + # psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; + }; + + # Find the active PostgreSQL version + activeVersion = getVersion (builtins.head (builtins.attrNames postgresVersions)); + + # Function to create the pg_regress package + makePgRegress = version: + let + postgresqlPackage = pkgs."postgresql_${version}"; + in + pkgs.callPackage ./nix/ext/pg_regress.nix { + postgresql = postgresqlPackage; + }; + + in + postgresVersions //{ supabase-groonga = supabase-groonga; # PostgreSQL versions. psql_15 = makePostgres "15"; - #psql_16 = makePostgres "16"; #psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; sfcgal = sfcgal; - pg_regress = pg_regress; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; postgresql_15 = pkgs.postgresql_15; @@ -319,6 +340,7 @@ }; mecab_naist_jdic = mecab-naist-jdic; supabase_groonga = supabase-groonga; + pg_regress = makePgRegress activeVersion; # Start a version of the server. start-server = let @@ -455,6 +477,7 @@ sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; + pg_regress = basePackages.pg_regress; in pkgs.runCommand "postgres-${pgpkg.version}-check-harness" { diff --git a/nix/ext/gdal.nix b/nix/ext/gdal.nix new file mode 100644 index 000000000..83924d9ff --- /dev/null +++ b/nix/ext/gdal.nix @@ -0,0 +1,69 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, curl +, expat +, libgeotiff +, geos +, json_c +, libxml2 +, postgresql +, proj +, sqlite +, libtiff +, zlib +}: + +stdenv.mkDerivation rec { + pname = "gdal"; + version = "3.8.5"; + + src = fetchFromGitHub { + owner = "OSGeo"; + repo = "gdal"; + rev = "v${version}"; + hash = "sha256-Z+mYlyOX9vJ772qwZMQfCbD/V7RL6+9JLHTzoZ55ot0="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + curl + expat + libgeotiff + geos + json_c + libxml2 + postgresql + proj + sqlite + libtiff + zlib + ]; + + cmakeFlags = [ + "-DGDAL_USE_INTERNAL_LIBS=OFF" + "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" + "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DBUILD_PYTHON_BINDINGS=OFF" + ] ++ lib.optionals (!stdenv.isDarwin) [ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + ] ++ lib.optionals stdenv.isDarwin [ + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" + ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Translator library for raster geospatial data formats (PostGIS-focused build)"; + homepage = "https://www.gdal.org/"; + license = licenses.mit; + maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ]; + platforms = platforms.unix; + }; +} diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index fcf1a8a56..bb9a6162a 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -5,7 +5,6 @@ , postgresql , geos , proj -, gdalMinimal , json_c , pkg-config , file @@ -17,8 +16,8 @@ }: let - gdal = gdalMinimal; sfcgal = callPackage ./sfcgal/sfcgal.nix { }; + gdal = callPackage ./gdal.nix { inherit postgresql; }; in stdenv.mkDerivation rec { pname = "postgis"; diff --git a/nix/overlays/gdal-small.nix b/nix/overlays/gdal-small.nix deleted file mode 100644 index 18be8a526..000000000 --- a/nix/overlays/gdal-small.nix +++ /dev/null @@ -1,14 +0,0 @@ -final: prev: { - # override the version of gdal used with postgis with the small version. - # significantly reduces overall closure size - gdal = prev.gdalMinimal.override { - /* other features can be enabled, reference: - https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/gdal/default.nix - */ - - # useHDF = true; - # useArrow = true; - # useLibHEIF = true; - # ... - }; -} From 5ce731b4169e00a4c53e5c9bb8926f5982ca156f Mon Sep 17 00:00:00 2001 From: Bruno Andrade <1145012+bmpandrade@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:02:38 +0100 Subject: [PATCH 005/271] fix: AIO - update platform defaults position on postgresql.conf to ensure overrides happen successfully (#1238) --- docker/all-in-one/entrypoint.sh | 2 +- .../etc/postgresql-custom/postgresql-platform-defaults.conf | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/all-in-one/entrypoint.sh b/docker/all-in-one/entrypoint.sh index 97e68a6aa..0aff0b1ec 100755 --- a/docker/all-in-one/entrypoint.sh +++ b/docker/all-in-one/entrypoint.sh @@ -101,7 +101,7 @@ function setup_postgres { mv /etc/postgresql.schema.sql /docker-entrypoint-initdb.d/migrations/99-schema.sql tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgresql-custom/pgsodium_root.key - echo "include = '/etc/postgresql-custom/postgresql-platform-defaults.conf'" >>$PG_CONF + sed -i "/# Automatically generated optimizations/i # Supabase Platform Defaults\ninclude = '/etc/postgresql-custom/platform-defaults.conf'\n" $PG_CONF # TODO (darora): walg enablement is temporarily performed here until changes from https://github.com/supabase/postgres/pull/639 get picked up # other things will still be needed in the future (auth_delay config) diff --git a/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf b/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf index e62a1de83..51d34a13a 100644 --- a/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf +++ b/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf @@ -1,8 +1,6 @@ # these get imported _after_ the user specified overrides row_security = on wal_level = logical -max_wal_senders = 10 -max_replication_slots = 5 log_connections = on statement_timeout = 120000 jit = off From 3db2f7075d5ab30b0e2f2479973b077f76e1c0d5 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Sat, 28 Sep 2024 06:33:03 -0700 Subject: [PATCH 006/271] feat: bump gotrue version to v2.162.0 (#1241) --- ansible/vars.yml | 4 ++-- common-nix.vars.pkr.hcl | 2 +- common.vars.pkr.hcl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index e76e99cb0..471b073c6 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -17,8 +17,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.161.0 -gotrue_release_checksum: sha1:8e45f3511fee8f99a0b1567c73673991a0a5986c +gotrue_release: 2.162.0 +gotrue_release_checksum: sha1:855b23bd002577290c7d42d7042ac0f5316984b1 aws_cli_release: "2.2.7" diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl index 58c4586f2..38508dbf0 100644 --- a/common-nix.vars.pkr.hcl +++ b/common-nix.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.8.1.000" +postgres-version = "15.8.1.001" diff --git a/common.vars.pkr.hcl b/common.vars.pkr.hcl index 3c999dccd..fa1387690 100644 --- a/common.vars.pkr.hcl +++ b/common.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.1.1.93" +postgres-version = "15.1.1.94" From 074a2ecde1725cd81ac1f917e318558499510494 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:32:13 +0100 Subject: [PATCH 007/271] fix: only grant pg_read_all_data if it exists (#1242) * fix: only grant pg_read_all_data if it exists * fix: prevent `public` from being casted into `regrole` --- .../admin_api_scripts/pg_upgrade_scripts/common.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 4c776844b..a11f8ff32 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -357,7 +357,7 @@ begin , case when rec.grantee = 'postgres'::regrole then 'supabase_admin' when rec.grantee = 'supabase_admin'::regrole then 'postgres' when rec.grantee = 0 then 'public' - else rec.grantee::regrole + else rec.grantee::regrole::text end )); end if; @@ -383,7 +383,7 @@ begin when obj->>'objtype' = 'T' then 'types' when obj->>'objtype' = 'n' then 'schemas' end - , case when rec.grantee = 0 then 'public' else rec.grantee::regrole end + , case when rec.grantee = 0 then 'public' else rec.grantee::regrole::text end , case when rec.is_grantable then 'with grant option' else '' end )); end if; @@ -530,7 +530,14 @@ $$; alter database postgres connection limit -1; -- #incident-2024-09-12-project-upgrades-are-temporarily-disabled -grant pg_read_all_data, pg_signal_backend to postgres; +do $$ +begin + if exists (select from pg_authid where rolname = 'pg_read_all_data') then + execute('grant pg_read_all_data to postgres'); + end if; +end +$$; +grant pg_signal_backend to postgres; set session authorization supabase_admin; drop role supabase_tmp; From bc7155d208c934162a47b768e8f9f57e4d8c213e Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 1 Oct 2024 21:49:58 -0400 Subject: [PATCH 008/271] feat: make sure to source debug and src from our build (#1246) Co-authored-by: Sam Rose --- flake.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 03106015b..b6b77aec9 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,6 @@ (import ./nix/overlays/cargo-pgrx-0-11-3.nix) ]; }; - postgresql_15 = pkgs.postgresql.postgresql_15; 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 { }; @@ -305,7 +304,7 @@ pkgs.callPackage ./nix/ext/pg_regress.nix { postgresql = postgresqlPackage; }; - + postgresql_15 = getPostgresqlPackage "15"; in postgresVersions //{ supabase-groonga = supabase-groonga; @@ -314,13 +313,13 @@ #psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - postgresql_15 = pkgs.postgresql_15; - + inherit postgresql_15; + postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; - version = pkgs.postgresql_15.version; + version = postgresql_15.version; - src = pkgs.postgresql_15.src; + src = postgresql_15.src; nativeBuildInputs = [ pkgs.bzip2 ]; From 1bf8c053ba4d2a635bccd40bc1f00157f5523b4f Mon Sep 17 00:00:00 2001 From: angelico Date: Wed, 2 Oct 2024 11:21:33 +0800 Subject: [PATCH 009/271] chore: updates to run physical backups as a service (#1235) * chore: init commence-backup service * chore: bump adminapi and adminmgr * chore: bump version * fix: provide correct filename --- ansible/files/adminapi.sudoers.conf | 2 ++ ansible/files/commence-backup.service.j2 | 12 ++++++++++++ ansible/tasks/internal/admin-api.yml | 5 +++++ ansible/vars.yml | 4 ++-- common-nix.vars.pkr.hcl | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 ansible/files/commence-backup.service.j2 diff --git a/ansible/files/adminapi.sudoers.conf b/ansible/files/adminapi.sudoers.conf index eada0a94b..ae5537715 100644 --- a/ansible/files/adminapi.sudoers.conf +++ b/ansible/files/adminapi.sudoers.conf @@ -17,6 +17,8 @@ Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl st %adminapi ALL= NOPASSWD: /usr/bin/systemctl restart postgresql.service %adminapi ALL= NOPASSWD: /usr/bin/systemctl show -p NRestarts postgresql.service %adminapi ALL= NOPASSWD: /usr/bin/systemctl restart adminapi.service +%adminapi ALL= NOPASSWD: /usr/bin/systemctl is-active commence-backup.service +%adminapi ALL= NOPASSWD: /usr/bin/systemctl start commence-backup.service %adminapi ALL= NOPASSWD: /bin/systemctl daemon-reload %adminapi ALL= NOPASSWD: /bin/systemctl restart services.slice %adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf diff --git a/ansible/files/commence-backup.service.j2 b/ansible/files/commence-backup.service.j2 new file mode 100644 index 000000000..9d4ad0c68 --- /dev/null +++ b/ansible/files/commence-backup.service.j2 @@ -0,0 +1,12 @@ +[Unit] +Description=Async commence physical backup + +[Service] +Type=simple +User=adminapi +ExecStart=/usr/bin/admin-mgr commence-backup --run-as-service true +Restart=no +OOMScoreAdjust=-1000 + +[Install] +WantedBy=multi-user.target diff --git a/ansible/tasks/internal/admin-api.yml b/ansible/tasks/internal/admin-api.yml index cea0109fd..da93fef62 100644 --- a/ansible/tasks/internal/admin-api.yml +++ b/ansible/tasks/internal/admin-api.yml @@ -79,6 +79,11 @@ src: files/adminapi.service.j2 dest: /etc/systemd/system/adminapi.service +- name: adminapi - create service file for commence backup process + template: + src: files/commence-backup.service.j2 + dest: /etc/systemd/system/commence-backup.service + - name: UFW - Allow connections to adminapi ports ufw: rule: allow diff --git a/ansible/vars.yml b/ansible/vars.yml index 471b073c6..3c5ef2172 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -50,8 +50,8 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.68.0 -adminmgr_release: 0.22.1 +adminapi_release: 0.71.1 +adminmgr_release: 0.24.0 # Postgres Extensions postgis_release: "3.3.2" diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl index 38508dbf0..898212036 100644 --- a/common-nix.vars.pkr.hcl +++ b/common-nix.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.8.1.001" +postgres-version = "15.8.1.002" From 270c1c2f5417d6ef96a607ef02cd0e6beb1e44e9 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 2 Oct 2024 12:57:50 +0300 Subject: [PATCH 010/271] fix(develop): account for pg_stat_monitor major version upgrade (#1249) --- ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 9443d2acb..c0a213d02 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -11,6 +11,7 @@ # them depending on regtypes referencing system OIDs or outdated library files. EXTENSIONS_TO_DISABLE=( "pg_graphql" + "pg_stat_monitor" ) PG14_EXTENSIONS_TO_DISABLE=( From 26bdc463a0d153fff52ee19e8e55368edf76317d Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 2 Oct 2024 14:57:12 +0300 Subject: [PATCH 011/271] fix(pg_upgrade): retry commands within the cleanup step; wait until PG is ready to accept connections (#1251) --- .../admin_api_scripts/pg_upgrade_scripts/initiate.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index c0a213d02..31a7cd5b3 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -120,20 +120,22 @@ cleanup() { CI_start_postgres fi + retry 8 pg_isready -h localhost -U supabase_admin + echo "Re-enabling extensions" if [ -f $POST_UPGRADE_EXTENSION_SCRIPT ]; then - run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT + retry 5 run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT fi echo "Removing SUPERUSER grant from postgres" - run_sql -c "ALTER USER postgres WITH NOSUPERUSER;" + retry 5 run_sql -c "ALTER USER postgres WITH NOSUPERUSER;" echo "Resetting postgres database connection limit" - run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;" + retry 5 run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;" if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then echo "Unmounting data disk from ${MOUNT_POINT}" - umount $MOUNT_POINT + retry 3 umount $MOUNT_POINT fi echo "$UPGRADE_STATUS" > /tmp/pg-upgrade-status From 9b64ef3c4e9d88c3505ddc1eca39dcf7e86524bc Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 2 Oct 2024 20:38:16 +0300 Subject: [PATCH 012/271] fix(upgrades): collision when patching wrappers lib locations for upgrades (#1253) --- .../files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 31a7cd5b3..235b4f4c1 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -211,7 +211,7 @@ function patch_wrappers { WRAPPERS_LIB_PATH_DIR=$(dirname "$WRAPPERS_LIB_PATH") if [ "$WRAPPERS_LIB_PATH" != "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" ]; then echo "Copying $WRAPPERS_LIB_PATH to $WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" - cp "$WRAPPERS_LIB_PATH" "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" + cp "$WRAPPERS_LIB_PATH" "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" || true fi fi done @@ -225,7 +225,7 @@ function patch_wrappers { LIB_FILE_NAME=$(basename "$OLD_WRAPPER_LIB_PATH") if [ "$WRAPPERS_LIB_PATH" != "$PGLIBNEW/${LIB_FILE_NAME}" ]; then echo "Copying $WRAPPERS_LIB_PATH to $PGLIBNEW/${LIB_FILE_NAME}" - cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}" + cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}" || true fi fi fi From 7295fc04691cd731c80566384f31c10806a7b24c Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 3 Oct 2024 01:59:52 -0700 Subject: [PATCH 013/271] fix: add .well-known endpoints to envoy config (#1255) * fix: add .well-known endpoints to envoy config * fix: add ./well-known endpoints to aio kong * chore: fix formatting * fix: increase max_program_size for regex --- ansible/files/envoy_config/lds.yaml | 4 +++- docker/all-in-one/etc/kong/kong.yml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/files/envoy_config/lds.yaml b/ansible/files/envoy_config/lds.yaml index 60a38f65d..f2c719d20 100644 --- a/ansible/files/envoy_config/lds.yaml +++ b/ansible/files/envoy_config/lds.yaml @@ -254,8 +254,10 @@ resources: type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBACPerRoute - match: safe_regex: + google_re2: + max_program_size: 150 regex: >- - /auth/v1/(verify|callback|authorize|sso/saml/(acs|metadata|slo)) + /auth/v1/(verify|callback|authorize|sso/saml/(acs|metadata|slo)|\.well-known/(openid-configuration|jwks\.json)) route: cluster: gotrue regex_rewrite: diff --git a/docker/all-in-one/etc/kong/kong.yml b/docker/all-in-one/etc/kong/kong.yml index 53ad4baef..9952f9861 100644 --- a/docker/all-in-one/etc/kong/kong.yml +++ b/docker/all-in-one/etc/kong/kong.yml @@ -27,6 +27,12 @@ services: routes: [{ name: auth-v1-open-saml, strip_path: true, paths: [/auth/v1/sso/saml/] }], plugins: [{ name: cors }], } + - { + name: auth-v1-open-well-known, + url: 'http://localhost:9999/.well-known/', + routes: [{ name: auth-v1-open-well-known, strip_path: true, paths: [/auth/v1/.well-known/] }], + plugins: [{ name: cors }], + } - { name: auth-v1, url: 'http://localhost:9999/', From 6757ba00ddd0c6f2af60c3ee606332a30d7df23d Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Thu, 3 Oct 2024 08:41:58 -0500 Subject: [PATCH 014/271] Support restoring a user defined backup (#1254) * allow user defined init script for restoring paused db dumps * make start-client CLI more erganomic with named args and help * update description in cli * Update nix/tools/run-client.sh.in Co-authored-by: Beng Eu --------- Co-authored-by: Beng Eu --- nix/tools/run-client.sh.in | 126 +++++++++++++++++++++++++++++++------ 1 file changed, 106 insertions(+), 20 deletions(-) diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 18a8f21bb..5f3bf9bbb 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -3,16 +3,84 @@ [ ! -z "$DEBUG" ] && set -x -# first argument should be '15' or '16' for the version -if [ "$1" == "15" ]; then +# Default values +PSQL_VERSION="15" +MIGRATION_FILE="" +PORTNO="@PGSQL_DEFAULT_PORT@" + +# Function to display help +print_help() { + echo "Usage: nix run .#start-client -- [options]" + echo + echo "Options:" + echo " -v, --version [15|16|orioledb-16] Specify the PostgreSQL version to use (required)" + echo " -f, --file FILE Provide a custom migration script" + echo " -h, --help Show this help message" + echo + echo "Description:" + echo " Starts an interactive 'psql' session connecting to a Postgres database started with the" + echo " 'nix run .#start-server' command. If a migration file is not provided, the client" + echo " initializes the database with the default migrations for a new Supabase project." + echo " If a migrations file is provided, default migrations are skipped" + echo " If no migration file is provided, it runs the default Supabase migrations." + echo + echo "Examples:" + echo " nix run .#start-client" + echo " nix run .#start-client -- --version 15" + echo " nix run .#start-client -- --version 16 --file custom_migration.sql" + echo " nix run .#start-client -- --version 16 --port 5433" +} + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case "$1" in + -v|--version) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PSQL_VERSION="$2" + shift 2 + else + echo "Error: --version requires an argument (15, 16, or orioledb-16)" + exit 1 + fi + ;; + -f|--file) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + MIGRATION_FILE="$2" + shift 2 + else + echo "Error: --file requires a filename" + exit 1 + fi + ;; + -h|--help) + print_help + exit 0 + ;; + *) + echo "Unknown option: $1" + print_help + exit 1 + ;; + esac +done + +# Check if version is provided +if [[ -z "$PSQL_VERSION" ]]; then + echo "Error: PostgreSQL version is required." + print_help + exit 1 +fi + +# Determine PostgreSQL version +if [ "$PSQL_VERSION" == "15" ]; then echo "Starting client for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" -elif [ "$1" == "16" ]; then +elif [ "$PSQL_VERSION" == "16" ]; then echo "Starting client for PSQL 16" PSQL16=@PSQL16_BINDIR@ BINDIR="$PSQL16" -elif [ "$1" == "orioledb-16" ]; then +elif [ "$PSQL_VERSION" == "orioledb-16" ]; then echo "Starting client for PSQL ORIOLEDB 16" PSQLORIOLEDB16=@PSQLORIOLEDB16_BINDIR@ BINDIR="$PSQLORIOLEDB16" @@ -20,11 +88,12 @@ else echo "Please provide a valid Postgres version (15, 16, or orioledb-16)" exit 1 fi + #vars for migration.sh export PATH=$BINDIR/bin:$PATH export POSTGRES_DB=postgres export POSTGRES_HOST=localhost -export POSTGRES_PORT=@PGSQL_DEFAULT_PORT@ + PORTNO="${2:-@PGSQL_DEFAULT_PORT@}" PGSQL_SUPERUSER=@PGSQL_SUPERUSER@ MIGRATIONS_DIR=@MIGRATIONS_DIR@ @@ -35,20 +104,37 @@ psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$POR create role postgres superuser login password '$PGPASSWORD'; alter database postgres owner to postgres; EOSQL -for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -f "$sql" postgres -done -psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" -psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" -psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" -# run migrations as super user - postgres user demoted in post-setup -for sql in "$MIGRATIONS_DIR"/migrations/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$sql" postgres -done -psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$POSTGRESQL_SCHEMA_SQL" postgres -# TODO Do we need to reset stats when running migrations locally? -#psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -c 'SELECT extensions.pg_stat_statements_reset(); SELECT pg_stat_reset();' postgres || true +# Use custom migration script if provided +if [ -n "$MIGRATION_FILE" ]; then + echo "$0: running user-provided migration file $MIGRATION_FILE" + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -f "$MIGRATION_FILE" postgres +else + # Run default init scripts + for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do + echo "$0: running $sql" + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -f "$sql" postgres + done + + # Alter user password + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" + + # Run additional schema files + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" + + # Run migrations as superuser + for sql in "$MIGRATIONS_DIR"/migrations/*.sql; do + echo "$0: running $sql" + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$sql" postgres + done + + # Run PostgreSQL schema + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$POSTGRESQL_SCHEMA_SQL" postgres +fi + +# Optional: Reset stats if needed +# psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -c 'SELECT extensions.pg_stat_statements_reset(); SELECT pg_stat_reset();' postgres || true + +# Start interactive psql session exec psql -U postgres -p "$PORTNO" -h localhost postgres From 263aa1e19a6fd45066be96cd96bb6e180519267e Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Fri, 4 Oct 2024 13:37:51 -0500 Subject: [PATCH 015/271] Adds the pgmq extension to support queuing (#1120) * add pgmq SQL only extension * revert accidental file inclusion * add public interface test coverage * order by namespace for tables in interface test to make timescale stable since they use 3 schemas * pgmq in prime * update to pgmq 1.4.2 * regression tests for pgmq * add pgmq migration test script * add pg_partman * remove pg_partman_bgq from test suite postgresql.conf * checkin broken test * checkin broken test 2 * bump pgmq to 1.4.4 * sync test outputs and pg_partman with 1.4.4 * add pgmq to supautils privileged extensions --- .../files/postgresql_config/supautils.conf.j2 | 2 +- common-nix.vars.pkr.hcl | 2 +- flake.nix | 2 + nix/ext/pg_partman.nix | 34 ++ nix/ext/pgmq.nix | 33 ++ .../expected/extensions_sql_interface.out | 375 ++++++++++++------ nix/tests/expected/pg_partman.out | 101 +++++ nix/tests/expected/pgmq.out | 143 +++++++ nix/tests/migrations/pgmq.sql | 12 + nix/tests/prime.sql | 12 +- nix/tests/sql/extensions_sql_interface.sql | 1 + nix/tests/sql/pg_partman.sql | 82 ++++ nix/tests/sql/pgmq.sql | 89 +++++ 13 files changed, 754 insertions(+), 134 deletions(-) create mode 100644 nix/ext/pg_partman.nix create mode 100644 nix/ext/pgmq.nix create mode 100644 nix/tests/expected/pg_partman.out create mode 100644 nix/tests/expected/pgmq.out create mode 100644 nix/tests/migrations/pgmq.sql create mode 100644 nix/tests/sql/pg_partman.sql create mode 100644 nix/tests/sql/pgmq.sql diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 2ab4257fd..aa01cd8aa 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -3,7 +3,7 @@ supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identitie # full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 -supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pg_prewarm, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgstattuple, pgsodium, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' +supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_partman, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pg_prewarm, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgstattuple, pgsodium, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl index 898212036..8419992a8 100644 --- a/common-nix.vars.pkr.hcl +++ b/common-nix.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.8.1.002" +postgres-version = "15.8.1.003" diff --git a/flake.nix b/flake.nix index b6b77aec9..82409b185 100644 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,7 @@ ./nix/ext/pgroonga.nix ./nix/ext/index_advisor.nix ./nix/ext/wal2json.nix + ./nix/ext/pgmq.nix ./nix/ext/pg_repack.nix ./nix/ext/pg-safeupdate.nix ./nix/ext/plpgsql-check.nix @@ -119,6 +120,7 @@ ./nix/ext/pg_hashids.nix ./nix/ext/pgsodium.nix ./nix/ext/pg_graphql.nix + ./nix/ext/pg_partman.nix ./nix/ext/pg_stat_monitor.nix ./nix/ext/pg_jsonschema.nix ./nix/ext/pgvector.nix diff --git a/nix/ext/pg_partman.nix b/nix/ext/pg_partman.nix new file mode 100644 index 000000000..1ece63386 --- /dev/null +++ b/nix/ext/pg_partman.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + pname = "pg_partman"; + version = "5.1.0"; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "pgpartman"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "sha256-GrVOJ5ywZMyqyDroYDLdKkXDdIJSDGhDfveO/ZvrmYs="; + }; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + cp src/*${postgresql.dlSuffix} $out/lib + cp updates/* $out/share/postgresql/extension + cp -r sql/* $out/share/postgresql/extension + cp *.control $out/share/postgresql/extension + ''; + + meta = with lib; { + description = "Partition management extension for PostgreSQL"; + homepage = "https://github.com/pgpartman/pg_partman"; + changelog = "https://github.com/pgpartman/pg_partman/blob/v${version}/CHANGELOG.md"; + maintainers = with maintainers; [ samrose ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + broken = versionOlder postgresql.version "14"; + }; +} diff --git a/nix/ext/pgmq.nix b/nix/ext/pgmq.nix new file mode 100644 index 000000000..97a3c27e3 --- /dev/null +++ b/nix/ext/pgmq.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + pname = "pgmq"; + version = "1.4.4"; + buildInputs = [ postgresql ]; + src = fetchFromGitHub { + owner = "tembo-io"; + repo = pname; + rev = "v${version}"; + hash = "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw="; + }; + + buildPhase = '' + cd pgmq-extension + ''; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + mv sql/pgmq.sql $out/share/postgresql/extension/pgmq--${version}.sql + cp sql/*.sql $out/share/postgresql/extension + cp *.control $out/share/postgresql/extension + ''; + + meta = with lib; { + description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres."; + homepage = "https://github.com/tembo-io/pgmq"; + maintainers = with maintainers; [ olirice ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; +} diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index d5df3c719..5714fbcec 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -76,6 +76,7 @@ order by pg_hashids | t pg_jsonschema | f pg_net | f + pg_partman | f pg_prewarm | t pg_repack | f pg_stat_monitor | t @@ -88,6 +89,7 @@ order by pgaudit | t pgcrypto | t pgjwt | f + pgmq | f pgroonga | f pgroonga_database | f pgrouting | t @@ -121,7 +123,7 @@ order by vector | t wrappers | f xml2 | f -(81 rows) +(83 rows) /* @@ -149,8 +151,8 @@ order by n.nspname, p.proname, pg_catalog.pg_get_function_identity_arguments(p.oid); - extension_name | schema_name | function_name | argument_types | return_type -------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + extension_name | schema_name | function_name | argument_types | return_type +------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr @@ -1147,6 +1149,45 @@ order by pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | worker_restart | | boolean + pg_partman | public | apply_cluster | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text | void + pg_partman | public | apply_constraints | p_parent_table text, p_child_table text, p_analyze boolean, p_job_id bigint | void + pg_partman | public | apply_privileges | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text, p_job_id bigint | void + pg_partman | public | autovacuum_off | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean + pg_partman | public | autovacuum_reset | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean + pg_partman | public | calculate_time_partition_info | p_time_interval interval, p_start_time timestamp with time zone, p_date_trunc_interval text, OUT base_timestamp timestamp with time zone, OUT datetime_string text | record + pg_partman | public | check_automatic_maintenance_value | p_automatic_maintenance text | boolean + pg_partman | public | check_control_type | p_parent_schema text, p_parent_tablename text, p_control text | TABLE(general_type text, exact_type text) + pg_partman | public | check_default | p_exact_count boolean | SETOF check_default_table + pg_partman | public | check_epoch_type | p_type text | boolean + pg_partman | public | check_name_length | p_object_name text, p_suffix text, p_table_partition boolean | text + pg_partman | public | check_partition_type | p_type text | boolean + pg_partman | public | check_subpart_sameconfig | p_parent_table text | TABLE(sub_control text, sub_partition_interval text, sub_partition_type text, sub_premake integer, sub_automatic_maintenance text, sub_template_table text, sub_retention text, sub_retention_schema text, sub_retention_keep_index boolean, sub_retention_keep_table boolean, sub_epoch text, sub_constraint_cols text[], sub_optimize_constraint integer, sub_infinite_time_partitions boolean, sub_jobmon boolean, sub_inherit_privileges boolean, sub_constraint_valid boolean, sub_date_trunc_interval text, sub_ignore_default_data boolean, sub_default_table boolean, sub_maintenance_order integer, sub_retention_keep_publication boolean) + pg_partman | public | check_subpartition_limits | p_parent_table text, p_type text, OUT sub_min text, OUT sub_max text | record + pg_partman | public | create_parent | p_parent_table text, p_control text, p_interval text, p_type text, p_epoch text, p_premake integer, p_start_partition text, p_default_table boolean, p_automatic_maintenance text, p_constraint_cols text[], p_template_table text, p_jobmon boolean, p_date_trunc_interval text | boolean + pg_partman | public | create_partition_id | p_parent_table text, p_partition_ids bigint[], p_start_partition text | boolean + pg_partman | public | create_partition_time | p_parent_table text, p_partition_times timestamp with time zone[], p_start_partition text | boolean + pg_partman | public | create_sub_parent | p_top_parent text, p_control text, p_interval text, p_type text, p_default_table boolean, p_declarative_check text, p_constraint_cols text[], p_premake integer, p_start_partition text, p_epoch text, p_jobmon boolean, p_date_trunc_interval text | boolean + pg_partman | public | drop_constraints | p_parent_table text, p_child_table text, p_debug boolean | void + pg_partman | public | drop_partition_id | p_parent_table text, p_retention bigint, p_keep_table boolean, p_keep_index boolean, p_retention_schema text | integer + pg_partman | public | drop_partition_time | p_parent_table text, p_retention interval, p_keep_table boolean, p_keep_index boolean, p_retention_schema text, p_reference_timestamp timestamp with time zone | integer + pg_partman | public | dump_partitioned_table_definition | p_parent_table text, p_ignore_template_table boolean | text + pg_partman | public | inherit_replica_identity | p_parent_schemaname text, p_parent_tablename text, p_child_tablename text | void + pg_partman | public | inherit_template_properties | p_parent_table text, p_child_schema text, p_child_tablename text | boolean + pg_partman | public | partition_data_id | p_parent_table text, p_batch_count integer, p_batch_interval bigint, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint + pg_partman | public | partition_data_proc | IN p_parent_table text, IN p_loop_count integer, IN p_interval text, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_order text, IN p_source_table text, IN p_ignored_columns text[], IN p_quiet boolean | + pg_partman | public | partition_data_time | p_parent_table text, p_batch_count integer, p_batch_interval interval, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint + pg_partman | public | partition_gap_fill | p_parent_table text | integer + pg_partman | public | reapply_constraints_proc | IN p_parent_table text, IN p_drop_constraints boolean, IN p_apply_constraints boolean, IN p_wait integer, IN p_dryrun boolean | + pg_partman | public | reapply_privileges | p_parent_table text | void + pg_partman | public | run_analyze | IN p_skip_locked boolean, IN p_quiet boolean, IN p_parent_table text | + pg_partman | public | run_maintenance | p_parent_table text, p_analyze boolean, p_jobmon boolean | void + pg_partman | public | run_maintenance_proc | IN p_wait integer, IN p_analyze boolean, IN p_jobmon boolean | + pg_partman | public | show_partition_info | p_child_table text, p_partition_interval text, p_parent_table text, OUT child_start_time timestamp with time zone, OUT child_end_time timestamp with time zone, OUT child_start_id bigint, OUT child_end_id bigint, OUT suffix text | record + pg_partman | public | show_partition_name | p_parent_table text, p_value text, OUT partition_schema text, OUT partition_table text, OUT suffix_timestamp timestamp with time zone, OUT suffix_id bigint, OUT table_exists boolean | record + pg_partman | public | show_partitions | p_parent_table text, p_order text, p_include_default boolean | TABLE(partition_schemaname text, partition_tablename text) + pg_partman | public | stop_sub_partition | p_parent_table text, p_jobmon boolean | boolean + pg_partman | public | undo_partition | p_parent_table text, p_target_table text, p_loop_count integer, p_batch_interval text, p_keep_table boolean, p_lock_wait numeric, p_ignored_columns text[], p_drop_cascade boolean, OUT partitions_undone integer, OUT rows_undone bigint | record + pg_partman | public | undo_partition_proc | IN p_parent_table text, IN p_target_table text, IN p_loop_count integer, IN p_interval text, IN p_keep_table boolean, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_ignored_columns text[], IN p_drop_cascade boolean, IN p_quiet boolean | pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void pg_prewarm | public | pg_prewarm | regclass, mode text, fork text, first_block bigint, last_block bigint | bigint @@ -1306,6 +1347,34 @@ order by pgjwt | public | url_decode | data text | bytea pgjwt | public | url_encode | data bytea | text pgjwt | public | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) + pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean + pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _get_partition_col | partition_interval text | text + pgmq | pgmq | _get_pg_partman_major_version | | integer + pgmq | pgmq | _get_pg_partman_schema | | text + pgmq | pgmq | archive | queue_name text, msg_id bigint | boolean + pgmq | pgmq | archive | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | convert_archive_partitioned | table_name text, partition_interval text, retention_interval text, leading_partition integer | void + pgmq | pgmq | create | queue_name text | void + pgmq | pgmq | create_non_partitioned | queue_name text | void + pgmq | pgmq | create_partitioned | queue_name text, partition_interval text, retention_interval text | void + pgmq | pgmq | create_unlogged | queue_name text | void + pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean + pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean + pgmq | pgmq | format_table_name | queue_name text, prefix text | text + pgmq | pgmq | list_queues | | SETOF pgmq.queue_record + pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result + pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result + pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record + pgmq | pgmq | purge_queue | queue_name text | bigint + pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint + pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record + pgmq | pgmq | validate_queue_name | queue_name text | void pgroonga | pgroonga | command | groongacommand text | text pgroonga | pgroonga | command | groongacommand text, arguments text[] | text pgroonga | pgroonga | command_escape_value | value text | text @@ -5156,7 +5225,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5005 rows) +(5072 rows) /* @@ -5185,6 +5254,7 @@ where and pc.relkind in ('r', 'v', 'm', 'i') order by e.extname, + n.nspname, pc.relname, pa.attname; extension_name | schema_name | entity_name | attname @@ -5238,6 +5308,61 @@ order by pg_net | net | http_request_queue | method pg_net | net | http_request_queue | timeout_milliseconds pg_net | net | http_request_queue | url + pg_partman | public | part_config | automatic_maintenance + pg_partman | public | part_config | constraint_cols + pg_partman | public | part_config | constraint_valid + pg_partman | public | part_config | control + pg_partman | public | part_config | date_trunc_interval + pg_partman | public | part_config | datetime_string + pg_partman | public | part_config | default_table + pg_partman | public | part_config | epoch + pg_partman | public | part_config | ignore_default_data + pg_partman | public | part_config | infinite_time_partitions + pg_partman | public | part_config | inherit_privileges + pg_partman | public | part_config | jobmon + pg_partman | public | part_config | maintenance_last_run + pg_partman | public | part_config | maintenance_order + pg_partman | public | part_config | optimize_constraint + pg_partman | public | part_config | parent_table + pg_partman | public | part_config | partition_interval + pg_partman | public | part_config | partition_type + pg_partman | public | part_config | premake + pg_partman | public | part_config | retention + pg_partman | public | part_config | retention_keep_index + pg_partman | public | part_config | retention_keep_publication + pg_partman | public | part_config | retention_keep_table + pg_partman | public | part_config | retention_schema + pg_partman | public | part_config | sub_partition_set_full + pg_partman | public | part_config | template_table + pg_partman | public | part_config | undo_in_progress + pg_partman | public | part_config_sub | sub_automatic_maintenance + pg_partman | public | part_config_sub | sub_constraint_cols + pg_partman | public | part_config_sub | sub_constraint_valid + pg_partman | public | part_config_sub | sub_control + pg_partman | public | part_config_sub | sub_date_trunc_interval + pg_partman | public | part_config_sub | sub_default_table + pg_partman | public | part_config_sub | sub_epoch + pg_partman | public | part_config_sub | sub_ignore_default_data + pg_partman | public | part_config_sub | sub_infinite_time_partitions + pg_partman | public | part_config_sub | sub_inherit_privileges + pg_partman | public | part_config_sub | sub_jobmon + pg_partman | public | part_config_sub | sub_maintenance_order + pg_partman | public | part_config_sub | sub_optimize_constraint + pg_partman | public | part_config_sub | sub_parent + pg_partman | public | part_config_sub | sub_partition_interval + pg_partman | public | part_config_sub | sub_partition_type + pg_partman | public | part_config_sub | sub_premake + pg_partman | public | part_config_sub | sub_retention + pg_partman | public | part_config_sub | sub_retention_keep_index + pg_partman | public | part_config_sub | sub_retention_keep_publication + pg_partman | public | part_config_sub | sub_retention_keep_table + pg_partman | public | part_config_sub | sub_retention_schema + pg_partman | public | part_config_sub | sub_template_table + pg_partman | public | table_privs | grantee + pg_partman | public | table_privs | grantor + pg_partman | public | table_privs | privilege_type + pg_partman | public | table_privs | table_name + pg_partman | public | table_privs | table_schema pg_repack | repack | primary_keys | indexrelid pg_repack | repack | primary_keys | indrelid pg_repack | repack | tables | alter_col_storage @@ -5378,6 +5503,10 @@ order by pg_tle | pgtle | feature_info | obj_identity pg_tle | pgtle | feature_info | proname pg_tle | pgtle | feature_info | schema_name + pgmq | pgmq | meta | created_at + pgmq | pgmq | meta | is_partitioned + pgmq | pgmq | meta | is_unlogged + pgmq | pgmq | meta | queue_name pgsodium | pgsodium | decrypted_key | associated_data pgsodium | pgsodium | decrypted_key | comment pgsodium | pgsodium | decrypted_key | created @@ -5956,49 +6085,6 @@ order by supabase_vault | vault | secrets | nonce supabase_vault | vault | secrets | secret supabase_vault | vault | secrets | updated_at - timescaledb | _timescaledb_config | bgw_job | application_name - timescaledb | _timescaledb_config | bgw_job | check_name - timescaledb | _timescaledb_config | bgw_job | check_schema - timescaledb | _timescaledb_config | bgw_job | config - timescaledb | _timescaledb_config | bgw_job | fixed_schedule - timescaledb | _timescaledb_config | bgw_job | hypertable_id - timescaledb | _timescaledb_config | bgw_job | id - timescaledb | _timescaledb_config | bgw_job | initial_start - timescaledb | _timescaledb_config | bgw_job | max_retries - timescaledb | _timescaledb_config | bgw_job | max_runtime - timescaledb | _timescaledb_config | bgw_job | owner - timescaledb | _timescaledb_config | bgw_job | proc_name - timescaledb | _timescaledb_config | bgw_job | proc_schema - timescaledb | _timescaledb_config | bgw_job | retry_period - timescaledb | _timescaledb_config | bgw_job | schedule_interval - timescaledb | _timescaledb_config | bgw_job | scheduled - timescaledb | _timescaledb_config | bgw_job | timezone - timescaledb | _timescaledb_internal | bgw_job_stat | consecutive_crashes - timescaledb | _timescaledb_internal | bgw_job_stat | consecutive_failures - timescaledb | _timescaledb_internal | bgw_job_stat | flags - timescaledb | _timescaledb_internal | bgw_job_stat | job_id - timescaledb | _timescaledb_internal | bgw_job_stat | last_finish - timescaledb | _timescaledb_internal | bgw_job_stat | last_run_success - timescaledb | _timescaledb_internal | bgw_job_stat | last_start - timescaledb | _timescaledb_internal | bgw_job_stat | last_successful_finish - timescaledb | _timescaledb_internal | bgw_job_stat | next_start - timescaledb | _timescaledb_internal | bgw_job_stat | total_crashes - timescaledb | _timescaledb_internal | bgw_job_stat | total_duration - timescaledb | _timescaledb_internal | bgw_job_stat | total_duration_failures - timescaledb | _timescaledb_internal | bgw_job_stat | total_failures - timescaledb | _timescaledb_internal | bgw_job_stat | total_runs - timescaledb | _timescaledb_internal | bgw_job_stat | total_successes - timescaledb | _timescaledb_internal | bgw_job_stat_history | data - timescaledb | _timescaledb_internal | bgw_job_stat_history | execution_finish - timescaledb | _timescaledb_internal | bgw_job_stat_history | execution_start - timescaledb | _timescaledb_internal | bgw_job_stat_history | id - timescaledb | _timescaledb_internal | bgw_job_stat_history | job_id - timescaledb | _timescaledb_internal | bgw_job_stat_history | pid - timescaledb | _timescaledb_internal | bgw_job_stat_history | succeeded - timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | chunk_id - timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | job_id - timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | last_time_job_run - timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | num_times_job_run timescaledb | _timescaledb_cache | cache_inval_bgw_job | timescaledb | _timescaledb_cache | cache_inval_extension | timescaledb | _timescaledb_cache | cache_inval_hypertable | @@ -6018,10 +6104,6 @@ order by timescaledb | _timescaledb_catalog | chunk_column_stats | range_end timescaledb | _timescaledb_catalog | chunk_column_stats | range_start timescaledb | _timescaledb_catalog | chunk_column_stats | valid - timescaledb | timescaledb_information | chunk_compression_settings | chunk - timescaledb | timescaledb_information | chunk_compression_settings | hypertable - timescaledb | timescaledb_information | chunk_compression_settings | orderby - timescaledb | timescaledb_information | chunk_compression_settings | segmentby timescaledb | _timescaledb_catalog | chunk_constraint | chunk_id timescaledb | _timescaledb_catalog | chunk_constraint | constraint_name timescaledb | _timescaledb_catalog | chunk_constraint | dimension_slice_id @@ -6030,32 +6112,6 @@ order by timescaledb | _timescaledb_catalog | chunk_index | hypertable_id timescaledb | _timescaledb_catalog | chunk_index | hypertable_index_name timescaledb | _timescaledb_catalog | chunk_index | index_name - timescaledb | timescaledb_information | chunks | chunk_creation_time - timescaledb | timescaledb_information | chunks | chunk_name - timescaledb | timescaledb_information | chunks | chunk_schema - timescaledb | timescaledb_information | chunks | chunk_tablespace - timescaledb | timescaledb_information | chunks | hypertable_name - timescaledb | timescaledb_information | chunks | hypertable_schema - timescaledb | timescaledb_information | chunks | is_compressed - timescaledb | timescaledb_information | chunks | primary_dimension - timescaledb | timescaledb_information | chunks | primary_dimension_type - timescaledb | timescaledb_information | chunks | range_end - timescaledb | timescaledb_information | chunks | range_end_integer - timescaledb | timescaledb_information | chunks | range_start - timescaledb | timescaledb_information | chunks | range_start_integer - timescaledb | _timescaledb_internal | compressed_chunk_stats | chunk_name - timescaledb | _timescaledb_internal | compressed_chunk_stats | chunk_schema - timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_heap_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_index_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_toast_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_total_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | compression_status - timescaledb | _timescaledb_internal | compressed_chunk_stats | hypertable_name - timescaledb | _timescaledb_internal | compressed_chunk_stats | hypertable_schema - timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_heap_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_index_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_toast_size - timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_total_size timescaledb | _timescaledb_catalog | compression_algorithm | description timescaledb | _timescaledb_catalog | compression_algorithm | id timescaledb | _timescaledb_catalog | compression_algorithm | name @@ -6071,18 +6127,11 @@ order by timescaledb | _timescaledb_catalog | compression_chunk_size | uncompressed_heap_size timescaledb | _timescaledb_catalog | compression_chunk_size | uncompressed_index_size timescaledb | _timescaledb_catalog | compression_chunk_size | uncompressed_toast_size - timescaledb | timescaledb_information | compression_settings | attname - timescaledb | timescaledb_information | compression_settings | hypertable_name - timescaledb | timescaledb_information | compression_settings | hypertable_schema timescaledb | _timescaledb_catalog | compression_settings | orderby - timescaledb | timescaledb_information | compression_settings | orderby_asc - timescaledb | timescaledb_information | compression_settings | orderby_column_index timescaledb | _timescaledb_catalog | compression_settings | orderby_desc timescaledb | _timescaledb_catalog | compression_settings | orderby_nullsfirst - timescaledb | timescaledb_information | compression_settings | orderby_nullsfirst timescaledb | _timescaledb_catalog | compression_settings | relid timescaledb | _timescaledb_catalog | compression_settings | segmentby - timescaledb | timescaledb_information | compression_settings | segmentby_column_index timescaledb | _timescaledb_catalog | continuous_agg | direct_view_name timescaledb | _timescaledb_catalog | continuous_agg | direct_view_schema timescaledb | _timescaledb_catalog | continuous_agg | finalized @@ -6105,17 +6154,6 @@ order by timescaledb | _timescaledb_catalog | continuous_agg_migrate_plan_step | status timescaledb | _timescaledb_catalog | continuous_agg_migrate_plan_step | step_id timescaledb | _timescaledb_catalog | continuous_agg_migrate_plan_step | type - timescaledb | timescaledb_information | continuous_aggregates | compression_enabled - timescaledb | timescaledb_information | continuous_aggregates | finalized - timescaledb | timescaledb_information | continuous_aggregates | hypertable_name - timescaledb | timescaledb_information | continuous_aggregates | hypertable_schema - timescaledb | timescaledb_information | continuous_aggregates | materialization_hypertable_name - timescaledb | timescaledb_information | continuous_aggregates | materialization_hypertable_schema - timescaledb | timescaledb_information | continuous_aggregates | materialized_only - timescaledb | timescaledb_information | continuous_aggregates | view_definition - timescaledb | timescaledb_information | continuous_aggregates | view_name - timescaledb | timescaledb_information | continuous_aggregates | view_owner - timescaledb | timescaledb_information | continuous_aggregates | view_schema timescaledb | _timescaledb_catalog | continuous_aggs_bucket_function | bucket_fixed_width timescaledb | _timescaledb_catalog | continuous_aggs_bucket_function | bucket_func timescaledb | _timescaledb_catalog | continuous_aggs_bucket_function | bucket_offset @@ -6149,16 +6187,6 @@ order by timescaledb | _timescaledb_catalog | dimension_slice | id timescaledb | _timescaledb_catalog | dimension_slice | range_end timescaledb | _timescaledb_catalog | dimension_slice | range_start - timescaledb | timescaledb_information | dimensions | column_name - timescaledb | timescaledb_information | dimensions | column_type - timescaledb | timescaledb_information | dimensions | dimension_number - timescaledb | timescaledb_information | dimensions | dimension_type - timescaledb | timescaledb_information | dimensions | hypertable_name - timescaledb | timescaledb_information | dimensions | hypertable_schema - timescaledb | timescaledb_information | dimensions | integer_interval - timescaledb | timescaledb_information | dimensions | integer_now_func - timescaledb | timescaledb_information | dimensions | num_partitions - timescaledb | timescaledb_information | dimensions | time_interval timescaledb | _timescaledb_catalog | hypertable | associated_schema_name timescaledb | _timescaledb_catalog | hypertable | associated_table_prefix timescaledb | _timescaledb_catalog | hypertable | chunk_sizing_func_name @@ -6171,6 +6199,71 @@ order by timescaledb | _timescaledb_catalog | hypertable | schema_name timescaledb | _timescaledb_catalog | hypertable | status timescaledb | _timescaledb_catalog | hypertable | table_name + timescaledb | _timescaledb_catalog | metadata | include_in_telemetry + timescaledb | _timescaledb_catalog | metadata | key + timescaledb | _timescaledb_catalog | metadata | value + timescaledb | _timescaledb_catalog | tablespace | hypertable_id + timescaledb | _timescaledb_catalog | tablespace | id + timescaledb | _timescaledb_catalog | tablespace | tablespace_name + timescaledb | _timescaledb_catalog | telemetry_event | body + timescaledb | _timescaledb_catalog | telemetry_event | created + timescaledb | _timescaledb_catalog | telemetry_event | tag + timescaledb | _timescaledb_config | bgw_job | application_name + timescaledb | _timescaledb_config | bgw_job | check_name + timescaledb | _timescaledb_config | bgw_job | check_schema + timescaledb | _timescaledb_config | bgw_job | config + timescaledb | _timescaledb_config | bgw_job | fixed_schedule + timescaledb | _timescaledb_config | bgw_job | hypertable_id + timescaledb | _timescaledb_config | bgw_job | id + timescaledb | _timescaledb_config | bgw_job | initial_start + timescaledb | _timescaledb_config | bgw_job | max_retries + timescaledb | _timescaledb_config | bgw_job | max_runtime + timescaledb | _timescaledb_config | bgw_job | owner + timescaledb | _timescaledb_config | bgw_job | proc_name + timescaledb | _timescaledb_config | bgw_job | proc_schema + timescaledb | _timescaledb_config | bgw_job | retry_period + timescaledb | _timescaledb_config | bgw_job | schedule_interval + timescaledb | _timescaledb_config | bgw_job | scheduled + timescaledb | _timescaledb_config | bgw_job | timezone + timescaledb | _timescaledb_internal | bgw_job_stat | consecutive_crashes + timescaledb | _timescaledb_internal | bgw_job_stat | consecutive_failures + timescaledb | _timescaledb_internal | bgw_job_stat | flags + timescaledb | _timescaledb_internal | bgw_job_stat | job_id + timescaledb | _timescaledb_internal | bgw_job_stat | last_finish + timescaledb | _timescaledb_internal | bgw_job_stat | last_run_success + timescaledb | _timescaledb_internal | bgw_job_stat | last_start + timescaledb | _timescaledb_internal | bgw_job_stat | last_successful_finish + timescaledb | _timescaledb_internal | bgw_job_stat | next_start + timescaledb | _timescaledb_internal | bgw_job_stat | total_crashes + timescaledb | _timescaledb_internal | bgw_job_stat | total_duration + timescaledb | _timescaledb_internal | bgw_job_stat | total_duration_failures + timescaledb | _timescaledb_internal | bgw_job_stat | total_failures + timescaledb | _timescaledb_internal | bgw_job_stat | total_runs + timescaledb | _timescaledb_internal | bgw_job_stat | total_successes + timescaledb | _timescaledb_internal | bgw_job_stat_history | data + timescaledb | _timescaledb_internal | bgw_job_stat_history | execution_finish + timescaledb | _timescaledb_internal | bgw_job_stat_history | execution_start + timescaledb | _timescaledb_internal | bgw_job_stat_history | id + timescaledb | _timescaledb_internal | bgw_job_stat_history | job_id + timescaledb | _timescaledb_internal | bgw_job_stat_history | pid + timescaledb | _timescaledb_internal | bgw_job_stat_history | succeeded + timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | chunk_id + timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | job_id + timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | last_time_job_run + timescaledb | _timescaledb_internal | bgw_policy_chunk_stats | num_times_job_run + timescaledb | _timescaledb_internal | compressed_chunk_stats | chunk_name + timescaledb | _timescaledb_internal | compressed_chunk_stats | chunk_schema + timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_heap_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_index_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_toast_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | compressed_total_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | compression_status + timescaledb | _timescaledb_internal | compressed_chunk_stats | hypertable_name + timescaledb | _timescaledb_internal | compressed_chunk_stats | hypertable_schema + timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_heap_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_index_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_toast_size + timescaledb | _timescaledb_internal | compressed_chunk_stats | uncompressed_total_size timescaledb | _timescaledb_internal | hypertable_chunk_local_size | chunk_id timescaledb | _timescaledb_internal | hypertable_chunk_local_size | chunk_name timescaledb | _timescaledb_internal | hypertable_chunk_local_size | chunk_schema @@ -6185,6 +6278,59 @@ order by timescaledb | _timescaledb_internal | hypertable_chunk_local_size | index_bytes timescaledb | _timescaledb_internal | hypertable_chunk_local_size | toast_bytes timescaledb | _timescaledb_internal | hypertable_chunk_local_size | total_bytes + timescaledb | timescaledb_experimental | policies | config + timescaledb | timescaledb_experimental | policies | hypertable_name + timescaledb | timescaledb_experimental | policies | hypertable_schema + timescaledb | timescaledb_experimental | policies | proc_name + timescaledb | timescaledb_experimental | policies | proc_schema + timescaledb | timescaledb_experimental | policies | relation_name + timescaledb | timescaledb_experimental | policies | relation_schema + timescaledb | timescaledb_experimental | policies | schedule_interval + timescaledb | timescaledb_information | chunk_compression_settings | chunk + timescaledb | timescaledb_information | chunk_compression_settings | hypertable + timescaledb | timescaledb_information | chunk_compression_settings | orderby + timescaledb | timescaledb_information | chunk_compression_settings | segmentby + timescaledb | timescaledb_information | chunks | chunk_creation_time + timescaledb | timescaledb_information | chunks | chunk_name + timescaledb | timescaledb_information | chunks | chunk_schema + timescaledb | timescaledb_information | chunks | chunk_tablespace + timescaledb | timescaledb_information | chunks | hypertable_name + timescaledb | timescaledb_information | chunks | hypertable_schema + timescaledb | timescaledb_information | chunks | is_compressed + timescaledb | timescaledb_information | chunks | primary_dimension + timescaledb | timescaledb_information | chunks | primary_dimension_type + timescaledb | timescaledb_information | chunks | range_end + timescaledb | timescaledb_information | chunks | range_end_integer + timescaledb | timescaledb_information | chunks | range_start + timescaledb | timescaledb_information | chunks | range_start_integer + timescaledb | timescaledb_information | compression_settings | attname + timescaledb | timescaledb_information | compression_settings | hypertable_name + timescaledb | timescaledb_information | compression_settings | hypertable_schema + timescaledb | timescaledb_information | compression_settings | orderby_asc + timescaledb | timescaledb_information | compression_settings | orderby_column_index + timescaledb | timescaledb_information | compression_settings | orderby_nullsfirst + timescaledb | timescaledb_information | compression_settings | segmentby_column_index + timescaledb | timescaledb_information | continuous_aggregates | compression_enabled + timescaledb | timescaledb_information | continuous_aggregates | finalized + timescaledb | timescaledb_information | continuous_aggregates | hypertable_name + timescaledb | timescaledb_information | continuous_aggregates | hypertable_schema + timescaledb | timescaledb_information | continuous_aggregates | materialization_hypertable_name + timescaledb | timescaledb_information | continuous_aggregates | materialization_hypertable_schema + timescaledb | timescaledb_information | continuous_aggregates | materialized_only + timescaledb | timescaledb_information | continuous_aggregates | view_definition + timescaledb | timescaledb_information | continuous_aggregates | view_name + timescaledb | timescaledb_information | continuous_aggregates | view_owner + timescaledb | timescaledb_information | continuous_aggregates | view_schema + timescaledb | timescaledb_information | dimensions | column_name + timescaledb | timescaledb_information | dimensions | column_type + timescaledb | timescaledb_information | dimensions | dimension_number + timescaledb | timescaledb_information | dimensions | dimension_type + timescaledb | timescaledb_information | dimensions | hypertable_name + timescaledb | timescaledb_information | dimensions | hypertable_schema + timescaledb | timescaledb_information | dimensions | integer_interval + timescaledb | timescaledb_information | dimensions | integer_now_func + timescaledb | timescaledb_information | dimensions | num_partitions + timescaledb | timescaledb_information | dimensions | time_interval timescaledb | timescaledb_information | hypertable_compression_settings | compress_interval_length timescaledb | timescaledb_information | hypertable_compression_settings | hypertable timescaledb | timescaledb_information | hypertable_compression_settings | orderby @@ -6245,23 +6391,6 @@ order by timescaledb | timescaledb_information | jobs | retry_period timescaledb | timescaledb_information | jobs | schedule_interval timescaledb | timescaledb_information | jobs | scheduled - timescaledb | _timescaledb_catalog | metadata | include_in_telemetry - timescaledb | _timescaledb_catalog | metadata | key - timescaledb | _timescaledb_catalog | metadata | value - timescaledb | timescaledb_experimental | policies | config - timescaledb | timescaledb_experimental | policies | hypertable_name - timescaledb | timescaledb_experimental | policies | hypertable_schema - timescaledb | timescaledb_experimental | policies | proc_name - timescaledb | timescaledb_experimental | policies | proc_schema - timescaledb | timescaledb_experimental | policies | relation_name - timescaledb | timescaledb_experimental | policies | relation_schema - timescaledb | timescaledb_experimental | policies | schedule_interval - timescaledb | _timescaledb_catalog | tablespace | hypertable_id - timescaledb | _timescaledb_catalog | tablespace | id - timescaledb | _timescaledb_catalog | tablespace | tablespace_name - timescaledb | _timescaledb_catalog | telemetry_event | body - timescaledb | _timescaledb_catalog | telemetry_event | created - timescaledb | _timescaledb_catalog | telemetry_event | tag wrappers | public | wrappers_fdw_stats | bytes_in wrappers | public | wrappers_fdw_stats | bytes_out wrappers | public | wrappers_fdw_stats | create_times @@ -6271,5 +6400,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1082 rows) +(1141 rows) diff --git a/nix/tests/expected/pg_partman.out b/nix/tests/expected/pg_partman.out new file mode 100644 index 000000000..527d58b12 --- /dev/null +++ b/nix/tests/expected/pg_partman.out @@ -0,0 +1,101 @@ +create schema if not exists partman_test; +/* +Simple Time Based: 1 Partition Per Day + +For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. +*/ +create table partman_test.time_taptest_table( + col1 int, + col2 text default 'stuff', + col3 timestamptz not null default now() +) + partition by range (col3); +create index on partman_test.time_tap (col3); +ERROR: relation "partman_test.time_tap" does not exist +/* +Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. + +Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. +*/ +create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); +alter table partman_test.time_taptest_table_template add primary key (col1); +/* +Review tables in the partman_test schema +*/ +select + table_name, + table_type +from + information_schema.tables +where + table_schema = 'partman_test'; + table_name | table_type +-----------------------------+------------ + time_taptest_table | BASE TABLE + time_taptest_table_template | BASE TABLE +(2 rows) + +select public.create_parent( + p_parent_table := 'partman_test.time_taptest_table', + p_control := 'col3', + p_interval := '1 day', + p_template_table := 'partman_test.time_taptest_table_template' +); + create_parent +--------------- + t +(1 row) + +/* +Review tables in the partman_test schema, which should now include daily partitions +*/ +select + -- dates in partition names are variable, so reduced to the prefix + substring(table_name, 1, 21) as table_prefix, + table_type +from + information_schema.tables +where + table_schema = 'partman_test' +order by + table_name; + table_prefix | table_type +-----------------------+------------ + time_taptest_table | BASE TABLE + time_taptest_table_de | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_p2 | BASE TABLE + time_taptest_table_te | BASE TABLE +(12 rows) + +/* +Confirm maintenance proc runs without issue +*/ +call public.run_maintenance_proc(); +/* +Make sure the background worker is NOT enabled. +This is intentional. We document using pg_cron to schedule calls to +public.run_maintenance_proc(). That is consistent with other providers. +*/ +select + application_name +from + pg_stat_activity +where + application_name = 'pg_partman_bgw'; + application_name +------------------ +(0 rows) + +-- Cleanup +drop schema partman_test cascade; +NOTICE: drop cascades to 2 other objects +DETAIL: drop cascades to table partman_test.time_taptest_table +drop cascades to table partman_test.time_taptest_table_template diff --git a/nix/tests/expected/pgmq.out b/nix/tests/expected/pgmq.out new file mode 100644 index 000000000..b2886d9fa --- /dev/null +++ b/nix/tests/expected/pgmq.out @@ -0,0 +1,143 @@ +-- Test the standard flow +select + pgmq.create('Foo'); + create +-------- + +(1 row) + +select + * +from + pgmq.send( + queue_name:='Foo', + msg:='{"foo": "bar1"}' + ); + send +------ + 1 +(1 row) + +-- Test queue is not case sensitive +select + msg_id, + read_ct, + message +from + pgmq.send( + queue_name:='foo', -- note: lowercase useage + msg:='{"foo": "bar2"}', + delay:=5 + ); +ERROR: column "msg_id" does not exist +LINE 2: msg_id, + ^ +select + msg_id, + read_ct, + message +from + pgmq.read( + queue_name:='Foo', + vt:=30, + qty:=2 + ); + msg_id | read_ct | message +--------+---------+----------------- + 1 | 1 | {"foo": "bar1"} +(1 row) + +select + msg_id, + read_ct, + message +from + pgmq.pop('Foo'); + msg_id | read_ct | message +--------+---------+--------- +(0 rows) + +-- Archive message with msg_id=2. +select + pgmq.archive( + queue_name:='Foo', + msg_id:=2 + ); + archive +--------- + f +(1 row) + +select + pgmq.create('my_queue'); + create +-------- + +(1 row) + +select + pgmq.send_batch( + queue_name:='my_queue', + msgs:=array['{"foo": "bar3"}','{"foo": "bar4"}','{"foo": "bar5"}']::jsonb[] +); + send_batch +------------ + 1 + 2 + 3 +(3 rows) + +select + pgmq.archive( + queue_name:='my_queue', + msg_ids:=array[3, 4, 5] + ); + archive +--------- + 3 +(1 row) + +select + pgmq.delete('my_queue', 6); + delete +-------- + f +(1 row) + +select + pgmq.drop_queue('my_queue'); + drop_queue +------------ + t +(1 row) + +select + pgmq.create_partitioned( + 'my_partitioned_queue', + '5 seconds', + '10 seconds' +); + create_partitioned +-------------------- + +(1 row) + +-- Make sure SQLI enabling characters are blocked +select pgmq.create('F--oo'); +ERROR: queue name contains invalid characters: $, ;, --, or \' +CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE +PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization +SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" +PL/pgSQL function pgmq."create"(text) line 3 at PERFORM +select pgmq.create('F$oo'); +ERROR: queue name contains invalid characters: $, ;, --, or \' +CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE +PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization +SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" +PL/pgSQL function pgmq."create"(text) line 3 at PERFORM +select pgmq.create($$F'oo$$); +ERROR: queue name contains invalid characters: $, ;, --, or \' +CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE +PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization +SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" +PL/pgSQL function pgmq."create"(text) line 3 at PERFORM diff --git a/nix/tests/migrations/pgmq.sql b/nix/tests/migrations/pgmq.sql new file mode 100644 index 000000000..d0121a269 --- /dev/null +++ b/nix/tests/migrations/pgmq.sql @@ -0,0 +1,12 @@ +select + pgmq.create('Foo'); + +select + * +from + pgmq.send( + queue_name:='Foo', + msg:='{"foo": "bar1"}' + ); + + diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index f31558531..3891817e1 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -28,6 +28,7 @@ create extension ltree; create extension moddatetime; create extension old_snapshot; create extension pageinspect; +create extension pg_backtrace; create extension pg_buffercache; /* @@ -42,6 +43,7 @@ create extension pg_graphql; create extension pg_freespacemap; create extension pg_hashids; create extension pg_prewarm; +create extension pg_partman; create extension pg_jsonschema; create extension pg_repack; create extension pg_stat_monitor; @@ -53,6 +55,7 @@ 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; @@ -61,11 +64,9 @@ create extension pgsodium; create extension pgrowlocks; create extension pgstattuple; create extension plpgsql_check; - create extension plv8; create extension plcoffee; create extension plls; - create extension postgis; create extension postgis_raster; create extension postgis_sfcgal; @@ -88,10 +89,3 @@ create extension "uuid-ossp"; create extension vector; create extension wrappers; create extension xml2; - - - - - - -CREATE EXTENSION IF NOT EXISTS pg_backtrace; diff --git a/nix/tests/sql/extensions_sql_interface.sql b/nix/tests/sql/extensions_sql_interface.sql index ce7580248..947a4a612 100644 --- a/nix/tests/sql/extensions_sql_interface.sql +++ b/nix/tests/sql/extensions_sql_interface.sql @@ -97,5 +97,6 @@ where and pc.relkind in ('r', 'v', 'm', 'i') order by e.extname, + n.nspname, pc.relname, pa.attname; diff --git a/nix/tests/sql/pg_partman.sql b/nix/tests/sql/pg_partman.sql new file mode 100644 index 000000000..621e1a7c9 --- /dev/null +++ b/nix/tests/sql/pg_partman.sql @@ -0,0 +1,82 @@ +create schema if not exists partman_test; + +/* +Simple Time Based: 1 Partition Per Day + +For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. +*/ + +create table partman_test.time_taptest_table( + col1 int, + col2 text default 'stuff', + col3 timestamptz not null default now() +) + partition by range (col3); + +create index on partman_test.time_tap (col3); + +/* +Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. + +Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. +*/ + +create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); + +alter table partman_test.time_taptest_table_template add primary key (col1); + +/* +Review tables in the partman_test schema +*/ + +select + table_name, + table_type +from + information_schema.tables +where + table_schema = 'partman_test'; + + +select public.create_parent( + p_parent_table := 'partman_test.time_taptest_table', + p_control := 'col3', + p_interval := '1 day', + p_template_table := 'partman_test.time_taptest_table_template' +); + +/* +Review tables in the partman_test schema, which should now include daily partitions +*/ + +select + -- dates in partition names are variable, so reduced to the prefix + substring(table_name, 1, 21) as table_prefix, + table_type +from + information_schema.tables +where + table_schema = 'partman_test' +order by + table_name; + + +/* +Confirm maintenance proc runs without issue +*/ +call public.run_maintenance_proc(); + +/* +Make sure the background worker is NOT enabled. +This is intentional. We document using pg_cron to schedule calls to +public.run_maintenance_proc(). That is consistent with other providers. +*/ +select + application_name +from + pg_stat_activity +where + application_name = 'pg_partman_bgw'; + +-- Cleanup +drop schema partman_test cascade; diff --git a/nix/tests/sql/pgmq.sql b/nix/tests/sql/pgmq.sql new file mode 100644 index 000000000..4d4045484 --- /dev/null +++ b/nix/tests/sql/pgmq.sql @@ -0,0 +1,89 @@ +-- Test the standard flow +select + pgmq.create('Foo'); + +select + * +from + pgmq.send( + queue_name:='Foo', + msg:='{"foo": "bar1"}' + ); + +-- Test queue is not case sensitive +select + msg_id, + read_ct, + message +from + pgmq.send( + queue_name:='foo', -- note: lowercase useage + msg:='{"foo": "bar2"}', + delay:=5 + ); + +select + msg_id, + read_ct, + message +from + pgmq.read( + queue_name:='Foo', + vt:=30, + qty:=2 + ); + +select + msg_id, + read_ct, + message +from + pgmq.pop('Foo'); + + +-- Archive message with msg_id=2. +select + pgmq.archive( + queue_name:='Foo', + msg_id:=2 + ); + + +select + pgmq.create('my_queue'); + +select + pgmq.send_batch( + queue_name:='my_queue', + msgs:=array['{"foo": "bar3"}','{"foo": "bar4"}','{"foo": "bar5"}']::jsonb[] +); + +select + pgmq.archive( + queue_name:='my_queue', + msg_ids:=array[3, 4, 5] + ); + +select + pgmq.delete('my_queue', 6); + + +select + pgmq.drop_queue('my_queue'); + +select + pgmq.create_partitioned( + 'my_partitioned_queue', + '5 seconds', + '10 seconds' +); + + +-- Make sure SQLI enabling characters are blocked +select pgmq.create('F--oo'); +select pgmq.create('F$oo'); +select pgmq.create($$F'oo$$); + + + + From f7bb3feca663f25fd584905ebf20e25a35365b85 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 8 Oct 2024 05:45:16 -0400 Subject: [PATCH 016/271] fix: reformat ec2 cleanup commands (#1267) Co-authored-by: Sam Rose --- .github/workflows/testinfra-nix.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-nix.yml index 3835a9a00..fee2fd791 100644 --- a/.github/workflows/testinfra-nix.yml +++ b/.github/workflows/testinfra-nix.yml @@ -65,12 +65,12 @@ jobs: - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -n 1 -I {} aws ec2 terminate-instances --region ap-southeast-1 --instance-ids {} - - - name: Cleanup resources on build cancellation + aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids + + - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -n 1 -I {} aws ec2 terminate-instances --region ap-southeast-1 --instance-ids {} || true + aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids || true - name: Cleanup AMIs if: always() From 4ab36409604935d76f975a9e7bd239433633009e Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 9 Oct 2024 16:54:52 -0400 Subject: [PATCH 017/271] feat: pg-restore utility (#1243) Co-authored-by: Sam Rose --- flake.nix | 8 +++ nix/tools/run-restore.sh.in | 121 ++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 nix/tools/run-restore.sh.in diff --git a/flake.nix b/flake.nix index 82409b185..15f1a585a 100644 --- a/flake.nix +++ b/flake.nix @@ -459,6 +459,13 @@ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' chmod +x $out/bin/start-postgres-replica ''; + pg-restore = + pkgs.runCommand "run-pg-restore" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/run-restore.sh.in} $out/bin/pg-restore \ + --subst-var-by PSQL15_BINDIR '${basePackages.psql_15.bin}' + chmod +x $out/bin/pg-restore + ''; sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' mkdir -p $out/bin substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ @@ -589,6 +596,7 @@ start-replica = mkApp "start-replica" "start-postgres-replica"; migration-test = mkApp "migrate-tool" "migrate-postgres"; sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; + pg-restore = mkApp "pg-restore" "pg-restore"; }; # 'devShells.default' lists the set of packages that are included in the diff --git a/nix/tools/run-restore.sh.in b/nix/tools/run-restore.sh.in new file mode 100644 index 000000000..33fa70c3a --- /dev/null +++ b/nix/tools/run-restore.sh.in @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +# Function to display help message +show_help() { + echo "Usage: nix run .#pg-restore -- [OPTIONS]" + echo + echo "Run pg_restore with the specified parameters." + echo + echo "Options:" + echo " --version PostgreSQL version (currently only 15 is supported)" + echo " --dbname Name of the database to restore to" + echo " --host Host of the database server" + echo " --user Database user to connect as" + echo " --file Path to the file to restore from (absolute or relative to current directory)" + echo " --port Port number (default: 5432)" + echo " -h, --help Show this help message and exit" + echo "Example:" + echo "nix run .#pg-restore -- --version 15 --dbname postgres --host localhost --user postgres --port 5435 --file my.dump" +} + +# Initialize variables +PG_VERSION="" +DBNAME="" +DBHOST="" +DBUSER="" +RESTORE_FILE="" +PORT="5432" + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + --version) + PG_VERSION="$2" + shift 2 + ;; + --dbname) + DBNAME="$2" + shift 2 + ;; + --host) + DBHOST="$2" + shift 2 + ;; + --user) + DBUSER="$2" + shift 2 + ;; + --file) + RESTORE_FILE="$2" + shift 2 + ;; + --port) + PORT="$2" + shift 2 + ;; + -h|--help) + show_help + exit 0 + ;; + *) + echo "Unknown option: $1" + show_help + exit 1 + ;; + esac +done + +# Check if all required arguments are provided +if [ -z "$PG_VERSION" ] || [ -z "$DBNAME" ] || [ -z "$DBHOST" ] || [ -z "$DBUSER" ] || [ -z "$RESTORE_FILE" ]; then + echo "Error: Missing required arguments." + show_help + exit 1 +fi + +if [ "$PG_VERSION" == "15" ]; then + echo "Starting restore for PSQL 15" + PSQL15=@PSQL15_BINDIR@ + PSQL_BINDIR="$PSQL15" +else + echo "Error: Please provide a valid Postgres version (currently only 15 is supported)" + show_help + exit 1 +fi + +# Convert RESTORE_FILE to an absolute path if it's relative +if [[ "$RESTORE_FILE" != /* ]]; then + RESTORE_FILE="$(pwd)/$RESTORE_FILE" +fi + +# Check if the file exists +if [ ! -f "$RESTORE_FILE" ]; then + echo "Error: Restore file '$RESTORE_FILE' does not exist." + exit 1 +fi + +echo "Using restore file: $RESTORE_FILE" + +# Run pg_restore and capture its exit status +"$PSQL_BINDIR/bin/pg_restore" \ + -h "$DBHOST" \ + -p "$PORT" \ + -U "$DBUSER" \ + -d "$DBNAME" \ + -v \ + --no-owner \ + --no-acl \ + "$RESTORE_FILE" + +RESTORE_STATUS=$? + +# Check the exit status of pg_restore +if [ $RESTORE_STATUS -eq 0 ]; then + echo "Restore completed successfully." + exit 0 +else + echo "Restore failed with exit code $RESTORE_STATUS." + exit $RESTORE_STATUS +fi \ No newline at end of file From d8f88444d7e9a6a7fad6dff210468a706777e50e Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 10 Oct 2024 18:44:26 -0500 Subject: [PATCH 018/271] bump to pg_net 0.11.0 --- common.vars.pkr.hcl | 2 +- nix/ext/pg_net.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.vars.pkr.hcl b/common.vars.pkr.hcl index fa1387690..871647b06 100644 --- a/common.vars.pkr.hcl +++ b/common.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.1.1.94" +postgres-version = "15.1.1.95" diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index fe4404cdf..bff869f37 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pg_net"; - version = "0.10.0"; + version = "0.11.0"; buildInputs = [ curl postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-R9Mzw5gvV7b2R59LTOzuOc0AI99+3ncFNzijI4mySUg="; + hash = "sha256-XN441jXK1q+I/LZRNwvzbSsebXHgZ8iYsslZvcPFlAs="; }; env.NIX_CFLAGS_COMPILE = "-Wno-error"; From 725ffa301a28fb318e9b78785f5c5ce5365054bc Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Mon, 14 Oct 2024 15:13:16 +0300 Subject: [PATCH 019/271] fix: disable pg_stat_monitor (#1261) --- ansible/files/postgresql_config/postgresql.conf.j2 | 2 +- nix/tests/postgresql.conf.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index ee16715a6..1604d94f9 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -688,7 +688,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pg_stat_monitor, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use # - Other Defaults - diff --git a/nix/tests/postgresql.conf.in b/nix/tests/postgresql.conf.in index d2d667b9a..ef860afcb 100644 --- a/nix/tests/postgresql.conf.in +++ b/nix/tests/postgresql.conf.in @@ -718,7 +718,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pg_stat_monitor, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, pg_backtrace' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, pg_backtrace' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use From f904736987c7fefd8d078a4569e3730c3a2883ec Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Tue, 15 Oct 2024 16:54:15 -0500 Subject: [PATCH 020/271] allow user defined role for start-client (#1272) --- nix/tools/run-client.sh.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 5f3bf9bbb..309588828 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -7,6 +7,7 @@ PSQL_VERSION="15" MIGRATION_FILE="" PORTNO="@PGSQL_DEFAULT_PORT@" +PSQL_USER="postgres" # Function to display help print_help() { @@ -15,6 +16,7 @@ print_help() { echo "Options:" echo " -v, --version [15|16|orioledb-16] Specify the PostgreSQL version to use (required)" echo " -f, --file FILE Provide a custom migration script" + echo " -u, --user USER Specify the user/role to use (default: postgres)" echo " -h, --help Show this help message" echo echo "Description:" @@ -29,6 +31,7 @@ print_help() { echo " nix run .#start-client -- --version 15" echo " nix run .#start-client -- --version 16 --file custom_migration.sql" echo " nix run .#start-client -- --version 16 --port 5433" + echo " nix run .#start-client -- --version 16 --user supabase_admin" } # Parse arguments @@ -52,6 +55,15 @@ while [[ "$#" -gt 0 ]]; do exit 1 fi ;; + -u|--user) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PSQL_USER="$2" + shift 2 + else + echo "Error: --user requires an argument" + exit 1 + fi + ;; -h|--help) print_help exit 0 @@ -137,4 +149,4 @@ fi # psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -c 'SELECT extensions.pg_stat_statements_reset(); SELECT pg_stat_reset();' postgres || true # Start interactive psql session -exec psql -U postgres -p "$PORTNO" -h localhost postgres +exec psql -U "$PSQL_USER" -p "$PORTNO" -h localhost postgres From 578e2758f13b0e5dcac7e0ca31a1efc6aba31aaa Mon Sep 17 00:00:00 2001 From: angelico Date: Wed, 16 Oct 2024 17:53:02 +0800 Subject: [PATCH 021/271] fix: only consider pgsodium to be valid if they are in these versions (#1276) * fix: only consider pgsodium to be valid if they are in these versions * chore: add 3.1.9 jic --- .../db/migrations/20221207154255_create_pgsodium_and_vault.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql index ede303451..3d3867ab5 100644 --- a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql +++ b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql @@ -9,6 +9,7 @@ BEGIN select count(*) = 1 from pg_available_extensions where name = 'pgsodium' + and default_version in ('3.1.6', '3.1.7', '3.1.8', '3.1.9') ); vault_exists = ( From cfbb1714dad2535bca42b58f62f6be4edf85a65f Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 17 Oct 2024 08:02:35 -0400 Subject: [PATCH 022/271] Sam/15 16 nix package, build and test of 15.8 and 16.3 (#1266) * feat: build and flake check of pg 16.3 with exts/wrappers * pg_partman test 15/16 compat * merge sql interface test * tests: build test and cache both versions * chore: run checks individually * pg 15 and 16 packer/ansible/ghactions (#1268) * fix: reformat ec2 cleanup commands (#1267) Co-authored-by: Sam Rose * feat: build and flake check of pg 16.3 with exts/wrappers * pg_partman test 15/16 compat * merge sql interface test * tests: build test and cache both versions * chore: run checks individually * feat: realease 15 and 16 to staging * chore: update versions * chore: make yq available * chore: run yq from nix * chore: more setup for staging AMI * fix: yq usage * chore: shell vars * fix: When --init none is used, only users who can elevate to sudo privileges can run Nix * fix: no -i * fix: quote correction * fix: newline extra quotes * fix: no need for pg major version on packer * fix: postgresql_major * fix: ql * fix: no ansible args in stage to invocation * fix: unique val * fix: adjustments to build scripts * chore: env var handling * fix: bump to build * chore: set up more required vars * chore: bump var * feat: pg 16 debug symbols * feat: matrix pg versions build on testinfra * feat: matrix on Test Database * chore: running nix in the right context * feat: just use existing Dockerfile + pg version * chore: refer to var * fix: read name without including quotes * chore: try format function * fix: strip quotes from version number * chore: env var * fix: pg client * fix * fix: try to use psql from our own corresponding pkg * fix: try psql from ppa * fix: dbmate per pg version * build dbmate and then install client * fix: account for architecture * chore: limit changes detection migrations/schema.sql * missing docker compose call * ore: drop tests while investigating * test: try on pg15 only * chore: schema needs update * chore: now run on all versions in matrix * test: trying a version of schema per major pg version as there are type diffs --------- Co-authored-by: Sam Rose Co-authored-by: Oliver Rice * chore: rm dead code * chore: resolve versions from ansible/vars.yml instead of packer file create a matrix build for 15 16 (or how ever many versions there are) * fix: don not lose if statements used for hotfix when needed * chore: cleanup --------- Co-authored-by: Sam Rose Co-authored-by: Oliver Rice --- .github/workflows/ami-release-nix.yml | 65 +- ...ublish-nix-pgupgrade-bin-flake-version.yml | 33 +- .../publish-nix-pgupgrade-scripts.yml | 38 +- .github/workflows/test.yml | 65 +- .github/workflows/testinfra-nix.yml | 37 +- Dockerfile-15 | 223 ++++ Dockerfile-16 | 223 ++++ ansible/tasks/stage2-setup-postgres.yml | 14 +- ansible/vars.yml | 14 +- common-nix.vars.pkr.hcl | 1 - docker/nix/build_nix.sh | 5 +- flake.nix | 38 +- migrations/Dockerfile.dbmate | 23 + migrations/docker-compose.yaml | 4 +- migrations/schema-15.sql | 1064 +++++++++++++++++ migrations/schema-16.sql | 1064 +++++++++++++++++ migrations/schema.sql | 2 +- nix/ext/hypopg.nix | 2 +- nix/ext/pg_backtrace.nix | 2 +- nix/ext/pg_cron.nix | 2 +- nix/ext/pg_hashids.nix | 2 +- nix/ext/pg_net.nix | 2 +- nix/ext/pg_plan_filter.nix | 2 +- nix/ext/pg_stat_monitor.nix | 2 +- nix/ext/pg_tle.nix | 2 +- nix/ext/pgrouting.nix | 33 +- nix/ext/pgsodium.nix | 2 +- nix/ext/pgsql-http.nix | 2 +- nix/ext/pgvector.nix | 2 +- nix/ext/plv8.nix | 76 +- nix/ext/supautils.nix | 2 +- nix/postgresql/16.nix | 4 + nix/postgresql/default.nix | 1 + .../expected/extensions_sql_interface.out | 17 +- nix/tests/expected/pg_partman.out | 5 +- nix/tests/sql/extensions_sql_interface.sql | 12 + nix/tests/sql/pg_partman.sql | 5 +- scripts/nix-provision.sh | 7 + stage2-nix-psql.pkr.hcl | 8 +- 39 files changed, 2957 insertions(+), 148 deletions(-) create mode 100644 Dockerfile-15 create mode 100644 Dockerfile-16 delete mode 100644 common-nix.vars.pkr.hcl create mode 100644 migrations/Dockerfile.dbmate create mode 100644 migrations/schema-15.sql create mode 100644 migrations/schema-16.sql create mode 100644 nix/postgresql/16.nix diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 194c8de21..643f26fc7 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -8,12 +8,31 @@ on: paths: - '.github/workflows/ami-release-nix.yml' - 'common-nix.vars.pkr.hcl' + - 'ansible/vars.yml' workflow_dispatch: jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + build: + needs: prepare strategy: matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - runner: arm-runner arch: arm64 @@ -31,42 +50,55 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} - # Update `ci.yaml` too if changing constraints. run: | - SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common-nix.vars.pkr.hcl) + SUFFIX=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z $SUFFIX ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 fi - # extensions are build in nix prior to this step - # so we can just use the binaries from the nix store - # for postgres, extensions and wrappers + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + + - name: Generate common-nix.vars.pkr.hcl + run: | + PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl + # Ensure there's a newline at the end of the file + echo "" >> common-nix.vars.pkr.hcl - name: Build AMI stage 1 + env: + POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" amazon-arm64-nix.pkr.hcl + packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 + env: + POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} + packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl - name: Grab release version id: process_release_version run: | - VERSION=$(sed -e 's/postgres-version = "\(.*\)"/\1/g' common-nix.vars.pkr.hcl) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" + VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Create nix flake revision tarball run: | GIT_SHA=${{github.sha}} - MAJOR_VERSION=$(echo "${{ steps.process_release_version.outputs.version }}" | cut -d. -f1) + MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" echo "$GIT_SHA" >> "/tmp/pg_upgrade_bin/${MAJOR_VERSION}/nix_flake_version" @@ -84,17 +116,13 @@ jobs: ansible-playbook -i localhost \ -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ -e "internal_artifacts_bucket=${{ secrets.ARTIFACTS_BUCKET }}" \ + -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ manifest-playbook.yml - name: Upload nix flake revision to s3 staging run: | aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz - #Our self hosted github runner already has permissions to publish images - #but they're limited to only that; - #so if we want s3 access we'll need to config credentials with the below steps - # (which overwrites existing perms) after the ami build - - name: configure aws credentials - prod uses: aws-actions/configure-aws-credentials@v4 with: @@ -107,6 +135,7 @@ jobs: ansible-playbook -i localhost \ -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ -e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \ + -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ manifest-playbook.yml - name: Upload nix flake revision to s3 prod @@ -130,12 +159,12 @@ jobs: SLACK_MESSAGE: 'Building Postgres AMI failed' SLACK_FOOTER: '' - - name: Cleanup resources on build cancellation + - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -n 1 -I {} aws ec2 terminate-instances --instance-ids {} + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -n 1 -I {} aws ec2 terminate-instances --instance-ids {} + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index 5b985f4be..6160b586c 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -11,8 +11,28 @@ permissions: id-token: write jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + publish-staging: + needs: prepare runs-on: ubuntu-latest + strategy: + matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} steps: - name: Checkout Repo @@ -21,7 +41,8 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(grep 'postgres-version' common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi @@ -58,6 +79,10 @@ jobs: publish-prod: runs-on: ubuntu-latest if: github.ref_name == 'develop' || contains( github.ref, 'release' ) + needs: prepare + strategy: + matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} steps: - name: Checkout Repo @@ -66,10 +91,8 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(grep 'postgres-version' common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') - if [[ "${{ inputs.postgresVersion }}" != "" ]]; then - VERSION=${{ inputs.postgresVersion }} - fi + VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index eb5f7a755..176f57a03 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -7,7 +7,6 @@ on: - release/* paths: - '.github/workflows/publish-nix-pgupgrade-scripts.yml' - - 'common-nix.vars.pkr.hcl' workflow_dispatch: inputs: postgresVersion: @@ -18,17 +17,40 @@ permissions: id-token: write jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + publish-staging: + needs: prepare runs-on: ubuntu-latest + strategy: + matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} steps: - name: Checkout Repo uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - name: Grab release version id: process_release_version run: | - VERSION=$(grep 'postgres-version' common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi @@ -61,9 +83,15 @@ jobs: SLACK_FOOTER: '' publish-prod: + needs: prepare runs-on: ubuntu-latest if: github.ref_name == 'develop' || contains( github.ref, 'release' ) + strategy: + matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} + + steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -71,10 +99,8 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(grep 'postgres-version' common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') - if [[ "${{ inputs.postgresVersion }}" != "" ]]; then - VERSION=${{ inputs.postgresVersion }} - fi + VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Create a tarball containing pg_upgrade scripts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2be061941..1457eb100 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,9 +8,27 @@ on: workflow_dispatch: jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + build: + needs: prepare strategy: matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - runner: [self-hosted, X64] arch: amd64 @@ -23,14 +41,36 @@ jobs: POSTGRES_PASSWORD: password steps: - uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + + - name: Strip quotes from pg major and set env var + run: | + stripped_version=$(echo ${{ matrix.postgres_version }} | sed 's/^"\(.*\)"$/\1/') + echo "PGMAJOR=$stripped_version" >> $GITHUB_ENV + + - name: Generate common-nix.vars.pkr.hcl + run: | + PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl + # Ensure there's a newline at the end of the file + echo "" >> common-nix.vars.pkr.hcl + - id: settings # Remove spaces and quotes to get the raw version string run: sed -r 's/(\s|\")+//g' common-nix.vars.pkr.hcl >> $GITHUB_OUTPUT - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' + - name: Generate args + id: args + run: | + ARGS=$(sudo nix run nixpkgs#yq -- 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' ansible/vars.yml) + echo "result<> $GITHUB_OUTPUT + echo "$ARGS" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - run: docker context create builders - uses: docker/setup-buildx-action@v3 @@ -40,7 +80,7 @@ jobs: with: load: true context: . - file: "Dockerfile-156" + file: Dockerfile-${{ env.PGMAJOR }} target: production build-args: | ${{ steps.args.outputs.result }} @@ -57,10 +97,13 @@ jobs: -p ${{ env.POSTGRES_PORT }}:5432 \ --name supabase_postgres \ -d supabase/postgres:${{ steps.settings.outputs.postgres-version }} + - name: Install psql run: | + sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt update - sudo apt install -y --no-install-recommends postgresql-client + sudo apt install -y --no-install-recommends postgresql-client-${{ env.PGMAJOR }} - name: Install pg_prove run: sudo cpan -T TAP::Parser::SourceHandler::pgTAP @@ -107,11 +150,15 @@ jobs: PGUSER: supabase_admin PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} + - name: Update Dockerfile.dbmate version + run: | + sed -i 's/%VERSION%/${{ env.PGMAJOR }}/g' migrations/Dockerfile.dbmate + - name: verify schema.sql is committed run: | docker compose -f migrations/docker-compose.yaml up db dbmate --abort-on-container-exit - if ! git diff --ignore-space-at-eol --exit-code --quiet migrations/schema.sql; then - echo "Detected uncommitted changes after build. See status below:" - git diff + if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then + echo "Detected changes in schema.sql:" + git diff migrations/schema-${{ env.PGMAJOR }}.sql exit 1 fi diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-nix.yml index fee2fd791..4a51c159c 100644 --- a/.github/workflows/testinfra-nix.yml +++ b/.github/workflows/testinfra-nix.yml @@ -5,17 +5,35 @@ on: workflow_dispatch: jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + test-ami-nix: + needs: prepare strategy: fail-fast: false matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - runner: arm-runner arch: arm64 ubuntu_release: focal ubuntu_version: 20.04 mcpu: neoverse-n1 - runs-on: ${{ matrix.runner }} + runs-on: ${{ matrix.runner }} timeout-minutes: 150 permissions: contents: write @@ -40,18 +58,29 @@ jobs: - name: Generate random string id: random run: echo "random_string=$(openssl rand -hex 8)" >> $GITHUB_OUTPUT + + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + + - name: Generate common-nix.vars.pkr.hcl + run: | + PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl + # Ensure there's a newline at the end of the file + echo "" >> common-nix.vars.pkr.hcl - name: Build AMI stage 1 run: | packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" amazon-arm64-nix.pkr.hcl + packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 run: | packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl + packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl - name: Run tests timeout-minutes: 10 @@ -91,4 +120,4 @@ jobs: # Deregister AMIs deregister_ami_by_name "$STAGE1_AMI_NAME" - deregister_ami_by_name "$STAGE2_AMI_NAME" \ No newline at end of file + deregister_ami_by_name "$STAGE2_AMI_NAME" diff --git a/Dockerfile-15 b/Dockerfile-15 new file mode 100644 index 000000000..ce83237f2 --- /dev/null +++ b/Dockerfile-15 @@ -0,0 +1,223 @@ +# syntax=docker/dockerfile:1.6 +ARG postgresql_major=15 +ARG postgresql_release=${postgresql_major}.1 + +# Bump default build arg to build a package from source +# Bump vars.yml to specify runtime package version +ARG sfcgal_release=1.3.10 +ARG postgis_release=3.3.2 +ARG pgrouting_release=3.4.1 +ARG pgtap_release=1.2.0 +ARG pg_cron_release=1.6.2 +ARG pgaudit_release=1.7.0 +ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 +ARG pgsql_http_release=1.5.0 +ARG plpgsql_check_release=2.2.5 +ARG pg_safeupdate_release=1.4 +ARG timescaledb_release=2.9.1 +ARG wal2json_release=2_5 +ARG pljava_release=1.6.4 +ARG plv8_release=3.1.5 +ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 +ARG pg_net_release=0.7.1 +ARG rum_release=1.3.13 +ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 +ARG libsodium_release=1.0.18 +ARG pgsodium_release=3.1.6 +ARG pg_graphql_release=1.5.1 +ARG pg_stat_monitor_release=1.1.1 +ARG pg_jsonschema_release=0.1.4 +ARG pg_repack_release=1.4.8 +ARG vault_release=0.2.8 +ARG groonga_release=12.0.8 +ARG pgroonga_release=2.4.0 +ARG wrappers_release=0.3.0 +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.0 +ARG wal_g_release=2.0.1 + +FROM ubuntu:focal as base + +RUN apt update -y && apt install -y \ + curl \ + gnupg \ + lsb-release \ + software-properties-common \ + wget \ + sudo \ + && apt clean + + +RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres +RUN adduser --system --no-create-home --shell /bin/bash --group wal-g +RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ +--init none \ +--no-confirm \ +--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + +ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" + +COPY . /nixpg + +WORKDIR /nixpg + +RUN nix profile install .#psql_15/bin + + + +WORKDIR / + + +RUN mkdir -p /usr/lib/postgresql/bin \ + /usr/lib/postgresql/share/postgresql \ + /usr/share/postgresql \ + # /usr/lib/postgresql/share/postgresql/contrib \ + #/usr/lib/postgresql/share/postgresql/timezonesets \ + #/usr/lib/postgresql/share/postgresql/tsearch_data \ + # /usr/lib/postgresql/share/postgresql/extension \ + && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /usr/share/postgresql + +# Create symbolic links +RUN ln -s /nix/var/nix/profiles/default/bin/* /usr/lib/postgresql/bin/ \ + && ln -s /nix/var/nix/profiles/default/bin/* /usr/bin/ \ + && chown -R postgres:postgres /usr/bin + +# Create symbolic links for PostgreSQL shares +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/share/postgresql/ +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ +RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ +RUN chown -R postgres:postgres /usr/share/postgresql/ +# Create symbolic links for contrib directory +RUN mkdir -p /usr/lib/postgresql/share/postgresql/contrib \ + && find /nix/var/nix/profiles/default/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ + && chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/contrib/ + +RUN chown -R postgres:postgres /usr/lib/postgresql + +RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets + + +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + checkinstall \ + cmake + +ENV PGDATA=/var/lib/postgresql/data + +#################### +# setup-wal-g.yml +#################### +FROM base as walg +ARG wal_g_release +# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz +RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ + apt-get update && apt-get install -y --no-install-recommends curl && \ + curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \ + tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ + rm -rf /tmp/wal-g.tar.gz && \ + mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g + +# #################### +# # Download gosu for easy step-down from root +# #################### +FROM base as gosu +ARG TARGETARCH +# Install dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gnupg \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* +# Download binary +ARG GOSU_VERSION=1.16 +ARG GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4 +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH \ + /usr/local/bin/gosu +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH.asc \ + /usr/local/bin/gosu.asc +# Verify checksum +RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY && \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ + gpgconf --kill all && \ + chmod +x /usr/local/bin/gosu + +# #################### +# # Build final image +# #################### +FROM gosu as production +RUN id postgres || (echo "postgres user does not exist" && exit 1) +# # Setup extensions +COPY --from=walg /tmp/wal-g /usr/local/bin/ + +# # Initialise configs +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts +COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh +COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh + +RUN sed -i \ + -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ + -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ + #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ + echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + usermod -aG postgres wal-g && \ + mkdir -p /etc/postgresql-custom && \ + chown postgres:postgres /etc/postgresql-custom + +# # Include schema migrations +COPY migrations/db /docker-entrypoint-initdb.d/ +COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql +COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql + +# # Add upstream entrypoint script +COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu +ADD --chmod=0755 \ + https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ + /usr/local/bin/ + +RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql + +ENTRYPOINT ["docker-entrypoint.sh"] + +HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost +STOPSIGNAL SIGINT +EXPOSE 5432 + +ENV POSTGRES_HOST=/var/run/postgresql +ENV POSTGRES_USER=supabase_admin +ENV POSTGRES_DB=postgres +RUN apt-get update && apt-get install -y --no-install-recommends \ + locales \ + && rm -rf /var/lib/apt/lists/* && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ + && localedef -i C -c -f UTF-8 -A /usr/share/locale/locale.alias C.UTF-8 +RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 +ENV LC_CTYPE=C.UTF-8 +ENV LC_COLLATE=C.UTF-8 +ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive +CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/Dockerfile-16 b/Dockerfile-16 new file mode 100644 index 000000000..db5772cee --- /dev/null +++ b/Dockerfile-16 @@ -0,0 +1,223 @@ +# syntax=docker/dockerfile:1.6 +ARG postgresql_major=15 +ARG postgresql_release=${postgresql_major}.1 + +# Bump default build arg to build a package from source +# Bump vars.yml to specify runtime package version +ARG sfcgal_release=1.3.10 +ARG postgis_release=3.3.2 +ARG pgrouting_release=3.4.1 +ARG pgtap_release=1.2.0 +ARG pg_cron_release=1.6.2 +ARG pgaudit_release=1.7.0 +ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 +ARG pgsql_http_release=1.5.0 +ARG plpgsql_check_release=2.2.5 +ARG pg_safeupdate_release=1.4 +ARG timescaledb_release=2.9.1 +ARG wal2json_release=2_5 +ARG pljava_release=1.6.4 +ARG plv8_release=3.1.5 +ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 +ARG pg_net_release=0.7.1 +ARG rum_release=1.3.13 +ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 +ARG libsodium_release=1.0.18 +ARG pgsodium_release=3.1.6 +ARG pg_graphql_release=1.5.1 +ARG pg_stat_monitor_release=1.1.1 +ARG pg_jsonschema_release=0.1.4 +ARG pg_repack_release=1.4.8 +ARG vault_release=0.2.8 +ARG groonga_release=12.0.8 +ARG pgroonga_release=2.4.0 +ARG wrappers_release=0.3.0 +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.0 +ARG wal_g_release=2.0.1 + +FROM ubuntu:focal as base + +RUN apt update -y && apt install -y \ + curl \ + gnupg \ + lsb-release \ + software-properties-common \ + wget \ + sudo \ + && apt clean + + +RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres +RUN adduser --system --no-create-home --shell /bin/bash --group wal-g +RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ +--init none \ +--no-confirm \ +--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + +ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" + +COPY . /nixpg + +WORKDIR /nixpg + +RUN nix profile install .#psql_16/bin + + + +WORKDIR / + + +RUN mkdir -p /usr/lib/postgresql/bin \ + /usr/lib/postgresql/share/postgresql \ + /usr/share/postgresql \ + # /usr/lib/postgresql/share/postgresql/contrib \ + #/usr/lib/postgresql/share/postgresql/timezonesets \ + #/usr/lib/postgresql/share/postgresql/tsearch_data \ + # /usr/lib/postgresql/share/postgresql/extension \ + && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /usr/share/postgresql + +# Create symbolic links +RUN ln -s /nix/var/nix/profiles/default/bin/* /usr/lib/postgresql/bin/ \ + && ln -s /nix/var/nix/profiles/default/bin/* /usr/bin/ \ + && chown -R postgres:postgres /usr/bin + +# Create symbolic links for PostgreSQL shares +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/share/postgresql/ +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ +RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ +RUN chown -R postgres:postgres /usr/share/postgresql/ +# Create symbolic links for contrib directory +RUN mkdir -p /usr/lib/postgresql/share/postgresql/contrib \ + && find /nix/var/nix/profiles/default/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ + && chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/contrib/ + +RUN chown -R postgres:postgres /usr/lib/postgresql + +RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets + + +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + checkinstall \ + cmake + +ENV PGDATA=/var/lib/postgresql/data + +#################### +# setup-wal-g.yml +#################### +FROM base as walg +ARG wal_g_release +# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz +RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ + apt-get update && apt-get install -y --no-install-recommends curl && \ + curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \ + tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ + rm -rf /tmp/wal-g.tar.gz && \ + mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g + +# #################### +# # Download gosu for easy step-down from root +# #################### +FROM base as gosu +ARG TARGETARCH +# Install dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gnupg \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* +# Download binary +ARG GOSU_VERSION=1.16 +ARG GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4 +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH \ + /usr/local/bin/gosu +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH.asc \ + /usr/local/bin/gosu.asc +# Verify checksum +RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY && \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ + gpgconf --kill all && \ + chmod +x /usr/local/bin/gosu + +# #################### +# # Build final image +# #################### +FROM gosu as production +RUN id postgres || (echo "postgres user does not exist" && exit 1) +# # Setup extensions +COPY --from=walg /tmp/wal-g /usr/local/bin/ + +# # Initialise configs +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts +COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh +COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh + +RUN sed -i \ + -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ + -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ + #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ + echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + usermod -aG postgres wal-g && \ + mkdir -p /etc/postgresql-custom && \ + chown postgres:postgres /etc/postgresql-custom + +# # Include schema migrations +COPY migrations/db /docker-entrypoint-initdb.d/ +COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql +COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql + +# # Add upstream entrypoint script +COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu +ADD --chmod=0755 \ + https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ + /usr/local/bin/ + +RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql + +ENTRYPOINT ["docker-entrypoint.sh"] + +HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost +STOPSIGNAL SIGINT +EXPOSE 5432 + +ENV POSTGRES_HOST=/var/run/postgresql +ENV POSTGRES_USER=supabase_admin +ENV POSTGRES_DB=postgres +RUN apt-get update && apt-get install -y --no-install-recommends \ + locales \ + && rm -rf /var/lib/apt/lists/* && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ + && localedef -i C -c -f UTF-8 -A /usr/share/locale/locale.alias C.UTF-8 +RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 +ENV LC_CTYPE=C.UTF-8 +ENV LC_COLLATE=C.UTF-8 +ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive +CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 20ad069e2..e22cbe67b 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -6,7 +6,7 @@ - name: Install Postgres from nix binary cache become: yes shell: | - sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#psql_15/bin" + sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{psql_version}}/bin" #TODO (samrose) switch pg_prove sourcing to develop branch once PR is merged when: stage2_nix @@ -22,6 +22,18 @@ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#supabase-groonga" when: stage2_nix +- name: Install debug symbols for postgres version + become: yes + shell: | + sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_debug" + when: stage2_nix + +- name: Install source files for postgresql version + become: yes + shell: | + sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" + when: stage2_nix + - name: Set ownership and permissions for /etc/ssl/private become: yes file: diff --git a/ansible/vars.yml b/ansible/vars.yml index 3c5ef2172..f78b56c97 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -2,9 +2,17 @@ supabase_internal: true ebssurrogate_mode: true async_mode: true -postgresql_major: "15" -postgresql_release: "15.1" -postgresql_release_checksum: sha256:ea2cf059a85882654b989acd07edc121833164a30340faee0d3615cf7058e66c +# postgresql_major: "15" +# postgresql_release: "15.1" +# postgresql_release_checksum: sha256:ea2cf059a85882654b989acd07edc121833164a30340faee0d3615cf7058e66c +postgres_major: + - "15" + - "16" + +# Full version strings for each major version +postgres_release: + postgres15: "15.8.1.003-staging-5" + postgres16: "16.3.1.000-staging-5" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl deleted file mode 100644 index 8419992a8..000000000 --- a/common-nix.vars.pkr.hcl +++ /dev/null @@ -1 +0,0 @@ -postgres-version = "15.8.1.003" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index a8a8639e2..3cf8505c0 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -5,6 +5,9 @@ nix --version if [ -d "/workspace" ]; then cd /workspace fi +nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link +nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link nix build .#psql_15/bin -o psql_15 -nix flake check -L +nix build .#psql_16/bin -o psql_16 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_16 diff --git a/flake.nix b/flake.nix index 15f1a585a..f3d724dcd 100644 --- a/flake.nix +++ b/flake.nix @@ -141,8 +141,6 @@ #postgis_override = pkgs.postgis_override; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; - #we will add supported versions to this list in the future - supportedVersions = [ "15" ]; # Create a 'receipt' file for a given postgresql package. This is a way # of adding a bit of metadata to the package, which can be used by other # tools to inspect what the contents of the install are: the PSQL @@ -290,8 +288,7 @@ # Define the available PostgreSQL versions postgresVersions = { psql_15 = makePostgres "15"; - # Uncomment the line below to enable PostgreSQL 16 - # psql_16 = makePostgres "16"; + psql_16 = makePostgres "16"; # psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; }; @@ -307,16 +304,19 @@ postgresql = postgresqlPackage; }; postgresql_15 = getPostgresqlPackage "15"; + postgresql_16 = getPostgresqlPackage "16"; in postgresVersions //{ supabase-groonga = supabase-groonga; # PostgreSQL versions. - psql_15 = makePostgres "15"; + psql_15 = postgresVersions.psql_15; + psql_16 = postgresVersions.psql_16; #psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15; + inherit postgresql_15 postgresql_16; postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; + postgresql_16_debug = if pkgs.stdenv.isLinux then postgresql_16.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; version = postgresql_15.version; @@ -339,6 +339,28 @@ platforms = platforms.all; }; }; + postgresql_16_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-16-src"; + version = postgresql_16.version; + + src = postgresql_16.src; + + nativeBuildInputs = [ pkgs.bzip2 ]; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + + meta = with pkgs.lib; { + description = "PostgreSQL 15 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; + }; mecab_naist_jdic = mecab-naist-jdic; supabase_groonga = supabase-groonga; pg_regress = makePgRegress activeVersion; @@ -397,6 +419,7 @@ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ --subst-var-by 'PSQL_CONF_FILE' $out/etc/postgresql/postgresql.conf \ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ --subst-var-by 'READREPL_CONF_FILE' "$out/etc/postgresql-custom/read-replica.conf" \ --subst-var-by 'LOGGING_CONF_FILE' "$out/etc/postgresql-custom/logging.conf" \ @@ -425,6 +448,7 @@ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ @@ -576,7 +600,7 @@ # flake check'. This is run in the CI system, as well. checks = { psql_15 = makeCheckHarness basePackages.psql_15.bin; - #psql_16 = makeCheckHarness basePackages.psql_16.bin; + psql_16 = makeCheckHarness basePackages.psql_16.bin; #psql_orioledb_16 = makeCheckHarness basePackages.psql_orioledb_16.bin; }; diff --git a/migrations/Dockerfile.dbmate b/migrations/Dockerfile.dbmate new file mode 100644 index 000000000..29c80e6e5 --- /dev/null +++ b/migrations/Dockerfile.dbmate @@ -0,0 +1,23 @@ +FROM debian:bullseye-slim + +RUN apt-get update && apt-get install -y curl wget gnupg2 lsb-release + +RUN ARCH=$(dpkg --print-architecture); \ + case ${ARCH} in \ + amd64) DBMATE_ARCH="linux-amd64" ;; \ + arm64) DBMATE_ARCH="linux-arm64" ;; \ + *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \ + esac && \ + curl -fsSL -o /usr/local/bin/dbmate \ + https://github.com/amacneil/dbmate/releases/latest/download/dbmate-${DBMATE_ARCH} && \ + chmod +x /usr/local/bin/dbmate + +RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list +RUN apt-get update && apt-get install -y postgresql-client-%VERSION% + +ENV PATH="/usr/lib/postgresql/%VERSION%/bin:${PATH}" + +RUN dbmate --version + +ENTRYPOINT ["dbmate"] diff --git a/migrations/docker-compose.yaml b/migrations/docker-compose.yaml index 2609d6008..1b3e8b143 100644 --- a/migrations/docker-compose.yaml +++ b/migrations/docker-compose.yaml @@ -33,7 +33,9 @@ services: command: pg_prove /tests/test.sql dbmate: - image: amacneil/dbmate:1.16.2 + build: + context: . + dockerfile: Dockerfile.dbmate depends_on: db: condition: service_healthy diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql new file mode 100644 index 000000000..1bff8b9d8 --- /dev/null +++ b/migrations/schema-15.sql @@ -0,0 +1,1064 @@ +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: auth; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA auth; + + +-- +-- Name: extensions; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA extensions; + + +-- +-- Name: graphql; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql; + + +-- +-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql_public; + + +-- +-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgbouncer; + + +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgsodium; + + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + +-- +-- Name: realtime; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA realtime; + + +-- +-- Name: storage; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA storage; + + +-- +-- Name: vault; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA vault; + + +-- +-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; + + +-- +-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; + + +-- +-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; + + +-- +-- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +-- +-- Name: email(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.email() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.email', true), '')::text; +$$; + + +-- +-- Name: role(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.role() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.role', true), '')::text; +$$; + + +-- +-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid; +$$; + + +-- +-- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_cron' + ) + THEN + grant usage on schema cron to postgres with grant option; + + alter default privileges in schema cron grant all on tables to postgres with grant option; + alter default privileges in schema cron grant all on functions to postgres with grant option; + alter default privileges in schema cron grant all on sequences to postgres with grant option; + + alter default privileges for user supabase_admin in schema cron grant all + on sequences to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on tables to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on functions to postgres with grant option; + + grant all privileges on all tables in schema cron to postgres with grant option; + revoke all on table cron.job from postgres; + grant select on table cron.job to postgres with grant option; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; + + +-- +-- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ +DECLARE + func_is_graphql_resolve bool; +BEGIN + func_is_graphql_resolve = ( + SELECT n.proname = 'resolve' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_proc AS n + ON ev.objid = n.oid + ); + + IF func_is_graphql_resolve + THEN + -- Update public wrapper to pass all arguments through to the pg_graphql resolve func + DROP FUNCTION IF EXISTS graphql_public.graphql; + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language sql + as $$ + select graphql.resolve( + query := query, + variables := coalesce(variables, '{}'), + "operationName" := "operationName", + extensions := extensions + ); + $$; + + -- This hook executes when `graphql.resolve` is created. That is not necessarily the last + -- function in the extension so we need to grant permissions on existing entities AND + -- update default permissions to any others that are created after `graphql.resolve` + grant usage on schema graphql to postgres, anon, authenticated, service_role; + grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; + grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; + grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; + + -- Allow postgres role to allow granting usage on graphql and graphql_public schemas to custom roles + grant usage on schema graphql_public to postgres with grant option; + grant usage on schema graphql to postgres with grant option; + END IF; + +END; +$_$; + + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; + + +-- +-- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; + + +-- +-- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + cmd record; +BEGIN + FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + IF cmd.command_tag IN ( + 'CREATE SCHEMA', 'ALTER SCHEMA' + , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' + , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' + , 'CREATE VIEW', 'ALTER VIEW' + , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' + , 'CREATE FUNCTION', 'ALTER FUNCTION' + , 'CREATE TRIGGER' + , 'CREATE TYPE', 'ALTER TYPE' + , 'CREATE RULE' + , 'COMMENT' + ) + -- don't notify in case of CREATE TEMP table or other objects created on pg_temp + AND cmd.schema_name is distinct from 'pg_temp' + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + obj record; +BEGIN + FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() + LOOP + IF obj.object_type IN ( + 'schema' + , 'table' + , 'foreign table' + , 'view' + , 'materialized view' + , 'function' + , 'trigger' + , 'type' + , 'rule' + ) + AND obj.is_temporary IS false -- no pg_temp objects + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ + DECLARE + graphql_is_dropped bool; + BEGIN + graphql_is_dropped = ( + SELECT ev.schema_name = 'graphql_public' + FROM pg_event_trigger_dropped_objects() AS ev + WHERE ev.schema_name = 'graphql_public' + ); + + IF graphql_is_dropped + THEN + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language plpgsql + as $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; + $$; + END IF; + + END; +$_$; + + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; + + +-- +-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - +-- + +CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) + LANGUAGE plpgsql SECURITY DEFINER + AS $$ +BEGIN + RAISE WARNING 'PgBouncer auth request: %', p_usename; + + RETURN QUERY + SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow + WHERE usename = p_usename; +END; +$$; + + +-- +-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.extension(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +_filename text; +BEGIN + select string_to_array(name, '/') into _parts; + select _parts[array_length(_parts,1)] into _filename; + -- @todo return the last part instead of 2 + return split_part(_filename, '.', 2); +END +$$; + + +-- +-- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.filename(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[array_length(_parts,1)]; +END +$$; + + +-- +-- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.foldername(name text) RETURNS text[] + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[1:array_length(_parts,1)-1]; +END +$$; + + +-- +-- Name: search(text, text, integer, integer, integer); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) + LANGUAGE plpgsql + AS $$ +DECLARE +_bucketId text; +BEGIN + -- will be replaced by migrations when server starts + -- saving space for cloud-init +END +$$; + + +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.audit_log_entries ( + instance_id uuid, + id uuid NOT NULL, + payload json, + created_at timestamp with time zone +); + + +-- +-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; + + +-- +-- Name: instances; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.instances ( + id uuid NOT NULL, + uuid uuid, + raw_base_config text, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; + + +-- +-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.refresh_tokens ( + instance_id uuid, + id bigint NOT NULL, + token character varying(255), + user_id character varying(255), + revoked boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: - +-- + +CREATE SEQUENCE auth.refresh_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: - +-- + +ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.schema_migrations ( + version character varying(255) NOT NULL +); + + +-- +-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; + + +-- +-- Name: users; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.users ( + instance_id uuid, + id uuid NOT NULL, + aud character varying(255), + role character varying(255), + email character varying(255), + encrypted_password character varying(255), + confirmed_at timestamp with time zone, + invited_at timestamp with time zone, + confirmation_token character varying(255), + confirmation_sent_at timestamp with time zone, + recovery_token character varying(255), + recovery_sent_at timestamp with time zone, + email_change_token character varying(255), + email_change character varying(255), + email_change_sent_at timestamp with time zone, + last_sign_in_at timestamp with time zone, + raw_app_meta_data jsonb, + raw_user_meta_data jsonb, + is_super_admin boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.schema_migrations ( + version character varying(128) NOT NULL +); + + +-- +-- Name: buckets; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.buckets ( + id text NOT NULL, + name text NOT NULL, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now() +); + + +-- +-- Name: migrations; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.migrations ( + id integer NOT NULL, + name character varying(100) NOT NULL, + hash character varying(40) NOT NULL, + executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +-- +-- Name: objects; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.objects ( + id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, + bucket_id text, + name text, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + last_accessed_at timestamp with time zone DEFAULT now(), + metadata jsonb +); + + +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT secrets.id, + secrets.name, + secrets.description, + secrets.secret, + CASE + WHEN (secrets.secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (secrets.key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) + END + END AS decrypted_secret, + secrets.key_id, + secrets.nonce, + secrets.created_at, + secrets.updated_at + FROM vault.secrets; + + +-- +-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); + + +-- +-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.audit_log_entries + ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); + + +-- +-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.instances + ADD CONSTRAINT instances_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: users users_email_key; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_email_key UNIQUE (email); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); + + +-- +-- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_name_key UNIQUE (name); + + +-- +-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); + + +-- +-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_pkey PRIMARY KEY (id); + + +-- +-- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); + + +-- +-- Name: refresh_tokens_token_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); + + +-- +-- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); + + +-- +-- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); + + +-- +-- Name: bname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); + + +-- +-- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); + + +-- +-- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); + + +-- +-- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); + + +-- +-- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: - +-- + +ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; + +-- +-- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: - +-- + +CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); + + +-- +-- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop + WHEN TAG IN ('DROP EXTENSION') + EXECUTE FUNCTION extensions.set_graphql_placeholder(); + + +-- +-- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_cron_access(); + + +-- +-- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end + WHEN TAG IN ('CREATE FUNCTION') + EXECUTE FUNCTION extensions.grant_pg_graphql_access(); + + +-- +-- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + + +-- +-- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end + EXECUTE FUNCTION extensions.pgrst_ddl_watch(); + + +-- +-- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop + EXECUTE FUNCTION extensions.pgrst_drop_watch(); + + +-- +-- PostgreSQL database dump complete +-- + + +-- +-- Dbmate schema migrations +-- + diff --git a/migrations/schema-16.sql b/migrations/schema-16.sql new file mode 100644 index 000000000..49873a109 --- /dev/null +++ b/migrations/schema-16.sql @@ -0,0 +1,1064 @@ +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: auth; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA auth; + + +-- +-- Name: extensions; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA extensions; + + +-- +-- Name: graphql; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql; + + +-- +-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql_public; + + +-- +-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgbouncer; + + +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgsodium; + + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + +-- +-- Name: realtime; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA realtime; + + +-- +-- Name: storage; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA storage; + + +-- +-- Name: vault; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA vault; + + +-- +-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; + + +-- +-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; + + +-- +-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; + + +-- +-- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +-- +-- Name: email(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.email() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.email', true), '')::text; +$$; + + +-- +-- Name: role(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.role() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.role', true), '')::text; +$$; + + +-- +-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid; +$$; + + +-- +-- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_cron' + ) + THEN + grant usage on schema cron to postgres with grant option; + + alter default privileges in schema cron grant all on tables to postgres with grant option; + alter default privileges in schema cron grant all on functions to postgres with grant option; + alter default privileges in schema cron grant all on sequences to postgres with grant option; + + alter default privileges for user supabase_admin in schema cron grant all + on sequences to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on tables to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on functions to postgres with grant option; + + grant all privileges on all tables in schema cron to postgres with grant option; + revoke all on table cron.job from postgres; + grant select on table cron.job to postgres with grant option; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; + + +-- +-- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ +DECLARE + func_is_graphql_resolve bool; +BEGIN + func_is_graphql_resolve = ( + SELECT n.proname = 'resolve' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_proc AS n + ON ev.objid = n.oid + ); + + IF func_is_graphql_resolve + THEN + -- Update public wrapper to pass all arguments through to the pg_graphql resolve func + DROP FUNCTION IF EXISTS graphql_public.graphql; + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language sql + as $$ + select graphql.resolve( + query := query, + variables := coalesce(variables, '{}'), + "operationName" := "operationName", + extensions := extensions + ); + $$; + + -- This hook executes when `graphql.resolve` is created. That is not necessarily the last + -- function in the extension so we need to grant permissions on existing entities AND + -- update default permissions to any others that are created after `graphql.resolve` + grant usage on schema graphql to postgres, anon, authenticated, service_role; + grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; + grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; + grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; + + -- Allow postgres role to allow granting usage on graphql and graphql_public schemas to custom roles + grant usage on schema graphql_public to postgres with grant option; + grant usage on schema graphql to postgres with grant option; + END IF; + +END; +$_$; + + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; + + +-- +-- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; + + +-- +-- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + cmd record; +BEGIN + FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + IF cmd.command_tag IN ( + 'CREATE SCHEMA', 'ALTER SCHEMA' + , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' + , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' + , 'CREATE VIEW', 'ALTER VIEW' + , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' + , 'CREATE FUNCTION', 'ALTER FUNCTION' + , 'CREATE TRIGGER' + , 'CREATE TYPE', 'ALTER TYPE' + , 'CREATE RULE' + , 'COMMENT' + ) + -- don't notify in case of CREATE TEMP table or other objects created on pg_temp + AND cmd.schema_name is distinct from 'pg_temp' + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + obj record; +BEGIN + FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() + LOOP + IF obj.object_type IN ( + 'schema' + , 'table' + , 'foreign table' + , 'view' + , 'materialized view' + , 'function' + , 'trigger' + , 'type' + , 'rule' + ) + AND obj.is_temporary IS false -- no pg_temp objects + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ + DECLARE + graphql_is_dropped bool; + BEGIN + graphql_is_dropped = ( + SELECT ev.schema_name = 'graphql_public' + FROM pg_event_trigger_dropped_objects() AS ev + WHERE ev.schema_name = 'graphql_public' + ); + + IF graphql_is_dropped + THEN + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language plpgsql + as $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; + $$; + END IF; + + END; +$_$; + + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; + + +-- +-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - +-- + +CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) + LANGUAGE plpgsql SECURITY DEFINER + AS $$ +BEGIN + RAISE WARNING 'PgBouncer auth request: %', p_usename; + + RETURN QUERY + SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow + WHERE usename = p_usename; +END; +$$; + + +-- +-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.extension(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +_filename text; +BEGIN + select string_to_array(name, '/') into _parts; + select _parts[array_length(_parts,1)] into _filename; + -- @todo return the last part instead of 2 + return split_part(_filename, '.', 2); +END +$$; + + +-- +-- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.filename(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[array_length(_parts,1)]; +END +$$; + + +-- +-- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.foldername(name text) RETURNS text[] + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[1:array_length(_parts,1)-1]; +END +$$; + + +-- +-- Name: search(text, text, integer, integer, integer); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) + LANGUAGE plpgsql + AS $$ +DECLARE +_bucketId text; +BEGIN + -- will be replaced by migrations when server starts + -- saving space for cloud-init +END +$$; + + +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.audit_log_entries ( + instance_id uuid, + id uuid NOT NULL, + payload json, + created_at timestamp with time zone +); + + +-- +-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; + + +-- +-- Name: instances; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.instances ( + id uuid NOT NULL, + uuid uuid, + raw_base_config text, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; + + +-- +-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.refresh_tokens ( + instance_id uuid, + id bigint NOT NULL, + token character varying(255), + user_id character varying(255), + revoked boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: - +-- + +CREATE SEQUENCE auth.refresh_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: - +-- + +ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.schema_migrations ( + version character varying(255) NOT NULL +); + + +-- +-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; + + +-- +-- Name: users; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.users ( + instance_id uuid, + id uuid NOT NULL, + aud character varying(255), + role character varying(255), + email character varying(255), + encrypted_password character varying(255), + confirmed_at timestamp with time zone, + invited_at timestamp with time zone, + confirmation_token character varying(255), + confirmation_sent_at timestamp with time zone, + recovery_token character varying(255), + recovery_sent_at timestamp with time zone, + email_change_token character varying(255), + email_change character varying(255), + email_change_sent_at timestamp with time zone, + last_sign_in_at timestamp with time zone, + raw_app_meta_data jsonb, + raw_user_meta_data jsonb, + is_super_admin boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.schema_migrations ( + version character varying(128) NOT NULL +); + + +-- +-- Name: buckets; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.buckets ( + id text NOT NULL, + name text NOT NULL, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now() +); + + +-- +-- Name: migrations; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.migrations ( + id integer NOT NULL, + name character varying(100) NOT NULL, + hash character varying(40) NOT NULL, + executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +-- +-- Name: objects; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.objects ( + id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, + bucket_id text, + name text, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + last_accessed_at timestamp with time zone DEFAULT now(), + metadata jsonb +); + + +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT id, + name, + description, + secret, + CASE + WHEN (secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) + END + END AS decrypted_secret, + key_id, + nonce, + created_at, + updated_at + FROM vault.secrets; + + +-- +-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); + + +-- +-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.audit_log_entries + ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); + + +-- +-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.instances + ADD CONSTRAINT instances_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: users users_email_key; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_email_key UNIQUE (email); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); + + +-- +-- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_name_key UNIQUE (name); + + +-- +-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); + + +-- +-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_pkey PRIMARY KEY (id); + + +-- +-- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); + + +-- +-- Name: refresh_tokens_token_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); + + +-- +-- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); + + +-- +-- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); + + +-- +-- Name: bname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); + + +-- +-- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); + + +-- +-- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); + + +-- +-- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); + + +-- +-- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: - +-- + +ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; + +-- +-- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: - +-- + +CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); + + +-- +-- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop + WHEN TAG IN ('DROP EXTENSION') + EXECUTE FUNCTION extensions.set_graphql_placeholder(); + + +-- +-- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_cron_access(); + + +-- +-- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end + WHEN TAG IN ('CREATE FUNCTION') + EXECUTE FUNCTION extensions.grant_pg_graphql_access(); + + +-- +-- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + + +-- +-- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end + EXECUTE FUNCTION extensions.pgrst_ddl_watch(); + + +-- +-- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop + EXECUTE FUNCTION extensions.pgrst_drop_watch(); + + +-- +-- PostgreSQL database dump complete +-- + + +-- +-- Dbmate schema migrations +-- + diff --git a/migrations/schema.sql b/migrations/schema.sql index f68d131e8..1bff8b9d8 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -737,7 +737,7 @@ COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure sch -- CREATE TABLE public.schema_migrations ( - version character varying(255) NOT NULL + version character varying(128) NOT NULL ); diff --git a/nix/ext/hypopg.nix b/nix/ext/hypopg.nix index 4fc00a82f..300a44900 100644 --- a/nix/ext/hypopg.nix +++ b/nix/ext/hypopg.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_backtrace.nix b/nix/ext/pg_backtrace.nix index b0169124c..47ede88e2 100644 --- a/nix/ext/pg_backtrace.nix +++ b/nix/ext/pg_backtrace.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_cron.nix b/nix/ext/pg_cron.nix index 5c546c797..d51254aa2 100644 --- a/nix/ext/pg_cron.nix +++ b/nix/ext/pg_cron.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_hashids.nix b/nix/ext/pg_hashids.nix index 41c3ba664..50bff95da 100644 --- a/nix/ext/pg_hashids.nix +++ b/nix/ext/pg_hashids.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index bff869f37..dc923b9a8 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp sql/*.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_plan_filter.nix b/nix/ext/pg_plan_filter.nix index 2d7d224ec..0ed527251 100644 --- a/nix/ext/pg_plan_filter.nix +++ b/nix/ext/pg_plan_filter.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_stat_monitor.nix b/nix/ext/pg_stat_monitor.nix index 8784067d2..c3e91fe2b 100644 --- a/nix/ext/pg_stat_monitor.nix +++ b/nix/ext/pg_stat_monitor.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pg_tle.nix b/nix/ext/pg_tle.nix index 6b1c7b1ca..0221d8768 100644 --- a/nix/ext/pg_tle.nix +++ b/nix/ext/pg_tle.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pgrouting.nix b/nix/ext/pgrouting.nix index 36edf3404..5587566cd 100644 --- a/nix/ext/pgrouting.nix +++ b/nix/ext/pgrouting.nix @@ -14,9 +14,38 @@ stdenv.mkDerivation rec { hash = "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="; }; + #disable compile time warnings for incompatible pointer types only on macos and pg16 + NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") + "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types"; + + cmakeFlags = [ + "-DPOSTGRESQL_VERSION=${postgresql.version}" + ] ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [ + "-DCMAKE_MACOSX_RPATH=ON" + "-DCMAKE_SHARED_MODULE_SUFFIX=.dylib" + "-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib" + ]; + + preConfigure = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' + export DLSUFFIX=.dylib + export CMAKE_SHARED_LIBRARY_SUFFIX=.dylib + export CMAKE_SHARED_MODULE_SUFFIX=.dylib + export MACOSX_RPATH=ON + ''; + + postBuild = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' + shopt -s nullglob + for file in lib/libpgrouting-*.so; do + if [ -f "$file" ]; then + mv "$file" "''${file%.so}.dylib" + fi + done + shopt -u nullglob + ''; + installPhase = '' - install -D lib/*.so -t $out/lib - install -D sql/pgrouting--${version}.sql -t $out/share/postgresql/extension + install -D lib/*${postgresql.dlSuffix} -t $out/lib + install -D sql/pgrouting--*.sql -t $out/share/postgresql/extension install -D sql/common/pgrouting.control -t $out/share/postgresql/extension ''; diff --git a/nix/ext/pgsodium.nix b/nix/ext/pgsodium.nix index e3b0da228..4e184faa9 100644 --- a/nix/ext/pgsodium.nix +++ b/nix/ext/pgsodium.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp sql/*.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index 2edaa9d53..de8fa68c6 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/pgvector.nix b/nix/ext/pgvector.nix index 476f7606c..aefeeea3a 100644 --- a/nix/ext/pgvector.nix +++ b/nix/ext/pgvector.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp sql/*.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension ''; diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index 5cb4fb67e..785f5e601 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -105,81 +105,17 @@ stdenv.mkDerivation (finalAttrs: { rmdir "$out/nix/store"/* "$out/nix/store" "$out/nix" ${lib.optionalString stdenv.isDarwin '' - install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}.so - install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8-${finalAttrs.version}.so - install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}.so - install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}.so + install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} ''} ${lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}.so + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} ''} ''; - passthru = { - tests = - let - postgresqlWithSelf = postgresql.withPackages (_: [ - finalAttrs.finalPackage - ]); - in { - smoke = runCommand "plv8-smoke-test" {} '' - export PATH=${lib.makeBinPath [ - postgresqlWithSelf - coreutils - gnugrep - ]} - db="$PWD/testdb" - initdb "$db" - postgres -k "$db" -D "$db" & - pid="$!" - - for i in $(seq 1 100); do - if psql -h "$db" -d postgres -c "" 2>/dev/null; then - break - elif ! kill -0 "$pid"; then - exit 1 - else - sleep 0.1 - fi - done - - psql -h "$db" -d postgres -c 'CREATE EXTENSION plv8; DO $$ plv8.elog(NOTICE, plv8.version); $$ LANGUAGE plv8;' 2> "$out" - grep -q "${finalAttrs.version}" "$out" - kill -0 "$pid" - ''; - - regression = stdenv.mkDerivation { - name = "plv8-regression"; - inherit (finalAttrs) src patches nativeBuildInputs buildInputs dontConfigure; - - buildPhase = '' - runHook preBuild - - # The regression tests need to be run in the order specified in the Makefile. - echo -e "include Makefile\nprint_regress_files:\n\t@echo \$(REGRESS)" > Makefile.regress - REGRESS_TESTS=$(make -f Makefile.regress print_regress_files) - - ${postgresql}/lib/pgxs/src/test/regress/pg_regress \ - --bindir='${postgresqlWithSelf}/bin' \ - --temp-instance=regress-instance \ - --dbname=contrib_regression \ - $REGRESS_TESTS - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - touch "$out" - - runHook postInstall - ''; - }; - }; - }; - meta = with lib; { description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; homepage = "https://plv8.github.io/"; @@ -187,4 +123,4 @@ stdenv.mkDerivation (finalAttrs: { platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; license = licenses.postgresql; }; -}) \ No newline at end of file +}) diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index 9a32062b9..ee1d691b2 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/lib - install -D supautils.so -t $out/lib + install -D *${postgresql.dlSuffix} -t $out/lib ''; meta = with lib; { diff --git a/nix/postgresql/16.nix b/nix/postgresql/16.nix new file mode 100644 index 000000000..c964fc580 --- /dev/null +++ b/nix/postgresql/16.nix @@ -0,0 +1,4 @@ +import ./generic.nix { + version = "16.3"; + hash = "sha256-Mxlj1dPcTK9CFqBJ+kC2bWvLjHMGFYWUEblRh2TmBYU="; +} diff --git a/nix/postgresql/default.nix b/nix/postgresql/default.nix index 6ee0452dd..5f92262b2 100644 --- a/nix/postgresql/default.nix +++ b/nix/postgresql/default.nix @@ -3,6 +3,7 @@ let #adapted from the postgresql nixpkgs package versions = { postgresql_15 = ./15.nix; + postgresql_16 = ./16.nix; }; mkAttributes = jitSupport: diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index 5714fbcec..07c0d6650 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -146,6 +146,18 @@ from on e.oid = d.refobjid where d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') order by e.extname, n.nspname, @@ -1076,7 +1088,6 @@ order by moddatetime | public | moddatetime | | trigger old_snapshot | public | pg_old_snapshot_time_mapping | OUT array_offset integer, OUT end_timestamp timestamp with time zone, OUT newest_xmin xid | SETOF record pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record - pageinspect | public | brin_page_items | page bytea, index_oid regclass, OUT itemoffset integer, OUT blknum bigint, OUT attnum integer, OUT allnulls boolean, OUT hasnulls boolean, OUT placeholder boolean, OUT value text | SETOF record pageinspect | public | brin_page_type | page bytea | text pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid pageinspect | public | bt_metap | relname text, OUT magic integer, OUT version integer, OUT root bigint, OUT level bigint, OUT fastroot bigint, OUT fastlevel bigint, OUT last_cleanup_num_delpages bigint, OUT last_cleanup_num_tuples double precision, OUT allequalimage boolean | record @@ -1300,9 +1311,7 @@ order by pg_visibility | public | pg_visibility_map_summary | regclass, OUT all_visible bigint, OUT all_frozen bigint | record pg_walinspect | public | pg_get_wal_record_info | in_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | record pg_walinspect | public | pg_get_wal_records_info | start_lsn pg_lsn, end_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | SETOF record - pg_walinspect | public | pg_get_wal_records_info_till_end_of_wal | start_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | SETOF record pg_walinspect | public | pg_get_wal_stats | start_lsn pg_lsn, end_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record - pg_walinspect | public | pg_get_wal_stats_till_end_of_wal | start_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record pgaudit | public | pgaudit_ddl_command_end | | event_trigger pgaudit | public | pgaudit_sql_drop | | event_trigger pgcrypto | public | armor | bytea | text @@ -5225,7 +5234,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5072 rows) +(5069 rows) /* diff --git a/nix/tests/expected/pg_partman.out b/nix/tests/expected/pg_partman.out index 527d58b12..25aa80d2e 100644 --- a/nix/tests/expected/pg_partman.out +++ b/nix/tests/expected/pg_partman.out @@ -28,7 +28,10 @@ select from information_schema.tables where - table_schema = 'partman_test'; + table_schema = 'partman_test' +order by + table_name, + table_type; table_name | table_type -----------------------------+------------ time_taptest_table | BASE TABLE diff --git a/nix/tests/sql/extensions_sql_interface.sql b/nix/tests/sql/extensions_sql_interface.sql index 947a4a612..ad0f63ed8 100644 --- a/nix/tests/sql/extensions_sql_interface.sql +++ b/nix/tests/sql/extensions_sql_interface.sql @@ -63,6 +63,18 @@ from on e.oid = d.refobjid where d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') order by e.extname, n.nspname, diff --git a/nix/tests/sql/pg_partman.sql b/nix/tests/sql/pg_partman.sql index 621e1a7c9..d1fb9f4ba 100644 --- a/nix/tests/sql/pg_partman.sql +++ b/nix/tests/sql/pg_partman.sql @@ -35,7 +35,10 @@ select from information_schema.tables where - table_schema = 'partman_test'; + table_schema = 'partman_test' +order by + table_name, + table_type; select public.create_parent( diff --git a/scripts/nix-provision.sh b/scripts/nix-provision.sh index 223e84926..c4776b3a8 100644 --- a/scripts/nix-provision.sh +++ b/scripts/nix-provision.sh @@ -25,16 +25,23 @@ function install_nix() { function execute_stage2_playbook { + echo "POSTGRES_MAJOR_VERSION: ${POSTGRES_MAJOR_VERSION}" + echo "GIT_SHA: ${GIT_SHA}" sudo tee /etc/ansible/ansible.cfg < Date: Mon, 14 Oct 2024 11:33:17 -0500 Subject: [PATCH 023/271] bump to supautils v2.5.0 - CHANGELOG for v2.4.0: https://github.com/supabase/supautils/releases/tag/v2.4.0 - CHANGELOG for v2.5.0: https://github.com/supabase/supautils/releases/tag/v2.5.0 --- nix/ext/supautils.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index ee1d691b2..40c27fbe8 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "supautils"; - version = "2.2.1"; + version = "2.5.0"; buildInputs = [ postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-wSUEG0at00TPAoHv6+NMzuUE8mfW6fnHH0MNxvBdUiE="; + hash = "sha256-NyAk+QpQEdibmFY4yceO/FzMOhRYhKXf4XUw9XJ5rOY="; }; installPhase = '' From d4709ba1ca6e5881f65265578f8fec124bb34bd0 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 17 Oct 2024 13:26:08 -0400 Subject: [PATCH 024/271] chore: cut releases for 15.8 and 16.3 (#1279) Co-authored-by: Sam Rose --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index f78b56c97..9564c043e 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.003-staging-5" - postgres16: "16.3.1.000-staging-5" + postgres15: "15.8.1.004" + postgres16: "16.3.1.010" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 743c6f74d56d5dd2c1e044729e7bc62f5c6afe63 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 22 Oct 2024 10:46:46 -0400 Subject: [PATCH 025/271] feat: packaging and devshell with various cargo-pgrx versions! (#1277) * feat: packaging and devshell with various cargo-pgrx versions! * feat: cargo-pgrx_0_12_6 instead * feat: devshell with rust versions * rust versions in devshell + try to make wrappers build again * feat: override rust versions in buildPgrxExtension * chore: newline --------- Co-authored-by: Sam Rose --- flake.lock | 37 +++++- flake.nix | 73 ++++++++++-- nix/cargo-pgrx/buildPgrxExtension.nix | 161 ++++++++++++++++++++++++++ nix/cargo-pgrx/default.nix | 70 +++++++++++ nix/ext/pg_graphql.nix | 7 +- nix/ext/pg_jsonschema.nix | 7 +- nix/ext/wrappers/default.nix | 6 +- 7 files changed, 345 insertions(+), 16 deletions(-) create mode 100644 nix/cargo-pgrx/buildPgrxExtension.nix create mode 100644 nix/cargo-pgrx/default.nix diff --git a/flake.lock b/flake.lock index 3ee7c2d7f..2d05388c6 100644 --- a/flake.lock +++ b/flake.lock @@ -121,12 +121,47 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "nix-editor": "nix-editor", "nix2container": "nix2container", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1729045942, + "narHash": "sha256-HjmK0x5Zm2TK2vFpC7XBM2e3EDNVnAIuEoU2FkeN8xw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "9de3cea452d2401d6f93c06ad985178a4e11d1fc", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index f3d724dcd..1cef2669c 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,10 @@ flake-utils.url = "github:numtide/flake-utils"; nix2container.url = "github:nlewo/nix2container"; nix-editor.url = "github:snowfallorg/nix-editor"; + rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, flake-utils, nix2container, nix-editor, ...}: + outputs = { self, nixpkgs, flake-utils, nix2container, nix-editor, rust-overlay, ...}: let gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; @@ -53,10 +54,41 @@ }; inherit system; overlays = [ - # NOTE (aseipp): add any needed overlays here. in theory we could + # NOTE add any needed overlays here. in theory we could # pull them from the overlays/ directory automatically, but we don't # want to have an arbitrary order, since it might matter. being # explicit is better. + (import rust-overlay) + (final: prev: { + cargo-pgrx = final.callPackage ./nix/cargo-pgrx/default.nix { + inherit (final) lib; + inherit (final) darwin; + inherit (final) fetchCrate; + inherit (final) openssl; + inherit (final) pkg-config; + inherit (final) makeRustPlatform; + inherit (final) stdenv; + inherit (final) rust-bin; + }; + + buildPgrxExtension = final.callPackage ./nix/cargo-pgrx/buildPgrxExtension.nix { + inherit (final) cargo-pgrx; + inherit (final) lib; + inherit (final) Security; + inherit (final) pkg-config; + inherit (final) makeRustPlatform; + inherit (final) stdenv; + inherit (final) writeShellScriptBin; + }; + + buildPgrxExtension_0_11_3 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_3; + }; + + buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6; + }; + }) (final: prev: { postgresql = final.callPackage ./nix/postgresql/default.nix { inherit (final) lib; @@ -66,7 +98,6 @@ inherit (final) callPackage; }; }) - (import ./nix/overlays/cargo-pgrx-0-11-3.nix) ]; }; sfcgal = pkgs.callPackage ./nix/ext/sfcgal/sfcgal.nix { }; @@ -308,6 +339,8 @@ in postgresVersions //{ 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; # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_16 = postgresVersions.psql_16; @@ -590,10 +623,7 @@ packages = flake-utils.lib.flattenTree basePackages // { # Any extra packages we might want to include in our package # set can go here. - inherit (pkgs) - # NOTE: comes from our cargo-pgrx-0-11-3.nix overlay - cargo-pgrx_0_11_3; - + inherit (pkgs); }; # The list of exported 'checks' that are run with every run of 'nix @@ -627,7 +657,21 @@ # ambient $PATH environment when you run 'nix develop'. This is useful # for development and puts many convenient devtools instantly within # reach. - devShells.default = pkgs.mkShell { + + devShells = let + mkCargoPgrxDevShell = { pgrxVersion, rustVersion }: pkgs.mkShell { + packages = with pkgs; [ + basePackages."cargo-pgrx_${pgrxVersion}" + (rust-bin.stable.${rustVersion}.default.override { + extensions = [ "rust-src" ]; + }) + ]; + shellHook = '' + export HISTFILE=.history + ''; + }; + in { + default = pkgs.mkShell { packages = with pkgs; [ coreutils just @@ -650,6 +694,15 @@ export HISTFILE=.history ''; }; - } - ); + cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { + pgrxVersion = "0_11_3"; + rustVersion = "1.80.0"; + }; + cargo-pgrx_0_12_6 = mkCargoPgrxDevShell { + pgrxVersion = "0_12_6"; + rustVersion = "1.80.0"; + }; + }; + } + ); } diff --git a/nix/cargo-pgrx/buildPgrxExtension.nix b/nix/cargo-pgrx/buildPgrxExtension.nix new file mode 100644 index 000000000..89293ab62 --- /dev/null +++ b/nix/cargo-pgrx/buildPgrxExtension.nix @@ -0,0 +1,161 @@ +# preBuildAndTest and some small other bits +# taken from https://github.com/tcdi/pgrx/blob/v0.9.4/nix/extension.nix +# (but now heavily modified) +# which uses MIT License with the following license file +# +# MIT License +# +# Portions Copyright 2019-2021 ZomboDB, LLC. +# Portions Copyright 2021-2022 Technology Concepts & Design, Inc. . +# All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +{ lib +, cargo-pgrx +, pkg-config +, rustPlatform +, stdenv +, Security +, writeShellScriptBin +}: + +# The idea behind: Use it mostly like rustPlatform.buildRustPackage and so +# we hand most of the arguments down. +# +# Additional arguments are: +# - `postgresql` postgresql package of the version of postgresql this extension should be build for. +# Needs to be the build platform variant. +# - `useFakeRustfmt` Whether to use a noop fake command as rustfmt. cargo-pgrx tries to call rustfmt. +# If the generated rust bindings aren't needed to use the extension, its a +# unnecessary and heavy dependency. If you set this to true, you also +# have to add `rustfmt` to `nativeBuildInputs`. + +{ buildAndTestSubdir ? null +, buildType ? "release" +, buildFeatures ? [ ] +, cargoBuildFlags ? [ ] +, postgresql +# cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the +# dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g. +# if you include the generated code in the output via postInstall. +, useFakeRustfmt ? true +, usePgTestCheckFeature ? true +, ... +} @ args: +let + rustfmtInNativeBuildInputs = lib.lists.any (dep: lib.getName dep == "rustfmt") (args.nativeBuildInputs or []); +in + +assert lib.asserts.assertMsg ((args.installPhase or "") == "") + "buildPgrxExtensions overwrites the installPhase, so providing one does nothing"; +assert lib.asserts.assertMsg ((args.buildPhase or "") == "") + "buildPgrxExtensions overwrites the buildPhase, so providing one does nothing"; +assert lib.asserts.assertMsg (useFakeRustfmt -> !rustfmtInNativeBuildInputs) + "The parameter useFakeRustfmt is set to true, but rustfmt is included in nativeBuildInputs. Either set useFakeRustfmt to false or remove rustfmt from nativeBuildInputs."; +assert lib.asserts.assertMsg (!useFakeRustfmt -> rustfmtInNativeBuildInputs) + "The parameter useFakeRustfmt is set to false, but rustfmt is not included in nativeBuildInputs. Either set useFakeRustfmt to true or add rustfmt from nativeBuildInputs."; + +let + fakeRustfmt = writeShellScriptBin "rustfmt" '' + exit 0 + ''; + maybeDebugFlag = lib.optionalString (buildType != "release") "--debug"; + maybeEnterBuildAndTestSubdir = lib.optionalString (buildAndTestSubdir != null) '' + export CARGO_TARGET_DIR="$(pwd)/target" + pushd "${buildAndTestSubdir}" + ''; + maybeLeaveBuildAndTestSubdir = lib.optionalString (buildAndTestSubdir != null) "popd"; + + pgrxPostgresMajor = lib.versions.major postgresql.version; + preBuildAndTest = '' + export PGRX_HOME=$(mktemp -d) + export PGDATA="$PGRX_HOME/data-${pgrxPostgresMajor}/" + cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config + echo "unix_socket_directories = '$(mktemp -d)'" > "$PGDATA/postgresql.conf" + + # This is primarily for Mac or other Nix systems that don't use the nixbld user. + export USER="$(whoami)" + pg_ctl start + createuser -h localhost --superuser --createdb "$USER" || true + pg_ctl stop + ''; + + argsForBuildRustPackage = builtins.removeAttrs args [ "postgresql" "useFakeRustfmt" "usePgTestCheckFeature" ]; + + # so we don't accidentally `(rustPlatform.buildRustPackage argsForBuildRustPackage) // { ... }` because + # we forgot parentheses + finalArgs = argsForBuildRustPackage // { + buildInputs = (args.buildInputs or [ ]) ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ]; + + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ + cargo-pgrx + postgresql + pkg-config + rustPlatform.bindgenHook + ] ++ lib.optionals useFakeRustfmt [ fakeRustfmt ]; + + buildPhase = '' + runHook preBuild + + echo "Executing cargo-pgrx buildPhase" + ${preBuildAndTest} + ${maybeEnterBuildAndTestSubdir} + + PGRX_BUILD_FLAGS="--frozen -j $NIX_BUILD_CORES ${builtins.concatStringsSep " " cargoBuildFlags}" \ + ${lib.optionalString stdenv.hostPlatform.isDarwin ''RUSTFLAGS="''${RUSTFLAGS:+''${RUSTFLAGS} }-Clink-args=-Wl,-undefined,dynamic_lookup"''} \ + cargo pgrx package \ + --pg-config ${lib.getDev postgresql}/bin/pg_config \ + ${maybeDebugFlag} \ + --features "${builtins.concatStringsSep " " buildFeatures}" \ + --out-dir "$out" + + ${maybeLeaveBuildAndTestSubdir} + + runHook postBuild + ''; + + preCheck = preBuildAndTest + args.preCheck or ""; + + installPhase = '' + runHook preInstall + + echo "Executing buildPgrxExtension install" + + ${maybeEnterBuildAndTestSubdir} + + cargo-pgrx pgrx stop all + + mv $out/${postgresql}/* $out + rm -rf $out/nix + + ${maybeLeaveBuildAndTestSubdir} + + runHook postInstall + ''; + + PGRX_PG_SYS_SKIP_BINDING_REWRITE = "1"; + CARGO_BUILD_INCREMENTAL = "false"; + RUST_BACKTRACE = "full"; + + checkNoDefaultFeatures = true; + checkFeatures = (args.checkFeatures or [ ]) ++ (lib.optionals usePgTestCheckFeature [ "pg_test" ]) ++ [ "pg${pgrxPostgresMajor}" ]; + }; +in +rustPlatform.buildRustPackage finalArgs diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix new file mode 100644 index 000000000..2d5545927 --- /dev/null +++ b/nix/cargo-pgrx/default.nix @@ -0,0 +1,70 @@ +{ lib +, darwin +, fetchCrate +, openssl +, pkg-config +, makeRustPlatform +, stdenv +, rust-bin +}: +let + rustVersion = "1.76.0"; + rustPlatform = makeRustPlatform { + cargo = rust-bin.stable.${rustVersion}.default; + rustc = rust-bin.stable.${rustVersion}.default; + }; + generic = + { version + , hash + , cargoHash + }: + rustPlatform.buildRustPackage rec { + pname = "cargo-pgrx"; + inherit version; + src = fetchCrate { + inherit version pname hash; + }; + inherit cargoHash; + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + ]; + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + openssl + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.Security + ]; + + OPENSSL_DIR = "${openssl.dev}"; + OPENSSL_INCLUDE_DIR = "${openssl.dev}/include"; + OPENSSL_LIB_DIR = "${openssl.out}/lib"; + PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + preCheck = '' + export PGRX_HOME=$(mktemp -d) + ''; + checkFlags = [ + # requires pgrx to be properly initialized with cargo pgrx init + "--skip=command::schema::tests::test_parse_managed_postmasters" + ]; + meta = with lib; { + description = "Build Postgres Extensions with Rust"; + homepage = "https://github.com/pgcentralfoundation/pgrx"; + changelog = "https://github.com/pgcentralfoundation/pgrx/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ happysalada ]; + mainProgram = "cargo-pgrx"; + }; + }; +in +{ + cargo-pgrx_0_11_3 = generic { + version = "0.11.3"; + hash = "sha256-UHIfwOdXoJvR4Svha6ud0FxahP1wPwUtviUwUnTmLXU="; + cargoHash = "sha256-j4HnD8Zt9uhlV5N7ldIy9564o9qFEqs5KfXHmnQ1WEw="; + }; + cargo-pgrx_0_12_6 = generic { + version = "0.12.6"; + hash = "sha256-7aQkrApALZe6EoQGVShGBj0UIATnfOy2DytFj9IWdEA="; + cargoHash = "sha256-Di4UldQwAt3xVyvgQT1gUhdvYUVp7n/a72pnX45kP0w="; + }; + inherit rustPlatform; +} diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index 08451e3cd..1a900a821 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -1,5 +1,8 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo }: - +{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo, rust-bin }: +let + rustVersion = "1.76.0"; + cargo = rust-bin.stable.${rustVersion}.default; +in buildPgrxExtension_0_11_3 rec { pname = "pg_graphql"; version = "1.5.7"; diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix index 6606d3aaa..f79efcd95 100644 --- a/nix/ext/pg_jsonschema.nix +++ b/nix/ext/pg_jsonschema.nix @@ -1,5 +1,8 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo }: - +{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo, rust-bin }: +let + rustVersion = "1.76.0"; + cargo = rust-bin.stable.${rustVersion}.default; +in buildPgrxExtension_0_11_3 rec { pname = "pg_jsonschema"; version = "0.3.1"; diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 98d6a7cbc..d44af6b50 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -8,8 +8,12 @@ , cargo , darwin , jq +, rust-bin }: - +let + rustVersion = "1.76.0"; + cargo = rust-bin.stable.${rustVersion}.default; +in buildPgrxExtension_0_11_3 rec { pname = "supabase-wrappers"; version = "0.4.2"; From d7902e50b24ec04705d9822e4cc3b88cba78d500 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Thu, 24 Oct 2024 12:05:53 +1100 Subject: [PATCH 026/271] chore: bump wrappers to v0.4.3 (#1286) * chore: bump wrappers to v0.4.3 * fix: pkg changes for wrappers using cargo-pgrx 0.12.6 (#1288) * fix: pkg changes for wrappers using cargo-pgrx 0.12.6 * chore: cleanup --------- Co-authored-by: Sam Rose --------- Co-authored-by: samrose Co-authored-by: Sam Rose --- ansible/vars.yml | 2 +- nix/ext/wrappers/default.nix | 32 +++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 9564c043e..129e1a238 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -141,7 +141,7 @@ groonga_release_checksum: sha256:1c2d1a6981c1ad3f02a11aff202b15ba30cb1c6147f1fa9 pgroonga_release: "3.0.7" pgroonga_release_checksum: sha256:885ff3878cc30e9030e5fc56d561bc8b66df3ede1562c9d802bc0ea04fe5c203 -wrappers_release: "0.4.2" +wrappers_release: "0.4.3" hypopg_release: "1.4.1" hypopg_release_checksum: sha256:9afe6357fd389d8d33fad81703038ce520b09275ec00153c6c89282bcdedd6bc diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index d44af6b50..74b94f9f9 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -4,46 +4,56 @@ , openssl , pkg-config , postgresql -, buildPgrxExtension_0_11_3 +, buildPgrxExtension_0_12_6 , cargo , darwin , jq , rust-bin }: let - rustVersion = "1.76.0"; + rustVersion = "1.80.0"; cargo = rust-bin.stable.${rustVersion}.default; in -buildPgrxExtension_0_11_3 rec { +buildPgrxExtension_0_12_6 rec { pname = "supabase-wrappers"; - version = "0.4.2"; + version = "0.4.3"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = ["0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; rev = "v${version}"; - hash = "sha256-ut3IQED6ANXgabiHoEUdfSrwkuuYYSpRoeWdtBvSe64="; + hash = "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA="; }; + nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl ] ++ lib.optionals (stdenv.isDarwin) [ + buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration ]; + + NIX_LDFLAGS = "-L${postgresql}/lib -lpq"; + + # Set necessary environment variables for pgrx + env = lib.optionalAttrs stdenv.isDarwin { + POSTGRES_LIB = "${postgresql}/lib"; + RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; + PGPORT = "5435"; + }; + OPENSSL_NO_VENDOR = 1; #need to set this to 2 to avoid cpu starvation CARGO_BUILD_JOBS = "2"; CARGO="${cargo}/bin/cargo"; + cargoLock = { lockFile = "${src}/Cargo.lock"; - outputHashes = { - "clickhouse-rs-1.0.0-alpha.1" = "sha256-0zmoUo/GLyCKDLkpBsnLAyGs1xz6cubJhn+eVqMEMaw="; - }; + allowBuiltinFetchGit = true; }; - postPatch = "cp ${cargoLock.lockFile} Cargo.lock"; + buildAndTestSubdir = "wrappers"; buildFeatures = [ "helloworld_fdw" From 7db7e1a9e34b9ffb9b0e3372ccf08eb4fa772f4b Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 23 Oct 2024 23:34:36 -0400 Subject: [PATCH 027/271] feat: tmp disable pg_net on macos and allow for server start on macos (#1289) Co-authored-by: Sam Rose --- flake.nix | 13 ++++++++++--- nix/tools/run-server.sh.in | 7 +++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 1cef2669c..3014f9032 100644 --- a/flake.nix +++ b/flake.nix @@ -128,7 +128,8 @@ # use, but even if they did, keeping our own copies means that we can # rollout new versions of these critical things easier without having to # go through the upstream release engineering process. - ourExtensions = [ + ourExtensions = let + baseExtensions = [ ./nix/ext/rum.nix ./nix/ext/timescaledb.nix ./nix/ext/pgroonga.nix @@ -147,7 +148,6 @@ ./nix/ext/pg_cron.nix ./nix/ext/pgsql-http.nix ./nix/ext/pg_plan_filter.nix - ./nix/ext/pg_net.nix ./nix/ext/pg_hashids.nix ./nix/ext/pgsodium.nix ./nix/ext/pg_graphql.nix @@ -162,7 +162,13 @@ ./nix/ext/supautils.nix ./nix/ext/plv8.nix ]; + + # Add pg_net only if NOT on macOS aarch64 + pgNetExtension = if (system == "aarch64-darwin") + then [] + else [ ./nix/ext/pg_net.nix ]; + in baseExtensions ++ pgNetExtension; #Where we import and build the orioledb extension, we add on our custom extensions # plus the orioledb option orioledbExtension = ourExtensions ++ [ ./nix/ext/orioledb.nix ]; @@ -462,7 +468,8 @@ --subst-var-by 'LOCALES' '${localeArchive}' \ --subst-var-by 'EXTENSION_CUSTOM_SCRIPTS_DIR' "$out/extension-custom-scripts" \ --subst-var-by 'MECAB_LIB' '${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so' \ - --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' + --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' chmod +x $out/bin/start-postgres-server ''; diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 977a437fb..2552ebcd6 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -32,12 +32,14 @@ EXTENSION_CUSTOM_SCRIPTS=@EXTENSION_CUSTOM_SCRIPTS_DIR@ GROONGA=@GROONGA_DIR@ DATDIR=$(mktemp -d) LOCALE_ARCHIVE=@LOCALES@ +CURRENT_SYSTEM=@CURRENT_SYSTEM@ export LOCALE_ARCHIVE export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 +echo "Current system is $CURRENT_SYSTEM" mkdir -p "$DATDIR" echo "NOTE: using port $PORTNO for server" echo "NOTE: using temporary directory $DATDIR for data, which will not be removed" @@ -61,5 +63,10 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" +if [ "$CURRENT_SYSTEM" = "aarch64-darwin" ]; then + echo "NOTE: using aarch64-darwin system" + sed -i '' 's/ pg_net,//g' "$DATDIR/postgresql.conf" + sed -i '' 's/ pg_net,//g' "$DATDIR/supautils.conf" +fi export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k /tmp From e109fc6561dea9041778c367f7766533a610f529 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 28 Oct 2024 15:22:39 -0400 Subject: [PATCH 028/271] fix: clickhouse deps needs git on path to install and/or build (#1300) Co-authored-by: Sam Rose --- ansible/tasks/stage2-setup-postgres.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index e22cbe67b..3b8d9ad02 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -3,6 +3,15 @@ # shell: | # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task + +- name: Install Git for Nix package management + become: yes + apt: + name: git + state: present + update_cache: yes + when: stage2_nix + - name: Install Postgres from nix binary cache become: yes shell: | @@ -34,6 +43,14 @@ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix +- name: Install Git for Nix package management + become: yes + apt: + name: git + state: present + update_cache: yes + when: stage2_nix + - name: Set ownership and permissions for /etc/ssl/private become: yes file: From 004595dcedd1506469c494e0335910dfb71aac87 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 29 Oct 2024 00:12:01 -0400 Subject: [PATCH 029/271] fix: needs git in buildInputs too (#1301) * fix: needs git in buildInputs too * fix: git on inputs in func * fix: should be remove git * fix: add git to dockerfile for clickhouse dep * fix: non interactive tzdata * fix: try to make timezone intall noninteractive * fix: cleanup package installs --------- Co-authored-by: Sam Rose --- Dockerfile-15 | 22 ++++++++++++++-------- Dockerfile-16 | 23 ++++++++++++++--------- ansible/tasks/stage2-setup-postgres.yml | 7 ++++--- nix/ext/wrappers/default.nix | 3 ++- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index ce83237f2..01895db39 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -41,14 +41,26 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ + +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - && apt clean + git \ + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -102,12 +114,6 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata - RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/Dockerfile-16 b/Dockerfile-16 index db5772cee..c281ccd7f 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -41,14 +41,25 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - && apt clean + git \ + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -101,13 +112,7 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets - -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata - + RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 3b8d9ad02..4e9003ace 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -43,12 +43,13 @@ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix -- name: Install Git for Nix package management +- name: Remove Git after Nix package installations become: yes apt: name: git - state: present - update_cache: yes + state: absent + autoremove: yes + purge: yes when: stage2_nix - name: Set ownership and permissions for /etc/ssl/private diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 74b94f9f9..df44de35f 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -9,6 +9,7 @@ , darwin , jq , rust-bin +, git }: let rustVersion = "1.80.0"; @@ -29,7 +30,7 @@ buildPgrxExtension_0_12_6 rec { }; nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ + buildInputs = [ openssl postgresql git ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration From 94a17cbecbe112c50cbb0cf1fcc45b68999e39a3 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Thu, 31 Oct 2024 15:25:18 -0500 Subject: [PATCH 030/271] Update saltminion install to use the new package repo location (#1306) * fix suffix parsing for staging releases * update saltminion install to use the new package repo location * test install * revert test config --- ansible/tasks/internal/install-salt.yml | 34 +++++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/ansible/tasks/internal/install-salt.yml b/ansible/tasks/internal/install-salt.yml index 281e370bb..73cd6ee85 100644 --- a/ansible/tasks/internal/install-salt.yml +++ b/ansible/tasks/internal/install-salt.yml @@ -1,29 +1,47 @@ - name: Add apt repository for Saltstack (arm) block: + - name: Ensure /etc/apt/keyrings directory exists + file: + path: /etc/apt/keyrings + state: directory + mode: '0755' + - name: salt gpg key - ansible.builtin.apt_key: - url: https://repo.saltproject.io/salt/py3/ubuntu/20.04/arm64/SALT-PROJECT-GPG-PUBKEY-2023.gpg - keyring: /etc/apt/trusted.gpg.d/salt-archive-keyring-2023-arm.gpg + ansible.builtin.get_url: + url: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public + dest: /etc/apt/keyrings/salt-archive-keyring-2023.pgp + mode: '0644' - name: salt apt repo ansible.builtin.apt_repository: - repo: deb [signed-by=/etc/apt/trusted.gpg.d/salt-archive-keyring-2023-arm.gpg arch=arm64] https://repo.saltproject.io/salt/py3/ubuntu/20.04/arm64/{{ salt_minion_version }} focal main + repo: "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.pgp arch=arm64] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main" + filename: 'salt.list' state: present when: platform == "arm64" - name: Add apt repository for Saltstack (amd) block: + - name: Ensure /etc/apt/keyrings directory exists + file: + path: /etc/apt/keyrings + state: directory + mode: '0755' + - name: salt gpg key - ansible.builtin.apt_key: - url: https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg - keyring: /etc/apt/trusted.gpg.d/salt-archive-keyring-2023-amd.gpg + ansible.builtin.get_url: + url: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public + dest: /etc/apt/keyrings/salt-archive-keyring-2023.pgp + mode: '0644' - name: salt apt repo ansible.builtin.apt_repository: - repo: deb [signed-by=/etc/apt/trusted.gpg.d/salt-archive-keyring-2023-amd.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/{{ salt_minon_version }} focal main + repo: "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.pgp arch=amd64] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main" + filename: 'salt.list' state: present when: platform == "amd64" - name: Salt minion install apt: name: salt-minion + state: present + update_cache: yes From 019fceaba4a4a4b6b8a982526a69436c00308a15 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Fri, 1 Nov 2024 13:14:48 +0100 Subject: [PATCH 031/271] feat: update envoy lds file to strip `sb-opk` header (#1297) --- ansible/files/envoy_config/lds.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ansible/files/envoy_config/lds.yaml b/ansible/files/envoy_config/lds.yaml index f2c719d20..2fc7cae13 100644 --- a/ansible/files/envoy_config/lds.yaml +++ b/ansible/files/envoy_config/lds.yaml @@ -258,6 +258,9 @@ resources: max_program_size: 150 regex: >- /auth/v1/(verify|callback|authorize|sso/saml/(acs|metadata|slo)|\.well-known/(openid-configuration|jwks\.json)) + request_headers_to_remove: + - apikey + - sb-opk route: cluster: gotrue regex_rewrite: @@ -271,6 +274,9 @@ resources: typed_per_filter_config: *ref_0 - match: prefix: /auth/v1/ + request_headers_to_remove: + - apikey + - sb-opk route: cluster: gotrue prefix_rewrite: / @@ -282,6 +288,7 @@ resources: present_match: true request_headers_to_remove: - apikey + - sb-opk route: cluster: postgrest prefix_rewrite: / @@ -295,6 +302,7 @@ resources: prefix: /rest/v1/ request_headers_to_remove: - apikey + - sb-opk route: cluster: postgrest prefix_rewrite: / @@ -311,6 +319,7 @@ resources: present_match: true request_headers_to_remove: - apikey + - sb-opk route: cluster: postgrest_admin prefix_rewrite: / @@ -323,6 +332,7 @@ resources: prefix: /rest-admin/v1/ request_headers_to_remove: - apikey + - sb-opk route: cluster: postgrest_admin prefix_rewrite: / @@ -332,18 +342,25 @@ resources: header: key: Content-Profile value: graphql_public + request_headers_to_remove: + - apikey + - sb-opk route: cluster: postgrest prefix_rewrite: /rpc/graphql timeout: 125s - match: prefix: /admin/v1/ + request_headers_to_remove: + - sb-opk route: cluster: admin_api prefix_rewrite: / timeout: 600s - match: prefix: /customer/v1/privileged/ + request_headers_to_remove: + - sb-opk route: cluster: admin_api prefix_rewrite: /privileged/ @@ -367,6 +384,8 @@ resources: treat_missing_header_as_empty: true - match: prefix: /metrics/aggregated + request_headers_to_remove: + - sb-opk route: cluster: admin_api prefix_rewrite: /supabase-internal/metrics From f28c5d137da0b0c21b8c7aaa631e5861e470801e Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Fri, 1 Nov 2024 11:42:23 -0500 Subject: [PATCH 032/271] pgmq and partman owned by postgres vs supabase_admin (#1299) * remove pgmq and pg_partman (unreleased) until permissions issues resolved * align ext tests * bump 15.8 and 16.3 images w/o pgmq and pg_partman * convert ownership to postgres * minor test bugfix * 15 release only * remove partman * bump version num * align output for removing pg_partman * re-enable partman (not added back into tests yet) * fix suffix parsing for staging releases * remove pg_partman * remove partman from full list * prep for merge * align test output * restore wrappers release --- .github/workflows/ami-release-nix.yml | 2 +- .../files/postgresql_config/supautils.conf.j2 | 5 +- ansible/vars.yml | 4 +- flake.nix | 1 - .../expected/extensions_sql_interface.out | 105 +----------------- nix/tests/expected/pg_partman.out | 104 ----------------- nix/tests/expected/pgmq.out | 22 ++-- nix/tests/prime.sql | 1 - nix/tests/sql/pg_partman.sql | 85 -------------- nix/tests/sql/pgmq.sql | 7 +- 10 files changed, 25 insertions(+), 311 deletions(-) delete mode 100644 nix/tests/expected/pg_partman.out delete mode 100644 nix/tests/sql/pg_partman.sql diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 643f26fc7..3242a4e1d 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -55,7 +55,7 @@ jobs: - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} run: | - SUFFIX=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z $SUFFIX ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index aa01cd8aa..b2112cf98 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -1,9 +1,10 @@ supautils.extensions_parameter_overrides = '{"pg_cron":{"schema":"pg_catalog"}}' supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' -# full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 +# full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 -supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_partman, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pg_prewarm, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgstattuple, pgsodium, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' +# omitted because doesn't require superuser: pgmq +supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' diff --git a/ansible/vars.yml b/ansible/vars.yml index 129e1a238..fbc9bf6ba 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.004" - postgres16: "16.3.1.010" + postgres15: "15.8.1.005" + postgres16: "16.3.1.011" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 3014f9032..857f5d66c 100644 --- a/flake.nix +++ b/flake.nix @@ -151,7 +151,6 @@ ./nix/ext/pg_hashids.nix ./nix/ext/pgsodium.nix ./nix/ext/pg_graphql.nix - ./nix/ext/pg_partman.nix ./nix/ext/pg_stat_monitor.nix ./nix/ext/pg_jsonschema.nix ./nix/ext/pgvector.nix diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index 07c0d6650..fff273a88 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -76,7 +76,6 @@ order by pg_hashids | t pg_jsonschema | f pg_net | f - pg_partman | f pg_prewarm | t pg_repack | f pg_stat_monitor | t @@ -123,7 +122,7 @@ order by vector | t wrappers | f xml2 | f -(83 rows) +(82 rows) /* @@ -163,8 +162,8 @@ order by n.nspname, p.proname, pg_catalog.pg_get_function_identity_arguments(p.oid); - extension_name | schema_name | function_name | argument_types | return_type -------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + extension_name | schema_name | function_name | argument_types | return_type +------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr @@ -1160,45 +1159,6 @@ order by pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | worker_restart | | boolean - pg_partman | public | apply_cluster | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text | void - pg_partman | public | apply_constraints | p_parent_table text, p_child_table text, p_analyze boolean, p_job_id bigint | void - pg_partman | public | apply_privileges | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text, p_job_id bigint | void - pg_partman | public | autovacuum_off | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean - pg_partman | public | autovacuum_reset | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean - pg_partman | public | calculate_time_partition_info | p_time_interval interval, p_start_time timestamp with time zone, p_date_trunc_interval text, OUT base_timestamp timestamp with time zone, OUT datetime_string text | record - pg_partman | public | check_automatic_maintenance_value | p_automatic_maintenance text | boolean - pg_partman | public | check_control_type | p_parent_schema text, p_parent_tablename text, p_control text | TABLE(general_type text, exact_type text) - pg_partman | public | check_default | p_exact_count boolean | SETOF check_default_table - pg_partman | public | check_epoch_type | p_type text | boolean - pg_partman | public | check_name_length | p_object_name text, p_suffix text, p_table_partition boolean | text - pg_partman | public | check_partition_type | p_type text | boolean - pg_partman | public | check_subpart_sameconfig | p_parent_table text | TABLE(sub_control text, sub_partition_interval text, sub_partition_type text, sub_premake integer, sub_automatic_maintenance text, sub_template_table text, sub_retention text, sub_retention_schema text, sub_retention_keep_index boolean, sub_retention_keep_table boolean, sub_epoch text, sub_constraint_cols text[], sub_optimize_constraint integer, sub_infinite_time_partitions boolean, sub_jobmon boolean, sub_inherit_privileges boolean, sub_constraint_valid boolean, sub_date_trunc_interval text, sub_ignore_default_data boolean, sub_default_table boolean, sub_maintenance_order integer, sub_retention_keep_publication boolean) - pg_partman | public | check_subpartition_limits | p_parent_table text, p_type text, OUT sub_min text, OUT sub_max text | record - pg_partman | public | create_parent | p_parent_table text, p_control text, p_interval text, p_type text, p_epoch text, p_premake integer, p_start_partition text, p_default_table boolean, p_automatic_maintenance text, p_constraint_cols text[], p_template_table text, p_jobmon boolean, p_date_trunc_interval text | boolean - pg_partman | public | create_partition_id | p_parent_table text, p_partition_ids bigint[], p_start_partition text | boolean - pg_partman | public | create_partition_time | p_parent_table text, p_partition_times timestamp with time zone[], p_start_partition text | boolean - pg_partman | public | create_sub_parent | p_top_parent text, p_control text, p_interval text, p_type text, p_default_table boolean, p_declarative_check text, p_constraint_cols text[], p_premake integer, p_start_partition text, p_epoch text, p_jobmon boolean, p_date_trunc_interval text | boolean - pg_partman | public | drop_constraints | p_parent_table text, p_child_table text, p_debug boolean | void - pg_partman | public | drop_partition_id | p_parent_table text, p_retention bigint, p_keep_table boolean, p_keep_index boolean, p_retention_schema text | integer - pg_partman | public | drop_partition_time | p_parent_table text, p_retention interval, p_keep_table boolean, p_keep_index boolean, p_retention_schema text, p_reference_timestamp timestamp with time zone | integer - pg_partman | public | dump_partitioned_table_definition | p_parent_table text, p_ignore_template_table boolean | text - pg_partman | public | inherit_replica_identity | p_parent_schemaname text, p_parent_tablename text, p_child_tablename text | void - pg_partman | public | inherit_template_properties | p_parent_table text, p_child_schema text, p_child_tablename text | boolean - pg_partman | public | partition_data_id | p_parent_table text, p_batch_count integer, p_batch_interval bigint, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint - pg_partman | public | partition_data_proc | IN p_parent_table text, IN p_loop_count integer, IN p_interval text, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_order text, IN p_source_table text, IN p_ignored_columns text[], IN p_quiet boolean | - pg_partman | public | partition_data_time | p_parent_table text, p_batch_count integer, p_batch_interval interval, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint - pg_partman | public | partition_gap_fill | p_parent_table text | integer - pg_partman | public | reapply_constraints_proc | IN p_parent_table text, IN p_drop_constraints boolean, IN p_apply_constraints boolean, IN p_wait integer, IN p_dryrun boolean | - pg_partman | public | reapply_privileges | p_parent_table text | void - pg_partman | public | run_analyze | IN p_skip_locked boolean, IN p_quiet boolean, IN p_parent_table text | - pg_partman | public | run_maintenance | p_parent_table text, p_analyze boolean, p_jobmon boolean | void - pg_partman | public | run_maintenance_proc | IN p_wait integer, IN p_analyze boolean, IN p_jobmon boolean | - pg_partman | public | show_partition_info | p_child_table text, p_partition_interval text, p_parent_table text, OUT child_start_time timestamp with time zone, OUT child_end_time timestamp with time zone, OUT child_start_id bigint, OUT child_end_id bigint, OUT suffix text | record - pg_partman | public | show_partition_name | p_parent_table text, p_value text, OUT partition_schema text, OUT partition_table text, OUT suffix_timestamp timestamp with time zone, OUT suffix_id bigint, OUT table_exists boolean | record - pg_partman | public | show_partitions | p_parent_table text, p_order text, p_include_default boolean | TABLE(partition_schemaname text, partition_tablename text) - pg_partman | public | stop_sub_partition | p_parent_table text, p_jobmon boolean | boolean - pg_partman | public | undo_partition | p_parent_table text, p_target_table text, p_loop_count integer, p_batch_interval text, p_keep_table boolean, p_lock_wait numeric, p_ignored_columns text[], p_drop_cascade boolean, OUT partitions_undone integer, OUT rows_undone bigint | record - pg_partman | public | undo_partition_proc | IN p_parent_table text, IN p_target_table text, IN p_loop_count integer, IN p_interval text, IN p_keep_table boolean, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_ignored_columns text[], IN p_drop_cascade boolean, IN p_quiet boolean | pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void pg_prewarm | public | pg_prewarm | regclass, mode text, fork text, first_block bigint, last_block bigint | bigint @@ -5234,7 +5194,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5069 rows) +(5030 rows) /* @@ -5317,61 +5277,6 @@ order by pg_net | net | http_request_queue | method pg_net | net | http_request_queue | timeout_milliseconds pg_net | net | http_request_queue | url - pg_partman | public | part_config | automatic_maintenance - pg_partman | public | part_config | constraint_cols - pg_partman | public | part_config | constraint_valid - pg_partman | public | part_config | control - pg_partman | public | part_config | date_trunc_interval - pg_partman | public | part_config | datetime_string - pg_partman | public | part_config | default_table - pg_partman | public | part_config | epoch - pg_partman | public | part_config | ignore_default_data - pg_partman | public | part_config | infinite_time_partitions - pg_partman | public | part_config | inherit_privileges - pg_partman | public | part_config | jobmon - pg_partman | public | part_config | maintenance_last_run - pg_partman | public | part_config | maintenance_order - pg_partman | public | part_config | optimize_constraint - pg_partman | public | part_config | parent_table - pg_partman | public | part_config | partition_interval - pg_partman | public | part_config | partition_type - pg_partman | public | part_config | premake - pg_partman | public | part_config | retention - pg_partman | public | part_config | retention_keep_index - pg_partman | public | part_config | retention_keep_publication - pg_partman | public | part_config | retention_keep_table - pg_partman | public | part_config | retention_schema - pg_partman | public | part_config | sub_partition_set_full - pg_partman | public | part_config | template_table - pg_partman | public | part_config | undo_in_progress - pg_partman | public | part_config_sub | sub_automatic_maintenance - pg_partman | public | part_config_sub | sub_constraint_cols - pg_partman | public | part_config_sub | sub_constraint_valid - pg_partman | public | part_config_sub | sub_control - pg_partman | public | part_config_sub | sub_date_trunc_interval - pg_partman | public | part_config_sub | sub_default_table - pg_partman | public | part_config_sub | sub_epoch - pg_partman | public | part_config_sub | sub_ignore_default_data - pg_partman | public | part_config_sub | sub_infinite_time_partitions - pg_partman | public | part_config_sub | sub_inherit_privileges - pg_partman | public | part_config_sub | sub_jobmon - pg_partman | public | part_config_sub | sub_maintenance_order - pg_partman | public | part_config_sub | sub_optimize_constraint - pg_partman | public | part_config_sub | sub_parent - pg_partman | public | part_config_sub | sub_partition_interval - pg_partman | public | part_config_sub | sub_partition_type - pg_partman | public | part_config_sub | sub_premake - pg_partman | public | part_config_sub | sub_retention - pg_partman | public | part_config_sub | sub_retention_keep_index - pg_partman | public | part_config_sub | sub_retention_keep_publication - pg_partman | public | part_config_sub | sub_retention_keep_table - pg_partman | public | part_config_sub | sub_retention_schema - pg_partman | public | part_config_sub | sub_template_table - pg_partman | public | table_privs | grantee - pg_partman | public | table_privs | grantor - pg_partman | public | table_privs | privilege_type - pg_partman | public | table_privs | table_name - pg_partman | public | table_privs | table_schema pg_repack | repack | primary_keys | indexrelid pg_repack | repack | primary_keys | indrelid pg_repack | repack | tables | alter_col_storage @@ -6409,5 +6314,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1141 rows) +(1086 rows) diff --git a/nix/tests/expected/pg_partman.out b/nix/tests/expected/pg_partman.out deleted file mode 100644 index 25aa80d2e..000000000 --- a/nix/tests/expected/pg_partman.out +++ /dev/null @@ -1,104 +0,0 @@ -create schema if not exists partman_test; -/* -Simple Time Based: 1 Partition Per Day - -For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. -*/ -create table partman_test.time_taptest_table( - col1 int, - col2 text default 'stuff', - col3 timestamptz not null default now() -) - partition by range (col3); -create index on partman_test.time_tap (col3); -ERROR: relation "partman_test.time_tap" does not exist -/* -Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. - -Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. -*/ -create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); -alter table partman_test.time_taptest_table_template add primary key (col1); -/* -Review tables in the partman_test schema -*/ -select - table_name, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name, - table_type; - table_name | table_type ------------------------------+------------ - time_taptest_table | BASE TABLE - time_taptest_table_template | BASE TABLE -(2 rows) - -select public.create_parent( - p_parent_table := 'partman_test.time_taptest_table', - p_control := 'col3', - p_interval := '1 day', - p_template_table := 'partman_test.time_taptest_table_template' -); - create_parent ---------------- - t -(1 row) - -/* -Review tables in the partman_test schema, which should now include daily partitions -*/ -select - -- dates in partition names are variable, so reduced to the prefix - substring(table_name, 1, 21) as table_prefix, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name; - table_prefix | table_type ------------------------+------------ - time_taptest_table | BASE TABLE - time_taptest_table_de | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_te | BASE TABLE -(12 rows) - -/* -Confirm maintenance proc runs without issue -*/ -call public.run_maintenance_proc(); -/* -Make sure the background worker is NOT enabled. -This is intentional. We document using pg_cron to schedule calls to -public.run_maintenance_proc(). That is consistent with other providers. -*/ -select - application_name -from - pg_stat_activity -where - application_name = 'pg_partman_bgw'; - application_name ------------------- -(0 rows) - --- Cleanup -drop schema partman_test cascade; -NOTICE: drop cascades to 2 other objects -DETAIL: drop cascades to table partman_test.time_taptest_table -drop cascades to table partman_test.time_taptest_table_template diff --git a/nix/tests/expected/pgmq.out b/nix/tests/expected/pgmq.out index b2886d9fa..9fb18191b 100644 --- a/nix/tests/expected/pgmq.out +++ b/nix/tests/expected/pgmq.out @@ -20,18 +20,18 @@ from -- Test queue is not case sensitive select - msg_id, - read_ct, - message + * from pgmq.send( queue_name:='foo', -- note: lowercase useage msg:='{"foo": "bar2"}', delay:=5 ); -ERROR: column "msg_id" does not exist -LINE 2: msg_id, - ^ + send +------ + 2 +(1 row) + select msg_id, read_ct, @@ -65,7 +65,7 @@ select ); archive --------- - f + t (1 row) select @@ -111,17 +111,15 @@ select t (1 row) +/* +-- Disabled until pg_partman goes back into the image select pgmq.create_partitioned( 'my_partitioned_queue', '5 seconds', '10 seconds' ); - create_partitioned --------------------- - -(1 row) - +*/ -- Make sure SQLI enabling characters are blocked select pgmq.create('F--oo'); ERROR: queue name contains invalid characters: $, ;, --, or \' diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 3891817e1..a72f3bf48 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -43,7 +43,6 @@ create extension pg_graphql; create extension pg_freespacemap; create extension pg_hashids; create extension pg_prewarm; -create extension pg_partman; create extension pg_jsonschema; create extension pg_repack; create extension pg_stat_monitor; diff --git a/nix/tests/sql/pg_partman.sql b/nix/tests/sql/pg_partman.sql deleted file mode 100644 index d1fb9f4ba..000000000 --- a/nix/tests/sql/pg_partman.sql +++ /dev/null @@ -1,85 +0,0 @@ -create schema if not exists partman_test; - -/* -Simple Time Based: 1 Partition Per Day - -For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. -*/ - -create table partman_test.time_taptest_table( - col1 int, - col2 text default 'stuff', - col3 timestamptz not null default now() -) - partition by range (col3); - -create index on partman_test.time_tap (col3); - -/* -Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. - -Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. -*/ - -create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); - -alter table partman_test.time_taptest_table_template add primary key (col1); - -/* -Review tables in the partman_test schema -*/ - -select - table_name, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name, - table_type; - - -select public.create_parent( - p_parent_table := 'partman_test.time_taptest_table', - p_control := 'col3', - p_interval := '1 day', - p_template_table := 'partman_test.time_taptest_table_template' -); - -/* -Review tables in the partman_test schema, which should now include daily partitions -*/ - -select - -- dates in partition names are variable, so reduced to the prefix - substring(table_name, 1, 21) as table_prefix, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name; - - -/* -Confirm maintenance proc runs without issue -*/ -call public.run_maintenance_proc(); - -/* -Make sure the background worker is NOT enabled. -This is intentional. We document using pg_cron to schedule calls to -public.run_maintenance_proc(). That is consistent with other providers. -*/ -select - application_name -from - pg_stat_activity -where - application_name = 'pg_partman_bgw'; - --- Cleanup -drop schema partman_test cascade; diff --git a/nix/tests/sql/pgmq.sql b/nix/tests/sql/pgmq.sql index 4d4045484..cd47cc34d 100644 --- a/nix/tests/sql/pgmq.sql +++ b/nix/tests/sql/pgmq.sql @@ -12,9 +12,7 @@ from -- Test queue is not case sensitive select - msg_id, - read_ct, - message + * from pgmq.send( queue_name:='foo', -- note: lowercase useage @@ -71,12 +69,15 @@ select select pgmq.drop_queue('my_queue'); +/* +-- Disabled until pg_partman goes back into the image select pgmq.create_partitioned( 'my_partitioned_queue', '5 seconds', '10 seconds' ); +*/ -- Make sure SQLI enabling characters are blocked From c2c383bcfedf3a7ee90f269d3a1793b273380f83 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Wed, 6 Nov 2024 09:21:38 -0500 Subject: [PATCH 033/271] bump to pg_net 0.13.0 (#1311) * bump to pg_net 0.13.0 This is now compatible with macos, so it also reverts "feat: tmp disable pg_net on macos and allow for server start on macos (#1289) 7db7e1a9e34b9ffb9b0e3372ccf08eb4fa772f4b. - CHANGELOG for v0.12.0: https://github.com/supabase/pg_net/releases/tag/v0.12.0 - CHANGELOG for v0.13.0: https://github.com/supabase/pg_net/releases/tag/v0.13.0 * chore: version bump --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 4 ++-- flake.nix | 13 +++---------- nix/ext/pg_net.nix | 4 ++-- nix/tools/run-server.sh.in | 7 ------- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index fbc9bf6ba..da1b61704 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.005" - postgres16: "16.3.1.011" + postgres15: "15.8.1.006" + postgres16: "16.3.1.012" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 857f5d66c..615df5da5 100644 --- a/flake.nix +++ b/flake.nix @@ -128,8 +128,7 @@ # use, but even if they did, keeping our own copies means that we can # rollout new versions of these critical things easier without having to # go through the upstream release engineering process. - ourExtensions = let - baseExtensions = [ + ourExtensions = [ ./nix/ext/rum.nix ./nix/ext/timescaledb.nix ./nix/ext/pgroonga.nix @@ -148,6 +147,7 @@ ./nix/ext/pg_cron.nix ./nix/ext/pgsql-http.nix ./nix/ext/pg_plan_filter.nix + ./nix/ext/pg_net.nix ./nix/ext/pg_hashids.nix ./nix/ext/pgsodium.nix ./nix/ext/pg_graphql.nix @@ -161,13 +161,7 @@ ./nix/ext/supautils.nix ./nix/ext/plv8.nix ]; - - # Add pg_net only if NOT on macOS aarch64 - pgNetExtension = if (system == "aarch64-darwin") - then [] - else [ ./nix/ext/pg_net.nix ]; - in baseExtensions ++ pgNetExtension; #Where we import and build the orioledb extension, we add on our custom extensions # plus the orioledb option orioledbExtension = ourExtensions ++ [ ./nix/ext/orioledb.nix ]; @@ -467,8 +461,7 @@ --subst-var-by 'LOCALES' '${localeArchive}' \ --subst-var-by 'EXTENSION_CUSTOM_SCRIPTS_DIR' "$out/extension-custom-scripts" \ --subst-var-by 'MECAB_LIB' '${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so' \ - --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' \ - --subst-var-by 'CURRENT_SYSTEM' '${system}' + --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' chmod +x $out/bin/start-postgres-server ''; diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index dc923b9a8..3bf04ff94 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pg_net"; - version = "0.11.0"; + version = "0.13.0"; buildInputs = [ curl postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-XN441jXK1q+I/LZRNwvzbSsebXHgZ8iYsslZvcPFlAs="; + hash = "sha256-FRaTZPCJQPYAFmsJg22hYJJ0+gH1tMdDQoCQgiqEnaA="; }; env.NIX_CFLAGS_COMPILE = "-Wno-error"; diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 2552ebcd6..977a437fb 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -32,14 +32,12 @@ EXTENSION_CUSTOM_SCRIPTS=@EXTENSION_CUSTOM_SCRIPTS_DIR@ GROONGA=@GROONGA_DIR@ DATDIR=$(mktemp -d) LOCALE_ARCHIVE=@LOCALES@ -CURRENT_SYSTEM=@CURRENT_SYSTEM@ export LOCALE_ARCHIVE export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 -echo "Current system is $CURRENT_SYSTEM" mkdir -p "$DATDIR" echo "NOTE: using port $PORTNO for server" echo "NOTE: using temporary directory $DATDIR for data, which will not be removed" @@ -63,10 +61,5 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" -if [ "$CURRENT_SYSTEM" = "aarch64-darwin" ]; then - echo "NOTE: using aarch64-darwin system" - sed -i '' 's/ pg_net,//g' "$DATDIR/postgresql.conf" - sed -i '' 's/ pg_net,//g' "$DATDIR/supautils.conf" -fi export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k /tmp From 9edaf28580348324f8b3b6970b1a31a4f5b7f8ca Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 6 Nov 2024 20:38:55 -0500 Subject: [PATCH 034/271] chore: adding support for x86_64-darwin (#1310) * chore: adding support for x86_64-darwin * fix: handle logic for various darwin platforms * fix: != &&, == || * fix: support system here too * feature: support added for x86_64-darwin * fix: increase timeout so that aws access does not expire * fix: duration was too high * chore: see if 2 hours will work * fix: try more than 2 less than 3 hrs * chore: try a bit lower * chore: bump down lower * chore: set to the apparent max * chore: limit nix build to 15 on x86_64-darwin --------- Co-authored-by: Sam Rose --- .github/workflows/nix-build.yml | 13 ++++++++----- ansible/vars.yml | 4 ++-- docker/nix/build_nix.sh | 18 ++++++++++++------ flake.nix | 1 + nix/ext/plv8.nix | 2 +- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 08c316bce..473579875 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -24,8 +24,10 @@ jobs: arch: arm64 - runner: macos-latest arch: arm64 + - runner: macos-13 + arch: amd64 runs-on: ${{ matrix.runner }} - + timeout-minutes: 180 steps: - name: Check out code @@ -40,6 +42,7 @@ jobs: role-to-assume: ${{ secrets.DEV_AWS_ROLE }} aws-region: "us-east-1" output-credentials: true + role-duration-seconds: 7200 - name: write secret key # use python so we don't interpolate the secret into the workflow logs, in case of bugs run: | @@ -47,23 +50,23 @@ jobs: env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - name: Log in to Docker Hub - if: matrix.runner != 'macos-latest' + if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build psql bundle with nix - if: matrix.runner != 'macos-latest' + if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' run: docker build -t base_nix -f docker/nix/Dockerfile . - name: Run build psql bundle - if: matrix.runner != 'macos-latest' + if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' run: | docker run -e AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }} \ -e AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }} \ -e AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }} \ base_nix bash -c "./workspace/docker/nix/build_nix.sh" - name: Build psql bundle on macos - if: matrix.runner == 'macos-latest' + if: matrix.runner == 'macos-latest' || matrix.runner == 'macos-13' run: | curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ diff --git a/ansible/vars.yml b/ansible/vars.yml index da1b61704..1017ef18c 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.006" - postgres16: "16.3.1.012" + postgres15: "15.8.1.007" + postgres16: "16.3.1.013" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index 3cf8505c0..5a7896a46 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -5,9 +5,15 @@ nix --version if [ -d "/workspace" ]; then cd /workspace fi -nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link -nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link -nix build .#psql_15/bin -o psql_15 -nix build .#psql_16/bin -o psql_16 -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_16 +if [ $(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') == "x86_64-darwin" ]; then + nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link + nix build .#psql_15/bin -o psql_15 + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 +else + nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link + nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link + nix build .#psql_15/bin -o psql_15 + nix build .#psql_16/bin -o psql_16 + 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_16 +fi diff --git a/flake.nix b/flake.nix index 615df5da5..f1cff1abd 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ system.x86_64-linux system.aarch64-linux system.aarch64-darwin + system.x86_64-darwin ]; in flake-utils.lib.eachSystem ourSystems (system: diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index 785f5e601..a331a1127 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -120,7 +120,7 @@ stdenv.mkDerivation (finalAttrs: { description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; homepage = "https://plv8.github.io/"; maintainers = with maintainers; [ samrose ]; - platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; + platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; license = licenses.postgresql; }; }) From f5cbb070f29ad9f6ebc1ee728c0b42675537c1dd Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Thu, 7 Nov 2024 17:53:17 +0100 Subject: [PATCH 035/271] pg_repack 1.5.2: Allow to run pg_repack by non-superuser (#1314) New version allows to run pg_repack by a non-superuser. PR on pg_repack repo: https://github.com/reorg/pg_repack/pull/431 --- ansible/vars.yml | 4 ++-- nix/ext/pg_repack.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 1017ef18c..747cfd2ff 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.007" - postgres16: "16.3.1.013" + postgres15: "15.8.1.008" + postgres16: "16.3.1.014" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/pg_repack.nix b/nix/ext/pg_repack.nix index f3247378a..fac666149 100644 --- a/nix/ext/pg_repack.nix +++ b/nix/ext/pg_repack.nix @@ -11,15 +11,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "pg_repack"; - version = "1.5.0"; + version = "1.5.2"; buildInputs = postgresql.buildInputs ++ [ postgresql ]; src = fetchFromGitHub { owner = "reorg"; repo = "pg_repack"; - rev = "ver_${finalAttrs.version}"; - hash = "sha256-do80phyMxwcRIkYyUt9z02z7byNQhK+pbSaCUmzG+4c="; + rev = "85b64c6d4f599b2988343c4e7121acab505c9006"; + hash = "sha256-lAuLI+vupusvn3uTzQ9OaLqkEfUVMCAwU9R70tTbb8Y="; }; installPhase = '' From 4a1d4726d52c8670e2d3c35a91626c58b957d81a Mon Sep 17 00:00:00 2001 From: Pavel Borisov <63344111+pashkinelfe@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:56:16 +0400 Subject: [PATCH 036/271] Upgrade pgvector to 0.8.0 (#1317) * Upgrade pgvector to 0.8.0 * Upgrade extensions_sql_interface.out for pgvector 0.8.0 * Bump AMI version in vars.yml --- ansible/vars.yml | 8 ++++---- nix/ext/pgvector.nix | 4 ++-- nix/tests/expected/extensions_sql_interface.out | 6 +++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 747cfd2ff..555887b62 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.008" - postgres16: "16.3.1.014" + postgres15: "15.8.1.010" + postgres16: "16.3.1.016" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -149,8 +149,8 @@ hypopg_release_checksum: sha256:9afe6357fd389d8d33fad81703038ce520b09275ec00153c pg_repack_release: "1.5.0" pg_repack_release_checksum: sha256:9a14d6a95bfa29f856aa10538238622c1f351d38eb350b196c06720a878ccc52 -pgvector_release: "0.7.4" -pgvector_release_checksum: sha256:0341edf89b1924ae0d552f617e14fb7f8867c0194ed775bcc44fa40288642583 +pgvector_release: "0.8.0" +pgvector_release_checksum: sha256:867a2c328d4928a5a9d6f052cd3bc78c7d60228a9b914ad32aa3db88e9de27b0 pg_tle_release: "1.3.2" pg_tle_release_checksum: sha256:d04f72d88b21b954656609743560684ac42645b64a36c800d4d2f84d1f180de1 diff --git a/nix/ext/pgvector.nix b/nix/ext/pgvector.nix index aefeeea3a..a7d58ec61 100644 --- a/nix/ext/pgvector.nix +++ b/nix/ext/pgvector.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pgvector"; - version = "0.7.4"; + version = "0.8.0"; buildInputs = [ postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "pgvector"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-qwPaguQUdDHV8q6GDneLq5MuhVroPizpbqt7f08gKJI="; + hash = "sha256-JsZV+I4eRMypXTjGmjCtMBXDVpqTIPHQa28ogXncE/Q="; }; installPhase = '' diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index fff273a88..9097efd94 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -5032,6 +5032,10 @@ order by vector | public | array_to_halfvec | integer[], integer, boolean | halfvec vector | public | array_to_halfvec | numeric[], integer, boolean | halfvec vector | public | array_to_halfvec | real[], integer, boolean | halfvec + vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | integer[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | numeric[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec vector | public | array_to_vector | double precision[], integer, boolean | vector vector | public | array_to_vector | integer[], integer, boolean | vector vector | public | array_to_vector | numeric[], integer, boolean | vector @@ -5194,7 +5198,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5030 rows) +(5034 rows) /* From ffa1052400519bce6447df5c19616e71f801448e Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Thu, 14 Nov 2024 11:45:52 +0200 Subject: [PATCH 037/271] chore: merge `release/15.6` changes into `develop` (#1320) * fix: account for `public` grantee * fix(ci): respect postgresVersion input (#1237) * feat: bump gotrue version to v2.162.0 (#1241) * fix: only grant pg_read_all_data if it exists (#1242) * fix: only grant pg_read_all_data if it exists * fix: prevent `public` from being casted into `regrole` * fix(15.6): account for pg_stat_monitor major version upgrade (#1247) * chore: release updates to run physical backup as a service to 15.6 image (#1248) * chore: updates to run physical backups as a service (#1235) * chore: init commence-backup service * chore: bump adminapi and adminmgr * chore: bump version * fix: provide correct filename * chore: bump postgres version * fix(15.6/pg_upgrade): retry commands within the cleanup step; wait until PG is ready to accept connections (#1250) * fix(15.6/upgrades): collision when patching wrappers lib locations for upgrades (#1252) * feat: bump auth 2.162.1 on 15.6 (#1256) * fix(15.6): disable pg_stat_monitor (#1260) * fix: disable pg_stat_monitor * chore: bump version * fix(15.6): disable pg_stat_monitor (#1262) * fix: disable pg_stat_monitor * chore: bump version * feat: bump gotrue to v2.162.2 (#1264) * chore: add timescaledb 2.9.1; wrappers upgrade fix; wrappers & plv8 naming fix (#1259) Co-authored-by: Bobbie Soedirgo Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Co-authored-by: Kang Ming Co-authored-by: Stojan Dimitrovski Co-authored-by: Sam Rose fix(ci): respect postgresVersion input (#1237) fix: only grant pg_read_all_data if it exists (#1242) fix(15.6): disable pg_stat_monitor (#1260) * chore(15.6): bump pg version (#1273) * feat: bump auth to v2.163.0 on 15.6 (#1275) * fix: restart PG during pre-upgrade steps to shed hanging connections (#1271) * fix(upgrades): wrappers 4.2.0 -> wrappers 4.2.0 (#1278) * fix: handle supabase_admin authenticator membership snowflake * feat: add auth v2.163.1 to 15.6 (#1283) * feat: bump gotrue to v2.163.2 (#1287) * pg_net 0.11 on 15.6 release branch (#1290) * bump pg_net to 0.11.0 * bump image to 15.6.1.135 * fix: don't copy custom extension scripts during pg_upgrade (#1291) * fix: add recursive flag to custom extension script directory delete (#1292) * [GEN-11027] chore: reserve a fixed amount of blocks for the data volume; remove ansible pkg + ppa (#1295) * fix: grant predefined roles post-upgrade * fix: add more roles to reserved_roles & reserved_memberships (#1303) * fix: add more roles to reserved_roles & reserved_memberships * Update common-nix.vars.pkr.hcl * feat: update envoy lds config with auth jwks, oidc URLs, strip `sb-opk` header (#1296) * chore: udpate package repo for salt (#1307) * fix: use sudo for apt-get commands * Update pg net to 0.13.0 on pg 15.6 branch (#1315) * upgrade pg_net to 0.13.0 on 15.6 * bump postgres-version * chore: cleanup pgbouncer.get_auth ownership accordingly * chore: standardize * feat: filter timescaledb to only be included on v15 (#1321) * feat: filter timescaledb to only be included on v15 * chore: shuffle a bit to match what is needed for various versions * chore: small fixes on sb wrappers and plv8 to merge in all needed install function --------- Co-authored-by: Bobbie Soedirgo Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Co-authored-by: Kang Ming Co-authored-by: angelico Co-authored-by: Stojan Dimitrovski Co-authored-by: Sam Rose Co-authored-by: Oliver Rice --- .../publish-nix-pgupgrade-scripts.yml | 3 + .../pg_upgrade_scripts/common.sh | 12 +++ .../pg_upgrade_scripts/complete.sh | 3 + .../pg_upgrade_scripts/initiate.sh | 81 ++++++------------- .../files/postgresql_config/supautils.conf.j2 | 4 +- ansible/vars.yml | 4 +- .../scripts/surrogate-bootstrap-nix.sh | 5 ++ flake.nix | 12 ++- nix/ext/plv8.nix | 42 +++++++--- nix/ext/timescaledb-2.9.1.nix | 51 ++++++++++++ nix/ext/wrappers/default.nix | 65 ++++++++++----- scripts/90-cleanup.sh | 5 +- scripts/nix-provision.sh | 6 +- 13 files changed, 200 insertions(+), 93 deletions(-) create mode 100644 nix/ext/timescaledb-2.9.1.nix diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 176f57a03..6fb7f1830 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -101,6 +101,9 @@ jobs: run: | VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + if [[ "${{ inputs.postgresVersion }}" != "" ]]; then + VERSION=${{ inputs.postgresVersion }} + fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Create a tarball containing pg_upgrade scripts 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 a11f8ff32..ea7217fcc 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -91,12 +91,24 @@ swap_postgres_and_supabase_admin() { alter database postgres connection limit 0; select pg_terminate_backend(pid) from pg_stat_activity where backend_type = 'client backend' and pid != pg_backend_pid(); EOSQL + + if [ -z "$IS_CI" ]; then + retry 5 systemctl restart postgresql + else + CI_start_postgres "" + fi + + retry 8 pg_isready -h localhost -U supabase_admin + run_sql <<'EOSQL' set statement_timeout = '600s'; begin; create role supabase_tmp superuser; set session authorization supabase_tmp; +-- to handle snowflakes that happened in the past +revoke supabase_admin from authenticator; + do $$ begin if exists (select from pg_extension where extname = 'timescaledb') then diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index d19b72422..c8542c685 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -78,6 +78,9 @@ EOF run_sql -c "$RECREATE_PG_CRON_QUERY" fi + + # #incident-2024-09-12-project-upgrades-are-temporarily-disabled + run_sql -c "grant pg_read_all_data, pg_signal_backend to postgres" } function complete_pg_upgrade { diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 235b4f4c1..88518766b 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -39,6 +39,7 @@ MOUNT_POINT="/data_migration" LOG_FILE="/var/log/pg-upgrade-initiate.log" POST_UPGRADE_EXTENSION_SCRIPT="/tmp/pg_upgrade/pg_upgrade_extensions.sql" +POST_UPGRADE_POSTGRES_PERMS_SCRIPT="/tmp/pg_upgrade/pg_upgrade_postgres_perms.sql" OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;") SERVER_LC_COLLATE=$(run_sql -A -t -c "SHOW lc_collate;") @@ -47,7 +48,6 @@ SERVER_ENCODING=$(run_sql -A -t -c "SHOW server_encoding;") POSTGRES_CONFIG_PATH="/etc/postgresql/postgresql.conf" PGBINOLD="/usr/lib/postgresql/bin" -PGLIBOLD="/usr/lib/postgresql/lib" PG_UPGRADE_BIN_DIR="/tmp/pg_upgrade_bin/$PGVERSION" NIX_INSTALLER_PATH="/tmp/persistent/nix-installer" @@ -133,6 +133,22 @@ cleanup() { echo "Resetting postgres database connection limit" retry 5 run_sql -c "ALTER DATABASE postgres CONNECTION LIMIT -1;" + echo "Making sure postgres still has access to pg_shadow" + cat << EOF >> $POST_UPGRADE_POSTGRES_PERMS_SCRIPT +DO \$\$ +begin + if exists (select from pg_authid where rolname = 'pg_read_all_data') then + execute('grant pg_read_all_data to postgres'); + end if; +end +\$\$; +grant pg_signal_backend to postgres; +EOF + + if [ -f $POST_UPGRADE_POSTGRES_PERMS_SCRIPT ]; then + retry 5 run_sql -f $POST_UPGRADE_POSTGRES_PERMS_SCRIPT + fi + if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then echo "Unmounting data disk from ${MOUNT_POINT}" retry 3 umount $MOUNT_POINT @@ -148,6 +164,14 @@ cleanup() { } function handle_extensions { + if [ -z "$IS_CI" ]; then + retry 5 systemctl restart postgresql + else + CI_start_postgres + fi + + retry 8 pg_isready -h localhost -U supabase_admin + rm -f $POST_UPGRADE_EXTENSION_SCRIPT touch $POST_UPGRADE_EXTENSION_SCRIPT @@ -181,58 +205,6 @@ EOF done } -function patch_wrappers { - local IS_NIX_UPGRADE=$1 - - WRAPPERS_ENABLED=$(run_sql -A -t -c "SELECT EXISTS(SELECT 1 FROM pg_extension WHERE extname = 'wrappers');") - if [ "$WRAPPERS_ENABLED" = "f" ]; then - echo "Wrappers extension not enabled. Skipping." - return - fi - - # This is a workaround for older versions of wrappers which don't have the expected - # naming scheme, containing the version in their library's file name - # e.g. wrappers-0.1.16.so, rather than wrappers.so - # pg_upgrade errors out when it doesn't find an equivalent file in the new PG version's - # library directory, so we're making sure the new version has the expected (old version's) - # file name. - # After the upgrade completes, the new version's library file is used. - # i.e. - # - old version: wrappers-0.1.16.so - # - new version: wrappers-0.1.18.so - # - workaround to make pg_upgrade happy: copy wrappers-0.1.18.so to wrappers-0.1.16.so - if [ "$IS_NIX_UPGRADE" = "true" ]; then - if [ -d "$PGLIBOLD" ]; then - OLD_WRAPPER_LIB_PATH=$(find "$PGLIBOLD" -name "wrappers*so" -print -quit) - OLD_LIB_FILE_NAME=$(basename "$OLD_WRAPPER_LIB_PATH") - - find /nix/store/ -name "wrappers*so" -print0 | while read -r -d $'\0' WRAPPERS_LIB_PATH; do - if [ -f "$WRAPPERS_LIB_PATH" ]; then - WRAPPERS_LIB_PATH_DIR=$(dirname "$WRAPPERS_LIB_PATH") - if [ "$WRAPPERS_LIB_PATH" != "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" ]; then - echo "Copying $WRAPPERS_LIB_PATH to $WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" - cp "$WRAPPERS_LIB_PATH" "$WRAPPERS_LIB_PATH_DIR/${OLD_LIB_FILE_NAME}" || true - fi - fi - done - fi - else - if [ -d "$PGLIBOLD" ]; then - WRAPPERS_LIB_PATH=$(find "$PGLIBNEW" -name "wrappers*so" -print -quit) - if [ -f "$WRAPPERS_LIB_PATH" ]; then - OLD_WRAPPER_LIB_PATH=$(find "$PGLIBOLD" -name "wrappers*so" -print -quit) - if [ -f "$OLD_WRAPPER_LIB_PATH" ]; then - LIB_FILE_NAME=$(basename "$OLD_WRAPPER_LIB_PATH") - if [ "$WRAPPERS_LIB_PATH" != "$PGLIBNEW/${LIB_FILE_NAME}" ]; then - echo "Copying $WRAPPERS_LIB_PATH to $PGLIBNEW/${LIB_FILE_NAME}" - cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}" || true - fi - fi - fi - fi - fi -} - function initiate_upgrade { mkdir -p "$MOUNT_POINT" SHARED_PRELOAD_LIBRARIES=$(cat "$POSTGRES_CONFIG_PATH" | grep shared_preload_libraries | sed "s/shared_preload_libraries =\s\{0,1\}'\(.*\)'.*/\1/") @@ -409,8 +381,6 @@ function initiate_upgrade { export LD_LIBRARY_PATH="${PGLIBNEW}" fi - patch_wrappers "$IS_NIX_UPGRADE" - echo "9. Creating new data directory, initializing database" chown -R postgres:postgres "$MOUNT_POINT/" rm -rf "${PGDATANEW:?}/" @@ -473,6 +443,7 @@ EOF cp -R /etc/postgresql-custom/* "$MOUNT_POINT/conf/" # removing supautils config as to allow the latest one provided by the latest image to be used rm -f "$MOUNT_POINT/conf/supautils.conf" || true + rm -rf "$MOUNT_POINT/conf/extension-custom-scripts" || true # removing wal-g config as to allow it to be explicitly enabled on the new instance rm -f "$MOUNT_POINT/conf/wal-g.conf" diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index b2112cf98..086d6df9e 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -9,5 +9,5 @@ supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/ex supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' -supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, authenticator' -supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' +supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' +supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' diff --git a/ansible/vars.yml b/ansible/vars.yml index 555887b62..d059b5f58 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -25,8 +25,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.162.0 -gotrue_release_checksum: sha1:855b23bd002577290c7d42d7042ac0f5316984b1 +gotrue_release: 2.163.2 +gotrue_release_checksum: sha1:31889bc8c498b924c2cb3b6c4084ef6e57ed97c0 aws_cli_release: "2.2.7" diff --git a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh index 45cbc8ac6..3b0bb93c8 100755 --- a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh +++ b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh @@ -110,6 +110,11 @@ function format_and_mount_rootfs { fi mkfs.ext4 /dev/xvdh + + # Explicitly reserving 100MiB worth of blocks for the data volume + RESERVED_DATA_VOLUME_BLOCK_COUNT=$((100 * 1024 * 1024 / 4096)) + tune2fs -r $RESERVED_DATA_VOLUME_BLOCK_COUNT /dev/xvdh + mkdir -p /mnt/data mount -o defaults,discard /dev/xvdh /mnt/data } diff --git a/flake.nix b/flake.nix index f1cff1abd..b66ec3449 100644 --- a/flake.nix +++ b/flake.nix @@ -213,9 +213,15 @@ in map (path: pkgs.callPackage path { inherit postgresql; }) orioledbExtension; makeOurPostgresPkgs = version: - let postgresql = getPostgresqlPackage version; - in map (path: pkgs.callPackage path { inherit postgresql; }) ourExtensions; - + let + postgresql = getPostgresqlPackage version; + extensions = if version == "15" + then ourExtensions ++ [ + ./nix/ext/timescaledb-2.9.1.nix + ] + else ourExtensions; + in + map (path: pkgs.callPackage path { inherit postgresql; }) extensions; # Create an attrset that contains all the extensions included in a server for the orioledb version of postgresql + extension. makeOurOrioleDbPostgresPkgsSet = version: patchedPostgres: (builtins.listToAttrs (map diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index a331a1127..340a07382 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -97,23 +97,43 @@ stdenv.mkDerivation (finalAttrs: { ''} ''; - postInstall = '' + postInstall = '' # Move the redirected to proper directory. # There appear to be no references to the install directories # so changing them does not cause issues. mv "$out/nix/store"/*/* "$out" rmdir "$out/nix/store"/* "$out/nix/store" "$out/nix" - ${lib.optionalString stdenv.isDarwin '' - install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - ''} - - ${lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - ''} + # Handle different PostgreSQL versions + if [ "${lib.versions.major postgresql.version}" = "15" ]; then + mv "$out/lib/plv8-${finalAttrs.version}.so" "$out/lib/plv8.so" + ln -s "$out/lib/plv8.so" "$out/lib/plv8-${finalAttrs.version}.so" + sed -i 's|module_pathname = '"'"'$libdir/plv8-[0-9.]*'"'"'|module_pathname = '"'"'$libdir/plv8'"'"'|' "$out/share/postgresql/extension/plv8.control" + sed -i 's|module_pathname = '"'"'$libdir/plv8-[0-9.]*'"'"'|module_pathname = '"'"'$libdir/plv8'"'"'|' "$out/share/postgresql/extension/plcoffee.control" + sed -i 's|module_pathname = '"'"'$libdir/plv8-[0-9.]*'"'"'|module_pathname = '"'"'$libdir/plv8'"'"'|' "$out/share/postgresql/extension/plls.control" + + ${lib.optionalString stdenv.isDarwin '' + install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8.so + install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8.so + install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so + install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8.so + ''} + + ${lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so + ''} + else + ${lib.optionalString stdenv.isDarwin '' + install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + ''} + + ${lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + ''} + fi ''; meta = with lib; { diff --git a/nix/ext/timescaledb-2.9.1.nix b/nix/ext/timescaledb-2.9.1.nix new file mode 100644 index 000000000..ad955e86f --- /dev/null +++ b/nix/ext/timescaledb-2.9.1.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }: + +stdenv.mkDerivation rec { + pname = "timescaledb-apache"; + version = "2.9.1"; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ postgresql openssl libkrb5 ]; + + src = fetchFromGitHub { + owner = "timescale"; + repo = "timescaledb"; + rev = version; + hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8="; + }; + + cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" "-DAPACHE_ONLY=1" ] + ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; + + # Fix the install phase which tries to install into the pgsql extension dir, + # and cannot be manually overridden. This is rather fragile but works OK. + postPatch = '' + for x in CMakeLists.txt sql/CMakeLists.txt; do + substituteInPlace "$x" \ + --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" + done + + for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do + substituteInPlace "$x" \ + --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" + done + ''; + + + # timescaledb-2.9.1.so already exists in the lib directory + # we have no need for the timescaledb.so or control file + postInstall = '' + rm $out/lib/timescaledb.so + rm $out/share/postgresql/extension/timescaledb.control + ''; + + meta = with lib; { + description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; + homepage = "https://www.timescale.com/"; + changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; + maintainers = with maintainers; [ samrose ]; + platforms = postgresql.meta.platforms; + license = licenses.asl20; + broken = versionOlder postgresql.version "13"; + }; +} diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index df44de35f..85e00aff3 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -78,24 +78,53 @@ buildPgrxExtension_0_12_6 rec { echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt ''; - postInstall = '' - echo "Creating SQL files for previous versions..." - current_version="${version}" - sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql" - - if [ -f "$sql_file" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql" - echo "Creating $new_file" - cp "$sql_file" "$new_file" - fi - done < git_tags.txt - else - echo "Warning: $sql_file not found" - fi - rm git_tags.txt - ''; + postInstall = '' + echo "Modifying main SQL file to use unversioned library name..." + current_version="${version}" + main_sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql" + if [ -f "$main_sql_file" ]; then + sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$main_sql_file" + echo "Modified $main_sql_file" + else + echo "Warning: $main_sql_file not found" + fi + echo "Creating and modifying SQL files for previous versions..." + + if [ -f "$main_sql_file" ]; then + while read -r previous_version; do + if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then + new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql" + echo "Creating $new_file" + cp "$main_sql_file" "$new_file" + sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$new_file" + echo "Modified $new_file" + fi + done < git_tags.txt + else + echo "Warning: $main_sql_file not found" + fi + mv $out/lib/wrappers-${version}${postgresql.dlSuffix} $out/lib/wrappers${postgresql.dlSuffix} + ln -s $out/lib/wrappers${postgresql.dlSuffix} $out/lib/wrappers-${version}${postgresql.dlSuffix} + + echo "Creating wrappers.so symlinks to support pg_upgrade..." + if [ -f "$out/lib/wrappers.so" ]; then + while read -r previous_version; do + if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then + new_file="$out/lib/wrappers-$previous_version.so" + echo "Creating $new_file" + ln -s "$out/lib/wrappers.so" "$new_file" + fi + done < git_tags.txt + else + echo "Warning: $out/lib/wrappers.so not found" + fi + + rm git_tags.txt + echo "Contents of updated wrappers.control:" + cat "$out/share/postgresql/extension/wrappers.control" + echo "List of generated SQL files:" + ls -l $out/share/postgresql/extension/wrappers--*.sql + ''; meta = with lib; { description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; diff --git a/scripts/90-cleanup.sh b/scripts/90-cleanup.sh index ebbf49080..f2e19686d 100644 --- a/scripts/90-cleanup.sh +++ b/scripts/90-cleanup.sh @@ -36,7 +36,10 @@ elif [ -n "$(command -v apt-get)" ]; then libicu-dev \ libcgal-dev \ libgcc-9-dev \ - libgcc-8-dev + libgcc-8-dev \ + ansible + + add-apt-repository --yes --remove ppa:ansible/ansible source /etc/os-release apt-get -y remove --purge linux-headers-5.11.0-1021-aws diff --git a/scripts/nix-provision.sh b/scripts/nix-provision.sh index c4776b3a8..a2cda7ffd 100644 --- a/scripts/nix-provision.sh +++ b/scripts/nix-provision.sh @@ -45,8 +45,12 @@ EOF $ARGS } +function cleanup_packages { + sudo apt-get -y remove --purge ansible + sudo add-apt-repository --yes --remove ppa:ansible/ansible +} install_packages install_nix execute_stage2_playbook - +cleanup_packages From dd307fb2cad5d6101331f6d0b2bfc3389287a5f1 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Wed, 20 Nov 2024 14:49:06 +0100 Subject: [PATCH 038/271] feat: separate envoy lds configs for self-hosting and supabase use-cases (#1325) * feat: separate envoy lds configs for self-hosting and supabase use-cases * feat: add origin protection key enforcement for envoy in `lds.supabase.yaml` --- .github/workflows/dockerhub-release-aio.yml | 1 + ansible/files/envoy_config/lds.supabase.yaml | 436 +++++++++++++++++++ ansible/tasks/setup-supabase-internal.yml | 3 + ansible/vars.yml | 4 +- docker/all-in-one/Dockerfile | 3 + 5 files changed, 445 insertions(+), 2 deletions(-) create mode 100644 ansible/files/envoy_config/lds.supabase.yaml diff --git a/.github/workflows/dockerhub-release-aio.yml b/.github/workflows/dockerhub-release-aio.yml index e5a5a8251..ce0efb597 100644 --- a/.github/workflows/dockerhub-release-aio.yml +++ b/.github/workflows/dockerhub-release-aio.yml @@ -74,6 +74,7 @@ jobs: push: true build-args: | postgres_version=${{ needs.settings.outputs.base_docker_version }} + envoy_lds=lds.supabase.yaml ${{ needs.settings.outputs.build_args }} target: production tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} diff --git a/ansible/files/envoy_config/lds.supabase.yaml b/ansible/files/envoy_config/lds.supabase.yaml new file mode 100644 index 000000000..2fc7cae13 --- /dev/null +++ b/ansible/files/envoy_config/lds.supabase.yaml @@ -0,0 +1,436 @@ +resources: + - '@type': type.googleapis.com/envoy.config.listener.v3.Listener + name: http_listener + address: + socket_address: + address: '::' + port_value: 80 + ipv4_compat: true + filter_chains: + - filters: &ref_1 + - name: envoy.filters.network.http_connection_manager + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager + access_log: + - name: envoy.access_loggers.stdout + filter: + status_code_filter: + comparison: + op: GE + value: + default_value: 400 + runtime_key: unused + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog + generate_request_id: false + http_filters: + - name: envoy.filters.http.cors + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors + - name: envoy.filters.http.rbac + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC + rules: + action: DENY + policies: + api_key_missing: + permissions: + - any: true + principals: + - not_id: + or_ids: + ids: + - header: + name: apikey + present_match: true + - header: + name: ':path' + string_match: + contains: apikey= + api_key_not_valid: + permissions: + - any: true + principals: + - not_id: + or_ids: + ids: + - header: + name: apikey + string_match: + exact: anon_key + - header: + name: apikey + string_match: + exact: service_key + - header: + name: apikey + string_match: + exact: supabase_admin_key + - header: + name: ':path' + string_match: + contains: apikey=anon_key + - header: + name: ':path' + string_match: + contains: apikey=service_key + - header: + name: ':path' + string_match: + contains: apikey=supabase_admin_key + - name: envoy.filters.http.lua + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua + source_codes: + remove_apikey_and_empty_key_query_parameters: + inline_string: |- + function envoy_on_request(request_handle) + local path = request_handle:headers():get(":path") + request_handle + :headers() + :replace(":path", path:gsub("&=[^&]*", ""):gsub("?=[^&]*$", ""):gsub("?=[^&]*&", "?"):gsub("&apikey=[^&]*", ""):gsub("?apikey=[^&]*$", ""):gsub("?apikey=[^&]*&", "?")) + end + remove_empty_key_query_parameters: + inline_string: |- + function envoy_on_request(request_handle) + local path = request_handle:headers():get(":path") + request_handle + :headers() + :replace(":path", path:gsub("&=[^&]*", ""):gsub("?=[^&]*$", ""):gsub("?=[^&]*&", "?")) + end + - name: envoy.filters.http.compressor.brotli + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor + response_direction_config: + common_config: + min_content_length: 100 + content_type: + - application/vnd.pgrst.object+json + - application/vnd.pgrst.array+json + - application/openapi+json + - application/geo+json + - text/csv + - application/vnd.pgrst.plan + - application/vnd.pgrst.object + - application/vnd.pgrst.array + - application/javascript + - application/json + - application/xhtml+xml + - image/svg+xml + - text/css + - text/html + - text/plain + - text/xml + disable_on_etag_header: true + request_direction_config: + common_config: + enabled: + default_value: false + runtime_key: request_compressor_enabled + compressor_library: + name: text_optimized + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.compression.brotli.compressor.v3.Brotli + - name: envoy.filters.http.compressor.gzip + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor + response_direction_config: + common_config: + min_content_length: 100 + content_type: + - application/vnd.pgrst.object+json + - application/vnd.pgrst.array+json + - application/openapi+json + - application/geo+json + - text/csv + - application/vnd.pgrst.plan + - application/vnd.pgrst.object + - application/vnd.pgrst.array + - application/javascript + - application/json + - application/xhtml+xml + - image/svg+xml + - text/css + - text/html + - text/plain + - text/xml + disable_on_etag_header: true + request_direction_config: + common_config: + enabled: + default_value: false + runtime_key: request_compressor_enabled + compressor_library: + name: text_optimized + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.compression.gzip.compressor.v3.Gzip + - name: envoy.filters.http.router + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + dynamic_stats: false + local_reply_config: + mappers: + - filter: + and_filter: + filters: + - status_code_filter: + comparison: + value: + default_value: 403 + runtime_key: unused + - header_filter: + header: + name: ':path' + string_match: + prefix: /customer/v1/privileged/ + status_code: 401 + body: + inline_string: Unauthorized + headers_to_add: + - header: + key: WWW-Authenticate + value: Basic realm="Unknown" + - filter: + and_filter: + filters: + - status_code_filter: + comparison: + value: + default_value: 403 + runtime_key: unused + - header_filter: + header: + name: ':path' + string_match: + prefix: /metrics/aggregated + invert_match: true + status_code: 401 + body_format_override: + json_format: + message: >- + `apikey` request header or query parameter is either + missing or invalid. Double check your Supabase `anon` + or `service_role` API key. + hint: '%RESPONSE_CODE_DETAILS%' + json_format_options: + sort_properties: false + merge_slashes: true + route_config: + name: route_config_0 + virtual_hosts: + - name: virtual_host_0 + domains: + - '*' + typed_per_filter_config: + envoy.filters.http.cors: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.cors.v3.CorsPolicy + allow_origin_string_match: + - safe_regex: + regex: \* + allow_methods: GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS,TRACE,CONNECT + allow_headers: apikey,authorization,x-client-info + max_age: '3600' + routes: + - match: + path: /health + direct_response: + status: 200 + body: + inline_string: Healthy + typed_per_filter_config: &ref_0 + envoy.filters.http.rbac: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBACPerRoute + - match: + safe_regex: + google_re2: + max_program_size: 150 + regex: >- + /auth/v1/(verify|callback|authorize|sso/saml/(acs|metadata|slo)|\.well-known/(openid-configuration|jwks\.json)) + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: gotrue + regex_rewrite: + pattern: + regex: ^/auth/v1 + substitution: '' + retry_policy: + num_retries: 3 + retry_on: 5xx + timeout: 35s + typed_per_filter_config: *ref_0 + - match: + prefix: /auth/v1/ + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: gotrue + prefix_rewrite: / + timeout: 35s + - match: + prefix: /rest/v1/ + query_parameters: + - name: apikey + present_match: true + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: postgrest + prefix_rewrite: / + timeout: 125s + typed_per_filter_config: + envoy.filters.http.lua: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute + name: remove_apikey_and_empty_key_query_parameters + - match: + prefix: /rest/v1/ + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: postgrest + prefix_rewrite: / + timeout: 125s + typed_per_filter_config: + envoy.filters.http.lua: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute + name: remove_empty_key_query_parameters + - match: + prefix: /rest-admin/v1/ + query_parameters: + - name: apikey + present_match: true + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: postgrest_admin + prefix_rewrite: / + typed_per_filter_config: + envoy.filters.http.lua: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute + name: remove_apikey_and_empty_key_query_parameters + - match: + prefix: /rest-admin/v1/ + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: postgrest_admin + prefix_rewrite: / + - match: + path: /graphql/v1 + request_headers_to_add: + header: + key: Content-Profile + value: graphql_public + request_headers_to_remove: + - apikey + - sb-opk + route: + cluster: postgrest + prefix_rewrite: /rpc/graphql + timeout: 125s + - match: + prefix: /admin/v1/ + request_headers_to_remove: + - sb-opk + route: + cluster: admin_api + prefix_rewrite: / + timeout: 600s + - match: + prefix: /customer/v1/privileged/ + request_headers_to_remove: + - sb-opk + route: + cluster: admin_api + prefix_rewrite: /privileged/ + typed_per_filter_config: + envoy.filters.http.rbac: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBACPerRoute + rbac: + rules: + action: DENY + policies: + basic_auth: + permissions: + - any: true + principals: + - header: + name: authorization + invert_match: true + string_match: + exact: Basic c2VydmljZV9yb2xlOnNlcnZpY2Vfa2V5 + treat_missing_header_as_empty: true + - match: + prefix: /metrics/aggregated + request_headers_to_remove: + - sb-opk + route: + cluster: admin_api + prefix_rewrite: /supabase-internal/metrics + typed_per_filter_config: + envoy.filters.http.rbac: + '@type': >- + type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBACPerRoute + rbac: + rules: + action: DENY + policies: + not_private_ip: + permissions: + - any: true + principals: + - not_id: + direct_remote_ip: + address_prefix: 10.0.0.0 + prefix_len: 8 + include_attempt_count_in_response: true + retry_policy: + num_retries: 5 + retry_back_off: + base_interval: 0.1s + max_interval: 1s + retry_on: gateway-error + stat_prefix: ingress_http + - '@type': type.googleapis.com/envoy.config.listener.v3.Listener + name: https_listener + address: + socket_address: + address: '::' + port_value: 443 + ipv4_compat: true + filter_chains: + - filters: *ref_1 + transport_socket: + name: envoy.transport_sockets.tls + typed_config: + '@type': >- + type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext + common_tls_context: + tls_certificates: + - certificate_chain: + filename: /etc/envoy/fullChain.pem + private_key: + filename: /etc/envoy/privKey.pem + diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index aea3a78c7..37e97dc59 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -114,3 +114,6 @@ import_tasks: internal/install-salt.yml tags: - aws-only + +- name: Envoy - use lds.supabase.yml for /etc/envoy/lds.yaml + command: mv /etc/envoy/lds.supabase.yml /etc/envoy/lds.yaml diff --git a/ansible/vars.yml b/ansible/vars.yml index d059b5f58..26416e8dd 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.010" - postgres16: "16.3.1.016" + postgres15: "15.8.1.011" + postgres16: "16.3.1.017" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/all-in-one/Dockerfile b/docker/all-in-one/Dockerfile index 70082bfb1..d9e5f3fa2 100644 --- a/docker/all-in-one/Dockerfile +++ b/docker/all-in-one/Dockerfile @@ -227,9 +227,12 @@ COPY docker/all-in-one/etc/gotrue.env /etc/gotrue.env # Customizations for envoy ARG envoy_release +ARG envoy_lds="lds.yaml" ADD --chmod=755 --chown=envoy:envoy "https://raw.githubusercontent.com/envoyproxy/envoy/v${envoy_release}/restarter/hot-restarter.py" /opt/envoy-hot-restarter.py COPY --chmod=775 --chown=envoy:envoy ansible/files/envoy_config/ /etc/envoy/ COPY --chmod=755 --chown=envoy:envoy ansible/files/start-envoy.sh /opt/ +RUN mv /etc/envoy/${envoy_lds} /etc/envoy/lds.yaml +RUN rm -f /etc/envoy/lds.supabase.yaml # Customizations for kong COPY docker/all-in-one/etc/kong/kong.conf /etc/kong/kong.conf From 1bc4749b5f2d4c9c52e571604fe6d484157db078 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 20 Nov 2024 13:57:37 -0500 Subject: [PATCH 039/271] fix: just a small typo in file name (#1330) * fix: just a small typo in file name * chore: bump version --- ansible/tasks/setup-supabase-internal.yml | 4 ++-- ansible/vars.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index 37e97dc59..7aa931763 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -115,5 +115,5 @@ tags: - aws-only -- name: Envoy - use lds.supabase.yml for /etc/envoy/lds.yaml - command: mv /etc/envoy/lds.supabase.yml /etc/envoy/lds.yaml +- name: Envoy - use lds.supabase.yaml for /etc/envoy/lds.yaml + command: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml diff --git a/ansible/vars.yml b/ansible/vars.yml index 26416e8dd..1209c29c7 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -11,8 +11,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgres15: "15.8.1.011" - postgres16: "16.3.1.017" + postgres15: "15.8.1.012" + postgres16: "16.3.1.018" # Non Postgres Extensions pgbouncer_release: "1.19.0" From c0a09059aadd0bbee615a7863e88a75f5cc68d31 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 22 Nov 2024 12:15:52 -0500 Subject: [PATCH 040/271] dbmate migration running and testing tool (#1316) * feat: basic running of dbmate migrations from tool * feat: a nix flake app tool to run dbmate migrations and produce schema.slq files * feat: test against schema.sql per mjr vrs + tool to generate * chore: pin at development branch version of tool * docs: update docs with usage info * fix: tmp use this working branch for flakeurl * chore: cleanup of test and dbmage migration tool * chore: build this version * chore: extra-conf * chore: reinstall true * chore: test no longer needs self-hosted runner, can use ephemeral * chore: correct format of runner * chore: not longer need sudo * chore: trying to get the action to use our cache * chore: conf 2nd invocation * chore: rm var * chore: nl * chore: cleanup and remove unnecessary changes * fix: make sure to run sql for pg-stat-extensions and pg-bouncer --- .github/workflows/test.yml | 105 +++----------- .gitignore | 2 + flake.nix | 41 +++++- migrations/README.md | 39 +++++- nix/tools/dbmate-tool.sh.in | 273 ++++++++++++++++++++++++++++++++++++ nix/tools/run-server.sh.in | 1 - 6 files changed, 369 insertions(+), 92 deletions(-) create mode 100644 nix/tools/dbmate-tool.sh.in diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1457eb100..d22b16f16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,10 @@ jobs: uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions @@ -30,9 +34,9 @@ jobs: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: [self-hosted, X64] + - runner: ubuntu-22.04 arch: amd64 - - runner: arm-runner + - runner: ubuntu-22.04 arch: arm64 runs-on: ${{ matrix.runner }} timeout-minutes: 180 @@ -40,9 +44,14 @@ jobs: POSTGRES_PORT: 5478 POSTGRES_PASSWORD: password steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV @@ -54,7 +63,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | - PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file @@ -67,96 +76,16 @@ jobs: - name: Generate args id: args run: | - ARGS=$(sudo nix run nixpkgs#yq -- 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' ansible/vars.yml) + ARGS=$(nix run nixpkgs#yq -- 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' ansible/vars.yml) echo "result<> $GITHUB_OUTPUT echo "$ARGS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/build-push-action@v5 - with: - load: true - context: . - file: Dockerfile-${{ env.PGMAJOR }} - target: production - build-args: | - ${{ steps.args.outputs.result }} - tags: supabase/postgres:${{ steps.settings.outputs.postgres-version }},supabase_postgres - cache-from: | - type=gha,scope=${{ github.ref_name }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }} - type=gha,scope=${{ github.base_ref }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }} - - - name: Start Postgres - run: | - docker run --rm --pull=never \ - -e POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }} \ - -p ${{ env.POSTGRES_PORT }}:5432 \ - --name supabase_postgres \ - -d supabase/postgres:${{ steps.settings.outputs.postgres-version }} - - - name: Install psql - run: | - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - - sudo apt update - sudo apt install -y --no-install-recommends postgresql-client-${{ env.PGMAJOR }} - - - name: Install pg_prove - run: sudo cpan -T TAP::Parser::SourceHandler::pgTAP - env: - SHELL: /bin/bash - - - name: Wait for healthy database - run: | - count=0 - until [ "$(docker inspect -f '{{.State.Health.Status}}' "$container")" == "healthy" ]; do - exit=$? - count=$((count + 1)) - if [ $count -ge "$retries" ]; then - echo "Retry $count/$retries exited $exit, no more retries left." - docker stop -t 2 "$container" - return $exit - fi - sleep 1; - done; - echo "$container container is healthy" - env: - retries: 20 - container: supabase_postgres - - - name: Run tests - run: pg_prove migrations/tests/test.sql - env: - PGHOST: localhost - PGPORT: ${{ env.POSTGRES_PORT }} - PGDATABASE: postgres - PGUSER: supabase_admin - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - - - name: Check migrations are idempotent - run: | - for sql in ./migrations/db/migrations/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -f "$sql" - done - env: - PGHOST: localhost - PGPORT: ${{ env.POSTGRES_PORT }} - PGDATABASE: postgres - PGUSER: supabase_admin - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - - - name: Update Dockerfile.dbmate version - run: | - sed -i 's/%VERSION%/${{ env.PGMAJOR }}/g' migrations/Dockerfile.dbmate - + #TODO PR Convert to develop branch flakeurl - name: verify schema.sql is committed run: | - docker compose -f migrations/docker-compose.yaml up db dbmate --abort-on-container-exit + GIT_SHA=${{github.sha}} + nix run github:supabase/postgres/${GIT_SHA}#dbmate-tool -- --version ${{ env.PGMAJOR }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql diff --git a/.gitignore b/.gitignore index a6950d2ff..ae375b82a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ result* #IDE .idea/ .vscode/ + +db \ No newline at end of file diff --git a/flake.nix b/flake.nix index b66ec3449..71b87d580 100644 --- a/flake.nix +++ b/flake.nix @@ -530,7 +530,7 @@ chmod +x $out/bin/pg-restore ''; sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' - mkdir -p $out/bin + mkdir -p $out/bin substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ @@ -539,8 +539,42 @@ --subst-var-by 'NIX' '${pkgs.nixVersions.nix_2_20}/bin/nix' chmod +x $out/bin/sync-exts-versions ''; + dbmate-tool = + let + migrationsDir = ./migrations/db; + ansibleVars = ./ansible/vars.yml; + pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ./ansible/files/stat_extension.sql; + in + pkgs.runCommand "dbmate-tool" { + buildInputs = with pkgs; [ + overmind + dbmate + nix + jq + yq + ]; + nativeBuildInputs = with pkgs; [ + makeWrapper + ]; + } '' + mkdir -p $out/bin $out/migrations + cp -r ${migrationsDir}/* $out + substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ + --subst-var-by 'MIGRATIONS_DIR' $out \ + --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ + --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/dbmate-tool + wrapProgram $out/bin/dbmate-tool \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} + ''; }; + # Create a testing harness for a PostgreSQL package. This is used for # 'nix flake check', and works with any PostgreSQL package you hand it. makeCheckHarness = pgpkg: @@ -654,9 +688,11 @@ start-server = mkApp "start-server" "start-postgres-server"; start-client = mkApp "start-client" "start-postgres-client"; start-replica = mkApp "start-replica" "start-postgres-replica"; - migration-test = mkApp "migrate-tool" "migrate-postgres"; + migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; pg-restore = mkApp "pg-restore" "pg-restore"; + dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; + migration-unit-tests = mkApp "migration-unit-tests" "migration-unit-tests"; }; # 'devShells.default' lists the set of packages that are included in the @@ -695,6 +731,7 @@ basePackages.start-replica basePackages.migrate-tool basePackages.sync-exts-versions + dbmate ]; shellHook = '' export HISTFILE=.history diff --git a/migrations/README.md b/migrations/README.md index bfd7308d4..19d2bf4b3 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -1,3 +1,36 @@ +# Usage + +from the root of the `supabase/postgres` project, you can run the following commands: + + +```shell +Usage: nix run .#dbmate-tool -- [options] + +Options: + -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all) + -p, --port PORT Specify the port number to use (default: 5435) + -h, --help Show this help message + +Description: + Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions. + NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new ' to create a new migration file. + +Examples: + nix run .#dbmate-tool + nix run .#dbmate-tool -- --version 15 + nix run .#dbmate-tool -- --version 16 --port 5433 + +``` + +This can also be run from a github "flake url" for example: + +```shell +nix run github:supabase/postgres#dbmate-tool -- --version 15 + +or + +nix run github:supabase/postgres/mybranch#dbmate-tool -- --version 15 +``` # supabase/migrations `supabase/migrations` is a consolidation of SQL migrations from: @@ -9,6 +42,8 @@ aiming to provide a single source of truth for migrations on the platform that can be depended upon by those components. For more information on goals see [the RFC](https://www.notion.so/supabase/Centralize-SQL-Migrations-cd3847ae027d4f2bba9defb2cc82f69a) + + ## How it was Created Migrations were pulled (in order) from: @@ -20,10 +55,12 @@ For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that 1. Run all `db/init-scripts` with `postgres` superuser role. 2. Run all `db/migrations` with `supabase_admin` superuser role. -3. Finalize role passwords with `/etc/postgres.schema.sql` if present. +3. Finalize role passwords with `/etc/postgresql.schema.sql` if present. Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/develop/ansible/playbook-docker.yml#L9) image contains several migration scripts to configure default extensions. These are run first by docker entrypoint and included in ami by ansible. + + ## Guidelines - Migrations are append only. Never edit existing migrations once they are on master. diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in new file mode 100644 index 000000000..b7aa0d26e --- /dev/null +++ b/nix/tools/dbmate-tool.sh.in @@ -0,0 +1,273 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +[ ! -z "$DEBUG" ] && set -x + +# Default values +PSQL_VERSION="ALL" +PORTNO="@PGSQL_DEFAULT_PORT@" +PGSQL_SUPERUSER="@PGSQL_SUPERUSER@" +PGPASSWORD="${PGPASSWORD:-postgres}" +PGSQL_USER="postgres" +FLAKE_URL="github:supabase/postgres" +MIGRATIONS_DIR="@MIGRATIONS_DIR@" +CURRENT_SYSTEM="@CURRENT_SYSTEM@" +ANSIBLE_VARS="@ANSIBLE_VARS@" +PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ +STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ +# Cleanup function +cleanup() { + echo "Cleaning up..." + + # Kill overmind processes first + if [ -S "./.overmind.sock" ]; then + overmind kill || true + sleep 2 + fi + + # Kill any remaining postgres processes + echo "Killing any remaining postgres processes..." + pkill -9 postgres || true + pkill -9 -f "tmux.*overmind.*postgresql" || true + + # Extra cleanup for tmux sessions + tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true + + # Remove socket and Procfile + rm -f .overmind.sock Procfile + + # Verify cleanup + remaining=$(ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep || true) + if [ ! -z "$remaining" ]; then + echo "Warning: Some processes might still be running:" + echo "$remaining" + fi +} + +# Set up trap for cleanup on script exit + +# Function to display help +print_help() { + echo "Usage: nix run .#dbmate-tool -- [options]" + echo + echo "Options:" + echo " -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" + echo " -p, --port PORT Specify the port number to use (default: 5435)" + echo " -h, --help Show this help message" + echo + echo "Description:" + echo " Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions." + echo " NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new ' to create a new migration file." + echo + echo "Examples:" + echo " nix run .#dbmate-tool" + echo " nix run .#dbmate-tool -- --version 15" + echo " nix run .#dbmate-tool -- --version 16 --port 5433" +} + + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case "$1" in + -v|--version) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PSQL_VERSION="$2" + shift 2 + else + echo "Error: --version requires an argument (15, 16, or orioledb-17)" + exit 1 + fi + ;; + -u|--user) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PGSQL_USER="$2" + shift 2 + else + echo "Error: --user requires an argument" + exit 1 + fi + ;; + -f|--flake-url) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + FLAKE_URL="$2" + shift 2 + else + echo "Error: --flake-url requires an argument" + exit 1 + fi + ;; + -p|--port) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PORTNO="$2" + shift 2 + else + echo "Error: --port requires an argument" + exit 1 + fi + ;; + -h|--help) + print_help + exit 0 + ;; + *) + echo "Unknown option: $1" + print_help + exit 1 + ;; + esac +done + +# Function to wait for PostgreSQL to be ready +wait_for_postgres() { + local max_attempts=30 # Increased significantly + local attempt=1 + + # Give overmind a moment to actually start the process + sleep 2 + + while [ $attempt -le $max_attempts ]; do + "${PSQLBIN}/pg_isready" -h localhost -p "$PORTNO" -U "$PGSQL_SUPERUSER" -d postgres + local status=$? + + if [ $status -eq 0 ]; then + echo "PostgreSQL is ready!" + return 0 + fi + echo "Waiting for PostgreSQL to start (attempt $attempt/$max_attempts)..." + sleep 2 + attempt=$((attempt + 1)) + done + + echo "PostgreSQL failed to start after $max_attempts attempts" + overmind echo postgres + return 1 +} + +trim_schema() { + case "$CURRENT_SYSTEM" in + "x86_64-darwin"|"aarch64-darwin") + sed -i '' '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql" + echo "Matched: $CURRENT_SYSTEM" + ;; + *) + sed -i '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql" + ;; + esac +} +overmind_start() { + cat > Procfile << EOF +postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" "$PSQL_VERSION" +EOF + overmind start -D + echo "Waiting for overmind socket..." + max_wait=5 + count=0 + while [ $count -lt $max_wait ]; do + if [ -S "./.overmind.sock" ]; then + # Found the socket, give it a moment to be ready + sleep 2 + echo "Socket file found and ready" + break + fi + echo "Waiting for socket file (attempt $count/$max_wait)" + sleep 1 + count=$((count + 1)) + done +} +migrate_version() { + echo "PSQL_VERSION: $PSQL_VERSION" + overmind kill || true + rm -f .overmind.sock Procfile || true + PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"') + echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN" + + # Start overmind + overmind_start + echo "Waiting for overmind socket..." + + + echo "Waiting for PostgreSQL to be ready..." + + #Wait for PostgreSQL to be ready to accept connections + if ! wait_for_postgres; then + echo "Failed to connect to PostgreSQL server" + exit 1 + fi + + echo "PostgreSQL server is ready" + + # Configure PostgreSQL roles and permissions + if ! "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres <<-EOSQL +create role postgres superuser login password '$PGPASSWORD'; +alter database postgres owner to postgres; +EOSQL + then + echo "Failed to configure PostgreSQL roles and permissions" + exit 1 + fi + "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" + "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" + + #set db url to run dbmate + export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" + #export path so dbmate can find correct psql and pg_dump + export PATH="$PSQLBIN:$PATH" + # run init scripts + if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then + echo "Error: Initial migration failed" + exit 1 + fi + + # Password update command + if ! "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then + echo "Error: Failed to update supabase_admin password" + exit 1 + fi + + # Set up database URL + export DATABASE_URL="postgres://$PGSQL_SUPERUSER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" + # Run migrations + if ! dbmate --migrations-dir "$MIGRATIONS_DIR/migrations" up; then + echo "Error: Final migration failed" + exit 1 + fi + + echo "Running dbmate dump with $PSQLBIN" + dbmate dump + + echo "CURRENT_SYSTEM: $CURRENT_SYSTEM" + if [ -f "./db/schema.sql" ]; then + trim_schema + cp "./db/schema.sql" "./migrations/schema-$PSQL_VERSION.sql" + echo "Schema file moved to ./migrations/schema-$PSQL_VERSION.sql" + echo "PSQLBIN is $PSQLBIN" + else + echo "Warning: schema.sql file not found in ./db directory" + exit 1 + fi + + # If we get here, all commands succeeded + echo "PostgreSQL migration completed successfully" + echo "Check migrations are idempotent" + for sql in ./migrations/db/migrations/*.sql; do + echo "$0: running $sql" + "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres -f "$sql" || { + echo "Failed to execute $sql" + exit 1 + } + done +} + +if [ "$PSQL_VERSION" == "all" ]; then + VERSIONS=$(yq '.postgres_major[]' "$ANSIBLE_VARS" | tr -d '"') + echo "$VERSIONS" | while read -r version; do + PSQL_VERSION="$version" + echo "Migrating to PostgreSQL version $PSQL_VERSION" + migrate_version + cleanup + done +else + echo "Migrating to PostgreSQL version $PSQL_VERSION" + migrate_version + cleanup +fi diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 977a437fb..2b079bbf1 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -38,7 +38,6 @@ export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 -mkdir -p "$DATDIR" echo "NOTE: using port $PORTNO for server" echo "NOTE: using temporary directory $DATDIR for data, which will not be removed" echo "NOTE: you are free to re-use this data directory at will" From 31ec3d13ac0a777c12c7e290a0c62a39cd99d45c Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Fri, 22 Nov 2024 11:30:01 -0600 Subject: [PATCH 041/271] bump graphql to 1.5.9 (#1322) --- nix/ext/pg_graphql.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index 1a900a821..f54dff46a 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -1,18 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo, rust-bin }: +{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_6, cargo, rust-bin }: let - rustVersion = "1.76.0"; + rustVersion = "1.80.0"; cargo = rust-bin.stable.${rustVersion}.default; in -buildPgrxExtension_0_11_3 rec { +buildPgrxExtension_0_12_6 rec { pname = "pg_graphql"; - version = "1.5.7"; + version = "1.5.9"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = pname; rev = "v${version}"; - hash = "sha256-Q6XfcTKVOjo5pGy8QACc4QCHolKxEGU8e0TTC6Zg8go="; + hash = "sha256-YpLN43FtLhp2cb7cyM+4gEx8GTwsRiKTfxaMq0b8hk0="; }; nativeBuildInputs = [ cargo ]; @@ -25,7 +25,7 @@ buildPgrxExtension_0_11_3 rec { RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; PGPORT = "5434"; }; - cargoHash = "sha256-WkHufMw8OvinMRYd06ZJACnVvY9OLi069nCgq3LSmMY="; + cargoHash = "sha256-d2RSHtJgbYlOvArjOTaeYoca01UyWPUEO5vhktxxB6U="; # FIXME (aseipp): disable the tests since they try to install .control # files into the wrong spot, aside from that the one main test seems From b25826a3e1b79cc0164ed07e3d10e06a7f7a5574 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 25 Nov 2024 09:55:19 -0500 Subject: [PATCH 042/271] fix: publish action, wrappers package issue, test of 15.8 image upgrade (#1324) * fix: publish action * chore: cleanup * chore : trigger build on push * chore: trigger build * fix: correct the var in action * fix: git should be a nativeBuildInput and not buildInput * chore: trigger release and publish * chore: try to build and cache deps so that nix does not try to fetch on install * fix: we can build and cache clickouse-rs this way so as to not fetch it * chore: bump to release to staging * chore: trugger upgrade script publish * ichore: trigger release and publish at same time * chore: cleanup pr testing lines * chore: revert for post-pr --- .../workflows/publish-nix-pgupgrade-scripts.yml | 11 ++++++----- ansible/tasks/stage2-setup-postgres.yml | 17 ----------------- nix/ext/wrappers/default.nix | 9 ++++++--- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 6fb7f1830..a4aa4c3de 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -49,8 +49,8 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi @@ -81,7 +81,6 @@ jobs: SLACK_COLOR: 'danger' SLACK_MESSAGE: 'Publishing pg_upgrade scripts failed' SLACK_FOOTER: '' - publish-prod: needs: prepare runs-on: ubuntu-latest @@ -95,11 +94,13 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 - + + - uses: DeterminateSystems/nix-installer-action@main + - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 4e9003ace..548f3ed94 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -4,14 +4,6 @@ # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task -- name: Install Git for Nix package management - become: yes - apt: - name: git - state: present - update_cache: yes - when: stage2_nix - - name: Install Postgres from nix binary cache become: yes shell: | @@ -42,15 +34,6 @@ shell: | sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix - -- name: Remove Git after Nix package installations - become: yes - apt: - name: git - state: absent - autoremove: yes - purge: yes - when: stage2_nix - name: Set ownership and permissions for /etc/ssl/private become: yes diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 85e00aff3..54f2c275b 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -29,8 +29,8 @@ buildPgrxExtension_0_12_6 rec { hash = "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA="; }; - nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl postgresql git ] ++ lib.optionals (stdenv.isDarwin) [ + nativeBuildInputs = [ pkg-config cargo git ]; + buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration @@ -52,7 +52,10 @@ buildPgrxExtension_0_12_6 rec { cargoLock = { lockFile = "${src}/Cargo.lock"; - allowBuiltinFetchGit = true; + allowBuiltinFetchGit = false; + outputHashes = { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-G+v4lNP5eK2U45D1fL90Dq24pUSlpIysNCxuZ17eac0="; + }; }; buildAndTestSubdir = "wrappers"; From 0bd4bb5c816b90f969ceb706475720ec47ae76fa Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 20 Nov 2024 19:57:16 -0500 Subject: [PATCH 043/271] chore: bump pg_jsonschema version to support pg 17 --- nix/ext/pg_jsonschema.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix index f79efcd95..50a2d3472 100644 --- a/nix/ext/pg_jsonschema.nix +++ b/nix/ext/pg_jsonschema.nix @@ -1,18 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_11_3, cargo, rust-bin }: +{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_6, cargo, rust-bin }: let - rustVersion = "1.76.0"; + rustVersion = "1.80.0"; cargo = rust-bin.stable.${rustVersion}.default; in -buildPgrxExtension_0_11_3 rec { +buildPgrxExtension_0_12_6 rec { pname = "pg_jsonschema"; - version = "0.3.1"; + version = "0.3.3"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = pname; rev = "v${version}"; - hash = "sha256-YdKpOEiDIz60xE7C+EzpYjBcH0HabnDbtZl23CYls6g="; + hash = "sha256-Au1mqatoFKVq9EzJrpu1FVq5a1kBb510sfC980mDlsU="; }; nativeBuildInputs = [ cargo ]; @@ -20,7 +20,7 @@ buildPgrxExtension_0_11_3 rec { # update the following array when the pg_jsonschema version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.3.0" "0.2.0" "0.1.4" "0.1.4" "0.1.2" "0.1.1" "0.1.0"]; + previousVersions = ["0.3.1" "0.3.0" "0.2.0" "0.1.4" "0.1.4" "0.1.2" "0.1.1" "0.1.0"]; CARGO="${cargo}/bin/cargo"; #darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions env = lib.optionalAttrs stdenv.isDarwin { @@ -28,8 +28,12 @@ buildPgrxExtension_0_11_3 rec { RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; PGPORT = "5433"; }; - cargoHash = "sha256-VcS+efMDppofuFW2zNrhhsbC28By3lYekDFquHPta2g="; + cargoLock = { + lockFile = "${src}/Cargo.lock"; + allowBuiltinFetchGit = false; + }; + # FIXME (aseipp): testsuite tries to write files into /nix/store; we'll have # to fix this a bit later. doCheck = false; From 897d9f30a0e534971f5b91d7cf40b46cd69e60c8 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 25 Nov 2024 17:23:25 -0500 Subject: [PATCH 044/271] Sam/oriole17 (#1298) * feat: build and flake check of pg 16.3 with exts/wrappers * pg_partman test 15/16 compat * merge sql interface test * tests: build test and cache both versions * chore: run checks individually * pg 15 and 16 packer/ansible/ghactions (#1268) * fix: reformat ec2 cleanup commands (#1267) Co-authored-by: Sam Rose * feat: build and flake check of pg 16.3 with exts/wrappers * pg_partman test 15/16 compat * merge sql interface test * tests: build test and cache both versions * chore: run checks individually * feat: realease 15 and 16 to staging * chore: update versions * chore: make yq available * chore: run yq from nix * chore: more setup for staging AMI * fix: yq usage * chore: shell vars * fix: When --init none is used, only users who can elevate to sudo privileges can run Nix * fix: no -i * fix: quote correction * fix: newline extra quotes * fix: no need for pg major version on packer * fix: postgresql_major * fix: ql * fix: no ansible args in stage to invocation * fix: unique val * fix: adjustments to build scripts * chore: env var handling * fix: bump to build * chore: set up more required vars * chore: bump var * feat: pg 16 debug symbols * feat: matrix pg versions build on testinfra * feat: matrix on Test Database * chore: running nix in the right context * feat: just use existing Dockerfile + pg version * chore: refer to var * fix: read name without including quotes * chore: try format function * fix: strip quotes from version number * chore: env var * fix: pg client * fix * fix: try to use psql from our own corresponding pkg * fix: try psql from ppa * fix: dbmate per pg version * build dbmate and then install client * fix: account for architecture * chore: limit changes detection migrations/schema.sql * missing docker compose call * ore: drop tests while investigating * test: try on pg15 only * chore: schema needs update * chore: now run on all versions in matrix * test: trying a version of schema per major pg version as there are type diffs --------- Co-authored-by: Sam Rose Co-authored-by: Oliver Rice * chore: rm dead code * chore: resolve versions from ansible/vars.yml instead of packer file create a matrix build for 15 16 (or how ever many versions there are) * feat: WIP orioledb 16 * feat: intro into CI building psql16 bundle oriole version * test: working through build compat for oriole * working orioledb build * fix: update value * chore: cut staging only release for oriole16 * narrow down to just oriole staging ami here * fix: make sure name lines up with gh action convention * fix: get correct naming convention in here too for oriole bundle * chore: bump to cut release * fix: make sure src and debug builds available for oriole too * chore: bump to staging release * fix: when oriole16 rm timescale from supautils conf * fix: also remove from postgresql conf * fix: find all instances and remove in this condition for tiemscaledb * fix: maybe broke pgsodium with too many spaces * fix: create a symlink for missing path * fix: try a more universal way to deactivate pgsodium at this stage * chore: when oriole16 rm timescale plv8 postgis pgvector pgrouting * fix: more handling of oriole16 differences * chore more oriole16 handling * fix: refine sed regex * fix: also cond rm actual files * fix: correct dir * chore: bump to release * feat: parse and handle oropledb-16 in start-server * feat: start-client for oriole16 * wip for orioledb push to build on linux * fix: running server * chore: consolidate nix code that handles building of postgres versions * fix: update name for bundle * chore: small cleanup * chore: bump version release * chore: cleanup names * chore: correct names * fix: var name * fix: one more var name * chore: bump to release * fix: reformatting metadata for clikchouse dep as git was not able to fetch * feat: wip refactor to pg 17 for orioledb * feat: working orioledb-17 * fix: increase role duration to avoid expiration * fix: correct version * fix: clickhouse needs git in build inputs * fix: install and then remove git for clickhouse dep * fix: correct rules for version * fix: db_user_namespace was deprecated starting in pg 16.4 and higher * apply fix for wrappers build, deactivate ext in unit test * chore: deactivate more tests due to deactivated extensions * fix: also remove from sql file * fix: regex * fix: also remove ref here * fix: graphql_public schema too * chore: correct dir * chore: staging release * feat: re-introduce wal2json rum and pgvector * fix: also restore pgvector in start-server * chore: bump staging release * feat: oriole specific default settings * feat: use icu for locales only if building orioledb * fix: need var in stage 1 too * fix: settings must be in db init * fix: ansible args * fix: PostgreSQL uses ICU for all locale-related operations, so we don't need to specify the collation and character type settings separately. * chore: add a migration for orioledb activation by default * feat: turn on oriole if oriole ext exists * test: conditional on test for orioledb * fix: salt changed repo and method for adding apt package * fix: udpate salt minion setup * fix: silent skip if oriole not in the install * test: check if oriole is available and if so then enable * chore: build and cache src and debug pkgs as well * fix: tmp supress build of src and debug * chore: tmp disable src and debug * fix: activate oriole first in the oriole context * fix: pgroonga build on macos * fix: restore flake check for now * fixing flake check for darwin + passing check until pg_net * fix: start-server macos * fix: src yq from apt * fix: all instances yq * fix: jq invoke * fix: nix profile install * fix: nix run * fix: sudo nix run * chore: cut staging release * chore: rm debugging * fix: still need CURRENT_SYSTEM * test: re-introduce flake checks for 15 and 16 * chore: bump versions of patched pg for oriole to 17_4 and ext to beta6 * chore: bump var to release ami * chore: break down into functions * fix: skip x86 darwin for oriole nix builds * chore: cleanup repo for final review, rebase and merge * fix: try to properly init db in non oriole context * chore: restore installation of debug and src for all versions` * chore: newline * chore: cleaning up and restoring missing code * chore: cleanup * chore: fix gh action conditonal for oriole * fix: filter orioledb-17 from test on read --------- Co-authored-by: Oliver Rice --- .github/workflows/test.yml | 21 +-- .github/workflows/testinfra-nix.yml | 3 +- .gitignore | 2 +- ansible/files/postgres_prestart.sh.j2 | 44 +++++- ansible/tasks/setup-postgres.yml | 60 +++++--- ansible/tasks/stage2-setup-postgres.yml | 77 ++++++++-- ansible/tasks/test-image.yml | 71 ++++++++- ansible/vars.yml | 9 +- docker/nix/build_nix.sh | 30 ++-- .../files/unit-tests/unit-test-01.sql | 63 ++++++-- .../scripts/surrogate-bootstrap-nix.sh | 5 +- flake.nix | 144 ++++++++---------- .../20241031003909_create_orioledb.sql | 11 ++ migrations/tests/test.sql | 10 ++ nix/ext/orioledb.nix | 10 +- nix/ext/pgaudit.nix | 4 + nix/ext/pgroonga.nix | 24 ++- nix/ext/rum.nix | 4 +- nix/ext/wal2json.nix | 4 +- nix/ext/wrappers/default.nix | 36 +++++ nix/overlays/psql_16-oriole.nix | 12 +- nix/postgresql/default.nix | 5 +- nix/postgresql/generic.nix | 29 ++-- nix/postgresql/orioledb-16.nix | 4 + nix/postgresql/orioledb-17.nix | 4 + nix/tools/run-client.sh.in | 6 +- nix/tools/run-server.sh.in | 35 ++++- 27 files changed, 525 insertions(+), 202 deletions(-) create mode 100644 migrations/db/migrations/20241031003909_create_orioledb.sql create mode 100644 nix/postgresql/orioledb-16.nix create mode 100644 nix/postgresql/orioledb-17.nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d22b16f16..1b60cfcca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,10 @@ name: Test Database - on: push: branches: - develop pull_request: workflow_dispatch: - jobs: prepare: runs-on: ubuntu-latest @@ -21,13 +19,11 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - name: Set PostgreSQL versions id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[] | select(. != "orioledb-17")' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT - build: needs: prepare strategy: @@ -45,34 +41,25 @@ jobs: POSTGRES_PASSWORD: password steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV - - name: Strip quotes from pg major and set env var run: | stripped_version=$(echo ${{ matrix.postgres_version }} | sed 's/^"\(.*\)"$/\1/') echo "PGMAJOR=$stripped_version" >> $GITHUB_ENV - - name: Generate common-nix.vars.pkr.hcl run: | PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl - # Ensure there's a newline at the end of the file echo "" >> common-nix.vars.pkr.hcl - - id: settings - # Remove spaces and quotes to get the raw version string run: sed -r 's/(\s|\")+//g' common-nix.vars.pkr.hcl >> $GITHUB_OUTPUT - - name: Generate args id: args run: | @@ -80,14 +67,12 @@ jobs: echo "result<> $GITHUB_OUTPUT echo "$ARGS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - #TODO PR Convert to develop branch flakeurl - name: verify schema.sql is committed run: | GIT_SHA=${{github.sha}} - nix run github:supabase/postgres/${GIT_SHA}#dbmate-tool -- --version ${{ env.PGMAJOR }} + nix run github:supabase/postgres/develop#dbmate-tool -- --version ${{ env.PGMAJOR }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql exit 1 - fi + fi \ No newline at end of file diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-nix.yml index 4a51c159c..14db4a7f2 100644 --- a/.github/workflows/testinfra-nix.yml +++ b/.github/workflows/testinfra-nix.yml @@ -18,7 +18,7 @@ jobs: - name: Set PostgreSQL versions id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT test-ami-nix: @@ -61,6 +61,7 @@ jobs: - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + - name: Generate common-nix.vars.pkr.hcl run: | diff --git a/.gitignore b/.gitignore index ae375b82a..45464e3f0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ result* .idea/ .vscode/ -db \ No newline at end of file +db diff --git a/ansible/files/postgres_prestart.sh.j2 b/ansible/files/postgres_prestart.sh.j2 index ae5aa1a7d..3ffe54c85 100644 --- a/ansible/files/postgres_prestart.sh.j2 +++ b/ansible/files/postgres_prestart.sh.j2 @@ -1,9 +1,49 @@ #!/bin/bash +check_orioledb_enabled() { + local pg_conf="/etc/postgresql/postgresql.conf" + if [ ! -f "$pg_conf" ]; then + return 0 + fi + grep "^shared_preload_libraries" "$pg_conf" | grep -c "orioledb" || return 0 +} + +get_shared_buffers() { + local opt_conf="/etc/postgresql-custom/generated-optimizations.conf" + if [ ! -f "$opt_conf" ]; then + return 0 + fi + grep "^shared_buffers = " "$opt_conf" | cut -d "=" -f2 | tr -d ' ' || return 0 +} + +update_orioledb_buffers() { + local pg_conf="/etc/postgresql/postgresql.conf" + local value="$1" + if grep -q "^orioledb.main_buffers = " "$pg_conf"; then + sed -i "s/^orioledb.main_buffers = .*/orioledb.main_buffers = $value/" "$pg_conf" + else + echo "orioledb.main_buffers = $value" >> "$pg_conf" + fi +} + +main() { + local has_orioledb=$(check_orioledb_enabled) + if [ "$has_orioledb" -lt 1 ]; then + return 0 + fi + local shared_buffers_value=$(get_shared_buffers) + if [ ! -z "$shared_buffers_value" ]; then + update_orioledb_buffers "$shared_buffers_value" + fi +} + +# Initial locale setup if [ $(cat /etc/locale.gen | grep -c en_US.UTF-8) -eq 0 ]; then - echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen fi if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then - locale-gen + locale-gen fi + +main diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 0038e3afc..188a364b8 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -204,23 +204,49 @@ ansible_command_timeout: 60 when: debpkg_mode -- name: Initialize the database stage2_nix - become: yes - become_user: postgres - shell: source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" - args: - executable: /bin/bash - environment: - LANG: en_US.UTF-8 - LANGUAGE: en_US.UTF-8 - LC_ALL: en_US.UTF-8 - LC_CTYPE: en_US.UTF-8 - LOCALE_ARCHIVE: /usr/lib/locale/locale-archive - vars: - ansible_command_timeout: 60 - # Circumvents the following error: - # "Timeout (12s) waiting for privilege escalation prompt" - when: stage2_nix +- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary + block: + - name: Check if psql_version is psql_orioledb + set_fact: + is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" + + - name: Initialize the database stage2_nix (non-orioledb) + become: yes + become_user: postgres + shell: source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" + args: + executable: /bin/bash + environment: + LANG: en_US.UTF-8 + LANGUAGE: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + LC_CTYPE: en_US.UTF-8 + LOCALE_ARCHIVE: /usr/lib/locale/locale-archive + vars: + ansible_command_timeout: 60 + when: stage2_nix and not is_psql_oriole + + - name: Initialize the database stage2_nix (orioledb) + become: yes + become_user: postgres + shell: > + source /var/lib/postgresql/.bashrc && initdb -D /var/lib/postgresql/data + --allow-group-access + --username=supabase_admin + --locale-provider=icu + --encoding=UTF-8 + --icu-locale=en_US.UTF-8 + args: + executable: /bin/bash + environment: + LANG: en_US.UTF-8 + LANGUAGE: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + LC_CTYPE: en_US.UTF-8 + LOCALE_ARCHIVE: /usr/lib/locale/locale-archive + vars: + ansible_command_timeout: 60 + when: stage2_nix and is_psql_oriole - name: copy PG systemd unit template: diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 548f3ed94..c3ce46941 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -4,11 +4,56 @@ # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task +- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary + block: + - name: Check if psql_version is psql_orioledb-16 + set_fact: + is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" + + - name: Remove specified extensions from postgresql.conf if oriole-16 build + ansible.builtin.command: + cmd: > + sed -i 's/ timescaledb,//g' + /etc/postgresql/postgresql.conf + when: is_psql_oriole and stage2_nix + become: yes + + - name: Remove specified extensions from supautils.conf if oriole-16 build + ansible.builtin.command: + cmd: > + sed -i 's/ timescaledb,//g; s/ vector,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' + /etc/postgresql-custom/supautils.conf + when: is_psql_oriole and stage2_nix + become: yes + + - name: Remove db_user_namespace from postgresql.conf if oriole-xx build + ansible.builtin.command: + cmd: > + sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' + /etc/postgresql/postgresql.conf + when: is_psql_oriole and stage2_nix + become: yes + + - name: Append orioledb to shared_preload_libraries append within closing quote + ansible.builtin.command: + cmd: > + sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' + /etc/postgresql/postgresql.conf + when: is_psql_oriole and stage2_nix + become: yes + + - name: Add default_table_access_method setting + ansible.builtin.lineinfile: + path: /etc/postgresql/postgresql.conf + line: "default_table_access_method = 'orioledb'" + state: present + when: is_psql_oriole and stage2_nix + become: yes + - name: Install Postgres from nix binary cache become: yes shell: | sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{psql_version}}/bin" -#TODO (samrose) switch pg_prove sourcing to develop branch once PR is merged when: stage2_nix - name: Install pg_prove from nix binary cache @@ -199,13 +244,19 @@ recurse: yes when: stage2_nix -- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir - shell: > - sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \ - sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ - && chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/" - become: yes - when: stage2_nix +- name: Check psql_version and run postgis linking if not oriole-xx + block: + - name: Check if psql_version is psql_orioledb-17 + set_fact: + is_psql_oriole: "{{ psql_version == 'psql_orioledb-17' }}" + + - name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir + shell: > + sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \ + sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ + && chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/" + become: yes + when: stage2_nix and not is_psql_oriole - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets file: @@ -240,8 +291,16 @@ line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh' when: stage2_nix +- name: Create symbolic link for pgsodium_getkey script + file: + src: "/usr/lib/postgresql/bin/pgsodium_getkey.sh" + dest: "/usr/lib/postgresql/share/postgresql/extension/pgsodium_getkey" + state: link + become: yes + when: stage2_nix + - name: Append GRN_PLUGINS_DIR to /etc/environment.d/postgresql.env ansible.builtin.lineinfile: path: /etc/environment.d/postgresql.env line: 'GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins' - become: yes \ No newline at end of file + become: yes diff --git a/ansible/tasks/test-image.yml b/ansible/tasks/test-image.yml index d6e8223f7..d8e951a3e 100644 --- a/ansible/tasks/test-image.yml +++ b/ansible/tasks/test-image.yml @@ -4,11 +4,22 @@ - libtap-parser-sourcehandler-pgtap-perl when: debpkg_mode +# - name: Temporarily disable PG Sodium references in config +# become: yes +# become_user: postgres +# shell: +# cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf +# when: debpkg_mode or stage2_nix + - name: Temporarily disable PG Sodium references in config become: yes become_user: postgres shell: - cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf + cmd: > + sed -i.bak + -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + -e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/' + /etc/postgresql/postgresql.conf when: debpkg_mode or stage2_nix - name: Start Postgres Database to load all extensions. @@ -46,6 +57,64 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive when: stage2_nix + +- name: Check psql_version and modify migrations if oriole-xx + block: + - name: Check if psql_version is psql_orioledb-xx + set_fact: + is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" + + - name: Remove specified extensions from SQL file + ansible.builtin.command: + cmd: > + sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\|pg_jsonschema\|pg_graphql\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql + when: is_psql_oriole + become: yes + + - name: Remove specified extension files from extensions directory + ansible.builtin.find: + paths: /tmp/migrations/tests/extensions + patterns: + - '*timescaledb*.sql' + - '*postgis*.sql' + - '*pgrouting*.sql' + - '*plv8*.sql' + - '*pg_jsonschema*.sql' + - '*pg_graphql*.sql' + register: files_to_remove + when: is_psql_oriole + + - name: Delete matched extension files + ansible.builtin.file: + path: "{{ item.path }}" + state: absent + loop: "{{ files_to_remove.files }}" + when: is_psql_oriole + become: yes + + - name: Remove specified extensions from SQL file + ansible.builtin.command: + cmd: > + sed -i "/'pg_graphql',/d" /tmp/unit-tests/unit-test-01.sql + when: is_psql_oriole + become: yes + + - name: Remove graphql schema test + lineinfile: + path: /tmp/migrations/tests/database/exists.sql + regexp: "^SELECT has_schema\\('graphql'\\);$" + state: absent + become: yes + when: is_psql_oriole + + - name: Remove graphql schema test + lineinfile: + path: /tmp/migrations/tests/database/exists.sql + regexp: "^SELECT has_schema\\('graphql_public'\\);$" + state: absent + become: yes + when: is_psql_oriole + - name: Run Unit tests (with filename unit-test-*) on Postgres Database shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql register: retval diff --git a/ansible/vars.yml b/ansible/vars.yml index 1209c29c7..0bcc68ab3 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -2,17 +2,16 @@ supabase_internal: true ebssurrogate_mode: true async_mode: true -# postgresql_major: "15" -# postgresql_release: "15.1" -# postgresql_release_checksum: sha256:ea2cf059a85882654b989acd07edc121833164a30340faee0d3615cf7058e66c postgres_major: - "15" - "16" + - "orioledb-17" # Full version strings for each major version postgres_release: - postgres15: "15.8.1.012" - postgres16: "16.3.1.018" + postgresorioledb-17: "orioledb-17.0.1.000" + postgres15: "15.8.1.005" + postgres16: "16.3.1.011" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index 5a7896a46..fc9883797 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -5,15 +5,23 @@ nix --version if [ -d "/workspace" ]; then cd /workspace fi -if [ $(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') == "x86_64-darwin" ]; then - nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link - nix build .#psql_15/bin -o psql_15 - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 -else - nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link - nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link - nix build .#psql_15/bin -o psql_15 - nix build .#psql_16/bin -o psql_16 - 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_16 + +SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') + +nix build .#checks.$SYSTEM.psql_15 -L --no-link +nix build .#checks.$SYSTEM.psql_16 -L --no-link + +nix build .#psql_15/bin -o psql_15 +nix build .#psql_16/bin -o psql_16 + +# Skip orioledb-17 on x86_64-darwin +if [ "$SYSTEM" != "x86_64-darwin" ]; then + nix build .#psql_orioledb-17/bin -o psql_orioledb_17 +fi + +# Copy to S3 +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_16 +if [ "$SYSTEM" != "x86_64-darwin" ]; then + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 fi diff --git a/ebssurrogate/files/unit-tests/unit-test-01.sql b/ebssurrogate/files/unit-tests/unit-test-01.sql index 0feb70e8b..f3d47459f 100644 --- a/ebssurrogate/files/unit-tests/unit-test-01.sql +++ b/ebssurrogate/files/unit-tests/unit-test-01.sql @@ -1,33 +1,64 @@ BEGIN; CREATE EXTENSION IF NOT EXISTS pgtap; + +DO $$ +DECLARE + extension_array text[]; + orioledb_available boolean; +BEGIN + -- Check if orioledb is available + SELECT EXISTS ( + SELECT 1 FROM pg_available_extensions WHERE name = 'orioledb' + ) INTO orioledb_available; + + -- If available, create it and add to the expected extensions list + IF orioledb_available THEN + CREATE EXTENSION IF NOT EXISTS orioledb; + extension_array := ARRAY[ + 'plpgsql', + 'pg_stat_statements', + 'pgsodium', + 'pgtap', + 'pg_graphql', + 'pgcrypto', + 'pgjwt', + 'uuid-ossp', + 'supabase_vault', + 'orioledb' + ]; + ELSE + extension_array := ARRAY[ + 'plpgsql', + 'pg_stat_statements', + 'pgsodium', + 'pgtap', + 'pg_graphql', + 'pgcrypto', + 'pgjwt', + 'uuid-ossp', + 'supabase_vault' + ]; + END IF; + + -- Set the array as a temporary variable to use in the test + PERFORM set_config('myapp.extensions', array_to_string(extension_array, ','), false); +END $$; + SELECT plan(8); --- Check installed extensions SELECT extensions_are( - ARRAY[ - 'plpgsql', - 'pg_stat_statements', - 'pgsodium', - 'pgtap', - 'pg_graphql', - 'pgcrypto', - 'pgjwt', - 'uuid-ossp', - 'supabase_vault' - ] + string_to_array(current_setting('myapp.extensions'), ',')::text[] ); --- Check schemas exists SELECT has_schema('pg_toast'); SELECT has_schema('pg_catalog'); SELECT has_schema('information_schema'); SELECT has_schema('public'); --- Check that service_role can execute certain pgsodium functions SELECT function_privs_are('pgsodium', 'crypto_aead_det_decrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); SELECT function_privs_are('pgsodium', 'crypto_aead_det_encrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); SELECT function_privs_are('pgsodium', 'crypto_aead_det_keygen', array[]::text[], 'service_role', array['EXECUTE']); -SELECT * from finish(); -ROLLBACK; +SELECT * FROM finish(); +ROLLBACK; \ No newline at end of file diff --git a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh index 3b0bb93c8..b204b326a 100755 --- a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh +++ b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh @@ -219,7 +219,10 @@ EOF # Run Ansible playbook #export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_DEBUG=True && export ANSIBLE_REMOTE_TEMP=/mnt/tmp export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp - ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml --extra-vars '{"nixpkg_mode": true, "debpkg_mode": false, "stage2_nix": false}' $ARGS + ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml \ + --extra-vars '{"nixpkg_mode": true, "debpkg_mode": false, "stage2_nix": false} ' \ + --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \ + $ARGS } function update_systemd_services { diff --git a/flake.nix b/flake.nix index 71b87d580..d1892b117 100644 --- a/flake.nix +++ b/flake.nix @@ -26,26 +26,6 @@ pgsqlSuperuser = "supabase_admin"; nix2img = nix2container.packages.${system}.nix2container; - # The 'oriole_pkgs' variable holds all the upstream packages in nixpkgs, which - # we can use to build our own images; it is the common name to refer to - # a copy of nixpkgs which contains all its packages. - # it also serves as a base for importing the orioldb/postgres overlay to - #build the orioledb postgres patched version of postgresql16 - oriole_pkgs = import nixpkgs { - config = { allowUnfree = true; }; - inherit system; - overlays = [ - # NOTE (aseipp): add any needed overlays here. in theory we could - # pull them from the overlays/ directory automatically, but we don't - # want to have an arbitrary order, since it might matter. being - # explicit is better. - (import ./nix/overlays/cargo-pgrx.nix) - (import ./nix/overlays/psql_16-oriole.nix) - - ]; - }; - #This variable works the same as 'oriole_pkgs' but builds using the upstream - #nixpkgs builds of postgresql 15 and 16 + the overlays listed below pkgs = import nixpkgs { config = { allowUnfree = true; @@ -55,7 +35,7 @@ }; inherit system; overlays = [ - # NOTE add any needed overlays here. in theory we could + # NOTE: add any needed overlays here. in theory we could # pull them from the overlays/ directory automatically, but we don't # want to have an arbitrary order, since it might matter. being # explicit is better. @@ -92,11 +72,7 @@ }) (final: prev: { postgresql = final.callPackage ./nix/postgresql/default.nix { - inherit (final) lib; - inherit (final) stdenv; - inherit (final) fetchurl; - inherit (final) makeWrapper; - inherit (final) callPackage; + inherit (final) lib stdenv fetchurl makeWrapper callPackage buildEnv newScope; }; }) ]; @@ -165,11 +141,19 @@ #Where we import and build the orioledb extension, we add on our custom extensions # plus the orioledb option - orioledbExtension = ourExtensions ++ [ ./nix/ext/orioledb.nix ]; + #we're not using timescaledb in the orioledb version of supabase extensions + orioleFilteredExtensions = builtins.filter ( + x: + x != ./nix/ext/timescaledb.nix && + x != ./nix/ext/plv8.nix && + x != ./nix/ext/postgis.nix && + x != ./nix/ext/pgrouting.nix && + x != ./nix/ext/pg_jsonschema.nix && + x != ./nix/ext/pg_graphql.nix + ) ourExtensions; + + orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - #this var is a convenience setting to import the orioledb patched version of postgresql - postgresql_orioledb_16 = oriole_pkgs.postgresql_orioledb_16; - #postgis_override = pkgs.postgis_override; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way @@ -200,7 +184,7 @@ }; extensions = ourExts; - # NOTE (aseipp): this field can be used to do cache busting (e.g. + # NOTE this field can be used to do cache busting (e.g. # force a rebuild of the psql packages) but also to helpfully inform # tools what version of the schema is being used, for forwards and # backwards compatibility @@ -208,28 +192,13 @@ }; }; - makeOurOrioleDbPostgresPkgs = version: patchedPostgres: - let postgresql = patchedPostgres; - in map (path: pkgs.callPackage path { inherit postgresql; }) orioledbExtension; - makeOurPostgresPkgs = version: let postgresql = getPostgresqlPackage version; - extensions = if version == "15" - then ourExtensions ++ [ - ./nix/ext/timescaledb-2.9.1.nix - ] + extensionsToUse = if (builtins.elem version ["orioledb-16" "orioledb-17"]) + then orioledbExtensions else ourExtensions; - in - map (path: pkgs.callPackage path { inherit postgresql; }) extensions; - # Create an attrset that contains all the extensions included in a server for the orioledb version of postgresql + extension. - makeOurOrioleDbPostgresPkgsSet = version: patchedPostgres: - (builtins.listToAttrs (map - (drv: - { name = drv.pname; value = drv; } - ) - (makeOurOrioleDbPostgresPkgs version patchedPostgres))) - // { recurseForDerivations = true; }; + in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; # Create an attrset that contains all the extensions included in a server. makeOurPostgresPkgsSet = version: @@ -269,27 +238,6 @@ paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; }; - makeOrioleDbPostgresBin = version: patchedPostgres: - let - postgresql = patchedPostgres; - upstreamExts = map - (ext: { - name = postgresql.pkgs."${ext}".pname; - version = postgresql.pkgs."${ext}".version; - }) - orioledbPsqlExtensions; - ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurOrioleDbPostgresPkgs version postgresql); - - pgbin = postgresql.withPackages (ps: - (map (ext: ps."${ext}") orioledbPsqlExtensions) ++ (makeOurOrioleDbPostgresPkgs version postgresql) - ); - in - pkgs.symlinkJoin { - inherit (pgbin) name version; - paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; - }; - - # Create an attribute set, containing all the relevant packages for a # PostgreSQL install, wrapped up with a bow on top. There are three # packages: @@ -304,11 +252,6 @@ exts = makeOurPostgresPkgsSet version; recurseForDerivations = true; }; - makeOrioleDbPostgres = version: patchedPostgres: rec { - bin = makeOrioleDbPostgresBin version patchedPostgres; - exts = makeOurOrioleDbPostgresPkgsSet version patchedPostgres; - recurseForDerivations = true; - }; # The base set of packages that we export from this Nix Flake, that can # be used with 'nix build'. Don't use the names listed below; check the @@ -326,7 +269,8 @@ postgresVersions = { psql_15 = makePostgres "15"; psql_16 = makePostgres "16"; - # psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; + #psql_orioledb-16 = makePostgres "orioledb-16" ; + psql_orioledb-17 = makePostgres "orioledb-17" ; }; # Find the active PostgreSQL version @@ -342,6 +286,8 @@ }; postgresql_15 = getPostgresqlPackage "15"; postgresql_16 = getPostgresqlPackage "16"; + #postgresql_orioledb-16 = getPostgresqlPackage "orioledb-16"; + postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; in postgresVersions //{ supabase-groonga = supabase-groonga; @@ -350,12 +296,14 @@ # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_16 = postgresVersions.psql_16; - #psql_orioledb_16 = makeOrioleDbPostgres "16_23" postgresql_orioledb_16; + #psql_orioledb-16 = postgresVersions.psql_orioledb-16; + psql_orioledb-17 = postgresVersions.psql_orioledb-17; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_16; + inherit postgresql_15 postgresql_16 postgresql_orioledb-17; postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; postgresql_16_debug = if pkgs.stdenv.isLinux then postgresql_16.debug else null; + postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; version = postgresql_15.version; @@ -400,6 +348,28 @@ platforms = platforms.all; }; }; + postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-17-src"; + version = postgresql_orioledb-17.version; + + src = postgresql_orioledb-17.src; + + nativeBuildInputs = [ pkgs.bzip2 ]; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + + meta = with pkgs.lib; { + description = "PostgreSQL 15 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; + }; mecab_naist_jdic = mecab-naist-jdic; supabase_groonga = supabase-groonga; pg_regress = makePgRegress activeVersion; @@ -459,6 +429,7 @@ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ --subst-var-by 'PSQL_CONF_FILE' $out/etc/postgresql/postgresql.conf \ --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ + --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ --subst-var-by 'READREPL_CONF_FILE' "$out/etc/postgresql-custom/read-replica.conf" \ --subst-var-by 'LOGGING_CONF_FILE' "$out/etc/postgresql-custom/logging.conf" \ @@ -468,7 +439,8 @@ --subst-var-by 'LOCALES' '${localeArchive}' \ --subst-var-by 'EXTENSION_CUSTOM_SCRIPTS_DIR' "$out/extension-custom-scripts" \ --subst-var-by 'MECAB_LIB' '${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so' \ - --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' + --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' chmod +x $out/bin/start-postgres-server ''; @@ -488,6 +460,7 @@ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ + --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ @@ -583,19 +556,24 @@ pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; pg_regress = basePackages.pg_regress; + tmpDirCmd = if pkgs.stdenv.isDarwin then + ''mkdir -p /tmp/postgres-check.$$ && echo "/tmp/postgres-check.$$"'' + else + "mktemp -d"; in pkgs.runCommand "postgres-${pgpkg.version}-check-harness" { nativeBuildInputs = with pkgs; [ coreutils bash pgpkg pg_prove pg_regress procps supabase-groonga ]; } '' - TMPDIR=$(mktemp -d) + TMPDIR=$(${tmpDirCmd}) if [ $? -ne 0 ]; then echo "Failed to create temp directory" >&2 exit 1 fi + chmod -R 755 "$TMPDIR" # Ensure the temporary directory is removed on exit - trap 'rm -rf "$TMPDIR"' EXIT + #trap 'rm -rf "$TMPDIR"' EXIT export PGDATA="$TMPDIR/pgdata" export PGSODIUM_DIR="$TMPDIR/pgsodium" @@ -615,6 +593,8 @@ echo "listen_addresses = '*'" >> $PGDATA/postgresql.conf echo "port = 5432" >> $PGDATA/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf + # Add system-specific configuration for aarch64-darwin + #postgres -D "$PGDATA" -k "$TMPDIR" -h localhost -p 5432 >$TMPDIR/logfile/postgresql.log 2>&1 & pg_ctl -D "$PGDATA" -l $TMPDIR/logfile/postgresql.log -o "-k $TMPDIR -p 5432" start for i in {1..60}; do @@ -655,7 +635,7 @@ pg_ctl -D "$PGDATA" stop mv $TMPDIR/logfile/postgresql.log $out echo ${pgpkg} - ''; + ''; in rec { # The list of all packages that can be built with 'nix build'. The list diff --git a/migrations/db/migrations/20241031003909_create_orioledb.sql b/migrations/db/migrations/20241031003909_create_orioledb.sql new file mode 100644 index 000000000..dbfe5a63e --- /dev/null +++ b/migrations/db/migrations/20241031003909_create_orioledb.sql @@ -0,0 +1,11 @@ +do $$ +begin + if exists (select 1 from pg_available_extensions where name = 'orioledb') then + if not exists (select 1 from pg_extension where extname = 'orioledb') then + create extension if not exists orioledb; + end if; + end if; +end $$; + +-- migrate:down +drop extension if exists orioledb; diff --git a/migrations/tests/test.sql b/migrations/tests/test.sql index 7afa40645..9682b4a2b 100644 --- a/migrations/tests/test.sql +++ b/migrations/tests/test.sql @@ -1,3 +1,13 @@ +-- Check and create OrioleDB if available +DO $$ +BEGIN + IF EXISTS (SELECT 1 FROM pg_available_extensions WHERE name = 'orioledb') THEN + IF NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'orioledb') THEN + CREATE EXTENSION orioledb; + END IF; + END IF; +END $$; + -- Create all extensions \ir extensions/test.sql diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 4d8c51bbd..9775226e1 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -6,17 +6,17 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "main"; - sha256 = "sha256-QbDp9S8JXO66sfaHZIQ3wFCVRxsAaaNSRgC6hvL3EKY="; + rev = "beta6"; + sha256 = "sha256-7nmgQDVcNuaGOM6V9xrer2jqfxhJhXZBXRZoiPEoisE="; }; - version = "patches16_23"; + version = "beta6"; buildInputs = [ curl libkrb5 postgresql python3 openssl ]; - buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=23"; + buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=4"; installPhase = '' runHook preInstall mkdir -p $out/{lib,share/postgresql/extension} - cp *.so $out/lib + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension diff --git a/nix/ext/pgaudit.nix b/nix/ext/pgaudit.nix index f6c5d8bb0..84fbf440d 100644 --- a/nix/ext/pgaudit.nix +++ b/nix/ext/pgaudit.nix @@ -2,6 +2,10 @@ #adapted from https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/ext/pgaudit.nix let source = { + "17" = { + version = "17.0"; + hash = "sha256-3ksq09wiudQPuBQI3dhEQi8IkXKLVIsPFgBnwLiicro="; + }; "16" = { version = "16.0"; hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc="; diff --git a/nix/ext/pgroonga.nix b/nix/ext/pgroonga.nix index 884b54582..c7fe90bb1 100644 --- a/nix/ext/pgroonga.nix +++ b/nix/ext/pgroonga.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkg-config, postgresql, msgpack-c, callPackage, mecab, makeWrapper }: +{ lib, stdenv, fetchurl, pkg-config, postgresql, msgpack-c, callPackage, mecab, makeWrapper, xxHash }: let supabase-groonga = callPackage ../supabase-groonga.nix { }; in @@ -10,7 +10,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-iF/zh4zDDpAw5fxW1WG8i2bfPt4VYsnYArwOoE/lwgM="; }; nativeBuildInputs = [ pkg-config makeWrapper ]; - buildInputs = [ postgresql msgpack-c supabase-groonga mecab ]; + + buildInputs = [ postgresql msgpack-c supabase-groonga mecab ] ++ lib.optionals stdenv.isDarwin [ + xxHash + ]; + propagatedBuildInputs = [ supabase-groonga ]; configureFlags = [ "--with-mecab=${mecab}" @@ -19,16 +23,30 @@ stdenv.mkDerivation rec { "--with-groonga-plugin-dir=${supabase-groonga}/lib/groonga/plugins" ]; - makeFlags = [ + makeFlags = [ "HAVE_MSGPACK=1" "MSGPACK_PACKAGE_NAME=msgpack-c" "HAVE_MECAB=1" ]; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (builtins.concatStringsSep " " [ + "-Wno-error=incompatible-function-pointer-types" + "-Wno-error=format" + "-Wno-format" + "-I${supabase-groonga}/include/groonga" + "-I${xxHash}/include" + "-DPGRN_VERSION=\"${version}\"" + ]); + preConfigure = '' export GROONGA_LIBS="-L${supabase-groonga}/lib -lgroonga" export GROONGA_CFLAGS="-I${supabase-groonga}/include" export MECAB_CONFIG="${mecab}/bin/mecab-config" + ${lib.optionalString stdenv.isDarwin '' + export CPPFLAGS="-I${supabase-groonga}/include/groonga -I${xxHash}/include -DPGRN_VERSION=\"${version}\"" + export CFLAGS="-I${supabase-groonga}/include/groonga -I${xxHash}/include -DPGRN_VERSION=\"${version}\"" + export PG_CPPFLAGS="-Wno-error=incompatible-function-pointer-types -Wno-error=format" + ''} ''; installPhase = '' diff --git a/nix/ext/rum.nix b/nix/ext/rum.nix index 16bf106c5..1270f1ff1 100644 --- a/nix/ext/rum.nix +++ b/nix/ext/rum.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "rum"; - version = "1.3.13"; + version = "1.3.14"; src = fetchFromGitHub { owner = "postgrespro"; repo = "rum"; rev = version; - hash = "sha256-yy2xeDnk3fENN+En0st4mv60nZlqPafIzwf68jwJ5fE="; + hash = "sha256-VsfpxQqRBu9bIAP+TfMRXd+B3hSjuhU2NsutocNiCt8="; }; buildInputs = [ postgresql ]; diff --git a/nix/ext/wal2json.nix b/nix/ext/wal2json.nix index 751eb64c0..ed578c7fd 100644 --- a/nix/ext/wal2json.nix +++ b/nix/ext/wal2json.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "wal2json"; - version = "2_5"; + version = "2_6"; src = fetchFromGitHub { owner = "eulerto"; repo = "wal2json"; rev = "wal2json_${builtins.replaceStrings ["."] ["_"] version}"; - hash = "sha256-Gpc9uDKrs/dmVSFgdgHM453+TaEnhRh9t0gDbSn8FUI="; + hash = "sha256-+QoACPCKiFfuT2lJfSUmgfzC5MXf75KpSoc2PzPxKyM="; }; buildInputs = [ postgresql ]; diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 54f2c275b..7125f41be 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -50,6 +50,7 @@ buildPgrxExtension_0_12_6 rec { CARGO_BUILD_JOBS = "2"; CARGO="${cargo}/bin/cargo"; + #CARGO_NET_GIT_FETCH_WITH_CLI = "true"; cargoLock = { lockFile = "${src}/Cargo.lock"; allowBuiltinFetchGit = false; @@ -57,6 +58,41 @@ buildPgrxExtension_0_12_6 rec { "clickhouse-rs-1.1.0-alpha.1" = "sha256-G+v4lNP5eK2U45D1fL90Dq24pUSlpIysNCxuZ17eac0="; }; }; + + preConfigure = '' + cd wrappers + + # update the clickhouse-rs dependency + # append the branch name to the git URL to help cargo locate the commit + # while maintaining the rev for reproducibility + awk -i inplace ' + /\[dependencies.clickhouse-rs\]/ { + print + getline + if ($0 ~ /git =/) { + print "git = \"https://github.com/suharev7/clickhouse-rs/async-await\"" + } else { + print + } + while ($0 !~ /^\[/ && NF > 0) { + getline + if ($0 ~ /rev =/) print + if ($0 ~ /^\[/) print + } + next + } + { print } + ' Cargo.toml + + # Verify the file is still valid TOML, break build with this error + # if it is not + if ! cargo verify-project 2>/dev/null; then + echo "Failed to maintain valid TOML syntax" + exit 1 + fi + + cd .. + ''; buildAndTestSubdir = "wrappers"; buildFeatures = [ diff --git a/nix/overlays/psql_16-oriole.nix b/nix/overlays/psql_16-oriole.nix index d55af10a2..309129f1f 100644 --- a/nix/overlays/psql_16-oriole.nix +++ b/nix/overlays/psql_16-oriole.nix @@ -1,10 +1,10 @@ final: prev: { - postgresql_16 = prev.postgresql_16.overrideAttrs (old: { - pname = "postgresql_16"; - version = "16_23"; + pg_orioledb = prev.postgresql_16.overrideAttrs (old: { + pname = "postgresql_orioledb"; + version = "16_31"; src = prev.fetchurl { - url = "https://github.com/orioledb/postgres/archive/refs/tags/patches16_23.tar.gz"; - sha256 = "sha256-xWmcqn3DYyBG0FsBNqPWTFzUidSJZgoPWI6Rt0N9oJ4="; + url = "https://github.com/orioledb/postgres/archive/refs/tags/patches16_31.tar.gz"; + sha256 = "sha256-29uHUACwZKh8e4zJ9tWzEhLNjEuh6P31KbpxnMEhtuI="; }; buildInputs = old.buildInputs ++ [ prev.bison @@ -17,5 +17,5 @@ final: prev: { prev.perl ]; }); - postgresql_orioledb_16 = final.postgresql_16; + postgresql_orioledb = final.pg_orioledb; } diff --git a/nix/postgresql/default.nix b/nix/postgresql/default.nix index 5f92262b2..a065d5aa7 100644 --- a/nix/postgresql/default.nix +++ b/nix/postgresql/default.nix @@ -1,11 +1,11 @@ self: let - #adapted from the postgresql nixpkgs package versions = { postgresql_15 = ./15.nix; postgresql_16 = ./16.nix; + postgresql_orioledb-16 = ./orioledb-16.nix; + postgresql_orioledb-17 = ./orioledb-17.nix; }; - mkAttributes = jitSupport: self.lib.mapAttrs' (version: path: let @@ -15,7 +15,6 @@ let inherit jitSupport self; }) ) versions; - in # variations without and with JIT (mkAttributes false) // (mkAttributes true) diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index 323b65167..19b73c162 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -7,6 +7,8 @@ let , glibc, zlib, readline, openssl, icu, lz4, zstd, systemd, libossp_uuid , pkg-config, libxml2, tzdata, libkrb5, substituteAll, darwin , linux-pam + #orioledb specific + , perl, bison, flex, docbook_xsl, docbook_xml_dtd_45, docbook_xsl_ns, libxslt # This is important to obtain a version of `libpq` that does not depend on systemd. , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic @@ -49,14 +51,20 @@ let inherit version; pname = pname + lib.optionalString jitSupport "-jit"; - src = fetchurl { - url = "mirror://postgresql/source/v${version}/${pname}-${version}.tar.bz2"; - inherit hash; - }; + src = if (builtins.match "[0-9][0-9]_.*" version != null) then + fetchurl { + url = "https://github.com/orioledb/postgres/archive/refs/tags/patches${version}.tar.gz"; + inherit hash; + } + else + fetchurl { + url = "mirror://postgresql/source/v${version}/${pname}-${version}.tar.bz2"; + inherit hash; + }; hardeningEnable = lib.optionals (!stdenv'.cc.isClang) [ "pie" ]; - outputs = [ "out" "lib" "doc" "man" ]; + outputs = [ "out" "lib" ]; setOutputFlags = false; # $out retains configureFlags :-/ buildInputs = [ @@ -74,7 +82,10 @@ let ++ lib.optionals pythonSupport [ python3 ] ++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals stdenv'.isLinux [ linux-pam ] - ++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ]; + ++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ] + ++ lib.optionals (builtins.match "[0-9][0-9]_.*" version != null) [ + perl bison flex docbook_xsl docbook_xml_dtd_45 docbook_xsl_ns libxslt + ]; nativeBuildInputs = [ makeWrapper @@ -86,7 +97,7 @@ let separateDebugInfo = true; - buildFlags = [ "world" ]; + buildFlags = [ "world-bin" ]; # Makes cross-compiling work when xml2-config can't be executed on the host. # Fixed upstream in https://github.com/postgres/postgres/commit/0bc8cebdb889368abdf224aeac8bc197fe4c9ae6 @@ -127,7 +138,7 @@ let (if atLeast "13" then ./patches/socketdir-in-run-13+.patch else ./patches/socketdir-in-run.patch) ]; - installTargets = [ "install-world" ]; + installTargets = [ "install-world-bin" ]; postPatch = '' # Hardcode the path to pgxs so pg_config returns the path in $out @@ -277,7 +288,7 @@ let paths = f pkgs ++ [ postgresql postgresql.lib - postgresql.man # in case user installs this into environment + #TODO RM postgresql.man # in case user installs this into environment ]; nativeBuildInputs = [ makeWrapper ]; diff --git a/nix/postgresql/orioledb-16.nix b/nix/postgresql/orioledb-16.nix new file mode 100644 index 000000000..e9a66850e --- /dev/null +++ b/nix/postgresql/orioledb-16.nix @@ -0,0 +1,4 @@ +import ./generic.nix { + version = "16_31"; + hash = "sha256-29uHUACwZKh8e4zJ9tWzEhLNjEuh6P31KbpxnMEhtuI="; +} diff --git a/nix/postgresql/orioledb-17.nix b/nix/postgresql/orioledb-17.nix new file mode 100644 index 000000000..bbe5024a5 --- /dev/null +++ b/nix/postgresql/orioledb-17.nix @@ -0,0 +1,4 @@ +import ./generic.nix { + version = "17_4"; + hash = "sha256-qMJpTcw/ExipQ1XIPvYTQK+qgcDC7zecdLJDIuQug+0="; +} diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 309588828..3c4e9181e 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -92,9 +92,9 @@ elif [ "$PSQL_VERSION" == "16" ]; then echo "Starting client for PSQL 16" PSQL16=@PSQL16_BINDIR@ BINDIR="$PSQL16" -elif [ "$PSQL_VERSION" == "orioledb-16" ]; then - echo "Starting client for PSQL ORIOLEDB 16" - PSQLORIOLEDB16=@PSQLORIOLEDB16_BINDIR@ +elif [ "$PSQL_VERSION" == "orioledb-17" ]; then + echo "Starting client for PSQL ORIOLEDB 17" + PSQLORIOLEDB16=@PSQLORIOLEDB17_BINDIR@ BINDIR="$PSQLORIOLEDB16" else echo "Please provide a valid Postgres version (15, 16, or orioledb-16)" diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 2b079bbf1..1ebae228f 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash [ ! -z "$DEBUG" ] && set -x -# first argument should be '15' or '16' for the version + if [ "$1" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ @@ -10,10 +10,10 @@ elif [ "$1" == "16" ]; then echo "Starting server for PSQL 16" PSQL16=@PSQL16_BINDIR@ BINDIR="$PSQL16" -elif [ "$1" == "orioledb-16" ]; then - echo "Starting server for PSQL ORIOLEDB 16" - PSQLORIOLEDB16=@PSQLORIOLEDB16_BINDIR@ - BINDIR="$PSQLORIOLEDB16" +elif [ "$1" == "orioledb-17" ]; then + echo "Starting server for PSQL ORIOLEDB 17" + PSQLORIOLEDB17=@PSQLORIOLEDB17_BINDIR@ + BINDIR="$PSQLORIOLEDB17" else echo "Please provide a valid Postgres version (15, 16 or orioledb-16)" exit 1 @@ -32,6 +32,7 @@ EXTENSION_CUSTOM_SCRIPTS=@EXTENSION_CUSTOM_SCRIPTS_DIR@ GROONGA=@GROONGA_DIR@ DATDIR=$(mktemp -d) LOCALE_ARCHIVE=@LOCALES@ +CURRENT_SYSTEM=@CURRENT_SYSTEM@ export LOCALE_ARCHIVE export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 @@ -60,5 +61,29 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" + +orioledb_config_items() { + if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then + # Remove items from postgresql.conf + sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" + #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present + sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf" + sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATADIR/postgresql.conf" + echo "default_table_access_method = 'orioledb'" >> "$DATADIR/postgresql.conf" + + fi + if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then + # Remove items from postgresql.conf + sed -i '' 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" + #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present + sed -i '' 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" + sed -i '' 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf" + sed -i '' 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATADIR/postgresql.conf" + echo "default_table_access_method = 'orioledb'" >> "$DATADIR/postgresql.conf" + + fi +} +orioledb_config_items "$1" export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k /tmp From 10137966b380aeae0fe3bc8d2ad5cace1df14dc2 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 25 Nov 2024 22:16:16 -0500 Subject: [PATCH 045/271] chore: bump releases (#1339) * chore: bump releases * chore: somehow -- migrate:up was missing * fix: update to use current version in dbmate test * chore: missing env. * chore: cleanup --- .github/workflows/test.yml | 3 +- ansible/vars.yml | 6 +- .../20241031003909_create_orioledb.sql | 1 + migrations/schema-orioledb-17.sql | 1091 +++++++++++++++++ 4 files changed, 1096 insertions(+), 5 deletions(-) create mode 100644 migrations/schema-orioledb-17.sql diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b60cfcca..f7a187eb5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,8 +69,7 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: verify schema.sql is committed run: | - GIT_SHA=${{github.sha}} - nix run github:supabase/postgres/develop#dbmate-tool -- --version ${{ env.PGMAJOR }} + nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 0bcc68ab3..057e1b370 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: "orioledb-17.0.1.000" - postgres15: "15.8.1.005" - postgres16: "16.3.1.011" + postgresorioledb-17: "orioledb-17.0.1.001" + postgres15: "15.8.1.013" + postgres16: "16.3.1.019" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20241031003909_create_orioledb.sql b/migrations/db/migrations/20241031003909_create_orioledb.sql index dbfe5a63e..5bab5182e 100644 --- a/migrations/db/migrations/20241031003909_create_orioledb.sql +++ b/migrations/db/migrations/20241031003909_create_orioledb.sql @@ -1,3 +1,4 @@ +-- migrate:up do $$ begin if exists (select 1 from pg_available_extensions where name = 'orioledb') then diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql new file mode 100644 index 000000000..f28dc9a2e --- /dev/null +++ b/migrations/schema-orioledb-17.sql @@ -0,0 +1,1091 @@ +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET transaction_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: auth; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA auth; + + +-- +-- Name: extensions; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA extensions; + + +-- +-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql_public; + + +-- +-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgbouncer; + + +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgsodium; + + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + +-- +-- Name: realtime; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA realtime; + + +-- +-- Name: storage; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA storage; + + +-- +-- Name: vault; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA vault; + + +-- +-- Name: orioledb; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public; + + +-- +-- Name: EXTENSION orioledb; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION orioledb IS 'OrioleDB -- the next generation transactional engine'; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; + + +-- +-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; + + +-- +-- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +-- +-- Name: email(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.email() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.email', true), '')::text; +$$; + + +-- +-- Name: role(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.role() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.role', true), '')::text; +$$; + + +-- +-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid; +$$; + + +-- +-- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_cron' + ) + THEN + grant usage on schema cron to postgres with grant option; + + alter default privileges in schema cron grant all on tables to postgres with grant option; + alter default privileges in schema cron grant all on functions to postgres with grant option; + alter default privileges in schema cron grant all on sequences to postgres with grant option; + + alter default privileges for user supabase_admin in schema cron grant all + on sequences to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on tables to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on functions to postgres with grant option; + + grant all privileges on all tables in schema cron to postgres with grant option; + revoke all on table cron.job from postgres; + grant select on table cron.job to postgres with grant option; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; + + +-- +-- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ +DECLARE + func_is_graphql_resolve bool; +BEGIN + func_is_graphql_resolve = ( + SELECT n.proname = 'resolve' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_proc AS n + ON ev.objid = n.oid + ); + + IF func_is_graphql_resolve + THEN + -- Update public wrapper to pass all arguments through to the pg_graphql resolve func + DROP FUNCTION IF EXISTS graphql_public.graphql; + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language sql + as $$ + select graphql.resolve( + query := query, + variables := coalesce(variables, '{}'), + "operationName" := "operationName", + extensions := extensions + ); + $$; + + -- This hook executes when `graphql.resolve` is created. That is not necessarily the last + -- function in the extension so we need to grant permissions on existing entities AND + -- update default permissions to any others that are created after `graphql.resolve` + grant usage on schema graphql to postgres, anon, authenticated, service_role; + grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; + grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; + grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; + + -- Allow postgres role to allow granting usage on graphql and graphql_public schemas to custom roles + grant usage on schema graphql_public to postgres with grant option; + grant usage on schema graphql to postgres with grant option; + END IF; + +END; +$_$; + + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; + + +-- +-- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; + + +-- +-- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + cmd record; +BEGIN + FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + IF cmd.command_tag IN ( + 'CREATE SCHEMA', 'ALTER SCHEMA' + , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' + , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' + , 'CREATE VIEW', 'ALTER VIEW' + , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' + , 'CREATE FUNCTION', 'ALTER FUNCTION' + , 'CREATE TRIGGER' + , 'CREATE TYPE', 'ALTER TYPE' + , 'CREATE RULE' + , 'COMMENT' + ) + -- don't notify in case of CREATE TEMP table or other objects created on pg_temp + AND cmd.schema_name is distinct from 'pg_temp' + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + obj record; +BEGIN + FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() + LOOP + IF obj.object_type IN ( + 'schema' + , 'table' + , 'foreign table' + , 'view' + , 'materialized view' + , 'function' + , 'trigger' + , 'type' + , 'rule' + ) + AND obj.is_temporary IS false -- no pg_temp objects + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ + DECLARE + graphql_is_dropped bool; + BEGIN + graphql_is_dropped = ( + SELECT ev.schema_name = 'graphql_public' + FROM pg_event_trigger_dropped_objects() AS ev + WHERE ev.schema_name = 'graphql_public' + ); + + IF graphql_is_dropped + THEN + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language plpgsql + as $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; + $$; + END IF; + + END; +$_$; + + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; + + +-- +-- Name: graphql(text, text, jsonb, jsonb); Type: FUNCTION; Schema: graphql_public; Owner: - +-- + +CREATE FUNCTION graphql_public.graphql("operationName" text DEFAULT NULL::text, query text DEFAULT NULL::text, variables jsonb DEFAULT NULL::jsonb, extensions jsonb DEFAULT NULL::jsonb) RETURNS jsonb + LANGUAGE plpgsql + AS $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; +$$; + + +-- +-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - +-- + +CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) + LANGUAGE plpgsql SECURITY DEFINER + AS $$ +BEGIN + RAISE WARNING 'PgBouncer auth request: %', p_usename; + + RETURN QUERY + SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow + WHERE usename = p_usename; +END; +$$; + + +-- +-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.extension(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +_filename text; +BEGIN + select string_to_array(name, '/') into _parts; + select _parts[array_length(_parts,1)] into _filename; + -- @todo return the last part instead of 2 + return split_part(_filename, '.', 2); +END +$$; + + +-- +-- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.filename(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[array_length(_parts,1)]; +END +$$; + + +-- +-- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.foldername(name text) RETURNS text[] + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[1:array_length(_parts,1)-1]; +END +$$; + + +-- +-- Name: search(text, text, integer, integer, integer); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) + LANGUAGE plpgsql + AS $$ +DECLARE +_bucketId text; +BEGIN + -- will be replaced by migrations when server starts + -- saving space for cloud-init +END +$$; + + +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.audit_log_entries ( + instance_id uuid, + id uuid NOT NULL, + payload json, + created_at timestamp with time zone +); + + +-- +-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; + + +-- +-- Name: instances; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.instances ( + id uuid NOT NULL, + uuid uuid, + raw_base_config text, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; + + +-- +-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.refresh_tokens ( + instance_id uuid, + id bigint NOT NULL, + token character varying(255), + user_id character varying(255), + revoked boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: - +-- + +CREATE SEQUENCE auth.refresh_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: - +-- + +ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.schema_migrations ( + version character varying(255) NOT NULL +); + + +-- +-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; + + +-- +-- Name: users; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.users ( + instance_id uuid, + id uuid NOT NULL, + aud character varying(255), + role character varying(255), + email character varying(255), + encrypted_password character varying(255), + confirmed_at timestamp with time zone, + invited_at timestamp with time zone, + confirmation_token character varying(255), + confirmation_sent_at timestamp with time zone, + recovery_token character varying(255), + recovery_sent_at timestamp with time zone, + email_change_token character varying(255), + email_change character varying(255), + email_change_sent_at timestamp with time zone, + last_sign_in_at timestamp with time zone, + raw_app_meta_data jsonb, + raw_user_meta_data jsonb, + is_super_admin boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.schema_migrations ( + version character varying(128) NOT NULL +); + + +-- +-- Name: buckets; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.buckets ( + id text NOT NULL, + name text NOT NULL, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now() +); + + +-- +-- Name: migrations; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.migrations ( + id integer NOT NULL, + name character varying(100) NOT NULL, + hash character varying(40) NOT NULL, + executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +-- +-- Name: objects; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.objects ( + id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, + bucket_id text, + name text, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + last_accessed_at timestamp with time zone DEFAULT now(), + metadata jsonb +); + + +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT id, + name, + description, + secret, + CASE + WHEN (secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) + END + END AS decrypted_secret, + key_id, + nonce, + created_at, + updated_at + FROM vault.secrets; + + +-- +-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); + + +-- +-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.audit_log_entries + ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); + + +-- +-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.instances + ADD CONSTRAINT instances_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: users users_email_key; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_email_key UNIQUE (email); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); + + +-- +-- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_name_key UNIQUE (name); + + +-- +-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); + + +-- +-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_pkey PRIMARY KEY (id); + + +-- +-- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); + + +-- +-- Name: refresh_tokens_token_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); + + +-- +-- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); + + +-- +-- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); + + +-- +-- Name: bname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); + + +-- +-- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); + + +-- +-- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); + + +-- +-- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); + + +-- +-- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: - +-- + +ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; + +-- +-- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: - +-- + +CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); + + +-- +-- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop + WHEN TAG IN ('DROP EXTENSION') + EXECUTE FUNCTION extensions.set_graphql_placeholder(); + + +-- +-- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_cron_access(); + + +-- +-- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end + WHEN TAG IN ('CREATE FUNCTION') + EXECUTE FUNCTION extensions.grant_pg_graphql_access(); + + +-- +-- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + + +-- +-- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end + EXECUTE FUNCTION extensions.pgrst_ddl_watch(); + + +-- +-- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop + EXECUTE FUNCTION extensions.pgrst_drop_watch(); + + +-- +-- PostgreSQL database dump complete +-- + + +-- +-- Dbmate schema migrations +-- + From 1a42585fbcd6a9bdbca95b609a41b82853d22ff6 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 27 Nov 2024 12:11:06 -0500 Subject: [PATCH 046/271] chore: we do not use the --migrate down so removing that statement (#1341) --- migrations/db/migrations/20241031003909_create_orioledb.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/migrations/db/migrations/20241031003909_create_orioledb.sql b/migrations/db/migrations/20241031003909_create_orioledb.sql index 5bab5182e..694fbb939 100644 --- a/migrations/db/migrations/20241031003909_create_orioledb.sql +++ b/migrations/db/migrations/20241031003909_create_orioledb.sql @@ -9,4 +9,3 @@ begin end $$; -- migrate:down -drop extension if exists orioledb; From 1d8545cef007923684179dc076e1092f3e13efab Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 29 Nov 2024 06:01:30 -0500 Subject: [PATCH 047/271] feat: add an env var we can detect in various utilities for managing oriole machines (#1344) --- ansible/tasks/stage2-setup-postgres.yml | 7 +++++++ ansible/vars.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index c3ce46941..facc1e54d 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -49,6 +49,13 @@ state: present when: is_psql_oriole and stage2_nix become: yes + + - name: Add ORIOLEDB_ENABLED environment variable + ansible.builtin.lineinfile: + path: /etc/environment + line: 'ORIOLEDB_ENABLED=true' + when: is_psql_oriole and stage2_nix + become: yes - name: Install Postgres from nix binary cache become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index 057e1b370..c0af41450 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "orioledb-17.0.1.001" + postgresorioledb-17: "orioledb-17.0.1.002" postgres15: "15.8.1.013" postgres16: "16.3.1.019" From 90cf6767fba902777be14ecb46ee67480ffe86d2 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 29 Nov 2024 09:41:09 -0500 Subject: [PATCH 048/271] chore: build and release oriole beta7 (#1345) * chore: build and release oriole beta7 * chore: clear nix cache on builder prior to install --- .github/workflows/test.yml | 9 ++++++++- ansible/vars.yml | 2 +- nix/ext/orioledb.nix | 8 ++++---- nix/postgresql/orioledb-17.nix | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7a187eb5..f343508a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,11 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - + + - name: Clear Nix cache + run: | + sudo rm -rf /home/runner/.cache/nix + - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | @@ -41,6 +45,9 @@ jobs: POSTGRES_PASSWORD: password steps: - uses: actions/checkout@v4 + - name: Clear Nix cache + run: | + sudo rm -rf /home/runner/.cache/nix - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | diff --git a/ansible/vars.yml b/ansible/vars.yml index c0af41450..74ad11cef 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "orioledb-17.0.1.002" + postgresorioledb-17: "orioledb-17.0.1.003" postgres15: "15.8.1.013" postgres16: "16.3.1.019" diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 9775226e1..d2291c549 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -6,12 +6,12 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "beta6"; - sha256 = "sha256-7nmgQDVcNuaGOM6V9xrer2jqfxhJhXZBXRZoiPEoisE="; + rev = "beta7"; + sha256 = "sha256-Rse/gYVkn4QvXipaJ8fyC6FIQ5afkLCaeylgp5MX1z8="; }; - version = "beta6"; + version = "beta7"; buildInputs = [ curl libkrb5 postgresql python3 openssl ]; - buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=4"; + buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5"; installPhase = '' runHook preInstall mkdir -p $out/{lib,share/postgresql/extension} diff --git a/nix/postgresql/orioledb-17.nix b/nix/postgresql/orioledb-17.nix index bbe5024a5..b79052e20 100644 --- a/nix/postgresql/orioledb-17.nix +++ b/nix/postgresql/orioledb-17.nix @@ -1,4 +1,4 @@ import ./generic.nix { - version = "17_4"; - hash = "sha256-qMJpTcw/ExipQ1XIPvYTQK+qgcDC7zecdLJDIuQug+0="; + version = "17_5"; + hash = "sha256-OgXLpFanNp+ngPFKyCEDUFvIEWQ9nK/1csUO9lVTXaQ="; } From 118094e303f27642030f9b60118c30cb2d632905 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 29 Nov 2024 13:45:34 -0500 Subject: [PATCH 049/271] chore: bump release (#1346) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 74ad11cef..4b3af8666 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: "orioledb-17.0.1.003" - postgres15: "15.8.1.013" - postgres16: "16.3.1.019" + postgresorioledb-17: "orioledb-17.0.1.004" + postgres15: "15.8.1.014" + postgres16: "16.3.1.020" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 4c381dd293ccf66a5b51baacf1c7cdb4b9314ebd Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Mon, 2 Dec 2024 17:59:39 +0200 Subject: [PATCH 050/271] chore: bump oriole to beta8 (#1349) --- ansible/vars.yml | 2 +- nix/ext/orioledb.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 4b3af8666..758829130 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "orioledb-17.0.1.004" + postgresorioledb-17: "orioledb-17.0.1.005" postgres15: "15.8.1.014" postgres16: "16.3.1.020" diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index d2291c549..ab6b9e39a 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -6,10 +6,10 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "beta7"; - sha256 = "sha256-Rse/gYVkn4QvXipaJ8fyC6FIQ5afkLCaeylgp5MX1z8="; + rev = "beta8"; + sha256 = "sha256-niyTQr1FQYEsKdxl/uVrKSiIR0DCnnT+DDkW47lsc80="; }; - version = "beta7"; + version = "beta8"; buildInputs = [ curl libkrb5 postgresql python3 openssl ]; buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5"; installPhase = '' From 891e45802022e1bf1c5ca6e25766289461afca54 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Mon, 2 Dec 2024 18:13:18 +0200 Subject: [PATCH 051/271] chore: bump other AMI versions (#1350) --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 758829130..7c28d7c2d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,8 +10,8 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "orioledb-17.0.1.005" - postgres15: "15.8.1.014" - postgres16: "16.3.1.020" + postgres15: "15.8.1.015" + postgres16: "16.3.1.021" # Non Postgres Extensions pgbouncer_release: "1.19.0" From ca87f92864b647f936e58314ba1c904237cbf436 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 4 Dec 2024 04:47:27 -0500 Subject: [PATCH 052/271] chore: name oriole ami with conventions used through the rest of supabase systems (#1354) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 7c28d7c2d..94c76eff1 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: "orioledb-17.0.1.005" - postgres15: "15.8.1.015" - postgres16: "16.3.1.021" + postgresorioledb-17: "17.0.1.006-orioledb" + postgres15: "15.8.1.016" + postgres16: "16.3.1.022" # Non Postgres Extensions pgbouncer_release: "1.19.0" From ee952d942293b691cb9a9e0b40855d7eaeb4ec0b Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 4 Dec 2024 14:41:31 -0500 Subject: [PATCH 053/271] feat: bootstrap tool for local infra set up on macos only (#1331) --- flake.nix | 7 + nix/tools/local-infra-bootstrap.sh.in | 407 ++++++++++++++++++++++++++ 2 files changed, 414 insertions(+) create mode 100644 nix/tools/local-infra-bootstrap.sh.in diff --git a/flake.nix b/flake.nix index d1892b117..b2a42c5f8 100644 --- a/flake.nix +++ b/flake.nix @@ -512,6 +512,12 @@ --subst-var-by 'NIX' '${pkgs.nixVersions.nix_2_20}/bin/nix' chmod +x $out/bin/sync-exts-versions ''; + + local-infra-bootstrap = pkgs.runCommand "local-infra-bootstrap" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap + chmod +x $out/bin/local-infra-bootstrap + ''; dbmate-tool = let migrationsDir = ./migrations/db; @@ -671,6 +677,7 @@ migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; pg-restore = mkApp "pg-restore" "pg-restore"; + local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; migration-unit-tests = mkApp "migration-unit-tests" "migration-unit-tests"; }; diff --git a/nix/tools/local-infra-bootstrap.sh.in b/nix/tools/local-infra-bootstrap.sh.in new file mode 100644 index 000000000..f1f8b752e --- /dev/null +++ b/nix/tools/local-infra-bootstrap.sh.in @@ -0,0 +1,407 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +[ ! -z "$DEBUG" ] && set -x + +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' # No Color +BOLD='\033[1m' + +INFRA_REPO_DIR="" +SUPABASE_REPO="" +SETUP_FLAG=false +NODE_VERSION="20" # Default Node.js version + +print_help() { + echo "Usage: nix run .#local-infra-bootstrap -- [options]" + echo + echo "Options:" + echo " -h, --help Show this help message" + echo " -s, --setup Setup the local infrastructure for development NOTE: Requires --infrastructure-repo and --supabase-repo" + echo " --infrastructure-repo Full path to infrastructure repository directory" + echo " --supabase-repo Full path to Supabase repository directory" + echo " --aws-yubikey-setup Install AWS CLI tools with YubiKey support" + echo " --aws-yubikey-setup-no-key Install AWS CLI tools without YubiKey" + echo " --node-version Specify Node.js version to install/use (default: $NODE_VERSION)" + echo + echo "Description:" + echo " Bootstrap the local infrastructure for development." + echo " This tool wraps homebrew and other tools to install the necessary dependencies." + echo + echo "Examples:" + echo " nix run .#local-infra-bootstrap -- --setup --infrastructure-repo /path/to/infrastructure --supabase-repo /path/to/supabase" + echo " nix run .#local-infra-bootstrap -- --aws-yubikey-setup" + echo " nix run .#local-infra-bootstrap -- --setup --node-version 18" +} + +check_brew() { + if command -v brew >/dev/null 2>&1; then + echo "Homebrew is installed." + echo "Version: $(brew --version)" + else + echo "Homebrew is not installed." + echo "To install Homebrew, run the following command:" + echo + echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' + echo + echo "After installation, you may need to add Homebrew to your PATH:" + echo + echo "For Intel Macs:" + echo 'echo '\''eval "$(/usr/local/bin/brew shellenv)"'\'' >> ~/.zprofile' + echo 'eval "$(/usr/local/bin/brew shellenv)"' + echo + echo "For Apple Silicon Macs (M1/M2/M3):" + echo 'echo '\''eval "$(/opt/homebrew/bin/brew shellenv)"'\'' >> ~/.zprofile' + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' + exit 1 + fi +} + +check_and_setup_node() { + echo -e "\n${BOLD}Checking Node.js installation...${NC}" + + # Check if the specified node version is installed + if ! brew list "node@$NODE_VERSION" &>/dev/null; then + echo "Node.js $NODE_VERSION is not installed. Installing..." + brew install "node@$NODE_VERSION" + fi + + # Unlink any existing node version + brew unlink node@* 2>/dev/null || true + + # Link the desired version with overwrite + echo "Linking Node.js $NODE_VERSION..." + brew link --overwrite --force "node@$NODE_VERSION" + + # Verify installation + if ! command -v node &>/dev/null; then + echo -e "${RED}❌ Failed to install Node.js $NODE_VERSION${NC}" + return 1 + fi + + current_version=$(node -v | cut -d 'v' -f2 | cut -d '.' -f1) + if [ "$current_version" = "$NODE_VERSION" ]; then + echo -e "${GREEN}✅ Node.js $NODE_VERSION is now active${NC}" + return 0 + else + echo -e "${RED}❌ Failed to switch to Node.js $NODE_VERSION${NC}" + return 1 + fi +} + +configure_ngrok() { + echo -e "\n${BOLD}Configuring ngrok settings...${NC}" + + if [ -z "$INFRA_REPO_DIR" ]; then + echo -e "${RED}Error: Infrastructure repository directory not specified${NC}" + return 1 + fi + + local env_file="$INFRA_REPO_DIR/.local.env" + mkdir -p "$INFRA_REPO_DIR" + + read -p "Enter your ngrok static domain (example.ngrok-free.app): " static_domain + read -p "Enter your ngrok auth token: " auth_token + + if [[ -z "$static_domain" || -z "$auth_token" ]]; then + echo -e "${RED}Error: Both static domain and auth token are required${NC}" + return 1 + fi + + cat > "$env_file" << EOF +EXTERNAL_SUPABASE_API_URL=http://${static_domain} +NGROK_AUTHTOKEN=${auth_token} +NGROK_STATIC_DOMAIN=${static_domain} +WARP_ALWAYS_ENABLED=true +SUPABASE_PATH=${SUPABASE_REPO} +EOF + + echo -e "${GREEN}✅ ngrok configuration saved to ${env_file}${NC}" +} + +check_app() { + local brew_name=$1 + local check_command=$2 + + echo "Checking $brew_name..." + + # Special case for OrbStack + if [ "$brew_name" = "orbstack" ]; then + if [ -d "/Applications/OrbStack.app" ]; then + echo "✅ $brew_name is installed" + return 0 + else + echo "❌ $brew_name is not installed" + return 1 + fi + fi + + # Standard command check + if command -v "$check_command" >/dev/null 2>&1; then + echo "✅ $brew_name is installed" + return 0 + else + echo "❌ $brew_name is not installed" + return 1 + fi +} + +install_app() { + local app=$1 + echo "Installing $app..." + + case "$app" in + "orbstack") + brew install --cask "$app" + if [ -d "/Applications/OrbStack.app" ]; then + echo "✅ OrbStack installed successfully" + echo "⚠️ Important: Please open OrbStack.app to complete the setup" + return 0 + fi + ;; + "aws-vault") + brew install --cask "$app" + # Give the system a moment to complete the linking + sleep 1 + if [ -f "/opt/homebrew/bin/aws-vault" ] || [ -f "/usr/local/bin/aws-vault" ]; then + echo "✅ aws-vault installed successfully" + return 0 + fi + ;; + "awscli") + brew install "$app" + # Reload shell environment to ensure AWS CLI is in PATH + eval "$(/opt/homebrew/bin/brew shellenv)" + if command -v aws >/dev/null 2>&1; then + echo "✅ $app installed successfully" + return 0 + fi + ;; + "dbmate"|*) + brew install "$app" + if command -v "$app" >/dev/null 2>&1; then + echo "✅ $app installed successfully" + return 0 + fi + ;; + esac + + echo "❌ Failed to install $app" + return 1 +} + +check_corepack_pnpm() { + echo -e "\nChecking Corepack PNPM setup..." + + # First check if pnpm binary exists in common locations + if [ -f "$(which pnpm 2>/dev/null)" ]; then + # Try to get version without executing pnpm + echo -e "${GREEN}✅ PNPM is enabled${NC}" + return 0 + else + echo -e "${RED}❌ PNPM is not installed${NC}" + return 1 + fi +} + +enable_corepack_pnpm() { + local pnpm_checked=false + + if [ "$pnpm_checked" = false ]; then + if ! check_corepack_pnpm; then + read -p "Would you like to enable PNPM through Corepack? (y/n) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Running corepack enable pnpm..." + # Remove existing symlinks if present + sudo rm -f /opt/homebrew/bin/pnpm /opt/homebrew/bin/pnpx + if NODE_OPTIONS="" corepack enable pnpm; then + echo -e "${GREEN}✅ Successfully enabled PNPM through Corepack${NC}" + pnpm_checked=true + return 0 + else + echo -e "${RED}❌ Failed to enable PNPM through Corepack${NC}" + pnpm_checked=true + return 1 + fi + else + echo -e "\n${BOLD}Skipping PNPM setup...${NC}" + pnpm_checked=true + return 0 + fi + else + pnpm_checked=true + return 0 + fi + fi + return 0 +} + +install_prerequisites() { + echo -e "\n${BOLD}Checking Prerequisites ...${NC}" + echo + + # Define apps and their check commands + local apps=("awscli" "dbmate" "orbstack" "corepack" "aws-vault" "tmux" "tmuxp" "ngrok") + local commands=("aws" "dbmate" "orbstack" "corepack" "aws-vault" "tmux" "tmuxp" "ngrok") + local pnpm_checked=false + + # Check each app and prompt for installation if missing + for i in "${!apps[@]}"; do + local brew_name="${apps[$i]}" + local check_command="${commands[$i]}" + + check_app "$brew_name" "$check_command" + if [ $? -eq 1 ]; then + read -p "Would you like to install $brew_name? (y/n) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + case "$brew_name" in + "tmux"|"tmuxp") + echo "Installing $brew_name..." + brew install "$brew_name" + if command -v "$brew_name" >/dev/null 2>&1; then + echo -e "${GREEN}✅ $brew_name installed successfully${NC}" + else + echo -e "${RED}❌ Failed to install $brew_name${NC}" + fi + ;; + *) + install_app "$brew_name" + ;; + esac + + # If we just installed corepack, check and enable pnpm + if [ "$brew_name" = "corepack" ] && [ "$pnpm_checked" = false ]; then + NODE_OPTIONS="" enable_corepack_pnpm + pnpm_checked=true + fi + else + echo -e "\n${BOLD}Skipping installation of $brew_name ...${NC}" + fi + elif [ "$brew_name" = "corepack" ] && [ "$pnpm_checked" = false ]; then + # If corepack is already installed, check pnpm once + NODE_OPTIONS="" enable_corepack_pnpm + pnpm_checked=true + fi + echo + done + if command -v ngrok >/dev/null 2>&1; then + configure_ngrok + fi + echo -e "\n${BOLD}Prerequisites Check Complete ${NC}" +} + +# AWS YubiKey Setup Function - Only installs required tools +install_aws_tools() { + echo -e "\n${BOLD}Installing required AWS CLI tools...${NC}" + + # Check and install AWS CLI + if ! command -v aws >/dev/null 2>&1; then + brew install awscli + echo -e "✅ AWS CLI installed" + else + echo -e "✅ AWS CLI already installed" + fi + + # Check and install AWS Vault + if ! command -v aws-vault >/dev/null 2>&1; then + brew install homebrew/cask/aws-vault + echo -e "✅ AWS Vault installed" + else + echo -e "✅ AWS Vault already installed" + fi + + if [[ "$1" != "--no-yubikey" ]]; then + # Check and install YubiKey Manager + if ! command -v ykman >/dev/null 2>&1; then + brew install ykman + echo -e "✅ YubiKey Manager installed" + else + echo -e "✅ YubiKey Manager already installed" + fi + fi + + echo -e "\n${BOLD}✅ AWS CLI tools installation complete${NC}" + echo -e "Please follow the AWS CLI MFA+YubiKey setup documentation for next steps." +} + +while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + print_help + exit 0 + ;; + -s|--setup) + SETUP_FLAG=true + shift + ;; + --node-version) + if [ -n "$2" ]; then + NODE_VERSION="$2" + shift 2 + else + echo "Error: --node-version requires a version number" + exit 1 + fi + ;; + --infrastructure-repo) + if [ -n "$2" ]; then + INFRA_REPO_DIR="$2" + shift 2 + else + echo "Error: --infrastructure-repo requires a path argument" + exit 1 + fi + ;; + --supabase-repo) + if [ -n "$2" ]; then + SUPABASE_REPO="$2" + shift 2 + else + echo "Error: --supabase-repo requires a path argument" + exit 1 + fi + ;; + --aws-yubikey-setup) + check_brew + install_aws_tools + shift + ;; + --aws-yubikey-setup-no-key) + check_brew + install_aws_tools "--no-yubikey" + shift + ;; + *) + echo "Unknown argument: $1" + print_help + exit 1 + ;; + esac +done + +# Validate setup requirements +if [ "$SETUP_FLAG" = true ]; then + if [ -z "$INFRA_REPO_DIR" ]; then + echo -e "${RED}Error: --infrastructure-repo is required when using --setup${NC}" + print_help + exit 1 + fi + if [ -z "$SUPABASE_REPO" ]; then + echo -e "${RED}Error: --supabase-repo is required when using --setup${NC}" + print_help + exit 1 + fi + check_brew + check_and_setup_node + install_prerequisites +fi + +# If no arguments provided, show help +if [ "$SETUP_FLAG" = false ] && [ -z "$INFRA_REPO_DIR" ]; then + print_help + exit 0 +fi \ No newline at end of file From dac11e1c53645e539994ec163ab47ca61d7029ee Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 4 Dec 2024 15:20:19 -0500 Subject: [PATCH 054/271] chore: update pgpsql-http version closes #1348 (#1353) --- ansible/vars.yml | 9 ++++----- nix/ext/pgsql-http.nix | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 94c76eff1..dff487733 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.006-orioledb" - postgres15: "15.8.1.016" - postgres16: "16.3.1.022" + postgresorioledb-17: "17.0.1.007-orioledb" + postgres15: "15.8.1.017" + postgres16: "16.3.1.023" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -78,8 +78,7 @@ pgaudit_release_checksum: sha256:8f4a73e451c88c567e516e6cba7dc1e23bc91686bb6f1f7 pgjwt_release: 9742dab1b2f297ad3811120db7b21451bca2d3c9 -pgsql_http_release: "1.5.0" -pgsql_http_release_checksum: sha256:43efc9e82afcd110f205b86b8d28d1355d39b6b134161e9661a33a1346818f5d +pgsql_http_release: "1.6.1" plpgsql_check_release: "2.2.5" plpgsql_check_release_checksum: sha256:6c3a3c5faf3f9689425c6db8a6b20bf4cd5e7144a055e29538eae980c7232573 diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index de8fa68c6..03fc3e683 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pgsql-http"; - version = "1.6.0"; + version = "1.6.1"; buildInputs = [ curl postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "pramsey"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-CPHfx7vhWfxkXsoKTzyFuTt47BPMvzi/pi1leGcuD60="; + hash = "sha256-C8eqi0q1dnshUAZjIsZFwa5FTYc7vmATF3vv2CReWPM="; }; installPhase = '' From 7ffa2a9db327626cbf297796d1ed1b4ec5e5c9b1 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 6 Dec 2024 14:47:02 -0500 Subject: [PATCH 055/271] chore: add building and cache for debug and src (#1361) --- docker/nix/build_nix.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index fc9883797..c03f124b4 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -25,3 +25,17 @@ nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16 if [ "$SYSTEM" != "x86_64-darwin" ]; then nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 fi +if [ "$SYSTEM" = "aarch64-linux" ]; then + nix build .#postgresql_15_debug -o ./postgresql_15_debug + nix build .#postgresql_15_src -o ./postgresql_15_src + nix build .#postgresql_16_debug -o ./postgresql_16_debug + nix build .#postgresql_16_src -o ./postgresql_16_src + nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug + nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src +fi From 5288163acfd72b21ac4d3b183ecba7c91a73ccf3 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 6 Dec 2024 18:04:16 -0500 Subject: [PATCH 056/271] chore: use all_fdws flag for buildFeatures attribute (#1359) --- nix/ext/wrappers/default.nix | 14 +------------- nix/tests/expected/extensions_sql_interface.out | 5 +---- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 7125f41be..772df813d 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -96,19 +96,7 @@ buildPgrxExtension_0_12_6 rec { buildAndTestSubdir = "wrappers"; buildFeatures = [ - "helloworld_fdw" - "bigquery_fdw" - "clickhouse_fdw" - "stripe_fdw" - "firebase_fdw" - "s3_fdw" - "airtable_fdw" - "logflare_fdw" - "auth0_fdw" - "mssql_fdw" - "redis_fdw" - "cognito_fdw" - "wasm_fdw" + "all_fdws" ]; doCheck = false; diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index 9097efd94..ca3a70135 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -5164,9 +5164,6 @@ order by wrappers | public | firebase_fdw_handler | | fdw_handler wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | firebase_fdw_validator | options text[], catalog oid | void - wrappers | public | hello_world_fdw_handler | | fdw_handler - wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) - wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void wrappers | public | logflare_fdw_handler | | fdw_handler wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | logflare_fdw_validator | options text[], catalog oid | void @@ -5198,7 +5195,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5034 rows) +(5031 rows) /* From 7d374fd6f629988a46e26b500922f56637cf9543 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Mon, 9 Dec 2024 12:54:26 -0600 Subject: [PATCH 057/271] Add pg-repack after create permissions script (#1356) * add pg-repack after create permissions script * bump image version to test * bump img * reset version tags * revert vars --- .../pg_repack/after-create.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ansible/files/postgresql_extension_custom_scripts/pg_repack/after-create.sql diff --git a/ansible/files/postgresql_extension_custom_scripts/pg_repack/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pg_repack/after-create.sql new file mode 100644 index 000000000..b0ec306de --- /dev/null +++ b/ansible/files/postgresql_extension_custom_scripts/pg_repack/after-create.sql @@ -0,0 +1,4 @@ +grant all on all tables in schema repack to postgres; +grant all on schema repack to postgres; +alter default privileges in schema repack grant all on tables to postgres; +alter default privileges in schema repack grant all on sequences to postgres; From 5e70797288d04722fc8fb3837f3cd40f0e629e55 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 9 Dec 2024 15:55:28 -0500 Subject: [PATCH 058/271] chore: let testinfra try to connect again if ssh conn is lost (#1355) * chore: let testinfra try to connect again if ssh conn is lost * fix: resolve file --- testinfra/test_ami_nix.py | 115 +++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 40 deletions(-) diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index cd58859fc..4d354fac3 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -12,8 +12,14 @@ from time import sleep # if GITHUB_RUN_ID is not set, use a default value that includes the user and hostname -RUN_ID = os.environ.get("GITHUB_RUN_ID", "unknown-ci-run-" + os.environ.get("USER", "unknown-user") + '@' + socket.gethostname()) -AMI_NAME = os.environ.get('AMI_NAME') +RUN_ID = os.environ.get( + "GITHUB_RUN_ID", + "unknown-ci-run-" + + os.environ.get("USER", "unknown-user") + + "@" + + socket.gethostname(), +) +AMI_NAME = os.environ.get("AMI_NAME") postgresql_schema_sql_content = """ ALTER DATABASE postgres SET "app.settings.jwt_secret" TO 'my_jwt_secret_which_is_not_so_secret'; ALTER DATABASE postgres SET "app.settings.jwt_exp" TO 3600; @@ -158,12 +164,12 @@ logger = logging.getLogger("ami-tests") handler = logging.StreamHandler() -formatter = logging.Formatter( - '%(asctime)s %(name)-12s %(levelname)-8s %(message)s') +formatter = logging.Formatter("%(asctime)s %(name)-12s %(levelname)-8s %(message)s") handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG) + # scope='session' uses the same container for all the tests; # scope='function' uses a new container per test function. @pytest.fixture(scope="session") @@ -232,7 +238,7 @@ def gzip_then_base64_encode(s: str) -> str: "Tags": [ {"Key": "Name", "Value": "ci-ami-test-nix"}, {"Key": "creator", "Value": "testinfra-ci"}, - {"Key": "testinfra-run-id", "Value": RUN_ID} + {"Key": "testinfra-run-id", "Value": RUN_ID}, ], } ], @@ -264,48 +270,76 @@ def gzip_then_base64_encode(s: str) -> str: logger.warning("waiting for ssh to be available") sleep(10) - host = testinfra.get_host( + def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): + for attempt in range(max_retries): + try: + return testinfra.get_host( + f"paramiko://ubuntu@{instance_ip}?timeout=60", + ssh_identity_file=ssh_identity_file, + ) + except Exception as e: + if attempt == max_retries - 1: + raise + logger.warning( + f"Ssh connection failed, retrying: {attempt + 1}/{max_retries} failed, retrying ..." + ) + sleep(5) + + host = get_ssh_connection( # paramiko is an ssh backend - f"paramiko://ubuntu@{instance.public_ip_address}?timeout=60", - ssh_identity_file=temp_key.get_priv_key_file(), + instance.public_ip_address, + temp_key.get_priv_key_file(), ) - def is_healthy(host) -> bool: - cmd = host.run("sudo -u postgres /usr/bin/pg_isready -U postgres") - if cmd.failed is True: - logger.warning("pg not ready") - return False - - cmd = host.run(f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'") - if cmd.failed is True: - logger.warning("adminapi not ready") - return False - - cmd = host.run("curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready") - if cmd.failed is True: - logger.warning("postgrest not ready") - return False - - cmd = host.run("curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health") - if cmd.failed is True: - logger.warning("gotrue not ready") - return False - - # TODO(thebengeu): switch to checking Envoy once it's the default. - cmd = host.run("sudo kong health") - if cmd.failed is True: - logger.warning("kong not ready") - return False - - cmd = host.run("sudo fail2ban-client status") - if cmd.failed is True: - logger.warning("fail2ban not ready") - return False + def is_healthy(host, instance_ip, ssh_identity_file) -> bool: + health_checks = [ + ( + "postgres", + lambda h: h.run("sudo -u postgres /usr/bin/pg_isready -U postgres"), + ), + ( + "adminapi", + lambda h: h.run( + f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'" + ), + ), + ( + "postgrest", + lambda h: h.run( + "curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready" + ), + ), + ( + "gotrue", + lambda h: h.run( + "curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health" + ), + ), + ("kong", lambda h: h.run("sudo kong health")), + ("fail2ban", lambda h: h.run("sudo fail2ban-client status")), + ] + + for service, check in health_checks: + try: + cmd = check(host) + if cmd.failed is True: + logger.warning(f"{service} not ready") + return False + except Exception: + logger.warning( + f"Connection failed during {service} check, attempting reconnect..." + ) + host = get_ssh_connection(instance_ip, ssh_identity_file) + return False return True while True: - if is_healthy(host): + if is_healthy( + host=host, + instance_ip=instance.public_ip_address, + ssh_identity_file=temp_key.get_priv_key_file(), + ): break sleep(1) @@ -393,6 +427,7 @@ def test_postgrest_ending_apikey_query_parameter_is_removed(host): ) assert res.ok + # There would be an error if the empty key query parameter isn't removed, # since PostgREST treats empty key query parameters as malformed input. # From 6468741590429269d7ba35546c1946225b2feef7 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Tue, 10 Dec 2024 18:28:26 -0500 Subject: [PATCH 059/271] bump pg_net 0.14.0 (#1366) CHANGELOG https://github.com/supabase/pg_net/releases/tag/v0.14.0 --- nix/ext/pg_net.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 3bf04ff94..22be10893 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pg_net"; - version = "0.13.0"; + version = "0.14.0"; buildInputs = [ curl postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-FRaTZPCJQPYAFmsJg22hYJJ0+gH1tMdDQoCQgiqEnaA="; + hash = "sha256-c1pxhTyrE5j6dY+M5eKAboQNofIORS+Dccz+7HKEKQI="; }; env.NIX_CFLAGS_COMPILE = "-Wno-error"; From c45336c611971037c2cc9fa21045870d225f80d5 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Thu, 12 Dec 2024 18:51:23 +0200 Subject: [PATCH 060/271] chore: merge 15.6 changes into develop (#1368) * fix: account for `public` grantee * fix(ci): respect postgresVersion input (#1237) * feat: bump gotrue version to v2.162.0 (#1241) * fix: only grant pg_read_all_data if it exists (#1242) * fix: only grant pg_read_all_data if it exists * fix: prevent `public` from being casted into `regrole` * fix(15.6): account for pg_stat_monitor major version upgrade (#1247) * chore: release updates to run physical backup as a service to 15.6 image (#1248) * chore: updates to run physical backups as a service (#1235) * chore: init commence-backup service * chore: bump adminapi and adminmgr * chore: bump version * fix: provide correct filename * chore: bump postgres version * fix(15.6/pg_upgrade): retry commands within the cleanup step; wait until PG is ready to accept connections (#1250) * fix(15.6/upgrades): collision when patching wrappers lib locations for upgrades (#1252) * feat: bump auth 2.162.1 on 15.6 (#1256) * fix(15.6): disable pg_stat_monitor (#1260) * fix: disable pg_stat_monitor * chore: bump version * fix(15.6): disable pg_stat_monitor (#1262) * fix: disable pg_stat_monitor * chore: bump version * feat: bump gotrue to v2.162.2 (#1264) * chore: add timescaledb 2.9.1; wrappers upgrade fix; wrappers & plv8 naming fix (#1259) Co-authored-by: Bobbie Soedirgo Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Co-authored-by: Kang Ming Co-authored-by: Stojan Dimitrovski Co-authored-by: Sam Rose fix(ci): respect postgresVersion input (#1237) fix: only grant pg_read_all_data if it exists (#1242) fix(15.6): disable pg_stat_monitor (#1260) * chore(15.6): bump pg version (#1273) * feat: bump auth to v2.163.0 on 15.6 (#1275) * fix: restart PG during pre-upgrade steps to shed hanging connections (#1271) * fix(upgrades): wrappers 4.2.0 -> wrappers 4.2.0 (#1278) * fix: handle supabase_admin authenticator membership snowflake * feat: add auth v2.163.1 to 15.6 (#1283) * feat: bump gotrue to v2.163.2 (#1287) * pg_net 0.11 on 15.6 release branch (#1290) * bump pg_net to 0.11.0 * bump image to 15.6.1.135 * fix: don't copy custom extension scripts during pg_upgrade (#1291) * fix: add recursive flag to custom extension script directory delete (#1292) * [GEN-11027] chore: reserve a fixed amount of blocks for the data volume; remove ansible pkg + ppa (#1295) * fix: grant predefined roles post-upgrade * fix: add more roles to reserved_roles & reserved_memberships (#1303) * fix: add more roles to reserved_roles & reserved_memberships * Update common-nix.vars.pkr.hcl * feat: update envoy lds config with auth jwks, oidc URLs, strip `sb-opk` header (#1296) * chore: udpate package repo for salt (#1307) * fix: use sudo for apt-get commands * Update pg net to 0.13.0 on pg 15.6 branch (#1315) * upgrade pg_net to 0.13.0 on 15.6 * bump postgres-version * chore: cleanup pgbouncer.get_auth ownership accordingly * chore: standardize * Upgrade pgvector to 0.8.0 * Update common-nix.vars.pkr.hcl Bump version to 15.6.1.140 * feat: upgrade to auth v2.164.0 (#1329) * fix: update auth to v2.164.0 * fix: upgrade version * fix: bump nix instead * fix: replace `alter routine` with `alter function|procedure` (#1333) * fix: pg_upgrade_script (#1336) * feat: supautils v2.5.0 * pgmq in 15.6 image (#1337) * pick pgmq to 15.6 * update extension interface test output * bump image version * fix: upload gotrue binary to internal-artifacts as a gz file (#1340) * feat: upgrade to auth v2.165.0 (#1357) Upgrade Auth version to v2.165.0 https://github.com/supabase/auth/pull/1846 Co-authored-by: Chris Stockton * feat: bump gotrue to v2.165.1 (#1358) * feat: build and cache debug and src on this branch (#1360) * fix: pgmq ownership (#1362) * fix: pgmq ownership * tmp * bump version for production release --------- Co-authored-by: Oliver Rice * fix: remove duplicate pgmq in test * chore: filter timescale 2.9.1 on pg 16 and oriole17 * chore: bumping versions (#1370) --------- Co-authored-by: Bobbie Soedirgo Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Co-authored-by: Kang Ming Co-authored-by: angelico Co-authored-by: Stojan Dimitrovski Co-authored-by: Sam Rose Co-authored-by: Oliver Rice Co-authored-by: Pavel Borisov Co-authored-by: Pavel Borisov <63344111+pashkinelfe@users.noreply.github.com> Co-authored-by: Joel Lee Co-authored-by: Chris Stockton <180184+cstockton@users.noreply.github.com> Co-authored-by: Chris Stockton --- Dockerfile | 2 +- .../pg_upgrade_scripts/common.sh | 5 ++++- .../pgmq/after-create.sql | 19 ++++++++++++++++++ ansible/manifest-playbook.yml | 20 ++----------------- ansible/vars.yml | 14 ++++++------- docker/orioledb/Dockerfile | 2 +- flake.nix | 11 ++++++++-- nix/tests/prime.sql | 2 +- 8 files changed, 44 insertions(+), 31 deletions(-) create mode 100644 ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql 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; From 2692c34f175ff8260caea88c6feaabd7c293ef54 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Sun, 15 Dec 2024 18:45:11 +0200 Subject: [PATCH 061/271] fix: pgmq perms+data (#1374) --- .../pg_upgrade_scripts/complete.sh | 74 ++++++++++++++++++- .../20241215003910_backfill_pgmq_metadata.sql | 29 ++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index c8542c685..515c490f6 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -79,7 +79,79 @@ EOF run_sql -c "$RECREATE_PG_CRON_QUERY" fi - # #incident-2024-09-12-project-upgrades-are-temporarily-disabled + # Patching pgmq ownership as it resets during upgrade + HAS_PGMQ=$(run_sql -A -t -c "select count(*) > 0 from pg_extension where extname = 'pgmq';") + if [ "$HAS_PGMQ" = "t" ]; then + PATCH_PGMQ_QUERY=$(cat <' + insert into pgmq.meta (queue_name, is_partitioned, is_unlogged, created_at) + select + substring(c.relname from 3) as queue_name, + false as is_partitioned, + case when c.relpersistence = 'u' then true else false end as is_unlogged, + now() as created_at + from + pg_catalog.pg_class c + join pg_catalog.pg_namespace n + on c.relnamespace = n.oid + where + n.nspname = 'pgmq' + and c.relname like 'q_%' + and c.relkind in ('r', 'p', 'u'); + end if; +end $$; + +-- migrate:down From 039c470fcd5109a26c6f02d0d9ce268e86181616 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 16 Dec 2024 07:47:50 -0500 Subject: [PATCH 062/271] feat: explicit create /var/lib/postgresql (#1376) * feat: explicit create /var/lib/postgresql * chore: rename --- ...ockerhub-release-15-6.yml => dockerhub-release-15-8.yml} | 2 +- Dockerfile-156 => Dockerfile-158 | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) rename .github/workflows/{dockerhub-release-15-6.yml => dockerhub-release-15-8.yml} (99%) rename Dockerfile-156 => Dockerfile-158 (97%) diff --git a/.github/workflows/dockerhub-release-15-6.yml b/.github/workflows/dockerhub-release-15-8.yml similarity index 99% rename from .github/workflows/dockerhub-release-15-6.yml rename to .github/workflows/dockerhub-release-15-8.yml index 4c7b5b998..11ffd2e48 100644 --- a/.github/workflows/dockerhub-release-15-6.yml +++ b/.github/workflows/dockerhub-release-15-8.yml @@ -60,7 +60,7 @@ jobs: platforms: linux/${{ matrix.arch }} cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - file: "Dockerfile-156" + file: "Dockerfile-158" - name: Slack Notification if: ${{ failure() }} uses: rtCamp/action-slack-notify@v2 diff --git a/Dockerfile-156 b/Dockerfile-158 similarity index 97% rename from Dockerfile-156 rename to Dockerfile-158 index ce83237f2..52c4e5af3 100644 --- a/Dockerfile-156 +++ b/Dockerfile-158 @@ -75,11 +75,9 @@ WORKDIR / RUN mkdir -p /usr/lib/postgresql/bin \ /usr/lib/postgresql/share/postgresql \ /usr/share/postgresql \ - # /usr/lib/postgresql/share/postgresql/contrib \ - #/usr/lib/postgresql/share/postgresql/timezonesets \ - #/usr/lib/postgresql/share/postgresql/tsearch_data \ - # /usr/lib/postgresql/share/postgresql/extension \ + /var/lib/postgresql \ && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /var/lib/postgresql \ && chown -R postgres:postgres /usr/share/postgresql # Create symbolic links From 2a778f7fd265f3100435a0d528681d39978e47c6 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Mon, 16 Dec 2024 12:40:45 -0600 Subject: [PATCH 063/271] pgmq migration safety (#1380) * improve pgmq migration safety * normalize whitespace --- .../20241215003910_backfill_pgmq_metadata.sql | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql b/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql index 652be2a1d..59ff0bf3a 100644 --- a/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql +++ b/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql @@ -3,10 +3,24 @@ do $$ begin -- Check if the pgmq.meta table exists if exists ( - select 1 - from pg_catalog.pg_class c - join pg_catalog.pg_namespace n on c.relnamespace = n.oid - where n.nspname = 'pgmq' and c.relname = 'meta' + select + 1 + from + pg_catalog.pg_class c + join pg_catalog.pg_namespace n + on c.relnamespace = n.oid + where + n.nspname = 'pgmq' + and c.relname = 'meta' + and c.relkind = 'r' -- regular table + -- Make sure only expected columns exist and are correctly named + and ( + select array_agg(attname::text order by attname) + from pg_catalog.pg_attribute a + where + a.attnum > 0 + and a.attrelid = c.oid + ) = array['created_at', 'is_partitioned', 'is_unlogged', 'queue_name']::text[] ) then -- Insert data into pgmq.meta for all tables matching the naming pattern 'pgmq.q_' insert into pgmq.meta (queue_name, is_partitioned, is_unlogged, created_at) @@ -20,9 +34,10 @@ begin join pg_catalog.pg_namespace n on c.relnamespace = n.oid where - n.nspname = 'pgmq' - and c.relname like 'q_%' - and c.relkind in ('r', 'p', 'u'); + n.nspname = 'pgmq' + and c.relname like 'q_%' + and c.relkind in ('r', 'p', 'u') + on conflict (queue_name) do nothing; end if; end $$; From ede8766d1e1320637be2602457288158b2f98458 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Mon, 16 Dec 2024 16:10:33 -0500 Subject: [PATCH 064/271] bump to supautils 2.6.0 (#1373) Has an important bug fix for ALTER SCHEMA, see CHANGELOG for v2.6.0: https://github.com/supabase/supautils/releases/tag/v2.6.0. --- ansible/vars.yml | 14 +++++++------- nix/ext/supautils.nix | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 588ac1e95..002023dac 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.008-orioledb" - postgres15: "15.8.1.018" - postgres16: "16.3.1.024" + postgresorioledb-17: "17.0.1.009-orioledb" + postgres15: "15.8.1.019" + postgres16: "16.3.1.025" # 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.5.0" -supautils_release_arm64_deb_checksum: sha256:406e4a816f719bd6c4b2143e9bb38078fbe60d7e85018ec0aed5d76924e28000 -supautils_release_amd64_deb_checksum: sha256:71f182b478d8aaf167609dd382875cdce3fbe992e888988b3d51cdad39e08202 -supautils_release_tar_checksum: sha256:07c41244e4374248da9c2df2822152f3ae8f1e74c8a92d361300480193219b63 +supautils_release: "2.6.0" +supautils_release_arm64_deb_checksum: sha256:b83f0777e506e310e33af4dafa8ae130b1b0e2871d6099234b332bfb33a5466f +supautils_release_amd64_deb_checksum: sha256:709d6cf4939031998b9392d435ad113564fb42c4c77e81e5035106840f8a74e0 +supautils_release_tar_checksum: sha256:b1cf964d1c56f45120d4724bfaf258cc7c0caccb30d8bde20bcda088a5990718 pljava_release: master pljava_release_checksum: sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6 diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index 40c27fbe8..f3f5f1482 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "supautils"; - version = "2.5.0"; + version = "2.6.0"; buildInputs = [ postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-NyAk+QpQEdibmFY4yceO/FzMOhRYhKXf4XUw9XJ5rOY="; + hash = "sha256-QNfUpQjqHNzbNqBvjb5a3GtNH9hjbBMDUK19xUU3LpI="; }; installPhase = '' From d21182ce2c7d9d6cebf37ce225f5650b177370cc Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Tue, 17 Dec 2024 14:57:50 +0200 Subject: [PATCH 065/271] [WIP] fix: add helloworld fdw back again (#1382) * fix: add helloworld fdw back again * chore: update extension interface output --- nix/ext/wrappers/default.nix | 1 + nix/tests/expected/extensions_sql_interface.out | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 772df813d..025b0b3b0 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -96,6 +96,7 @@ buildPgrxExtension_0_12_6 rec { buildAndTestSubdir = "wrappers"; buildFeatures = [ + "helloworld_fdw" "all_fdws" ]; doCheck = false; diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index ca3a70135..9097efd94 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -5164,6 +5164,9 @@ order by wrappers | public | firebase_fdw_handler | | fdw_handler wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | firebase_fdw_validator | options text[], catalog oid | void + wrappers | public | hello_world_fdw_handler | | fdw_handler + wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void wrappers | public | logflare_fdw_handler | | fdw_handler wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | logflare_fdw_validator | options text[], catalog oid | void @@ -5195,7 +5198,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5031 rows) +(5034 rows) /* From e73b260ac9fe3a54e2b6cec74a606f9ea653ac75 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Tue, 17 Dec 2024 19:38:53 +0100 Subject: [PATCH 066/271] fix: jump update auth version to 2.165.1 from 2.163.2 (#1383) Co-authored-by: Paul Cioanca --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 002023dac..a3d62095b 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.009-orioledb" - postgres15: "15.8.1.019" - postgres16: "16.3.1.025" + postgresorioledb-17: "17.0.1.010-orioledb" + postgres15: "15.8.1.020" + postgres16: "16.3.1.026" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.163.2 -gotrue_release_checksum: sha1:31889bc8c498b924c2cb3b6c4084ef6e57ed97c0 +gotrue_release: 2.165.1 +gotrue_release_checksum: sha1:bbd62327d8612ac756177dde81d5368b660ca4c8 aws_cli_release: "2.2.7" From 047a2d705755651af7a62462248edd46750e408c Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 18 Dec 2024 05:38:59 +0200 Subject: [PATCH 067/271] fix: upgrade script workflow (#1375) --- .github/workflows/publish-nix-pgupgrade-bin-flake-version.yml | 4 ++-- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index 6160b586c..47bbc274d 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -42,7 +42,7 @@ jobs: id: process_release_version run: | VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi @@ -92,7 +92,7 @@ jobs: id: process_release_version run: | VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index a4aa4c3de..907f5e8e8 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -101,7 +101,7 @@ jobs: id: process_release_version run: | VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} fi From 30dbf4a121cb44a3d6875339b7292885b76573fe Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Thu, 19 Dec 2024 15:49:06 -0600 Subject: [PATCH 068/271] resolve pgmq.delete_queue issue after restore (#1385) --- .../20241215003910_backfill_pgmq_metadata.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql b/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql index 59ff0bf3a..578527275 100644 --- a/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql +++ b/migrations/db/migrations/20241215003910_backfill_pgmq_metadata.sql @@ -41,4 +41,39 @@ begin end if; end $$; +-- For logical backups we detach the queue and archive tables from the pgmq extension +-- prior to pausing. Once detached, pgmq.drop_queue breaks. This re-attaches them +-- when a project is unpaused and allows pgmq.drop_queue to work normally. +do $$ +declare + ext_exists boolean; + tbl record; +begin + -- check if pgmq extension is installed + select exists(select 1 from pg_extension where extname = 'pgmq') into ext_exists; + + if ext_exists then + for tbl in + select c.relname as table_name + from pg_class c + join pg_namespace n on c.relnamespace = n.oid + where n.nspname = 'pgmq' + and c.relkind in ('r', 'u') -- include ordinary and unlogged tables + and (c.relname like 'q\_%' or c.relname like 'a\_%') + and c.oid not in ( + select d.objid + from pg_depend d + join pg_extension e on d.refobjid = e.oid + where e.extname = 'pgmq' + and d.classid = 'pg_class'::regclass + and d.deptype = 'e' + ) + loop + execute format('alter extension pgmq add table pgmq.%I', tbl.table_name); + end loop; + end if; +end; +$$; + + -- migrate:down From d61c5c4f798b8515f900d50dda3a8881a0b014f3 Mon Sep 17 00:00:00 2001 From: samrose Date: Sat, 21 Dec 2024 07:27:23 -0500 Subject: [PATCH 069/271] publish docker images/image updates for major versions (#1372) * feat: orioledb-17 Docker image and publish workflow * feat: refactor to build docker images from major versions skip if no Dockerfile exists * feat: gen common vars hcl file * chore: cleanup * chore: adj trigger for run in PR` * chore: trigger release all major vers * chore: trigger on any path * chore: cleanup version handling * chore: simplify name matching * chore: matrix on version and arch in build_release_image * chore: try to get json formatting correct * chore: more fixes to json parse * feat: collect all versions into file, then array * chore: try to account for gh action handling * chore: output single matrix for each version * chore: more fixes to matrix handling * chore : fix output versions * chore: matrix in all tasks * chore: refactor matrix handling * chore: fix syntax * chore: look in the right dir * chore: need to pass full tag * fix: formatting * chore: strip the prefix when passing to mirror.yml * chore: get version formatted to pass to mirror.yml * fix: typo * chore: fix vars * fix: tryo to pass the version * chore: matrix on version and arch * chore: try to account for orioledb version issue * chore: remove version * chore: reading the version info directly from vars.yml * chore: force string context * chore: fixing logic * chore: fix string handling logic * chore: use sed and grep instead * chore: revert this to working version * chore: version extraction * chore: different logic on version processing if stmnt * chore: try to avoid jq involvement in this section * chore: back to this version * chore: refactor using nushell where scripting needed * chore: use data from previous step * chore: install with snap * chore: raw output on json * chore: should be able to run on ephemeral runners * chore: incrementing changes to matrix * chore: just use special key name if present * chore: account for postgres namespace in matrix * chore: pg_version should be key/value * chrore: ubuntu latest * chore: needs arm-runner after all * chore: source nushell from nix * chore: cannot have uses and run keys on same id * chore: detect runner and adjust the way command is run * chore: formatting * chore: make sure env var can be appended in all contexts * chore: outputs instead of env * chore: fix get_publish_version * chore: handle oriole * chore: remove base64 encoding * ore: raw json * chore: ensure proper variable naming * chore: use the matrix config we already have access to * chore: handling architecture * chore directly use matrix * chore: process each version * chore: matrix_json variable * fix: mirroring the merged manifest instead of per arch image * chore: using tags from merge_manifest * chore: no longer need get_publish_version at all * chore: combine tags in outputs at the end of merge_manifest * chore: cleanup steps to unbreak yaml * chore: no from json * chore: try to build up json over iterations * chore: use the github outputs array * chore: first collect all versions into array then output json array * chore: debug mainfest output * chore: store the results data in artifacts * chore: unique upload, then download and combine * fix: re-add actions and login * chore: try quotes for name matching * chore: utilise versions from prepare for download of artifact * chore: format correctly for nushell * chore: parse matrix config directly * chore: convert table to list of strings * chore:rm redundant * chore: add debug * chore: from json * chore: download with pattern * chore: use list operations * chore: include and debug * chore: extract version * chore: set up for merge to develop * chore: add permission to proper dir * chore: remove old files * chore: newline --- .../workflows/dockerhub-release-matrix.yml | 240 ++++++++++++++++++ Dockerfile-15 | 28 +- Dockerfile-16 => Dockerfile-orioledb-17 | 54 ++-- 3 files changed, 280 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/dockerhub-release-matrix.yml rename Dockerfile-16 => Dockerfile-orioledb-17 (84%) diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml new file mode 100644 index 000000000..c7af95e67 --- /dev/null +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -0,0 +1,240 @@ +name: Release all major versions on Dockerhub + +on: + push: + branches: + - develop + - release/* + paths: + - ".github/workflows/dockerhub-release-matrix.yml" + workflow_dispatch: + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} + steps: + - uses: DeterminateSystems/nix-installer-action@main + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Generate build matrix + id: set-matrix + run: | + nix run nixpkgs#nushell -- -c 'let versions = (open ansible/vars.yml | get postgres_major) + let matrix = ($versions | each { |ver| + let version = ($ver | str trim) + let dockerfile = $"Dockerfile-($version)" + if ($dockerfile | path exists) { + { + version: $version, + dockerfile: $dockerfile + } + } else { + null + } + } | compact) + + let matrix_config = { + include: $matrix + } + + $"matrix_config=($matrix_config | to json -r)" | save --append $env.GITHUB_OUTPUT' + build: + needs: prepare + strategy: + matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }} + runs-on: ubuntu-latest + outputs: + build_args: ${{ steps.args.outputs.result }} + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV + + - id: args + run: | + nix run nixpkgs#nushell -- -c ' + open ansible/vars.yml + | items { |key value| {name: $key, item: $value} } + | where { |it| ($it.item | describe) == "string" } + | each { |it| $"($it.name)=($it.item)" } + | str join "\n" + | save --append $env.GITHUB_OUTPUT + ' + build_release_image: + needs: [prepare, build] + strategy: + matrix: + postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} + arch: [amd64, arm64] + runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} + timeout-minutes: 180 + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - run: docker context create builders + - uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get image tag + id: image + run: | + if [[ "${{ matrix.arch }}" == "arm64" ]]; then + pg_version=$(sudo nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.postgres.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + open ansible/vars.yml | get postgres_release | get $release_key | str trim + ') + echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT + else + pg_version=$(nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.postgres.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + open ansible/vars.yml | get postgres_release | get $release_key | str trim + ') + echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT + fi + - id: build + uses: docker/build-push-action@v5 + with: + push: true + build-args: | + ${{ needs.build.outputs.build_args }} + target: production + tags: ${{ steps.image.outputs.pg_version }}_${{ matrix.arch }} + platforms: linux/${{ matrix.arch }} + cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + file: ${{ matrix.postgres.dockerfile }} + merge_manifest: + needs: [prepare, build, build_release_image] + strategy: + matrix: + include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get image tag + id: get_version + run: | + nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim) + $"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT + ' + - name: Output version + id: output_version + run: | + echo "result=${{ steps.get_version.outputs.pg_version }}" >> $GITHUB_OUTPUT + - name: Collect versions + id: collect_versions + run: | + echo "${{ steps.output_version.outputs.result }}" >> results.txt # Append results + - name: Upload Results Artifact + uses: actions/upload-artifact@v3 + with: + name: merge_results-${{ matrix.version }} + path: results.txt + if-no-files-found: warn + - name: Merge multi-arch manifests + run: | + docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \ + ${{ steps.get_version.outputs.pg_version }}_amd64 \ + ${{ steps.get_version.outputs.pg_version }}_arm64 + combine_results: + needs: [prepare, merge_manifest] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + + - name: Debug Input from Prepare + run: | + echo "Raw matrix_config output:" + echo "${{ needs.prepare.outputs.matrix_config }}" + - name: Get Versions from Matrix Config + id: get_versions + run: | + nix run nixpkgs#nushell -- -c ' + # Parse the matrix configuration directly + let matrix_config = (${{ toJson(needs.prepare.outputs.matrix_config) }} | from json) + + # Get versions directly from include array + let versions = ($matrix_config.include | get version) + + echo "Versions: $versions" + + # Convert the versions to a comma-separated string + let versions_str = ($versions | str join ",") + $"versions=$versions_str" | save --append $env.GITHUB_ENV + ' + - name: Download Results Artifacts + uses: actions/download-artifact@v3 + with: + pattern: merge_results-* + - name: Combine Results + id: combine + run: | + nix run nixpkgs#nushell -- -c ' + # Get all results files and process them in one go + let files = (ls **/results.txt | get name) + echo $"Found files: ($files)" + + let matrix = { + include: ( + $files + | each { |file| open $file } # Open each file + | each { |content| $content | lines } # Split into lines + | flatten # Flatten the nested lists + | where { |line| $line != "" } # Filter empty lines + | each { |line| + # Extract just the version part after the last colon + let version = ($line | parse "supabase/postgres:{version}" | get version.0) + {version: $version} + } + ) + } + + let json_output = ($matrix | to json -r) # -r for raw output + echo $"Debug output: ($json_output)" + + $"matrix=($json_output)" | save --append $env.GITHUB_OUTPUT + ' + - name: Debug Combined Results + run: | + echo "Combined Results: '${{ steps.combine.outputs.matrix }}'" + outputs: + matrix: ${{ steps.combine.outputs.matrix }} + publish: + needs: combine_results + strategy: + matrix: ${{ fromJson(needs.combine_results.outputs.matrix) }} + uses: ./.github/workflows/mirror.yml + with: + version: ${{ matrix.version }} + secrets: inherit diff --git a/Dockerfile-15 b/Dockerfile-15 index 01895db39..52c4e5af3 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -41,26 +41,14 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base - -ENV DEBIAN_FRONTEND=noninteractive \ - DEBCONF_NONINTERACTIVE_SEEN=true \ - TZ=Etc/UTC - -# Pre-configure tzdata before any installations -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ - echo $TZ > /etc/timezone && \ - apt-get update && \ - apt-get install -y --no-install-recommends tzdata && \ - apt-get install -y \ +RUN apt update -y && apt install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - git \ - && apt clean && \ - rm -rf /var/lib/apt/lists/* + && apt clean RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -87,11 +75,9 @@ WORKDIR / RUN mkdir -p /usr/lib/postgresql/bin \ /usr/lib/postgresql/share/postgresql \ /usr/share/postgresql \ - # /usr/lib/postgresql/share/postgresql/contrib \ - #/usr/lib/postgresql/share/postgresql/timezonesets \ - #/usr/lib/postgresql/share/postgresql/tsearch_data \ - # /usr/lib/postgresql/share/postgresql/extension \ + /var/lib/postgresql \ && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /var/lib/postgresql \ && chown -R postgres:postgres /usr/share/postgresql # Create symbolic links @@ -114,6 +100,12 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/Dockerfile-16 b/Dockerfile-orioledb-17 similarity index 84% rename from Dockerfile-16 rename to Dockerfile-orioledb-17 index c281ccd7f..e75694c16 100644 --- a/Dockerfile-16 +++ b/Dockerfile-orioledb-17 @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.6 -ARG postgresql_major=15 +ARG postgresql_major=17-orioledb ARG postgresql_release=${postgresql_major}.1 # Bump default build arg to build a package from source @@ -41,25 +41,15 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -ENV DEBIAN_FRONTEND=noninteractive \ - DEBCONF_NONINTERACTIVE_SEEN=true \ - TZ=Etc/UTC - -# Pre-configure tzdata before any installations -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ - echo $TZ > /etc/timezone && \ - apt-get update && \ - apt-get install -y --no-install-recommends tzdata && \ - apt-get install -y \ +RUN apt update -y && apt install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - git \ - && apt clean && \ - rm -rf /var/lib/apt/lists/* + tree \ + && apt clean RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -76,7 +66,7 @@ COPY . /nixpg WORKDIR /nixpg -RUN nix profile install .#psql_16/bin +RUN nix profile install .#psql_orioledb-17/bin @@ -86,11 +76,9 @@ WORKDIR / RUN mkdir -p /usr/lib/postgresql/bin \ /usr/lib/postgresql/share/postgresql \ /usr/share/postgresql \ - # /usr/lib/postgresql/share/postgresql/contrib \ - #/usr/lib/postgresql/share/postgresql/timezonesets \ - #/usr/lib/postgresql/share/postgresql/tsearch_data \ - # /usr/lib/postgresql/share/postgresql/extension \ + /var/lib/postgresql \ && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /var/lib/postgresql \ && chown -R postgres:postgres /usr/share/postgresql # Create symbolic links @@ -104,15 +92,19 @@ RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ RUN chown -R postgres:postgres /usr/share/postgresql/ # Create symbolic links for contrib directory -RUN mkdir -p /usr/lib/postgresql/share/postgresql/contrib \ - && find /nix/var/nix/profiles/default/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ - && chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/contrib/ +RUN tree /nix > /tmp/tree.txt && cat /tmp/tree.txt && cat /tmp/tree.txt >&2 RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets - + +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ @@ -191,15 +183,28 @@ RUN sed -i \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom + # Remove items from postgresql.conf +RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" + #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present +RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf" +RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf" +RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf" + + + # # Include schema migrations COPY migrations/db /docker-entrypoint-initdb.d/ COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql +# Enable orioledb extension first +RUN echo "CREATE EXTENSION orioledb;" > /docker-entrypoint-initdb.d/init-scripts/00-pre-init.sql && \ + chown postgres:postgres /docker-entrypoint-initdb.d/init-scripts/00-pre-init.sql # # Add upstream entrypoint script COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ + https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ /usr/local/bin/ RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql @@ -213,6 +218,7 @@ EXPOSE 5432 ENV POSTGRES_HOST=/var/run/postgresql ENV POSTGRES_USER=supabase_admin ENV POSTGRES_DB=postgres +ENV POSTGRES_INITDB_ARGS="--allow-group-access --locale-provider=icu --encoding=UTF-8 --icu-locale=en_US.UTF-8" RUN apt-get update && apt-get install -y --no-install-recommends \ locales \ && rm -rf /var/lib/apt/lists/* && \ From 26e6e99b0aeccd3ed9906f5ca63b325913f2e32b Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Sun, 22 Dec 2024 11:25:19 -0500 Subject: [PATCH 070/271] Update supautils.conf.j2 | allow users to log temp files (#1280) --- ansible/files/postgresql_config/supautils.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 086d6df9e..9cb8990bd 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -8,6 +8,7 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' +supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' -supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' +supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' \ No newline at end of file From 11dd460a8e08431ba5165f589e2acc37553132bf Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:22:52 -0500 Subject: [PATCH 071/271] Update supautils.conf.j2 | remove duplicate (#1387) --- ansible/files/postgresql_config/supautils.conf.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 9cb8990bd..68dcff3a5 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -9,6 +9,5 @@ supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/ex supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' -supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' -supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' \ No newline at end of file +supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' From 2043276484dc9c7e17115410ec0d0262d0e5d0f4 Mon Sep 17 00:00:00 2001 From: Joel Lee Date: Tue, 24 Dec 2024 17:44:41 +0530 Subject: [PATCH 072/271] fix: upgrade ami to contain auth 2.167.0 (#1389) * fix: upgrade ami to 2.167.0 * fix: revert vars --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a3d62095b..1ddc5eef8 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.010-orioledb" - postgres15: "15.8.1.020" - postgres16: "16.3.1.026" + postgresorioledb-17: "17.0.1.011-orioledb" + postgres15: "15.8.1.021" + postgres16: "16.3.1.027" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.165.1 -gotrue_release_checksum: sha1:bbd62327d8612ac756177dde81d5368b660ca4c8 +gotrue_release: 2.167.0 +gotrue_release_checksum: sha1:087553ffd442a050e716f3aae5f12ae716f44ae5 aws_cli_release: "2.2.7" From 3df2ac1393ee4b697e0c820fc8fd08512ad38743 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Thu, 2 Jan 2025 17:03:42 +0200 Subject: [PATCH 073/271] fix: add extensions schema to postgis topology search path (#1392) --- ansible/vars.yml | 6 +++--- nix/ext/postgis.nix | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 1ddc5eef8..52ae41e72 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.011-orioledb" - postgres15: "15.8.1.021" - postgres16: "16.3.1.027" + postgresorioledb-17: "17.0.1.012-orioledb" + postgres15: "15.8.1.022" + postgres16: "16.3.1.028" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index bb9a6162a..17b389e5c 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -69,6 +69,10 @@ stdenv.mkDerivation rec { ln -s $prog $prog-${version} done + for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do + sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" + done + mkdir -p $doc/share/doc/postgis mv doc/* $doc/share/doc/postgis/ ''; From 28eceabeb09eaf5993599f0e253d32061e10407e Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 5 Jan 2025 19:24:12 +0800 Subject: [PATCH 074/271] fix: trigger docker image build on changes to ansible vars --- .github/workflows/dockerhub-release-matrix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index c7af95e67..378d61725 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -7,6 +7,7 @@ on: - release/* paths: - ".github/workflows/dockerhub-release-matrix.yml" + - "ansible/vars.yml" workflow_dispatch: jobs: From 363a3ddcbbda3d3ed0f7de6d60f9ff681e62c6fc Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Tue, 7 Jan 2025 07:10:16 -0800 Subject: [PATCH 075/271] fix: bump gotrue version to v2.168.0 (#1400) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 52ae41e72..893927c77 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.012-orioledb" - postgres15: "15.8.1.022" - postgres16: "16.3.1.028" + postgresorioledb-17: "17.0.1.013-orioledb" + postgres15: "15.8.1.023" + postgres16: "16.3.1.029" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.167.0 -gotrue_release_checksum: sha1:087553ffd442a050e716f3aae5f12ae716f44ae5 +gotrue_release: 2.168.0 +gotrue_release_checksum: sha1:c303e004f59a58f7cbefda6fa669fc77deabe8e6 aws_cli_release: "2.2.7" From 22d1c60edf0aa45461b785d043243bbc67811d2d Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Wed, 8 Jan 2025 18:29:29 +1100 Subject: [PATCH 076/271] chore: bump wrappers to v0.4.4 (#1396) * chore: bump wrappers to v0.4.4 * chore: bump postgres version --- ansible/vars.yml | 8 ++++---- nix/ext/wrappers/default.nix | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 893927c77..648db56b0 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.013-orioledb" - postgres15: "15.8.1.023" - postgres16: "16.3.1.029" + postgresorioledb-17: "17.0.1.014-orioledb" + postgres15: "15.8.1.024" + postgres16: "16.3.1.030" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -139,7 +139,7 @@ groonga_release_checksum: sha256:1c2d1a6981c1ad3f02a11aff202b15ba30cb1c6147f1fa9 pgroonga_release: "3.0.7" pgroonga_release_checksum: sha256:885ff3878cc30e9030e5fc56d561bc8b66df3ede1562c9d802bc0ea04fe5c203 -wrappers_release: "0.4.3" +wrappers_release: "0.4.4" hypopg_release: "1.4.1" hypopg_release_checksum: sha256:9afe6357fd389d8d33fad81703038ce520b09275ec00153c6c89282bcdedd6bc diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 025b0b3b0..887bbc10d 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -17,16 +17,16 @@ let in buildPgrxExtension_0_12_6 rec { pname = "supabase-wrappers"; - version = "0.4.3"; + version = "0.4.4"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = ["0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; rev = "v${version}"; - hash = "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA="; + hash = "sha256-QoGFJpq8PuvMM8SS+VZd7MlNl56uFivRjs1tCtwX+oE="; }; nativeBuildInputs = [ pkg-config cargo git ]; From 92ec17457d0d524ca8b1c2da0775413e7fa73acd Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Thu, 9 Jan 2025 11:21:21 -0600 Subject: [PATCH 077/271] pgmq patch drop queue (#1404) * add test highlighting the drop_queue issue. raises exception * add after create patch for drop_queue * remove test because supautils hooks dont run. confirmed it works using start-server --- .../pgmq/after-create.sql | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql index 8b126d403..276220a3c 100644 --- a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql @@ -4,6 +4,137 @@ declare r record; begin set local search_path = ''; + +/* + Override the pgmq.drop_queue to check if relevant tables are owned + by the pgmq extension before attempting to run + `alter extension pgmq drop table ...` + this is necessary becasue, to enable nightly logical backups to include user queues + we automatically detach them from pgmq. + + this update is backwards compatible with version 1.4.4 but should be removed once we're on + physical backups everywhere +*/ +-- Detach and delete the official function +alter extension pgmq drop function pgmq.drop_queue; +drop function pgmq.drop_queue; + +-- Create and reattach the patched function +CREATE FUNCTION pgmq.drop_queue(queue_name TEXT) +RETURNS BOOLEAN AS $func$ +DECLARE + qtable TEXT := pgmq.format_table_name(queue_name, 'q'); + qtable_seq TEXT := qtable || '_msg_id_seq'; + fq_qtable TEXT := 'pgmq.' || qtable; + atable TEXT := pgmq.format_table_name(queue_name, 'a'); + fq_atable TEXT := 'pgmq.' || atable; + partitioned BOOLEAN; +BEGIN + EXECUTE FORMAT( + $QUERY$ + SELECT is_partitioned FROM pgmq.meta WHERE queue_name = %L + $QUERY$, + queue_name + ) INTO partitioned; + + -- NEW CONDITIONAL CHECK + if exists ( + select 1 + from pg_class c + join pg_depend d on c.oid = d.objid + join pg_extension e on d.refobjid = e.oid + where c.relname = qtable and e.extname = 'pgmq' + ) then + + EXECUTE FORMAT( + $QUERY$ + ALTER EXTENSION pgmq DROP TABLE pgmq.%I + $QUERY$, + qtable + ); + + end if; + + -- NEW CONDITIONAL CHECK + if exists ( + select 1 + from pg_class c + join pg_depend d on c.oid = d.objid + join pg_extension e on d.refobjid = e.oid + where c.relname = qtable_seq and e.extname = 'pgmq' + ) then + EXECUTE FORMAT( + $QUERY$ + ALTER EXTENSION pgmq DROP SEQUENCE pgmq.%I + $QUERY$, + qtable_seq + ); + + end if; + + -- NEW CONDITIONAL CHECK + if exists ( + select 1 + from pg_class c + join pg_depend d on c.oid = d.objid + join pg_extension e on d.refobjid = e.oid + where c.relname = atable and e.extname = 'pgmq' + ) then + + EXECUTE FORMAT( + $QUERY$ + ALTER EXTENSION pgmq DROP TABLE pgmq.%I + $QUERY$, + atable + ); + + end if; + + -- NO CHANGES PAST THIS POINT + + EXECUTE FORMAT( + $QUERY$ + DROP TABLE IF EXISTS pgmq.%I + $QUERY$, + qtable + ); + + EXECUTE FORMAT( + $QUERY$ + DROP TABLE IF EXISTS pgmq.%I + $QUERY$, + atable + ); + + IF EXISTS ( + SELECT 1 + FROM information_schema.tables + WHERE table_name = 'meta' and table_schema = 'pgmq' + ) THEN + EXECUTE FORMAT( + $QUERY$ + DELETE FROM pgmq.meta WHERE queue_name = %L + $QUERY$, + queue_name + ); + END IF; + + IF partitioned THEN + EXECUTE FORMAT( + $QUERY$ + DELETE FROM %I.part_config where parent_table in (%L, %L) + $QUERY$, + pgmq._get_pg_partman_schema(), fq_qtable, fq_atable + ); + END IF; + + RETURN TRUE; +END; +$func$ LANGUAGE plpgsql; + +alter extension pgmq add function pgmq.drop_queue; + + 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 From 7adb0a5f529d6deecb46439446caef86ee0a51c8 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Thu, 9 Jan 2025 14:42:48 -0600 Subject: [PATCH 078/271] bump images for pgmq after-create hook (#1405) --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 648db56b0..2a7ba0232 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,8 +9,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.014-orioledb" - postgres15: "15.8.1.024" + postgresorioledb-17: "17.0.1.015-orioledb" + postgres15: "15.8.1.025" postgres16: "16.3.1.030" # Non Postgres Extensions From 9bca2556ee594d0a2f4b243f3ce03aa1b2278352 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:35:02 +0530 Subject: [PATCH 079/271] chore: build ami (#1406) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 2a7ba0232..c891ede27 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.015-orioledb" - postgres15: "15.8.1.025" - postgres16: "16.3.1.030" + postgresorioledb-17: "17.0.1.016-orioledb" + postgres15: "15.8.1.026" + postgres16: "16.3.1.032" # Non Postgres Extensions pgbouncer_release: "1.19.0" From f7d730cd3135fe66275cebc23ca9bf21d46a2c94 Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Fri, 10 Jan 2025 18:29:23 +0900 Subject: [PATCH 080/271] Pin pg_repack version 1.5.2 based on tag (#1377) Upgrade pg_repack from 85b64c6d4f599b2988343c4e7121acab505c9006 to ver_1.5.2. --- nix/ext/pg_repack.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/pg_repack.nix b/nix/ext/pg_repack.nix index fac666149..7b8a69593 100644 --- a/nix/ext/pg_repack.nix +++ b/nix/ext/pg_repack.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "reorg"; repo = "pg_repack"; - rev = "85b64c6d4f599b2988343c4e7121acab505c9006"; - hash = "sha256-lAuLI+vupusvn3uTzQ9OaLqkEfUVMCAwU9R70tTbb8Y="; + rev = "ver_${finalAttrs.version}"; + hash = "sha256-wfjiLkx+S3zVrAynisX1GdazueVJ3EOwQEPcgUQt7eA="; }; installPhase = '' From e60f71e012f9131f0b2512d0710d7e44f994c4e4 Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Mon, 13 Jan 2025 03:22:37 -0500 Subject: [PATCH 081/271] feat: add new supautils.privileged_role_allowed_configs Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> --- ansible/files/postgresql_config/supautils.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 68dcff3a5..584af6765 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -8,6 +8,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' -supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_messages, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing' +supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, pg_stat_statements.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' From 82b96e09fc0ede2b330e613b67aaf48a6edb03f6 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Mon, 13 Jan 2025 12:31:46 +0100 Subject: [PATCH 082/271] feat: update envoy lds with origin protection keys (#1403) --- ansible/files/envoy_config/lds.supabase.yaml | 19 +++++++++++++++++++ ansible/vars.yml | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ansible/files/envoy_config/lds.supabase.yaml b/ansible/files/envoy_config/lds.supabase.yaml index 2fc7cae13..40d3d46f2 100644 --- a/ansible/files/envoy_config/lds.supabase.yaml +++ b/ansible/files/envoy_config/lds.supabase.yaml @@ -82,6 +82,25 @@ resources: name: ':path' string_match: contains: apikey=supabase_admin_key + origin_protection_key_missing: + permissions: + - any: true + principals: + - not_id: + header: + name: sb-opk + present_match: true + origin_protection_key_not_valid: + permissions: + - any: true + principals: + - not_id: + or_ids: + ids: + - header: + name: sb-opk + string_match: + exact: supabase_origin_protection_key - name: envoy.filters.http.lua typed_config: '@type': >- diff --git a/ansible/vars.yml b/ansible/vars.yml index c891ede27..ae48764ca 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.016-orioledb" - postgres15: "15.8.1.026" - postgres16: "16.3.1.032" + postgresorioledb-17: "17.0.1.017-orioledb" + postgres15: "15.8.1.027" + postgres16: "16.3.1.033" # Non Postgres Extensions pgbouncer_release: "1.19.0" From f9bb095335ccfb86cdf62394162d542421309c56 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 14 Jan 2025 15:54:04 -0500 Subject: [PATCH 083/271] Sam/oriole17 flake check (#1399) * chore: WIP check harness * chore: consolidate start-server/start-client * chore: consolidate start-server, start-client and check harness * chore: rm dup cleanup * chore: do not run pg with overmin, just pg_ctl in daemon mode * chore: deprecate x86_64-darwin and run check on oriole17 * wip toward fixing for all systems * chore: refactoring to create reusable makePostgresDevSetup * chore: tweaks to run-server.sh.in top account for oriole on macos * chore: remove x86_64-darwin support * Isolate failing tests on pg17 and OrioleDB (#1402) * separate pg17 and oriole test diffs * ignore minor diffs in float value * update pgmq after-create script for pg 17 * all tests fixed except interface * sync tests * move postgis_tiger_geocoder to ext_interface * align pg 17 extension interface tests * chore: getting pg tap tests and pg_regress tests to run for pg_15 and oriole 17 * chore: do not build or cache pg 16 for now * chore: wip running pgtap and pgreress tests + rm pg 16 for now * chore: fix tests to account for architecture differences3 * chore: deactivate tests and builds for pg 16 * chore: will pull pg 16 from vars in future pr * chore: update to unit test in ansible build include pg_grapqhl and pg_jsonschema for orioledb * chore: also include pgrouting and postgis in orioledb test * chore: tmp deactivate postgis on this test * chore: rm from list of exts in test too * chore: was missing KEY_FILE var in script * chore: deprecate 16 from versions --------- Co-authored-by: Oliver Rice --- .github/workflows/nix-build.yml | 2 - .../pgmq/after-create.sql | 25 +- ansible/tasks/test-image.yml | 29 +- ansible/vars.yml | 6 +- docker/nix/build_nix.sh | 18 +- flake.nix | 579 +- nix/tests/expected/pg_tle.out | 13 +- ...l_interface.out => z_15_ext_interface.out} | 2322 +++---- ...t_monitor.out => z_15_pg_stat_monitor.out} | 0 .../{pgroonga.out => z_15_pgroonga.out} | 0 .../{pgvector.out => z_15_pgvector.out} | 0 .../expected/{plv8.out => z_15_plv8.out} | 6 + nix/tests/expected/{rum.out => z_15_rum.out} | 15 +- .../{timescale.out => z_15_timescale.out} | 6 + nix/tests/expected/z_17_ext_interface.out | 5324 +++++++++++++++++ nix/tests/expected/z_17_pg_stat_monitor.out | 10 + nix/tests/expected/z_17_pgvector.out | 59 + nix/tests/prime.sql | 161 +- nix/tests/sql/pg_tle.sql | 7 +- nix/tests/sql/z_15_ext_interface.sql | 122 + ...t_monitor.sql => z_15_pg_stat_monitor.sql} | 0 .../sql/{pgroonga.sql => z_15_pgroonga.sql} | 0 .../sql/{pgvector.sql => z_15_pgvector.sql} | 0 nix/tests/sql/{plv8.sql => z_15_plv8.sql} | 6 + nix/tests/sql/{rum.sql => z_15_rum.sql} | 5 +- .../sql/{timescale.sql => z_15_timescale.sql} | 6 + ...l_interface.sql => z_17_ext_interface.sql} | 0 nix/tests/sql/z_17_pg_stat_monitor.sql | 6 + nix/tests/sql/z_17_pgvector.sql | 52 + nix/tests/util/pgsodium_getkey.sh | 8 +- nix/tools/run-client.sh.in | 35 - nix/tools/run-server.sh.in | 305 +- 32 files changed, 7537 insertions(+), 1590 deletions(-) rename nix/tests/expected/{extensions_sql_interface.out => z_15_ext_interface.out} (99%) rename nix/tests/expected/{pg_stat_monitor.out => z_15_pg_stat_monitor.out} (100%) rename nix/tests/expected/{pgroonga.out => z_15_pgroonga.out} (100%) rename nix/tests/expected/{pgvector.out => z_15_pgvector.out} (100%) rename nix/tests/expected/{plv8.out => z_15_plv8.out} (66%) rename nix/tests/expected/{rum.out => z_15_rum.out} (65%) rename nix/tests/expected/{timescale.out => z_15_timescale.out} (87%) create mode 100644 nix/tests/expected/z_17_ext_interface.out create mode 100644 nix/tests/expected/z_17_pg_stat_monitor.out create mode 100644 nix/tests/expected/z_17_pgvector.out create mode 100644 nix/tests/sql/z_15_ext_interface.sql rename nix/tests/sql/{pg_stat_monitor.sql => z_15_pg_stat_monitor.sql} (100%) rename nix/tests/sql/{pgroonga.sql => z_15_pgroonga.sql} (100%) rename nix/tests/sql/{pgvector.sql => z_15_pgvector.sql} (100%) rename nix/tests/sql/{plv8.sql => z_15_plv8.sql} (63%) rename nix/tests/sql/{rum.sql => z_15_rum.sql} (80%) rename nix/tests/sql/{timescale.sql => z_15_timescale.sql} (82%) rename nix/tests/sql/{extensions_sql_interface.sql => z_17_ext_interface.sql} (100%) create mode 100644 nix/tests/sql/z_17_pg_stat_monitor.sql create mode 100644 nix/tests/sql/z_17_pgvector.sql diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 473579875..c1811fd00 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -24,8 +24,6 @@ jobs: arch: arm64 - runner: macos-latest arch: arm64 - - runner: macos-13 - arch: amd64 runs-on: ${{ matrix.runner }} timeout-minutes: 180 steps: diff --git a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql index 276220a3c..050e07dfc 100644 --- a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql @@ -2,7 +2,9 @@ do $$ declare extoid oid := (select oid from pg_extension where extname = 'pgmq'); r record; + cls pg_class%rowtype; begin + set local search_path = ''; /* @@ -136,15 +138,36 @@ alter extension pgmq add function pgmq.drop_queue; 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)); + + -- store the type's relkind + select * into cls from pg_class c where c.reltype = r.objid; + + if r.objid::regtype::text like '%[]' then + -- do nothing (skipping array type) + + elsif cls.relkind in ('r', 'p', 'f', 'm') then + -- table-like objects (regular table, partitioned, foreign, materialized view) + execute format('alter table pgmq.%I owner to postgres;', cls.relname); + + else + execute(format('alter type %s owner to postgres;', r.objid::regtype)); + + end if; + 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/tasks/test-image.yml b/ansible/tasks/test-image.yml index d8e951a3e..9a8d4fa27 100644 --- a/ansible/tasks/test-image.yml +++ b/ansible/tasks/test-image.yml @@ -67,7 +67,7 @@ - name: Remove specified extensions from SQL file ansible.builtin.command: cmd: > - sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\|pg_jsonschema\|pg_graphql\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql + sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql when: is_psql_oriole become: yes @@ -76,11 +76,9 @@ paths: /tmp/migrations/tests/extensions patterns: - '*timescaledb*.sql' + - '*plv8*.sql' - '*postgis*.sql' - '*pgrouting*.sql' - - '*plv8*.sql' - - '*pg_jsonschema*.sql' - - '*pg_graphql*.sql' register: files_to_remove when: is_psql_oriole @@ -91,29 +89,6 @@ loop: "{{ files_to_remove.files }}" when: is_psql_oriole become: yes - - - name: Remove specified extensions from SQL file - ansible.builtin.command: - cmd: > - sed -i "/'pg_graphql',/d" /tmp/unit-tests/unit-test-01.sql - when: is_psql_oriole - become: yes - - - name: Remove graphql schema test - lineinfile: - path: /tmp/migrations/tests/database/exists.sql - regexp: "^SELECT has_schema\\('graphql'\\);$" - state: absent - become: yes - when: is_psql_oriole - - - name: Remove graphql schema test - lineinfile: - path: /tmp/migrations/tests/database/exists.sql - regexp: "^SELECT has_schema\\('graphql_public'\\);$" - state: absent - become: yes - when: is_psql_oriole - name: Run Unit tests (with filename unit-test-*) on Postgres Database shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index ae48764ca..813a133ba 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -4,14 +4,12 @@ async_mode: true postgres_major: - "15" - - "16" - "orioledb-17" # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.017-orioledb" - postgres15: "15.8.1.027" - postgres16: "16.3.1.033" + postgresorioledb-17: "17.0.1.018-orioledb" + postgres15: "15.8.1.028" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index c03f124b4..b0eef9863 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -9,33 +9,21 @@ fi SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') nix build .#checks.$SYSTEM.psql_15 -L --no-link -nix build .#checks.$SYSTEM.psql_16 -L --no-link - +nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link nix build .#psql_15/bin -o psql_15 -nix build .#psql_16/bin -o psql_16 -# Skip orioledb-17 on x86_64-darwin -if [ "$SYSTEM" != "x86_64-darwin" ]; then - nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -fi +nix build .#psql_orioledb-17/bin -o psql_orioledb_17 # Copy to S3 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_16 -if [ "$SYSTEM" != "x86_64-darwin" ]; then - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 -fi +nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_15_debug -o ./postgresql_15_debug nix build .#postgresql_15_src -o ./postgresql_15_src - nix build .#postgresql_16_debug -o ./postgresql_16_debug - nix build .#postgresql_16_src -o ./postgresql_16_src nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src fi diff --git a/flake.nix b/flake.nix index 0ef79e1d0..c0ecc45f0 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,6 @@ system.x86_64-linux system.aarch64-linux system.aarch64-darwin - system.x86_64-darwin ]; in flake-utils.lib.eachSystem ourSystems (system: @@ -147,18 +146,10 @@ x: 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 && - x != ./nix/ext/pg_jsonschema.nix && - x != ./nix/ext/pg_graphql.nix + x != ./nix/ext/plv8.nix ) 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 @@ -200,10 +191,8 @@ makeOurPostgresPkgs = version: let postgresql = getPostgresqlPackage version; - extensionsToUse = if (builtins.elem version ["orioledb-16" "orioledb-17"]) + extensionsToUse = if (builtins.elem version ["orioledb-17"]) then orioledbExtensions - else if version == "16" - then pg16Extensions else ourExtensions; in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; @@ -260,6 +249,115 @@ recurseForDerivations = true; }; + makePostgresDevSetup = { pkgs, name, extraSubstitutions ? {} }: + let + paths = { + migrationsDir = builtins.path { + name = "migrations"; + path = ./migrations/db; + }; + postgresqlSchemaSql = builtins.path { + name = "postgresql-schema"; + path = ./nix/tools/postgresql_schema.sql; + }; + pgbouncerAuthSchemaSql = builtins.path { + name = "pgbouncer-auth-schema"; + path = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + }; + statExtensionSql = builtins.path { + name = "stat-extension"; + path = ./ansible/files/stat_extension.sql; + }; + pgconfigFile = builtins.path { + name = "postgresql.conf"; + path = ./ansible/files/postgresql_config/postgresql.conf.j2; + }; + supautilsConfigFile = builtins.path { + name = "supautils.conf"; + path = ./ansible/files/postgresql_config/supautils.conf.j2; + }; + loggingConfigFile = builtins.path { + name = "logging.conf"; + path = ./ansible/files/postgresql_config/postgresql-csvlog.conf; + }; + readReplicaConfigFile = builtins.path { + name = "readreplica.conf"; + path = ./ansible/files/postgresql_config/custom_read_replica.conf.j2; + }; + pgHbaConfigFile = builtins.path { + name = "pg_hba.conf"; + path = ./ansible/files/postgresql_config/pg_hba.conf.j2; + }; + pgIdentConfigFile = builtins.path { + name = "pg_ident.conf"; + path = ./ansible/files/postgresql_config/pg_ident.conf.j2; + }; + postgresqlExtensionCustomScriptsPath = builtins.path { + name = "extension-custom-scripts"; + path = ./ansible/files/postgresql_extension_custom_scripts; + }; + getkeyScript = builtins.path { + name = "pgsodium_getkey.sh"; + path = ./nix/tests/util/pgsodium_getkey.sh; + }; + }; + + localeArchive = if pkgs.stdenv.isDarwin + then "${pkgs.darwin.locale}/share/locale" + else "${pkgs.glibcLocales}/lib/locale/locale-archive"; + + substitutions = { + SHELL_PATH = "${pkgs.bash}/bin/bash"; + PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; + PGSQL_SUPERUSER = "${pgsqlSuperuser}"; + PSQL15_BINDIR = "${basePackages.psql_15.bin}"; + PSQL_CONF_FILE = "${paths.pgconfigFile}"; + PSQLORIOLEDB17_BINDIR = "${basePackages.psql_orioledb-17.bin}"; + PGSODIUM_GETKEY = "${paths.getkeyScript}"; + READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; + LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; + SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; + PG_HBA = "${paths.pgHbaConfigFile}"; + PG_IDENT = "${paths.pgIdentConfigFile}"; + LOCALES = "${localeArchive}"; + EXTENSION_CUSTOM_SCRIPTS_DIR = "${paths.postgresqlExtensionCustomScriptsPath}"; + MECAB_LIB = "${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so"; + GROONGA_DIR = "${supabase-groonga}"; + MIGRATIONS_DIR = "${paths.migrationsDir}"; + POSTGRESQL_SCHEMA_SQL = "${paths.postgresqlSchemaSql}"; + PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; + STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; + CURRENT_SYSTEM = "${system}"; + } // extraSubstitutions; # Merge in any extra substitutions + in pkgs.runCommand name { + inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; + } '' + set -x + mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts + + # Copy config files with error handling + cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } + cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } + cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } + cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } + cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } + cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } + cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } + + echo "Copy operation completed" + chmod 644 $out/etc/postgresql-custom/supautils.conf + chmod 644 $out/etc/postgresql/postgresql.conf + chmod 644 $out/etc/postgresql-custom/logging.conf + chmod 644 $out/etc/postgresql/pg_hba.conf + + substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ + ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs + (name: value: "--subst-var-by '${name}' '${value}'") + substitutions + ))} + chmod +x $out/bin/start-postgres-server + ''; + # The base set of packages that we export from this Nix Flake, that can # be used with 'nix build'. Don't use the names listed below; check the # name in 'nix flake show' in order to make sure exactly what name you @@ -275,8 +373,6 @@ # Define the available PostgreSQL versions postgresVersions = { psql_15 = makePostgres "15"; - psql_16 = makePostgres "16"; - #psql_orioledb-16 = makePostgres "orioledb-16" ; psql_orioledb-17 = makePostgres "orioledb-17" ; }; @@ -292,24 +388,19 @@ postgresql = postgresqlPackage; }; postgresql_15 = getPostgresqlPackage "15"; - postgresql_16 = getPostgresqlPackage "16"; - #postgresql_orioledb-16 = getPostgresqlPackage "orioledb-16"; postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; in - postgresVersions //{ + postgresVersions // { 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; # PostgreSQL versions. psql_15 = postgresVersions.psql_15; - psql_16 = postgresVersions.psql_16; - #psql_orioledb-16 = postgresVersions.psql_orioledb-16; psql_orioledb-17 = postgresVersions.psql_orioledb-17; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_16 postgresql_orioledb-17; + inherit postgresql_15 postgresql_orioledb-17; postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; - postgresql_16_debug = if pkgs.stdenv.isLinux then postgresql_16.debug else null; postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; @@ -333,28 +424,6 @@ platforms = platforms.all; }; }; - postgresql_16_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-16-src"; - version = postgresql_16.version; - - src = postgresql_16.src; - - nativeBuildInputs = [ pkgs.bzip2 ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out - cp -r . $out - ''; - - meta = with pkgs.lib; { - description = "PostgreSQL 15 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; - }; - }; postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { pname = "postgresql-17-src"; version = postgresql_orioledb-17.version; @@ -381,76 +450,10 @@ supabase_groonga = supabase-groonga; pg_regress = makePgRegress activeVersion; # Start a version of the server. - start-server = - let - pgconfigFile = builtins.path { - name = "postgresql.conf"; - path = ./ansible/files/postgresql_config/postgresql.conf.j2; - }; - supautilsConfigFile = builtins.path { - name = "supautils.conf"; - path = ./ansible/files/postgresql_config/supautils.conf.j2; - }; - loggingConfigFile = builtins.path { - name = "logging.conf"; - path = ./ansible/files/postgresql_config/postgresql-csvlog.conf; - }; - readReplicaConfigFile = builtins.path { - name = "readreplica.conf"; - path = ./ansible/files/postgresql_config/custom_read_replica.conf.j2; - }; - pgHbaConfigFile = builtins.path { - name = "pg_hba.conf"; - path = ./ansible/files/postgresql_config/pg_hba.conf.j2; - }; - pgIdentConfigFile = builtins.path { - name = "pg_ident.conf"; - path = ./ansible/files/postgresql_config/pg_ident.conf.j2; - }; - postgresqlExtensionCustomScriptsPath = builtins.path { - name = "extension-custom-scripts"; - path = ./ansible/files/postgresql_extension_custom_scripts; - }; - getkeyScript = ./nix/tests/util/pgsodium_getkey.sh; - localeArchive = if pkgs.stdenv.isDarwin - then "${pkgs.darwin.locale}/share/locale" - else "${pkgs.glibcLocales}/lib/locale/locale-archive"; - in - pkgs.runCommand "start-postgres-server" { } '' - mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts - cp ${supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } - cp ${pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } - cp ${loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } - cp ${readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } - cp ${pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } - cp ${pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } - cp -r ${postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } - echo "Copy operation completed" - chmod 644 $out/etc/postgresql-custom/supautils.conf - chmod 644 $out/etc/postgresql/postgresql.conf - chmod 644 $out/etc/postgresql-custom/logging.conf - chmod 644 $out/etc/postgresql/pg_hba.conf - substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL_CONF_FILE' $out/etc/postgresql/postgresql.conf \ - --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ - --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ - --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ - --subst-var-by 'READREPL_CONF_FILE' "$out/etc/postgresql-custom/read-replica.conf" \ - --subst-var-by 'LOGGING_CONF_FILE' "$out/etc/postgresql-custom/logging.conf" \ - --subst-var-by 'SUPAUTILS_CONF_FILE' "$out/etc/postgresql-custom/supautils.conf" \ - --subst-var-by 'PG_HBA' "$out/etc/postgresql/pg_hba.conf" \ - --subst-var-by 'PG_IDENT' "$out/etc/postgresql/pg_ident.conf" \ - --subst-var-by 'LOCALES' '${localeArchive}' \ - --subst-var-by 'EXTENSION_CUSTOM_SCRIPTS_DIR' "$out/extension-custom-scripts" \ - --subst-var-by 'MECAB_LIB' '${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so' \ - --subst-var-by 'GROONGA_DIR' '${supabase-groonga}' \ - --subst-var-by 'CURRENT_SYSTEM' '${system}' - - chmod +x $out/bin/start-postgres-server - ''; + start-server = makePostgresDevSetup { + inherit pkgs; + name = "start-postgres-server"; + }; # Start a version of the client and runs migrations script on server. start-client = @@ -466,7 +469,6 @@ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ @@ -526,130 +528,261 @@ chmod +x $out/bin/local-infra-bootstrap ''; dbmate-tool = - let - migrationsDir = ./migrations/db; - ansibleVars = ./ansible/vars.yml; - pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - statExtensionSql = ./ansible/files/stat_extension.sql; - in - pkgs.runCommand "dbmate-tool" { - buildInputs = with pkgs; [ - overmind - dbmate - nix - jq - yq - ]; - nativeBuildInputs = with pkgs; [ - makeWrapper - ]; - } '' - mkdir -p $out/bin $out/migrations - cp -r ${migrationsDir}/* $out - substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ - --subst-var-by 'MIGRATIONS_DIR' $out \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ - --subst-var-by 'CURRENT_SYSTEM' '${system}' \ - --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ - --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' - chmod +x $out/bin/dbmate-tool - wrapProgram $out/bin/dbmate-tool \ - --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} - ''; + let + migrationsDir = ./migrations/db; + ansibleVars = ./ansible/vars.yml; + pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ./ansible/files/stat_extension.sql; + in + pkgs.runCommand "dbmate-tool" { + buildInputs = with pkgs; [ + overmind + dbmate + nix + jq + yq + ]; + nativeBuildInputs = with pkgs; [ + makeWrapper + ]; + } '' + mkdir -p $out/bin $out/migrations + cp -r ${migrationsDir}/* $out + substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ + --subst-var-by 'MIGRATIONS_DIR' $out \ + --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ + --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/dbmate-tool + wrapProgram $out/bin/dbmate-tool \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} + ''; }; # Create a testing harness for a PostgreSQL package. This is used for # 'nix flake check', and works with any PostgreSQL package you hand it. + makeCheckHarness = pgpkg: let sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; pg_regress = basePackages.pg_regress; - tmpDirCmd = if pkgs.stdenv.isDarwin then - ''mkdir -p /tmp/postgres-check.$$ && echo "/tmp/postgres-check.$$"'' - else - "mktemp -d"; + getkey-script = pkgs.writeScriptBin "pgsodium-getkey" '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + TMPDIR_BASE=$(mktemp -d) + + if [[ "$(uname)" == "Darwin" ]]; then + KEY_DIR="/private/tmp/pgsodium" + else + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" + fi + KEY_FILE="$KEY_DIR/pgsodium.key" + + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then + echo "Error: Could not create key directory $KEY_DIR" >&2 + exit 1 + fi + chmod 1777 "$KEY_DIR" + + if [[ ! -f "$KEY_FILE" ]]; then + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then + if ! (openssl rand -hex 32 > "$KEY_FILE"); then + echo "00000000000000000000000000000000" > "$KEY_FILE" + echo "Warning: Using fallback key" >&2 + fi + fi + chmod 644 "$KEY_FILE" + fi + + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then + cat "$KEY_FILE" + else + echo "Error: Cannot read key file $KEY_FILE" >&2 + exit 1 + fi + ''; + + # Use the shared setup but with a test-specific name + start-postgres-server-bin = makePostgresDevSetup { + inherit pkgs; + name = "start-postgres-server-test"; + extraSubstitutions = { + PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey"; + }; + }; + + getVersionArg = pkg: + let + name = pkg.version; + in + if builtins.match "15.*" name != null then "15" + else if builtins.match "17.*" name != null then "orioledb-17" + else throw "Unsupported PostgreSQL version: ${name}"; + + # Helper function to filter SQL files based on version + filterTestFiles = version: dir: + let + files = builtins.readDir dir; + isValidFile = name: + let + isVersionSpecific = builtins.match "z_([0-9]+)_.*" name != null; + matchesVersion = + if isVersionSpecific + then builtins.match ("z_" + version + "_.*") name != null + else true; + in + pkgs.lib.hasSuffix ".sql" name && matchesVersion; + in + pkgs.lib.filterAttrs (name: _: isValidFile name) files; + + # Get the major version for filtering + majorVersion = + if builtins.match ".*17.*" pgpkg.version != null + then "17" + else "15"; + + # Filter SQL test files + filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; + + # Convert filtered tests to a sorted list of basenames (without extension) + testList = pkgs.lib.mapAttrsToList (name: _: + builtins.substring 0 (pkgs.lib.stringLength name - 4) name + ) filteredSqlTests; + sortedTestList = builtins.sort (a: b: a < b) testList; + in pkgs.runCommand "postgres-${pgpkg.version}-check-harness" { - nativeBuildInputs = with pkgs; [ coreutils bash pgpkg pg_prove pg_regress procps supabase-groonga ]; + nativeBuildInputs = with pkgs; [ + coreutils bash perl pgpkg pg_prove pg_regress procps + start-postgres-server-bin which getkey-script supabase-groonga + ]; } '' - TMPDIR=$(${tmpDirCmd}) - if [ $? -ne 0 ]; then - echo "Failed to create temp directory" >&2 + set -e + + #First we need to create a generic pg cluster for pgtap tests and run those + export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins + PGTAP_CLUSTER=$(mktemp -d) + initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" + substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ + --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" + echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf + # Remove timescaledb if running orioledb-17 check + echo "I AM ${pgpkg.version}====================================================" + if [[ "${pgpkg.version}" == *"17"* ]]; then + perl -pi -e 's/ timescaledb,//g' "$PGTAP_CLUSTER/postgresql.conf" + fi + #NOTE in the future we may also need to add the orioledb extension to the cluster when cluster is oriole + echo "PGTAP_CLUSTER directory contents:" + ls -la "$PGTAP_CLUSTER" + + # Check if postgresql.conf exists + if [ ! -f "$PGTAP_CLUSTER/postgresql.conf" ]; then + echo "postgresql.conf is missing!" + exit 1 + fi + + # PostgreSQL startup + if [[ "$(uname)" == "Darwin" ]]; then + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 + else + mkdir -p "$PGTAP_CLUSTER/sockets" + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 + fi || { + echo "pg_ctl failed to start PostgreSQL" + echo "Contents of postgresql.log:" + cat "$PGTAP_CLUSTER"/postgresql.log exit 1 - fi - chmod -R 755 "$TMPDIR" - - # Ensure the temporary directory is removed on exit - #trap 'rm -rf "$TMPDIR"' EXIT - - export PGDATA="$TMPDIR/pgdata" - export PGSODIUM_DIR="$TMPDIR/pgsodium" - - mkdir -p $PGDATA - mkdir -p $TMPDIR/logfile - # Generate a random key and store it in an environment variable - export PGSODIUM_KEY=$(head -c 32 /dev/urandom | od -A n -t x1 | tr -d ' \n') - export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins - # Create a simple script to echo the key - echo '#!/bin/sh' > $TMPDIR/getkey.sh - echo 'echo $PGSODIUM_KEY' >> $TMPDIR/getkey.sh - chmod +x $TMPDIR/getkey.sh - initdb --locale=C --username=supabase_admin - substitute ${./nix/tests/postgresql.conf.in} $PGDATA/postgresql.conf \ - --subst-var-by PGSODIUM_GETKEY_SCRIPT "$TMPDIR/getkey.sh" - echo "listen_addresses = '*'" >> $PGDATA/postgresql.conf - echo "port = 5432" >> $PGDATA/postgresql.conf - echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf - # Add system-specific configuration for aarch64-darwin - - #postgres -D "$PGDATA" -k "$TMPDIR" -h localhost -p 5432 >$TMPDIR/logfile/postgresql.log 2>&1 & - pg_ctl -D "$PGDATA" -l $TMPDIR/logfile/postgresql.log -o "-k $TMPDIR -p 5432" start - for i in {1..60}; do - if pg_isready -h localhost -p 5432; then - echo "PostgreSQL is ready" - break + } + for i in {1..60}; do + if pg_isready -h localhost -p 5435; then + echo "PostgreSQL is ready" + break + fi + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL is not ready after 60 seconds" + echo "PostgreSQL status:" + pg_ctl -D "$PGTAP_CLUSTER" status + echo "PostgreSQL log content:" + cat "$PGTAP_CLUSTER"/postgresql.log + exit 1 + fi + done + createdb -p 5435 -h localhost --username=supabase_admin testing + if ! psql -p 5435 -h localhost --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + echo "Error executing SQL file. PostgreSQL log content:" + cat "$PGTAP_CLUSTER"/postgresql.log + pg_ctl -D "$PGTAP_CLUSTER" stop + exit 1 fi - sleep 1 - if [ $i -eq 60 ]; then - echo "PostgreSQL is not ready after 60 seconds" - echo "PostgreSQL status:" - pg_ctl -D "$PGDATA" status - echo "PostgreSQL log content:" - cat $TMPDIR/logfile/postgresql.log + SORTED_DIR=$(mktemp -d) + for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do + psql -p 5435 -h localhost --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true + done + rm -rf "$SORTED_DIR" + pg_ctl -D "$PGTAP_CLUSTER" stop + rm -rf $PGTAP_CLUSTER + + # End of pgtap tests + # from here on out we are running pg_regress tests, we use a different cluster for this + # which is start by the start-postgres-server-bin script + # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations + + # Ensure pgsodium key directory exists with proper permissions + if [[ "$(uname)" == "Darwin" ]]; then + mkdir -p /private/tmp/pgsodium + chmod 1777 /private/tmp/pgsodium + fi + unset GRN_PLUGINS_DIR + ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize + + for i in {1..60}; do + if pg_isready -h localhost -p 5435 -U supabase_admin -q; then + echo "PostgreSQL is ready" + break + fi + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL failed to start" + exit 1 + fi + done + + if ! psql -p 5435 -h localhost --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + echo "Error executing SQL file" exit 1 fi - done - createdb -p 5432 -h localhost --username=supabase_admin testing - if ! psql -p 5432 -h localhost --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then - echo "Error executing SQL file. PostgreSQL log content:" - cat $TMPDIR/logfile/postgresql.log - pg_ctl -D "$PGDATA" stop - exit 1 - fi - pg_prove -p 5432 -h localhost --username=supabase_admin -d testing ${sqlTests}/*.sql - - mkdir -p $out/regression_output - pg_regress \ - --use-existing \ - --dbname=testing \ - --inputdir=${./nix/tests} \ - --outputdir=$out/regression_output \ - --host=localhost \ - --port=5432 \ - --user=supabase_admin \ - $(ls ${./nix/tests/sql} | sed -e 's/\..*$//' | sort ) - - pg_ctl -D "$PGDATA" stop - mv $TMPDIR/logfile/postgresql.log $out - echo ${pgpkg} - ''; - in + + mkdir -p $out/regression_output + if ! pg_regress \ + --use-existing \ + --dbname=postgres \ + --inputdir=${./nix/tests} \ + --outputdir=$out/regression_output \ + --host=localhost \ + --port=5435 \ + --user=supabase_admin \ + ${builtins.concatStringsSep " " sortedTestList}; then + echo "pg_regress tests failed" + exit 1 + fi + + # Copy logs to output + for logfile in $(find /tmp -name postgresql.log -type f); do + cp "$logfile" $out/postgresql.log + done + exit 0 + ''; + in rec { # The list of all packages that can be built with 'nix build'. The list # of names that can be used can be shown with 'nix flake show' @@ -663,8 +796,7 @@ # flake check'. This is run in the CI system, as well. checks = { psql_15 = makeCheckHarness basePackages.psql_15.bin; - psql_16 = makeCheckHarness basePackages.psql_16.bin; - #psql_orioledb_16 = makeCheckHarness basePackages.psql_orioledb_16.bin; + psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; }; # Apps is a list of names of things that can be executed with 'nix run'; @@ -686,7 +818,6 @@ pg-restore = mkApp "pg-restore" "pg-restore"; local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; - migration-unit-tests = mkApp "migration-unit-tests" "migration-unit-tests"; }; # 'devShells.default' lists the set of packages that are included in the diff --git a/nix/tests/expected/pg_tle.out b/nix/tests/expected/pg_tle.out index cffce1d67..387e63e03 100644 --- a/nix/tests/expected/pg_tle.out +++ b/nix/tests/expected/pg_tle.out @@ -1,3 +1,4 @@ +set client_min_messages = warning; select pgtle.install_extension( 'pg_distance', @@ -29,16 +30,16 @@ select (1 row) create extension pg_distance; -select manhattan_dist(1, 1, 5, 5); +select manhattan_dist(1, 1, 5, 5)::numeric(10,2); manhattan_dist ---------------- - 8 + 8.00 (1 row) -select euclidean_dist(1, 1, 5, 5); - euclidean_dist -------------------- - 5.656854249492381 +select euclidean_dist(1, 1, 5, 5)::numeric(10,2); + euclidean_dist +---------------- + 5.66 (1 row) SELECT pgtle.install_update_path( diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/z_15_ext_interface.out similarity index 99% rename from nix/tests/expected/extensions_sql_interface.out rename to nix/tests/expected/z_15_ext_interface.out index 9097efd94..648693928 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -12,6 +12,13 @@ If a new entry shows up in this list, that means a new extension has been added and you should `create extension ...` to enable it in ./nix/tests/prime */ +create extension if not exists adminpack; +create extension if not exists plv8; +create extension if not exists plcoffee; +create extension if not exists plls; +create extension if not exists old_snapshot; +create extension if not exists timescaledb; +create extension if not exists postgis_tiger_geocoder; select name from @@ -20,10 +27,11 @@ where installed_version is null order by name asc; - name ---------- + name +----------------- pg_cron -(1 row) + tsm_system_time +(2 rows) /* @@ -116,13 +124,12 @@ order by tcn | t timescaledb | f tsm_system_rows | t - tsm_system_time | t unaccent | t uuid-ossp | t vector | t wrappers | f xml2 | f -(82 rows) +(81 rows) /* @@ -161,7 +168,7 @@ order by e.extname, n.nspname, p.proname, - pg_catalog.pg_get_function_identity_arguments(p.oid); + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); extension_name | schema_name | function_name | argument_types | return_type ------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record @@ -457,8 +464,8 @@ order by btree_gist | public | ts_dist | timestamp without time zone, timestamp without time zone | interval btree_gist | public | tstz_dist | timestamp with time zone, timestamp with time zone | interval citext | public | citext | boolean | citext - citext | public | citext | character | citext citext | public | citext | inet | citext + citext | public | citext | character | citext citext | public | citext_cmp | citext, citext | integer citext | public | citext_eq | citext, citext | boolean citext | public | citext_ge | citext, citext | boolean @@ -485,8 +492,8 @@ order by citext | public | regexp_match | citext, citext, text | text[] citext | public | regexp_matches | citext, citext | SETOF text[] citext | public | regexp_matches | citext, citext, text | SETOF text[] - citext | public | regexp_replace | citext, citext, text | text citext | public | regexp_replace | citext, citext, text, text | text + citext | public | regexp_replace | citext, citext, text | text citext | public | regexp_split_to_array | citext, citext | text[] citext | public | regexp_split_to_array | citext, citext, text | text[] citext | public | regexp_split_to_table | citext, citext | SETOF text @@ -503,12 +510,12 @@ order by citext | public | texticregexne | citext, citext | boolean citext | public | texticregexne | citext, text | boolean citext | public | translate | citext, citext, text | text - cube | public | cube | cube, double precision | cube cube | public | cube | cube, double precision, double precision | cube cube | public | cube | double precision | cube + cube | public | cube | double precision[], double precision[] | cube + cube | public | cube | cube, double precision | cube cube | public | cube | double precision, double precision | cube cube | public | cube | double precision[] | cube - cube | public | cube | double precision[], double precision[] | cube cube | public | cube_cmp | cube, cube | integer cube | public | cube_contained | cube, cube | boolean cube | public | cube_contains | cube, cube | boolean @@ -543,16 +550,16 @@ order by cube | public | g_cube_picksplit | internal, internal | internal cube | public | g_cube_same | cube, cube, internal | internal cube | public | g_cube_union | internal, internal | cube - dblink | public | dblink | text | SETOF record dblink | public | dblink | text, boolean | SETOF record + dblink | public | dblink | text | SETOF record dblink | public | dblink | text, text | SETOF record dblink | public | dblink | text, text, boolean | SETOF record dblink | public | dblink_build_sql_delete | text, int2vector, integer, text[] | text dblink | public | dblink_build_sql_insert | text, int2vector, integer, text[], text[] | text dblink | public | dblink_build_sql_update | text, int2vector, integer, text[], text[] | text dblink | public | dblink_cancel_query | text | text - dblink | public | dblink_close | text | text dblink | public | dblink_close | text, boolean | text + dblink | public | dblink_close | text | text dblink | public | dblink_close | text, text | text dblink | public | dblink_close | text, text, boolean | text dblink | public | dblink_connect | text | text @@ -560,29 +567,29 @@ order by dblink | public | dblink_connect_u | text | text dblink | public | dblink_connect_u | text, text | text dblink | public | dblink_current_query | | text - dblink | public | dblink_disconnect | | text dblink | public | dblink_disconnect | text | text + dblink | public | dblink_disconnect | | text dblink | public | dblink_error_message | text | text - dblink | public | dblink_exec | text | text dblink | public | dblink_exec | text, boolean | text + dblink | public | dblink_exec | text | text dblink | public | dblink_exec | text, text | text dblink | public | dblink_exec | text, text, boolean | text dblink | public | dblink_fdw_validator | options text[], catalog oid | void + dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record dblink | public | dblink_fetch | text, integer | SETOF record - dblink | public | dblink_fetch | text, integer, boolean | SETOF record dblink | public | dblink_fetch | text, text, integer | SETOF record - dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record + dblink | public | dblink_fetch | text, integer, boolean | SETOF record dblink | public | dblink_get_connections | | text[] dblink | public | dblink_get_notify | OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record dblink | public | dblink_get_notify | conname text, OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record dblink | public | dblink_get_pkey | text | SETOF dblink_pkey_results - dblink | public | dblink_get_result | text | SETOF record dblink | public | dblink_get_result | text, boolean | SETOF record + dblink | public | dblink_get_result | text | SETOF record dblink | public | dblink_is_busy | text | integer + dblink | public | dblink_open | text, text, text, boolean | text dblink | public | dblink_open | text, text | text dblink | public | dblink_open | text, text, boolean | text dblink | public | dblink_open | text, text, text | text - dblink | public | dblink_open | text, text, text, boolean | text dblink | public | dblink_send_query | text, text | integer dict_int | public | dintdict_init | internal | internal dict_int | public | dintdict_lexize | internal, internal, internal, internal | internal @@ -604,17 +611,17 @@ order by fuzzystrmatch | public | dmetaphone_alt | text | text fuzzystrmatch | public | levenshtein | text, text | integer fuzzystrmatch | public | levenshtein | text, text, integer, integer, integer | integer - fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer fuzzystrmatch | public | levenshtein_less_equal | text, text, integer, integer, integer, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer fuzzystrmatch | public | metaphone | text, integer | text fuzzystrmatch | public | soundex | text | text fuzzystrmatch | public | text_soundex | text | text hstore | public | akeys | hstore | text[] hstore | public | avals | hstore | text[] hstore | public | defined | hstore, text | boolean - hstore | public | delete | hstore, hstore | hstore hstore | public | delete | hstore, text | hstore hstore | public | delete | hstore, text[] | hstore + hstore | public | delete | hstore, hstore | hstore hstore | public | each | hs hstore, OUT key text, OUT value text | SETOF record hstore | public | exist | hstore, text | boolean hstore | public | exists_all | hstore, text[] | boolean @@ -636,10 +643,10 @@ order by hstore | public | hs_concat | hstore, hstore | hstore hstore | public | hs_contained | hstore, hstore | boolean hstore | public | hs_contains | hstore, hstore | boolean - hstore | public | hstore | record | hstore + hstore | public | hstore | text[], text[] | hstore hstore | public | hstore | text, text | hstore hstore | public | hstore | text[] | hstore - hstore | public | hstore | text[], text[] | hstore + hstore | public | hstore | record | hstore hstore | public | hstore_cmp | hstore, hstore | integer hstore | public | hstore_eq | hstore, hstore | boolean hstore | public | hstore_ge | hstore, hstore | boolean @@ -671,23 +678,23 @@ order by hstore | public | tconvert | text, text | hstore http | public | bytea_to_text | data bytea | text http | public | http | request http_request | http_response - http | public | http_delete | uri character varying | http_response http | public | http_delete | uri character varying, content character varying, content_type character varying | http_response - http | public | http_get | uri character varying | http_response + http | public | http_delete | uri character varying | http_response http | public | http_get | uri character varying, data jsonb | http_response + http | public | http_get | uri character varying | http_response http | public | http_head | uri character varying | http_response http | public | http_header | field character varying, value character varying | http_header http | public | http_list_curlopt | | TABLE(curlopt text, value text) http | public | http_patch | uri character varying, content character varying, content_type character varying | http_response - http | public | http_post | uri character varying, content character varying, content_type character varying | http_response http | public | http_post | uri character varying, data jsonb | http_response + http | public | http_post | uri character varying, content character varying, content_type character varying | http_response http | public | http_put | uri character varying, content character varying, content_type character varying | http_response http | public | http_reset_curlopt | | boolean http | public | http_set_curlopt | curlopt character varying, value character varying | boolean http | public | text_to_bytea | data text | bytea http | public | urlencode | data jsonb | text - http | public | urlencode | string bytea | text http | public | urlencode | string character varying | text + http | public | urlencode | string bytea | text hypopg | public | hypopg | OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid | SETOF record hypopg | public | hypopg_create_index | sql_order text, OUT indexrelid oid, OUT indexname text | SETOF record hypopg | public | hypopg_drop_index | indexid oid | boolean @@ -760,37 +767,37 @@ order by intarray | public | subarray | integer[], integer, integer | integer[] intarray | public | uniq | integer[] | integer[] isn | public | btean13cmp | ean13, ean13 | integer - isn | public | btean13cmp | ean13, isbn | integer - isn | public | btean13cmp | ean13, isbn13 | integer - isn | public | btean13cmp | ean13, ismn | integer - isn | public | btean13cmp | ean13, ismn13 | integer isn | public | btean13cmp | ean13, issn | integer - isn | public | btean13cmp | ean13, issn13 | integer isn | public | btean13cmp | ean13, upc | integer + isn | public | btean13cmp | ean13, issn13 | integer + isn | public | btean13cmp | ean13, ismn | integer + isn | public | btean13cmp | ean13, ismn13 | integer + isn | public | btean13cmp | ean13, isbn13 | integer + isn | public | btean13cmp | ean13, isbn | integer + isn | public | btisbn13cmp | isbn13, isbn13 | integer isn | public | btisbn13cmp | isbn13, ean13 | integer isn | public | btisbn13cmp | isbn13, isbn | integer - isn | public | btisbn13cmp | isbn13, isbn13 | integer isn | public | btisbncmp | isbn, ean13 | integer isn | public | btisbncmp | isbn, isbn | integer isn | public | btisbncmp | isbn, isbn13 | integer + isn | public | btismn13cmp | ismn13, ismn13 | integer isn | public | btismn13cmp | ismn13, ean13 | integer isn | public | btismn13cmp | ismn13, ismn | integer - isn | public | btismn13cmp | ismn13, ismn13 | integer - isn | public | btismncmp | ismn, ean13 | integer isn | public | btismncmp | ismn, ismn | integer + isn | public | btismncmp | ismn, ean13 | integer isn | public | btismncmp | ismn, ismn13 | integer + isn | public | btissn13cmp | issn13, issn13 | integer isn | public | btissn13cmp | issn13, ean13 | integer isn | public | btissn13cmp | issn13, issn | integer - isn | public | btissn13cmp | issn13, issn13 | integer isn | public | btissncmp | issn, ean13 | integer - isn | public | btissncmp | issn, issn | integer isn | public | btissncmp | issn, issn13 | integer - isn | public | btupccmp | upc, ean13 | integer + isn | public | btissncmp | issn, issn | integer isn | public | btupccmp | upc, upc | integer + isn | public | btupccmp | upc, ean13 | integer isn | public | ean13_in | cstring | ean13 - isn | public | ean13_out | ean13 | cstring isn | public | ean13_out | isbn13 | cstring isn | public | ean13_out | ismn13 | cstring + isn | public | ean13_out | ean13 | cstring isn | public | ean13_out | issn13 | cstring isn | public | hashean13 | ean13 | integer isn | public | hashisbn | isbn | integer @@ -800,14 +807,14 @@ order by isn | public | hashissn | issn | integer isn | public | hashissn13 | issn13 | integer isn | public | hashupc | upc | integer - isn | public | is_valid | ean13 | boolean - isn | public | is_valid | isbn | boolean isn | public | is_valid | isbn13 | boolean + isn | public | is_valid | upc | boolean isn | public | is_valid | ismn | boolean - isn | public | is_valid | ismn13 | boolean isn | public | is_valid | issn | boolean + isn | public | is_valid | isbn | boolean + isn | public | is_valid | ismn13 | boolean + isn | public | is_valid | ean13 | boolean isn | public | is_valid | issn13 | boolean - isn | public | is_valid | upc | boolean isn | public | isbn | ean13 | isbn isn | public | isbn13 | ean13 | isbn13 isn | public | isbn13_in | cstring | isbn13 @@ -816,192 +823,192 @@ order by isn | public | ismn13 | ean13 | ismn13 isn | public | ismn13_in | cstring | ismn13 isn | public | ismn_in | cstring | ismn - isn | public | isn_out | isbn | cstring + isn | public | isn_out | upc | cstring isn | public | isn_out | ismn | cstring isn | public | isn_out | issn | cstring - isn | public | isn_out | upc | cstring - isn | public | isn_weak | | boolean + isn | public | isn_out | isbn | cstring isn | public | isn_weak | boolean | boolean + isn | public | isn_weak | | boolean + isn | public | isneq | ismn, ismn | boolean isn | public | isneq | ean13, ean13 | boolean - isn | public | isneq | ean13, isbn | boolean - isn | public | isneq | ean13, isbn13 | boolean - isn | public | isneq | ean13, ismn | boolean - isn | public | isneq | ean13, ismn13 | boolean - isn | public | isneq | ean13, issn | boolean - isn | public | isneq | ean13, issn13 | boolean - isn | public | isneq | ean13, upc | boolean isn | public | isneq | isbn, ean13 | boolean + isn | public | isneq | issn, ean13 | boolean + isn | public | isneq | isbn13, isbn13 | boolean + isn | public | isneq | ean13, issn | boolean isn | public | isneq | isbn, isbn | boolean - isn | public | isneq | isbn, isbn13 | boolean + isn | public | isneq | ean13, upc | boolean + isn | public | isneq | ean13, issn13 | boolean + isn | public | isneq | ean13, ismn | boolean + isn | public | isneq | upc, upc | boolean + isn | public | isneq | issn13, issn13 | boolean + isn | public | isneq | upc, ean13 | boolean + isn | public | isneq | ismn13, ismn13 | boolean + isn | public | isneq | issn13, ean13 | boolean + isn | public | isneq | ean13, ismn13 | boolean + isn | public | isneq | ismn13, ean13 | boolean + isn | public | isneq | issn13, issn | boolean + isn | public | isneq | ismn, ean13 | boolean + isn | public | isneq | ismn13, ismn | boolean + isn | public | isneq | ean13, isbn13 | boolean isn | public | isneq | isbn13, ean13 | boolean isn | public | isneq | isbn13, isbn | boolean - isn | public | isneq | isbn13, isbn13 | boolean - isn | public | isneq | ismn, ean13 | boolean - isn | public | isneq | ismn, ismn | boolean + isn | public | isneq | isbn, isbn13 | boolean isn | public | isneq | ismn, ismn13 | boolean - isn | public | isneq | ismn13, ean13 | boolean - isn | public | isneq | ismn13, ismn | boolean - isn | public | isneq | ismn13, ismn13 | boolean - isn | public | isneq | issn, ean13 | boolean - isn | public | isneq | issn, issn | boolean + isn | public | isneq | ean13, isbn | boolean isn | public | isneq | issn, issn13 | boolean - isn | public | isneq | issn13, ean13 | boolean - isn | public | isneq | issn13, issn | boolean - isn | public | isneq | issn13, issn13 | boolean - isn | public | isneq | upc, ean13 | boolean - isn | public | isneq | upc, upc | boolean + isn | public | isneq | issn, issn | boolean + isn | public | isnge | ismn, ismn | boolean isn | public | isnge | ean13, ean13 | boolean - isn | public | isnge | ean13, isbn | boolean - isn | public | isnge | ean13, isbn13 | boolean - isn | public | isnge | ean13, ismn | boolean - isn | public | isnge | ean13, ismn13 | boolean - isn | public | isnge | ean13, issn | boolean - isn | public | isnge | ean13, issn13 | boolean - isn | public | isnge | ean13, upc | boolean isn | public | isnge | isbn, ean13 | boolean + isn | public | isnge | issn, ean13 | boolean + isn | public | isnge | isbn13, isbn13 | boolean + isn | public | isnge | ean13, issn | boolean isn | public | isnge | isbn, isbn | boolean - isn | public | isnge | isbn, isbn13 | boolean + isn | public | isnge | ean13, upc | boolean + isn | public | isnge | ean13, issn13 | boolean + isn | public | isnge | ean13, ismn | boolean + isn | public | isnge | upc, upc | boolean + isn | public | isnge | issn13, issn13 | boolean + isn | public | isnge | upc, ean13 | boolean + isn | public | isnge | ismn13, ismn13 | boolean + isn | public | isnge | issn13, ean13 | boolean + isn | public | isnge | ean13, ismn13 | boolean + isn | public | isnge | ismn13, ean13 | boolean + isn | public | isnge | issn13, issn | boolean + isn | public | isnge | ismn, ean13 | boolean + isn | public | isnge | ismn13, ismn | boolean + isn | public | isnge | ean13, isbn13 | boolean isn | public | isnge | isbn13, ean13 | boolean isn | public | isnge | isbn13, isbn | boolean - isn | public | isnge | isbn13, isbn13 | boolean - isn | public | isnge | ismn, ean13 | boolean - isn | public | isnge | ismn, ismn | boolean + isn | public | isnge | isbn, isbn13 | boolean isn | public | isnge | ismn, ismn13 | boolean - isn | public | isnge | ismn13, ean13 | boolean - isn | public | isnge | ismn13, ismn | boolean - isn | public | isnge | ismn13, ismn13 | boolean - isn | public | isnge | issn, ean13 | boolean - isn | public | isnge | issn, issn | boolean + isn | public | isnge | ean13, isbn | boolean isn | public | isnge | issn, issn13 | boolean - isn | public | isnge | issn13, ean13 | boolean - isn | public | isnge | issn13, issn | boolean - isn | public | isnge | issn13, issn13 | boolean - isn | public | isnge | upc, ean13 | boolean - isn | public | isnge | upc, upc | boolean + isn | public | isnge | issn, issn | boolean + isn | public | isngt | ismn, ismn | boolean isn | public | isngt | ean13, ean13 | boolean - isn | public | isngt | ean13, isbn | boolean - isn | public | isngt | ean13, isbn13 | boolean - isn | public | isngt | ean13, ismn | boolean - isn | public | isngt | ean13, ismn13 | boolean - isn | public | isngt | ean13, issn | boolean - isn | public | isngt | ean13, issn13 | boolean - isn | public | isngt | ean13, upc | boolean isn | public | isngt | isbn, ean13 | boolean + isn | public | isngt | issn, ean13 | boolean + isn | public | isngt | isbn13, isbn13 | boolean + isn | public | isngt | ean13, issn | boolean isn | public | isngt | isbn, isbn | boolean - isn | public | isngt | isbn, isbn13 | boolean + isn | public | isngt | ean13, upc | boolean + isn | public | isngt | ean13, issn13 | boolean + isn | public | isngt | ean13, ismn | boolean + isn | public | isngt | upc, upc | boolean + isn | public | isngt | issn13, issn13 | boolean + isn | public | isngt | upc, ean13 | boolean + isn | public | isngt | ismn13, ismn13 | boolean + isn | public | isngt | issn13, ean13 | boolean + isn | public | isngt | ean13, ismn13 | boolean + isn | public | isngt | ismn13, ean13 | boolean + isn | public | isngt | issn13, issn | boolean + isn | public | isngt | ismn, ean13 | boolean + isn | public | isngt | ismn13, ismn | boolean + isn | public | isngt | ean13, isbn13 | boolean isn | public | isngt | isbn13, ean13 | boolean isn | public | isngt | isbn13, isbn | boolean - isn | public | isngt | isbn13, isbn13 | boolean - isn | public | isngt | ismn, ean13 | boolean - isn | public | isngt | ismn, ismn | boolean + isn | public | isngt | isbn, isbn13 | boolean isn | public | isngt | ismn, ismn13 | boolean - isn | public | isngt | ismn13, ean13 | boolean - isn | public | isngt | ismn13, ismn | boolean - isn | public | isngt | ismn13, ismn13 | boolean - isn | public | isngt | issn, ean13 | boolean - isn | public | isngt | issn, issn | boolean + isn | public | isngt | ean13, isbn | boolean isn | public | isngt | issn, issn13 | boolean - isn | public | isngt | issn13, ean13 | boolean - isn | public | isngt | issn13, issn | boolean - isn | public | isngt | issn13, issn13 | boolean - isn | public | isngt | upc, ean13 | boolean - isn | public | isngt | upc, upc | boolean + isn | public | isngt | issn, issn | boolean + isn | public | isnle | ismn, ismn | boolean isn | public | isnle | ean13, ean13 | boolean - isn | public | isnle | ean13, isbn | boolean - isn | public | isnle | ean13, isbn13 | boolean - isn | public | isnle | ean13, ismn | boolean - isn | public | isnle | ean13, ismn13 | boolean - isn | public | isnle | ean13, issn | boolean - isn | public | isnle | ean13, issn13 | boolean - isn | public | isnle | ean13, upc | boolean isn | public | isnle | isbn, ean13 | boolean + isn | public | isnle | issn, ean13 | boolean + isn | public | isnle | isbn13, isbn13 | boolean + isn | public | isnle | ean13, issn | boolean isn | public | isnle | isbn, isbn | boolean - isn | public | isnle | isbn, isbn13 | boolean + isn | public | isnle | ean13, upc | boolean + isn | public | isnle | ean13, issn13 | boolean + isn | public | isnle | ean13, ismn | boolean + isn | public | isnle | upc, upc | boolean + isn | public | isnle | issn13, issn13 | boolean + isn | public | isnle | upc, ean13 | boolean + isn | public | isnle | ismn13, ismn13 | boolean + isn | public | isnle | issn13, ean13 | boolean + isn | public | isnle | ean13, ismn13 | boolean + isn | public | isnle | ismn13, ean13 | boolean + isn | public | isnle | issn13, issn | boolean + isn | public | isnle | ismn, ean13 | boolean + isn | public | isnle | ismn13, ismn | boolean + isn | public | isnle | ean13, isbn13 | boolean isn | public | isnle | isbn13, ean13 | boolean isn | public | isnle | isbn13, isbn | boolean - isn | public | isnle | isbn13, isbn13 | boolean - isn | public | isnle | ismn, ean13 | boolean - isn | public | isnle | ismn, ismn | boolean + isn | public | isnle | isbn, isbn13 | boolean isn | public | isnle | ismn, ismn13 | boolean - isn | public | isnle | ismn13, ean13 | boolean - isn | public | isnle | ismn13, ismn | boolean - isn | public | isnle | ismn13, ismn13 | boolean - isn | public | isnle | issn, ean13 | boolean - isn | public | isnle | issn, issn | boolean + isn | public | isnle | ean13, isbn | boolean isn | public | isnle | issn, issn13 | boolean - isn | public | isnle | issn13, ean13 | boolean - isn | public | isnle | issn13, issn | boolean - isn | public | isnle | issn13, issn13 | boolean - isn | public | isnle | upc, ean13 | boolean - isn | public | isnle | upc, upc | boolean + isn | public | isnle | issn, issn | boolean + isn | public | isnlt | ismn, ismn | boolean isn | public | isnlt | ean13, ean13 | boolean - isn | public | isnlt | ean13, isbn | boolean - isn | public | isnlt | ean13, isbn13 | boolean - isn | public | isnlt | ean13, ismn | boolean - isn | public | isnlt | ean13, ismn13 | boolean + isn | public | isnlt | isbn, ean13 | boolean + isn | public | isnlt | issn, ean13 | boolean + isn | public | isnlt | isbn13, isbn13 | boolean isn | public | isnlt | ean13, issn | boolean - isn | public | isnlt | ean13, issn13 | boolean + isn | public | isnlt | isbn, isbn | boolean isn | public | isnlt | ean13, upc | boolean - isn | public | isnlt | isbn, ean13 | boolean - isn | public | isnlt | isbn, isbn | boolean - isn | public | isnlt | isbn, isbn13 | boolean + isn | public | isnlt | ean13, issn13 | boolean + isn | public | isnlt | ean13, ismn | boolean + isn | public | isnlt | upc, upc | boolean + isn | public | isnlt | issn13, issn13 | boolean + isn | public | isnlt | upc, ean13 | boolean + isn | public | isnlt | ismn13, ismn13 | boolean + isn | public | isnlt | issn13, ean13 | boolean + isn | public | isnlt | ean13, ismn13 | boolean + isn | public | isnlt | ismn13, ean13 | boolean + isn | public | isnlt | issn13, issn | boolean + isn | public | isnlt | ismn, ean13 | boolean + isn | public | isnlt | ismn13, ismn | boolean + isn | public | isnlt | ean13, isbn13 | boolean isn | public | isnlt | isbn13, ean13 | boolean isn | public | isnlt | isbn13, isbn | boolean - isn | public | isnlt | isbn13, isbn13 | boolean - isn | public | isnlt | ismn, ean13 | boolean - isn | public | isnlt | ismn, ismn | boolean + isn | public | isnlt | isbn, isbn13 | boolean isn | public | isnlt | ismn, ismn13 | boolean - isn | public | isnlt | ismn13, ean13 | boolean - isn | public | isnlt | ismn13, ismn | boolean - isn | public | isnlt | ismn13, ismn13 | boolean - isn | public | isnlt | issn, ean13 | boolean - isn | public | isnlt | issn, issn | boolean + isn | public | isnlt | ean13, isbn | boolean isn | public | isnlt | issn, issn13 | boolean - isn | public | isnlt | issn13, ean13 | boolean - isn | public | isnlt | issn13, issn | boolean - isn | public | isnlt | issn13, issn13 | boolean - isn | public | isnlt | upc, ean13 | boolean - isn | public | isnlt | upc, upc | boolean + isn | public | isnlt | issn, issn | boolean + isn | public | isnne | ismn, ismn | boolean isn | public | isnne | ean13, ean13 | boolean - isn | public | isnne | ean13, isbn | boolean - isn | public | isnne | ean13, isbn13 | boolean - isn | public | isnne | ean13, ismn | boolean - isn | public | isnne | ean13, ismn13 | boolean - isn | public | isnne | ean13, issn | boolean - isn | public | isnne | ean13, issn13 | boolean - isn | public | isnne | ean13, upc | boolean isn | public | isnne | isbn, ean13 | boolean + isn | public | isnne | issn, ean13 | boolean + isn | public | isnne | isbn13, isbn13 | boolean + isn | public | isnne | ean13, issn | boolean isn | public | isnne | isbn, isbn | boolean - isn | public | isnne | isbn, isbn13 | boolean + isn | public | isnne | ean13, upc | boolean + isn | public | isnne | ean13, issn13 | boolean + isn | public | isnne | ean13, ismn | boolean + isn | public | isnne | upc, upc | boolean + isn | public | isnne | issn13, issn13 | boolean + isn | public | isnne | upc, ean13 | boolean + isn | public | isnne | ismn13, ismn13 | boolean + isn | public | isnne | issn13, ean13 | boolean + isn | public | isnne | ean13, ismn13 | boolean + isn | public | isnne | ismn13, ean13 | boolean + isn | public | isnne | issn13, issn | boolean + isn | public | isnne | ismn, ean13 | boolean + isn | public | isnne | ismn13, ismn | boolean + isn | public | isnne | ean13, isbn13 | boolean isn | public | isnne | isbn13, ean13 | boolean isn | public | isnne | isbn13, isbn | boolean - isn | public | isnne | isbn13, isbn13 | boolean - isn | public | isnne | ismn, ean13 | boolean - isn | public | isnne | ismn, ismn | boolean + isn | public | isnne | isbn, isbn13 | boolean isn | public | isnne | ismn, ismn13 | boolean - isn | public | isnne | ismn13, ean13 | boolean - isn | public | isnne | ismn13, ismn | boolean - isn | public | isnne | ismn13, ismn13 | boolean - isn | public | isnne | issn, ean13 | boolean - isn | public | isnne | issn, issn | boolean + isn | public | isnne | ean13, isbn | boolean isn | public | isnne | issn, issn13 | boolean - isn | public | isnne | issn13, ean13 | boolean - isn | public | isnne | issn13, issn | boolean - isn | public | isnne | issn13, issn13 | boolean - isn | public | isnne | upc, ean13 | boolean - isn | public | isnne | upc, upc | boolean + isn | public | isnne | issn, issn | boolean isn | public | issn | ean13 | issn isn | public | issn13 | ean13 | issn13 isn | public | issn13_in | cstring | issn13 isn | public | issn_in | cstring | issn - isn | public | make_valid | ean13 | ean13 - isn | public | make_valid | isbn | isbn isn | public | make_valid | isbn13 | isbn13 + isn | public | make_valid | upc | upc isn | public | make_valid | ismn | ismn - isn | public | make_valid | ismn13 | ismn13 isn | public | make_valid | issn | issn + isn | public | make_valid | isbn | isbn + isn | public | make_valid | ismn13 | ismn13 + isn | public | make_valid | ean13 | ean13 isn | public | make_valid | issn13 | issn13 - isn | public | make_valid | upc | upc isn | public | upc | ean13 | upc isn | public | upc_in | cstring | upc lo | public | lo_manage | | trigger @@ -1029,14 +1036,14 @@ order by ltree | public | _ltxtq_rexec | ltxtquery, ltree[] | boolean ltree | public | index | ltree, ltree | integer ltree | public | index | ltree, ltree, integer | integer + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree, ltree | ltree ltree | public | lca | ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree[] | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree | ltree ltree | public | lquery_in | cstring | lquery ltree | public | lquery_out | lquery | cstring ltree | public | lquery_recv | internal | lquery @@ -1117,33 +1124,34 @@ order by pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] pg_backtrace | public | pg_backtrace_init | | void pg_buffercache | public | pg_buffercache_pages | | SETOF record - pg_freespacemap | public | pg_freespace | regclass, bigint | smallint pg_freespacemap | public | pg_freespace | rel regclass, OUT blkno bigint, OUT avail smallint | SETOF record + pg_freespacemap | public | pg_freespace | regclass, bigint | smallint pg_graphql | graphql | _internal_resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb pg_graphql | graphql | comment_directive | comment_ text | jsonb pg_graphql | graphql | exception | message text | text pg_graphql | graphql | get_schema_version | | integer pg_graphql | graphql | increment_schema_version | | event_trigger pg_graphql | graphql | resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb + pg_graphql | graphql_public | graphql | "operationName" text, query text, variables jsonb, extensions jsonb | jsonb pg_hashids | public | hash_decode | text, text, integer | integer pg_hashids | public | hash_encode | bigint | text pg_hashids | public | hash_encode | bigint, text | text pg_hashids | public | hash_encode | bigint, text, integer | text pg_hashids | public | id_decode | text | bigint[] pg_hashids | public | id_decode | text, text | bigint[] - pg_hashids | public | id_decode | text, text, integer | bigint[] pg_hashids | public | id_decode | text, text, integer, text | bigint[] + pg_hashids | public | id_decode | text, text, integer | bigint[] pg_hashids | public | id_decode_once | text | bigint pg_hashids | public | id_decode_once | text, text | bigint - pg_hashids | public | id_decode_once | text, text, integer | bigint pg_hashids | public | id_decode_once | text, text, integer, text | bigint + pg_hashids | public | id_decode_once | text, text, integer | bigint pg_hashids | public | id_encode | bigint | text - pg_hashids | public | id_encode | bigint, text | text - pg_hashids | public | id_encode | bigint, text, integer | text - pg_hashids | public | id_encode | bigint, text, integer, text | text pg_hashids | public | id_encode | bigint[] | text pg_hashids | public | id_encode | bigint[], text | text pg_hashids | public | id_encode | bigint[], text, integer | text + pg_hashids | public | id_encode | bigint, text | text + pg_hashids | public | id_encode | bigint, text, integer | text + pg_hashids | public | id_encode | bigint, text, integer, text | text pg_hashids | public | id_encode | bigint[], text, integer, text | text pg_jsonschema | public | json_matches_schema | schema json, instance json | boolean pg_jsonschema | public | jsonb_matches_schema | schema json, instance jsonb | boolean @@ -1202,9 +1210,9 @@ order by pg_stat_monitor | public | pgsm_create_17_view | | integer pg_stat_monitor | public | pgsm_create_view | | integer pg_stat_monitor | public | range | | text[] - pg_stat_statements | public | pg_stat_statements | showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision | SETOF record - pg_stat_statements | public | pg_stat_statements_info | OUT dealloc bigint, OUT stats_reset timestamp with time zone | record - pg_stat_statements | public | pg_stat_statements_reset | userid oid, dbid oid, queryid bigint | void + pg_stat_statements | extensions | pg_stat_statements | showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision | SETOF record + pg_stat_statements | extensions | pg_stat_statements_info | OUT dealloc bigint, OUT stats_reset timestamp with time zone | record + pg_stat_statements | extensions | pg_stat_statements_reset | userid oid, dbid oid, queryid bigint | void pg_surgery | public | heap_force_freeze | reloid regclass, tids tid[] | void pg_surgery | public | heap_force_kill | reloid regclass, tids tid[] | void pg_tle | pgtle | available_extension_versions | OUT name name, OUT version text, OUT superuser boolean, OUT trusted boolean, OUT relocatable boolean, OUT schema name, OUT requires name[], OUT comment text | SETOF record @@ -1266,56 +1274,56 @@ order by pg_visibility | public | pg_truncate_visibility_map | regclass | void pg_visibility | public | pg_visibility | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | SETOF record pg_visibility | public | pg_visibility | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | record - pg_visibility | public | pg_visibility_map | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | SETOF record pg_visibility | public | pg_visibility_map | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | record + pg_visibility | public | pg_visibility_map | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | SETOF record pg_visibility | public | pg_visibility_map_summary | regclass, OUT all_visible bigint, OUT all_frozen bigint | record pg_walinspect | public | pg_get_wal_record_info | in_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | record pg_walinspect | public | pg_get_wal_records_info | start_lsn pg_lsn, end_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | SETOF record pg_walinspect | public | pg_get_wal_stats | start_lsn pg_lsn, end_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record pgaudit | public | pgaudit_ddl_command_end | | event_trigger pgaudit | public | pgaudit_sql_drop | | event_trigger - pgcrypto | public | armor | bytea | text - pgcrypto | public | armor | bytea, text[], text[] | text - pgcrypto | public | crypt | text, text | text - pgcrypto | public | dearmor | text | bytea - pgcrypto | public | decrypt | bytea, bytea, text | bytea - pgcrypto | public | decrypt_iv | bytea, bytea, bytea, text | bytea - pgcrypto | public | digest | bytea, text | bytea - pgcrypto | public | digest | text, text | bytea - pgcrypto | public | encrypt | bytea, bytea, text | bytea - pgcrypto | public | encrypt_iv | bytea, bytea, bytea, text | bytea - pgcrypto | public | gen_random_bytes | integer | bytea - pgcrypto | public | gen_random_uuid | | uuid - pgcrypto | public | gen_salt | text | text - pgcrypto | public | gen_salt | text, integer | text - pgcrypto | public | hmac | bytea, bytea, text | bytea - pgcrypto | public | hmac | text, text, text | bytea - pgcrypto | public | pgp_armor_headers | text, OUT key text, OUT value text | SETOF record - pgcrypto | public | pgp_key_id | bytea | text - pgcrypto | public | pgp_pub_decrypt | bytea, bytea | text - pgcrypto | public | pgp_pub_decrypt | bytea, bytea, text | text - pgcrypto | public | pgp_pub_decrypt | bytea, bytea, text, text | text - pgcrypto | public | pgp_pub_decrypt_bytea | bytea, bytea | bytea - pgcrypto | public | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea - pgcrypto | public | pgp_pub_decrypt_bytea | bytea, bytea, text, text | bytea - pgcrypto | public | pgp_pub_encrypt | text, bytea | bytea - pgcrypto | public | pgp_pub_encrypt | text, bytea, text | bytea - pgcrypto | public | pgp_pub_encrypt_bytea | bytea, bytea | bytea - pgcrypto | public | pgp_pub_encrypt_bytea | bytea, bytea, text | bytea - pgcrypto | public | pgp_sym_decrypt | bytea, text | text - pgcrypto | public | pgp_sym_decrypt | bytea, text, text | text - pgcrypto | public | pgp_sym_decrypt_bytea | bytea, text | bytea - pgcrypto | public | pgp_sym_decrypt_bytea | bytea, text, text | bytea - pgcrypto | public | pgp_sym_encrypt | text, text | bytea - pgcrypto | public | pgp_sym_encrypt | text, text, text | bytea - pgcrypto | public | pgp_sym_encrypt_bytea | bytea, text | bytea - pgcrypto | public | pgp_sym_encrypt_bytea | bytea, text, text | bytea - pgjwt | public | algorithm_sign | signables text, secret text, algorithm text | text - pgjwt | public | sign | payload json, secret text, algorithm text | text - pgjwt | public | try_cast_double | inp text | double precision - pgjwt | public | url_decode | data text | bytea - pgjwt | public | url_encode | data bytea | text - pgjwt | public | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) + pgcrypto | extensions | armor | bytea, text[], text[] | text + pgcrypto | extensions | armor | bytea | text + pgcrypto | extensions | crypt | text, text | text + pgcrypto | extensions | dearmor | text | bytea + pgcrypto | extensions | decrypt | bytea, bytea, text | bytea + pgcrypto | extensions | decrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | digest | text, text | bytea + pgcrypto | extensions | digest | bytea, text | bytea + pgcrypto | extensions | encrypt | bytea, bytea, text | bytea + pgcrypto | extensions | encrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | gen_random_bytes | integer | bytea + pgcrypto | extensions | gen_random_uuid | | uuid + pgcrypto | extensions | gen_salt | text | text + pgcrypto | extensions | gen_salt | text, integer | text + pgcrypto | extensions | hmac | text, text, text | bytea + pgcrypto | extensions | hmac | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_armor_headers | text, OUT key text, OUT value text | SETOF record + pgcrypto | extensions | pgp_key_id | bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text, text | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text | text + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text, text | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt | bytea, text | text + pgcrypto | extensions | pgp_sym_decrypt | bytea, text, text | text + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea + pgjwt | extensions | algorithm_sign | signables text, secret text, algorithm text | text + pgjwt | extensions | sign | payload json, secret text, algorithm text | text + pgjwt | extensions | try_cast_double | inp text | double precision + pgjwt | extensions | url_decode | data text | bytea + pgjwt | extensions | url_encode | data bytea | text + pgjwt | extensions | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void pgmq | pgmq | _get_partition_col | partition_interval text | text @@ -1349,15 +1357,15 @@ order by pgroonga | pgroonga | command_escape_value | value text | text pgroonga | pgroonga | contain_varchar_array | character varying[], character varying | boolean pgroonga | pgroonga | escape | value bigint | text - pgroonga | pgroonga | escape | value boolean | text pgroonga | pgroonga | escape | value double precision | text - pgroonga | pgroonga | escape | value integer | text - pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value text, special_characters text | text + pgroonga | pgroonga | escape | value timestamp without time zone | text pgroonga | pgroonga | escape | value smallint | text pgroonga | pgroonga | escape | value text | text - pgroonga | pgroonga | escape | value text, special_characters text | text pgroonga | pgroonga | escape | value timestamp with time zone | text - pgroonga | pgroonga | escape | value timestamp without time zone | text + pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value boolean | text + pgroonga | pgroonga | escape | value integer | text pgroonga | pgroonga | flush | indexname cstring | boolean pgroonga | pgroonga | highlight_html | target text, keywords text[] | text pgroonga | pgroonga | match_in_text | text, text[] | boolean @@ -1366,16 +1374,16 @@ order by pgroonga | pgroonga | match_jsonb | jsonb, text | boolean pgroonga | pgroonga | match_positions_byte | target text, keywords text[] | integer[] pgroonga | pgroonga | match_positions_character | target text, keywords text[] | integer[] - pgroonga | pgroonga | match_query | character varying, character varying | boolean pgroonga | pgroonga | match_query | text, text | boolean + pgroonga | pgroonga | match_query | character varying, character varying | boolean pgroonga | pgroonga | match_query | text[], text | boolean - pgroonga | pgroonga | match_regexp | character varying, character varying | boolean pgroonga | pgroonga | match_regexp | text, text | boolean + pgroonga | pgroonga | match_regexp | character varying, character varying | boolean pgroonga | pgroonga | match_script_jsonb | jsonb, text | boolean - pgroonga | pgroonga | match_term | target character varying, term character varying | boolean - pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean pgroonga | pgroonga | match_term | target text, term text | boolean pgroonga | pgroonga | match_term | target text[], term text | boolean + pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean + pgroonga | pgroonga | match_term | target character varying, term character varying | boolean pgroonga | pgroonga | match_text | text, text | boolean pgroonga | pgroonga | match_text_array | text[], text | boolean pgroonga | pgroonga | match_varchar | character varying, character varying | boolean @@ -1420,21 +1428,21 @@ order by pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_escape | value bigint | text - pgroonga | public | pgroonga_escape | value boolean | text pgroonga | public | pgroonga_escape | value double precision | text - pgroonga | public | pgroonga_escape | value integer | text - pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value text, special_characters text | text + pgroonga | public | pgroonga_escape | value timestamp without time zone | text pgroonga | public | pgroonga_escape | value smallint | text pgroonga | public | pgroonga_escape | value text | text - pgroonga | public | pgroonga_escape | value text, special_characters text | text pgroonga | public | pgroonga_escape | value timestamp with time zone | text - pgroonga | public | pgroonga_escape | value timestamp without time zone | text + pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value boolean | text + pgroonga | public | pgroonga_escape | value integer | text pgroonga | public | pgroonga_flush | indexname cstring | boolean pgroonga | public | pgroonga_handler | internal | index_am_handler - pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text pgroonga | public | pgroonga_highlight_html | target text, keywords text[], indexname cstring | text - pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[], indexname cstring | text[] + pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text pgroonga | public | pgroonga_is_writable | | boolean @@ -1442,20 +1450,20 @@ order by pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean pgroonga | public | pgroonga_match_jsonb | jsonb, text | boolean - pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[], indexname cstring | integer[] - pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_positions_character | target text, keywords text[], indexname cstring | integer[] - pgroonga | public | pgroonga_match_query | character varying, character varying | boolean + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_query | text, text | boolean + pgroonga | public | pgroonga_match_query | character varying, character varying | boolean pgroonga | public | pgroonga_match_query | text[], text | boolean - pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean pgroonga | public | pgroonga_match_regexp | text, text | boolean + pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean pgroonga | public | pgroonga_match_script_jsonb | jsonb, text | boolean - pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean - pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean pgroonga | public | pgroonga_match_term | target text, term text | boolean pgroonga | public | pgroonga_match_term | target text[], term text | boolean + pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean + pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean pgroonga | public | pgroonga_match_text | text, text | boolean pgroonga | public | pgroonga_match_text_array | text[], text | boolean pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean @@ -1522,27 +1530,27 @@ order by pgroonga | public | pgroonga_table_name | indexname cstring | text pgroonga | public | pgroonga_tokenize | target text, VARIADIC options text[] | json[] pgroonga | public | pgroonga_vacuum | | boolean - pgroonga | public | pgroonga_wal_apply | | bigint pgroonga | public | pgroonga_wal_apply | indexname cstring | bigint - pgroonga | public | pgroonga_wal_set_applied_position | | boolean + pgroonga | public | pgroonga_wal_apply | | bigint pgroonga | public | pgroonga_wal_set_applied_position | block bigint, "offset" bigint | boolean - pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring, block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean + pgroonga | public | pgroonga_wal_set_applied_position | | boolean pgroonga | public | pgroonga_wal_status | | TABLE(name text, oid oid, current_block bigint, current_offset bigint, current_size bigint, last_block bigint, last_offset bigint, last_size bigint) - pgroonga | public | pgroonga_wal_truncate | | bigint pgroonga | public | pgroonga_wal_truncate | indexname cstring | bigint + pgroonga | public | pgroonga_wal_truncate | | bigint pgroonga_database | public | pgroonga_database_remove | | boolean pgrouting | public | _pgr_alphashape | text, alpha double precision, OUT seq1 bigint, OUT textgeom text | SETOF record pgrouting | public | _pgr_array_reverse | anyarray | anyarray pgrouting | public | _pgr_articulationpoints | edges_sql text, OUT seq integer, OUT node bigint | SETOF record - pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_astar | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bdastar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bddijkstra | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bddijkstra | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bellmanford | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_biconnectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1559,38 +1567,38 @@ order by pgrouting | public | _pgr_compiler_version | | text pgrouting | public | _pgr_connectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record pgrouting | public | _pgr_contraction | edges_sql text, contraction_order bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record - pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void pgrouting | public | _pgr_createindex | tabname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void pgrouting | public | _pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record pgrouting | public | _pgr_dagshortestpath | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dagshortestpath | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_depthfirstsearch | edges_sql text, root_vids anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstranear | text, anyarray, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstranear | text, anyarray, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstranear | text, bigint, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstravia | edges_sql text, via_vids anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_drivingdistance | edges_sql text, start_vids anyarray, distance double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edgecoloring | edges_sql text, OUT edge_id bigint, OUT color_id bigint | SETOF record - pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edwardmoore | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edwardmoore | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_endpoint | g geometry | geometry pgrouting | public | _pgr_floydwarshall | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_get_statement | o_sql text | text - pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text pgrouting | public | _pgr_getcolumnname | tab text, col text, reporterrs integer, fnname text | text - pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text pgrouting | public | _pgr_getcolumntype | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text pgrouting | public | _pgr_gettablename | tab text, reporterrs integer, fnname text, OUT sname text, OUT tname text | record pgrouting | public | _pgr_git_hash | | text pgrouting | public | _pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean pgrouting | public | _pgr_iscolumnindexed | tab text, col text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean pgrouting | public | _pgr_iscolumnintable | tab text, col text | boolean pgrouting | public | _pgr_isplanar | text | boolean pgrouting | public | _pgr_johnson | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record @@ -1604,8 +1612,8 @@ order by pgrouting | public | _pgr_maxcardinalitymatch | edges_sql text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record pgrouting | public | _pgr_maxflow | edges_sql text, combinations_sql text, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | _pgr_maxflow | edges_sql text, sources anyarray, targets anyarray, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_maxflowmincost | edges_sql text, sources anyarray, targets anyarray, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_msg | msgkind integer, fnname text, msg text | void pgrouting | public | _pgr_onerror | errcond boolean, reporterrs integer, fnname text, msgerr text, hinto text, msgok text | void pgrouting | public | _pgr_operating_system | | text @@ -1625,10 +1633,10 @@ order by pgrouting | public | _pgr_trsp | sql text, source_eid integer, source_pos double precision, target_eid integer, target_pos double precision, directed boolean, has_reverse_cost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trspvia | text, text, anyarray, boolean, boolean, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_trspvia_withpoints | text, text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_trspviavertices | sql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record @@ -1644,62 +1652,62 @@ order by pgrouting | public | _pgr_withpointsvia | sql text, via_edges bigint[], fraction double precision[], directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_withpointsvia | text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _v4trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_alphashape | geometry, alpha double precision | geometry pgrouting | public | pgr_analyzegraph | text, double precision, the_geom text, id text, source text, target text, rows_where text | character varying pgrouting | public | pgr_analyzeoneway | text, text[], text[], text[], text[], two_way_if_null boolean, oneway text, source text, target text | text pgrouting | public | pgr_articulationpoints | text, OUT node bigint | SETOF bigint - pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_biconnectedcomponents | text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record - pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bipartite | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_breadthfirstsearch | text, anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_breadthfirstsearch | text, bigint, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bridges | text, OUT edge bigint | SETOF bigint @@ -1711,54 +1719,54 @@ order by pgrouting | public | pgr_createverticestable | text, the_geom text, source text, target text, rows_where text | text pgrouting | public | pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record pgrouting | public | pgr_dagshortestpath | text, anyarray, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dagshortestpath | text, bigint, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dagshortestpath | text, text, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_degree | text, text, dryrun boolean, OUT node bigint, OUT degree bigint | SETOF record - pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_depthfirstsearch | text, bigint, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranear | text, bigint, anyarray, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranear | text, text, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranearcost | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranearcost | text, bigint, anyarray, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstravia | text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record - pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_drivingdistance | text, bigint, double precision, directed boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgecoloring | text, OUT edge_id bigint, OUT color_id bigint | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgedisjointpaths | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edmondskarp | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edmondskarp | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edmondskarp | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edwardmoore | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_extractvertices | text, dryrun boolean, OUT id bigint, OUT in_edges bigint[], OUT out_edges bigint[], OUT x double precision, OUT y double precision, OUT geom geometry | SETOF record - pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record pgrouting | public | pgr_findcloseedges | text, geometry[], double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record pgrouting | public | pgr_floydwarshall | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_full_version | OUT version text, OUT build_type text, OUT compile_date text, OUT library text, OUT system text, OUT postgresql text, OUT compiler text, OUT boost text, OUT hash text | record pgrouting | public | pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1767,10 +1775,10 @@ order by pgrouting | public | pgr_kruskal | text, OUT edge bigint, OUT cost double precision | SETOF record pgrouting | public | pgr_kruskalbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskalbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_ksp | text, bigint, bigint, integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1778,55 +1786,55 @@ order by pgrouting | public | pgr_linegraph | text, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision | SETOF record pgrouting | public | pgr_linegraphfull | text, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint | SETOF record pgrouting | public | pgr_makeconnected | text, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint | SETOF record - pgrouting | public | pgr_maxcardinalitymatch | text, OUT edge bigint | SETOF bigint pgrouting | public | pgr_maxcardinalitymatch | text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record + pgrouting | public | pgr_maxcardinalitymatch | text, OUT edge bigint | SETOF bigint pgrouting | public | pgr_maxflow | text, anyarray, anyarray | bigint - pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint + pgrouting | public | pgr_maxflow | text, text | bigint pgrouting | public | pgr_maxflow | text, bigint, anyarray | bigint + pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint pgrouting | public | pgr_maxflow | text, bigint, bigint | bigint - pgrouting | public | pgr_maxflow | text, text | bigint - pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, anyarray | double precision - pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision pgrouting | public | pgr_maxflowmincost_cost | text, bigint, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision pgrouting | public | pgr_maxflowmincost_cost | text, bigint, bigint | double precision - pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision pgrouting | public | pgr_nodenetwork | text, double precision, id text, the_geom text, table_ending text, rows_where text, outall boolean | text pgrouting | public | pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record pgrouting | public | pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record pgrouting | public | pgr_prim | text, OUT edge bigint, OUT cost double precision | SETOF record pgrouting | public | pgr_primbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_pushrelabel | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_pushrelabel | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_pushrelabel | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_sequentialvertexcoloring | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record pgrouting | public | pgr_stoerwagner | text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record pgrouting | public | pgr_strongcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record pgrouting | public | pgr_topologicalsort | text, OUT seq integer, OUT sorted_v bigint | SETOF record pgrouting | public | pgr_transitiveclosure | text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp | text, integer, double precision, integer, double precision, boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record pgrouting | public | pgr_trsp | text, integer, integer, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trspvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record @@ -1838,64 +1846,64 @@ order by pgrouting | public | pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_version | | text pgrouting | public | pgr_vrponedepot | text, text, text, integer, OUT oid integer, OUT opos integer, OUT vid integer, OUT tarrival integer, OUT tdepart integer | SETOF record - pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, anyarray, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, anyarray, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, bigint, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscostmatrix | text, text, anyarray, directed boolean, driving_side character, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsdd | text, text, bigint, double precision, directed boolean, driving_side character, details boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsksp | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrowlocks | public | pgrowlocks | relname text, OUT locked_row tid, OUT locker xid, OUT multi boolean, OUT xids xid[], OUT modes text[], OUT pids integer[] | SETOF record pgsodium | pgsodium | create_key | key_type pgsodium.key_type, name text, raw_key bytea, raw_key_nonce bytea, parent_key uuid, key_context bytea, expires timestamp with time zone, associated_data text | pgsodium.valid_key pgsodium | pgsodium | create_mask_view | relid oid, debug boolean | void pgsodium | pgsodium | create_mask_view | relid oid, subid integer, debug boolean | void - pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea - pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_keygen | | bytea pgsodium | pgsodium | crypto_aead_det_noncegen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_keygen | | bytea pgsodium | pgsodium | crypto_aead_ietf_noncegen | | bytea pgsodium | pgsodium | crypto_auth | message bytea, key bytea | bytea - pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth | message bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha256_keygen | | bytea pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha256_verify | signature bytea, message bytea, key_uuid uuid | boolean - pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha512_keygen | | bytea pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha512_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_keygen | | bytea + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key bytea | boolean pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean pgsodium | pgsodium | crypto_box | message bytea, nonce bytea, public bytea, secret bytea | bytea pgsodium | pgsodium | crypto_box_new_keypair | | pgsodium.crypto_box_keypair pgsodium | pgsodium | crypto_box_new_seed | | bytea @@ -1911,8 +1919,8 @@ order by pgsodium | pgsodium | crypto_generichash_keygen | | bytea pgsodium | pgsodium | crypto_hash_sha256 | message bytea | bytea pgsodium | pgsodium | crypto_hash_sha512 | message bytea | bytea - pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size integer, subkey_id bigint, context bytea, primary_key uuid | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea pgsodium | pgsodium | crypto_kdf_keygen | | bytea pgsodium | pgsodium | crypto_kx_client_session_keys | client_pk bytea, client_sk bytea, server_pk bytea | pgsodium.crypto_kx_session pgsodium | pgsodium | crypto_kx_new_keypair | | pgsodium.crypto_kx_keypair @@ -1923,9 +1931,9 @@ order by pgsodium | pgsodium | crypto_pwhash_saltgen | | bytea pgsodium | pgsodium | crypto_pwhash_str | password bytea | bytea pgsodium | pgsodium | crypto_pwhash_str_verify | hashed_password bytea, password bytea | boolean - pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_secretbox_keygen | | bytea pgsodium | pgsodium | crypto_secretbox_noncegen | | bytea pgsodium | pgsodium | crypto_secretbox_open | ciphertext bytea, nonce bytea, key bytea | bytea @@ -1957,8 +1965,8 @@ order by pgsodium | pgsodium | crypto_signcrypt_verify_after | state bytea, signature bytea, sender_pk bytea, ciphertext bytea | boolean pgsodium | pgsodium | crypto_signcrypt_verify_before | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, recipient_sk bytea | pgsodium.crypto_signcrypt_state_key pgsodium | pgsodium | crypto_signcrypt_verify_public | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, ciphertext bytea | boolean - pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea pgsodium | pgsodium | crypto_stream_xchacha20_keygen | | bytea pgsodium | pgsodium | crypto_stream_xchacha20_noncegen | | bytea pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bigint, context bytea | bytea @@ -1991,14 +1999,14 @@ order by pgsodium | pgsodium | update_mask | target oid, debug boolean | void pgsodium | pgsodium | update_masks | debug boolean | void pgsodium | pgsodium | version | | text - pgstattuple | public | pg_relpages | relname regclass | bigint pgstattuple | public | pg_relpages | relname text | bigint + pgstattuple | public | pg_relpages | relname regclass | bigint pgstattuple | public | pgstatginindex | relname regclass, OUT version integer, OUT pending_pages integer, OUT pending_tuples bigint | record pgstattuple | public | pgstathashindex | relname regclass, OUT version integer, OUT bucket_pages bigint, OUT overflow_pages bigint, OUT bitmap_pages bigint, OUT unused_pages bigint, OUT live_items bigint, OUT dead_items bigint, OUT free_percent double precision | record pgstattuple | public | pgstatindex | relname regclass, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record pgstattuple | public | pgstatindex | relname text, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record - pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record pgstattuple | public | pgstattuple | reloid regclass, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record pgstattuple | public | pgstattuple_approx | reloid regclass, OUT table_len bigint, OUT scanned_percent double precision, OUT approx_tuple_count bigint, OUT approx_tuple_len bigint, OUT approx_tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT approx_free_space bigint, OUT approx_free_percent double precision | record pgtap | public | _add | text, integer | integer pgtap | public | _add | text, integer, text | integer @@ -2009,9 +2017,9 @@ order by pgtap | public | _areni | text, text[], text[], text | text pgtap | public | _array_to_sorted_string | name[], text | text pgtap | public | _assets_are | text, text[], text[], text | text + pgtap | public | _cast_exists | name, name, name, name | boolean pgtap | public | _cast_exists | name, name | boolean pgtap | public | _cast_exists | name, name, name | boolean - pgtap | public | _cast_exists | name, name, name, name | boolean pgtap | public | _cdi | name, name, anyelement | text pgtap | public | _cdi | name, name, anyelement, text | text pgtap | public | _cdi | name, name, name, anyelement, text | text @@ -2029,10 +2037,10 @@ order by pgtap | public | _currtest | | integer pgtap | public | _db_privs | | name[] pgtap | public | _def_is | text, text, anyelement, text | text - pgtap | public | _definer | name | boolean - pgtap | public | _definer | name, name | boolean pgtap | public | _definer | name, name, name[] | boolean pgtap | public | _definer | name, name[] | boolean + pgtap | public | _definer | name | boolean + pgtap | public | _definer | name, name | boolean pgtap | public | _dexists | name | boolean pgtap | public | _dexists | name, name | boolean pgtap | public | _do_ne | text, text, text, text | text @@ -2043,20 +2051,20 @@ order by pgtap | public | _expand_vol | character | text pgtap | public | _ext_exists | name | boolean pgtap | public | _ext_exists | name, name | boolean - pgtap | public | _extensions | | SETOF name pgtap | public | _extensions | name | SETOF name + pgtap | public | _extensions | | SETOF name pgtap | public | _extras | character, name, name[] | name[] + pgtap | public | _extras | character[], name[] | name[] pgtap | public | _extras | character, name[] | name[] pgtap | public | _extras | character[], name, name[] | name[] - pgtap | public | _extras | character[], name[] | name[] pgtap | public | _finish | integer, integer, integer, boolean | SETOF text pgtap | public | _fkexists | name, name, name[] | boolean pgtap | public | _fkexists | name, name[] | boolean pgtap | public | _fprivs_are | text, name, name[], text | text - pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text pgtap | public | _func_compare | name, name, boolean, text | text pgtap | public | _func_compare | name, name, name[], anyelement, anyelement, text | text pgtap | public | _func_compare | name, name, name[], boolean, text | text + pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text pgtap | public | _funkargs | name[] | text pgtap | public | _get | text | integer pgtap | public | _get_ac_privs | name, text | text[] @@ -2067,8 +2075,8 @@ order by pgtap | public | _get_context | name, name | "char" pgtap | public | _get_db_owner | name | name pgtap | public | _get_db_privs | name, text | text[] - pgtap | public | _get_dtype | name | text pgtap | public | _get_dtype | name, text, boolean | text + pgtap | public | _get_dtype | name | text pgtap | public | _get_fdw_privs | name, text | text[] pgtap | public | _get_func_owner | name, name, name[] | name pgtap | public | _get_func_owner | name, name[] | name @@ -2083,12 +2091,12 @@ order by pgtap | public | _get_note | text | text pgtap | public | _get_opclass_owner | name | name pgtap | public | _get_opclass_owner | name, name | name - pgtap | public | _get_rel_owner | character, name | name - pgtap | public | _get_rel_owner | character, name, name | name - pgtap | public | _get_rel_owner | character[], name | name pgtap | public | _get_rel_owner | character[], name, name | name + pgtap | public | _get_rel_owner | character, name | name pgtap | public | _get_rel_owner | name | name pgtap | public | _get_rel_owner | name, name | name + pgtap | public | _get_rel_owner | character[], name | name + pgtap | public | _get_rel_owner | character, name, name | name pgtap | public | _get_schema_owner | name | name pgtap | public | _get_schema_privs | name, text | text[] pgtap | public | _get_sequence_privs | name, text | text[] @@ -2098,17 +2106,17 @@ order by pgtap | public | _get_tablespaceprivs | name, text | text[] pgtap | public | _get_type_owner | name | name pgtap | public | _get_type_owner | name, name | name - pgtap | public | _got_func | name | boolean - pgtap | public | _got_func | name, name | boolean pgtap | public | _got_func | name, name, name[] | boolean pgtap | public | _got_func | name, name[] | boolean + pgtap | public | _got_func | name | boolean + pgtap | public | _got_func | name, name | boolean pgtap | public | _grolist | name | oid[] pgtap | public | _has_def | name, name | boolean pgtap | public | _has_def | name, name, name | boolean pgtap | public | _has_group | name | boolean pgtap | public | _has_role | name | boolean - pgtap | public | _has_type | name, character[] | boolean pgtap | public | _has_type | name, name, character[] | boolean + pgtap | public | _has_type | name, character[] | boolean pgtap | public | _has_user | name | boolean pgtap | public | _hasc | name, character | boolean pgtap | public | _hasc | name, name, character | boolean @@ -2129,22 +2137,22 @@ order by pgtap | public | _is_verbose | | boolean pgtap | public | _keys | name, character | SETOF name[] pgtap | public | _keys | name, name, character | SETOF name[] - pgtap | public | _lang | name | name - pgtap | public | _lang | name, name | name pgtap | public | _lang | name, name, name[] | name pgtap | public | _lang | name, name[] | name + pgtap | public | _lang | name | name + pgtap | public | _lang | name, name | name pgtap | public | _missing | character, name, name[] | name[] + pgtap | public | _missing | character[], name[] | name[] pgtap | public | _missing | character, name[] | name[] pgtap | public | _missing | character[], name, name[] | name[] - pgtap | public | _missing | character[], name[] | name[] pgtap | public | _nosuch | name, name, name[] | text - pgtap | public | _op_exists | name, name, name | boolean pgtap | public | _op_exists | name, name, name, name | boolean pgtap | public | _op_exists | name, name, name, name, name | boolean + pgtap | public | _op_exists | name, name, name | boolean pgtap | public | _opc_exists | name | boolean pgtap | public | _opc_exists | name, name | boolean - pgtap | public | _partof | name, name | boolean pgtap | public | _partof | name, name, name, name | boolean + pgtap | public | _partof | name, name | boolean pgtap | public | _parts | name | SETOF name pgtap | public | _parts | name, name | SETOF name pgtap | public | _pg_sv_column_array | oid, smallint[] | name[] @@ -2154,35 +2162,35 @@ order by pgtap | public | _query | text | text pgtap | public | _quote_ident_like | text, text | text pgtap | public | _refine_vol | text | text - pgtap | public | _relcomp | text, anyarray, text, text | text - pgtap | public | _relcomp | text, text, text, text | text pgtap | public | _relcomp | text, text, text, text, text | text + pgtap | public | _relcomp | text, text, text, text | text + pgtap | public | _relcomp | text, anyarray, text, text | text pgtap | public | _relexists | name | boolean pgtap | public | _relexists | name, name | boolean - pgtap | public | _relne | text, anyarray, text, text | text pgtap | public | _relne | text, text, text, text | text - pgtap | public | _returns | name | text - pgtap | public | _returns | name, name | text + pgtap | public | _relne | text, anyarray, text, text | text pgtap | public | _returns | name, name, name[] | text pgtap | public | _returns | name, name[] | text + pgtap | public | _returns | name | text + pgtap | public | _returns | name, name | text + pgtap | public | _rexists | character[], name, name | boolean pgtap | public | _rexists | character, name | boolean - pgtap | public | _rexists | character, name, name | boolean pgtap | public | _rexists | character[], name | boolean - pgtap | public | _rexists | character[], name, name | boolean + pgtap | public | _rexists | character, name, name | boolean pgtap | public | _rule_on | name, name | "char" pgtap | public | _rule_on | name, name, name | "char" pgtap | public | _runem | text[], boolean | SETOF text pgtap | public | _runner | text[], text[], text[], text[], text[] | SETOF text - pgtap | public | _set | integer, integer | integer pgtap | public | _set | text, integer | integer + pgtap | public | _set | integer, integer | integer pgtap | public | _set | text, integer, text | integer - pgtap | public | _strict | name | boolean - pgtap | public | _strict | name, name | boolean pgtap | public | _strict | name, name, name[] | boolean pgtap | public | _strict | name, name[] | boolean + pgtap | public | _strict | name | boolean + pgtap | public | _strict | name, name | boolean pgtap | public | _table_privs | | name[] - pgtap | public | _temptable | anyarray, text | text pgtap | public | _temptable | text, text | text + pgtap | public | _temptable | anyarray, text | text pgtap | public | _temptypes | text | text pgtap | public | _time_trials | text, integer, numeric | SETOF _time_trial_type pgtap | public | _tlike | boolean, text, text, text | text @@ -2190,667 +2198,667 @@ order by pgtap | public | _trig | name, name | boolean pgtap | public | _trig | name, name, name | boolean pgtap | public | _type_func | "char", name | boolean - pgtap | public | _type_func | "char", name, name | boolean pgtap | public | _type_func | "char", name, name, name[] | boolean pgtap | public | _type_func | "char", name, name[] | boolean + pgtap | public | _type_func | "char", name, name | boolean pgtap | public | _types_are | name, name[], text, character[] | text pgtap | public | _types_are | name[], text, character[] | text pgtap | public | _unalike | boolean, anyelement, text, text | text - pgtap | public | _vol | name | text - pgtap | public | _vol | name, name | text pgtap | public | _vol | name, name, name[] | text pgtap | public | _vol | name, name[] | text + pgtap | public | _vol | name | text + pgtap | public | _vol | name, name | text pgtap | public | add_result | boolean, boolean, text, text, text | integer pgtap | public | alike | anyelement, text | text pgtap | public | alike | anyelement, text, text | text - pgtap | public | any_column_privs_are | name, name, name, name[] | text pgtap | public | any_column_privs_are | name, name, name, name[], text | text pgtap | public | any_column_privs_are | name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name, name[] | text pgtap | public | any_column_privs_are | name, name, name[], text | text - pgtap | public | bag_eq | text, anyarray | text pgtap | public | bag_eq | text, anyarray, text | text pgtap | public | bag_eq | text, text | text pgtap | public | bag_eq | text, text, text | text + pgtap | public | bag_eq | text, anyarray | text pgtap | public | bag_has | text, text | text pgtap | public | bag_has | text, text, text | text pgtap | public | bag_hasnt | text, text | text pgtap | public | bag_hasnt | text, text, text | text - pgtap | public | bag_ne | text, anyarray | text pgtap | public | bag_ne | text, anyarray, text | text pgtap | public | bag_ne | text, text | text pgtap | public | bag_ne | text, text, text | text - pgtap | public | can | name, name[] | text - pgtap | public | can | name, name[], text | text + pgtap | public | bag_ne | text, anyarray | text pgtap | public | can | name[] | text pgtap | public | can | name[], text | text - pgtap | public | cast_context_is | name, name, text | text + pgtap | public | can | name, name[], text | text + pgtap | public | can | name, name[] | text pgtap | public | cast_context_is | name, name, text, text | text + pgtap | public | cast_context_is | name, name, text | text pgtap | public | casts_are | text[] | text pgtap | public | casts_are | text[], text | text pgtap | public | check_test | text, boolean | SETOF text - pgtap | public | check_test | text, boolean, text | SETOF text + pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text pgtap | public | check_test | text, boolean, text, text | SETOF text + pgtap | public | check_test | text, boolean, text | SETOF text pgtap | public | check_test | text, boolean, text, text, text | SETOF text - pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text pgtap | public | cmp_ok | anyelement, text, anyelement | text pgtap | public | cmp_ok | anyelement, text, anyelement, text | text pgtap | public | col_default_is | name, name, anyelement | text - pgtap | public | col_default_is | name, name, anyelement, text | text - pgtap | public | col_default_is | name, name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, text, text | text pgtap | public | col_default_is | name, name, name, text, text | text pgtap | public | col_default_is | name, name, text | text - pgtap | public | col_default_is | name, name, text, text | text - pgtap | public | col_has_check | name, name | text + pgtap | public | col_default_is | name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, name, anyelement, text | text pgtap | public | col_has_check | name, name, name, text | text - pgtap | public | col_has_check | name, name, name[], text | text - pgtap | public | col_has_check | name, name, text | text - pgtap | public | col_has_check | name, name[] | text pgtap | public | col_has_check | name, name[], text | text - pgtap | public | col_has_default | name, name | text + pgtap | public | col_has_check | name, name[] | text + pgtap | public | col_has_check | name, name, text | text + pgtap | public | col_has_check | name, name, name[], text | text + pgtap | public | col_has_check | name, name | text pgtap | public | col_has_default | name, name, name, text | text pgtap | public | col_has_default | name, name, text | text - pgtap | public | col_hasnt_default | name, name | text + pgtap | public | col_has_default | name, name | text pgtap | public | col_hasnt_default | name, name, name, text | text pgtap | public | col_hasnt_default | name, name, text | text - pgtap | public | col_is_fk | name, name | text + pgtap | public | col_hasnt_default | name, name | text pgtap | public | col_is_fk | name, name, name, text | text - pgtap | public | col_is_fk | name, name, name[], text | text - pgtap | public | col_is_fk | name, name, text | text - pgtap | public | col_is_fk | name, name[] | text pgtap | public | col_is_fk | name, name[], text | text - pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_is_fk | name, name[] | text + pgtap | public | col_is_fk | name, name, text | text + pgtap | public | col_is_fk | name, name, name[], text | text + pgtap | public | col_is_fk | name, name | text pgtap | public | col_is_null | table_name name, column_name name, description text | text - pgtap | public | col_is_pk | name, name | text + pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text pgtap | public | col_is_pk | name, name, name, text | text - pgtap | public | col_is_pk | name, name, name[], text | text - pgtap | public | col_is_pk | name, name, text | text - pgtap | public | col_is_pk | name, name[] | text pgtap | public | col_is_pk | name, name[], text | text - pgtap | public | col_is_unique | name, name | text - pgtap | public | col_is_unique | name, name, name | text + pgtap | public | col_is_pk | name, name[] | text + pgtap | public | col_is_pk | name, name, text | text + pgtap | public | col_is_pk | name, name, name[], text | text + pgtap | public | col_is_pk | name, name | text pgtap | public | col_is_unique | name, name, name, text | text + pgtap | public | col_is_unique | name, name[], text | text pgtap | public | col_is_unique | name, name, name[] | text - pgtap | public | col_is_unique | name, name, name[], text | text - pgtap | public | col_is_unique | name, name, text | text pgtap | public | col_is_unique | name, name[] | text - pgtap | public | col_is_unique | name, name[], text | text - pgtap | public | col_isnt_fk | name, name | text + pgtap | public | col_is_unique | name, name, text | text + pgtap | public | col_is_unique | name, name, name[], text | text + pgtap | public | col_is_unique | name, name | text + pgtap | public | col_is_unique | name, name, name | text pgtap | public | col_isnt_fk | name, name, name, text | text - pgtap | public | col_isnt_fk | name, name, name[], text | text - pgtap | public | col_isnt_fk | name, name, text | text - pgtap | public | col_isnt_fk | name, name[] | text pgtap | public | col_isnt_fk | name, name[], text | text - pgtap | public | col_isnt_pk | name, name | text + pgtap | public | col_isnt_fk | name, name[] | text + pgtap | public | col_isnt_fk | name, name, text | text + pgtap | public | col_isnt_fk | name, name, name[], text | text + pgtap | public | col_isnt_fk | name, name | text pgtap | public | col_isnt_pk | name, name, name, text | text - pgtap | public | col_isnt_pk | name, name, name[], text | text - pgtap | public | col_isnt_pk | name, name, text | text - pgtap | public | col_isnt_pk | name, name[] | text pgtap | public | col_isnt_pk | name, name[], text | text - pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_isnt_pk | name, name[] | text + pgtap | public | col_isnt_pk | name, name, text | text + pgtap | public | col_isnt_pk | name, name, name[], text | text + pgtap | public | col_isnt_pk | name, name | text pgtap | public | col_not_null | table_name name, column_name name, description text | text - pgtap | public | col_type_is | name, name, name, name, text | text - pgtap | public | col_type_is | name, name, name, name, text, text | text + pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text pgtap | public | col_type_is | name, name, name, text | text + pgtap | public | col_type_is | name, name, text, text | text pgtap | public | col_type_is | name, name, name, text, text | text + pgtap | public | col_type_is | name, name, name, name, text, text | text pgtap | public | col_type_is | name, name, text | text - pgtap | public | col_type_is | name, name, text, text | text + pgtap | public | col_type_is | name, name, name, name, text | text pgtap | public | collect_tap | VARIADIC text[] | text pgtap | public | collect_tap | character varying[] | text + pgtap | public | column_privs_are | name, name, name, name[], text | text pgtap | public | column_privs_are | name, name, name, name, name[] | text - pgtap | public | column_privs_are | name, name, name, name, name[], text | text pgtap | public | column_privs_are | name, name, name, name[] | text - pgtap | public | column_privs_are | name, name, name, name[], text | text + pgtap | public | column_privs_are | name, name, name, name, name[], text | text + pgtap | public | columns_are | name, name[], text | text pgtap | public | columns_are | name, name, name[] | text - pgtap | public | columns_are | name, name, name[], text | text pgtap | public | columns_are | name, name[] | text - pgtap | public | columns_are | name, name[], text | text - pgtap | public | composite_owner_is | name, name | text - pgtap | public | composite_owner_is | name, name, name | text + pgtap | public | columns_are | name, name, name[], text | text pgtap | public | composite_owner_is | name, name, name, text | text pgtap | public | composite_owner_is | name, name, text | text + pgtap | public | composite_owner_is | name, name | text + pgtap | public | composite_owner_is | name, name, name | text pgtap | public | database_privs_are | name, name, name[] | text pgtap | public | database_privs_are | name, name, name[], text | text - pgtap | public | db_owner_is | name, name | text pgtap | public | db_owner_is | name, name, text | text - pgtap | public | diag | VARIADIC anyarray | text + pgtap | public | db_owner_is | name, name | text + pgtap | public | diag | msg text | text pgtap | public | diag | VARIADIC text[] | text + pgtap | public | diag | VARIADIC anyarray | text pgtap | public | diag | msg anyelement | text - pgtap | public | diag | msg text | text pgtap | public | diag_test_name | text | text pgtap | public | display_oper | name, oid | text - pgtap | public | do_tap | | SETOF text - pgtap | public | do_tap | name | SETOF text - pgtap | public | do_tap | name, text | SETOF text pgtap | public | do_tap | text | SETOF text + pgtap | public | do_tap | name, text | SETOF text + pgtap | public | do_tap | name | SETOF text + pgtap | public | do_tap | | SETOF text pgtap | public | doesnt_imatch | anyelement, text | text pgtap | public | doesnt_imatch | anyelement, text, text | text pgtap | public | doesnt_match | anyelement, text | text pgtap | public | doesnt_match | anyelement, text, text | text - pgtap | public | domain_type_is | name, text, name, text | text pgtap | public | domain_type_is | name, text, name, text, text | text - pgtap | public | domain_type_is | name, text, text | text - pgtap | public | domain_type_is | name, text, text, text | text pgtap | public | domain_type_is | text, text | text + pgtap | public | domain_type_is | name, text, text, text | text + pgtap | public | domain_type_is | name, text, text | text pgtap | public | domain_type_is | text, text, text | text - pgtap | public | domain_type_isnt | name, text, name, text | text + pgtap | public | domain_type_is | name, text, name, text | text pgtap | public | domain_type_isnt | name, text, name, text, text | text - pgtap | public | domain_type_isnt | name, text, text | text - pgtap | public | domain_type_isnt | name, text, text, text | text pgtap | public | domain_type_isnt | text, text | text + pgtap | public | domain_type_isnt | name, text, text, text | text + pgtap | public | domain_type_isnt | name, text, text | text pgtap | public | domain_type_isnt | text, text, text | text - pgtap | public | domains_are | name, name[] | text - pgtap | public | domains_are | name, name[], text | text + pgtap | public | domain_type_isnt | name, text, name, text | text pgtap | public | domains_are | name[] | text pgtap | public | domains_are | name[], text | text + pgtap | public | domains_are | name, name[], text | text + pgtap | public | domains_are | name, name[] | text + pgtap | public | enum_has_labels | name, name[], text | text pgtap | public | enum_has_labels | name, name, name[] | text - pgtap | public | enum_has_labels | name, name, name[], text | text pgtap | public | enum_has_labels | name, name[] | text - pgtap | public | enum_has_labels | name, name[], text | text - pgtap | public | enums_are | name, name[] | text - pgtap | public | enums_are | name, name[], text | text + pgtap | public | enum_has_labels | name, name, name[], text | text pgtap | public | enums_are | name[] | text pgtap | public | enums_are | name[], text | text - pgtap | public | extensions_are | name, name[] | text - pgtap | public | extensions_are | name, name[], text | text + pgtap | public | enums_are | name, name[], text | text + pgtap | public | enums_are | name, name[] | text pgtap | public | extensions_are | name[] | text pgtap | public | extensions_are | name[], text | text - pgtap | public | fail | | text + pgtap | public | extensions_are | name, name[], text | text + pgtap | public | extensions_are | name, name[] | text pgtap | public | fail | text | text + pgtap | public | fail | | text pgtap | public | fdw_privs_are | name, name, name[] | text pgtap | public | fdw_privs_are | name, name, name[], text | text - pgtap | public | findfuncs | name, text | text[] - pgtap | public | findfuncs | name, text, text | text[] pgtap | public | findfuncs | text | text[] pgtap | public | findfuncs | text, text | text[] + pgtap | public | findfuncs | name, text, text | text[] + pgtap | public | findfuncs | name, text | text[] pgtap | public | finish | exception_on_failure boolean | SETOF text - pgtap | public | fk_ok | name, name, name, name | text - pgtap | public | fk_ok | name, name, name, name, name, name, text | text pgtap | public | fk_ok | name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name | text pgtap | public | fk_ok | name, name, name, name, text | text - pgtap | public | fk_ok | name, name, name[], name, name, name[] | text pgtap | public | fk_ok | name, name, name[], name, name, name[], text | text + pgtap | public | fk_ok | name, name, name[], name, name, name[] | text pgtap | public | fk_ok | name, name[], name, name[] | text pgtap | public | fk_ok | name, name[], name, name[], text | text - pgtap | public | foreign_table_owner_is | name, name | text - pgtap | public | foreign_table_owner_is | name, name, name | text pgtap | public | foreign_table_owner_is | name, name, name, text | text pgtap | public | foreign_table_owner_is | name, name, text | text - pgtap | public | foreign_tables_are | name, name[] | text - pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_table_owner_is | name, name | text + pgtap | public | foreign_table_owner_is | name, name, name | text pgtap | public | foreign_tables_are | name[] | text pgtap | public | foreign_tables_are | name[], text | text - pgtap | public | function_lang_is | name, name | text - pgtap | public | function_lang_is | name, name, name | text + pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_tables_are | name, name[] | text pgtap | public | function_lang_is | name, name, name, text | text - pgtap | public | function_lang_is | name, name, name[], name | text - pgtap | public | function_lang_is | name, name, name[], name, text | text pgtap | public | function_lang_is | name, name, text | text - pgtap | public | function_lang_is | name, name[], name | text pgtap | public | function_lang_is | name, name[], name, text | text + pgtap | public | function_lang_is | name, name, name[], name | text + pgtap | public | function_lang_is | name, name | text + pgtap | public | function_lang_is | name, name, name | text + pgtap | public | function_lang_is | name, name[], name | text + pgtap | public | function_lang_is | name, name, name[], name, text | text + pgtap | public | function_owner_is | name, name[], name, text | text pgtap | public | function_owner_is | name, name, name[], name | text - pgtap | public | function_owner_is | name, name, name[], name, text | text pgtap | public | function_owner_is | name, name[], name | text - pgtap | public | function_owner_is | name, name[], name, text | text - pgtap | public | function_privs_are | name, name, name[], name, name[] | text + pgtap | public | function_owner_is | name, name, name[], name, text | text pgtap | public | function_privs_are | name, name, name[], name, name[], text | text pgtap | public | function_privs_are | name, name[], name, name[] | text pgtap | public | function_privs_are | name, name[], name, name[], text | text - pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_privs_are | name, name, name[], name, name[] | text pgtap | public | function_returns | name, name, name[], text, text | text - pgtap | public | function_returns | name, name, text | text - pgtap | public | function_returns | name, name, text, text | text pgtap | public | function_returns | name, name[], text | text - pgtap | public | function_returns | name, name[], text, text | text - pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, name, text, text | text + pgtap | public | function_returns | name, name, text | text pgtap | public | function_returns | name, text, text | text - pgtap | public | functions_are | name, name[] | text - pgtap | public | functions_are | name, name[], text | text + pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_returns | name, name[], text, text | text pgtap | public | functions_are | name[] | text pgtap | public | functions_are | name[], text | text + pgtap | public | functions_are | name, name[], text | text + pgtap | public | functions_are | name, name[] | text pgtap | public | groups_are | name[] | text pgtap | public | groups_are | name[], text | text - pgtap | public | has_cast | name, name | text - pgtap | public | has_cast | name, name, name | text - pgtap | public | has_cast | name, name, name, name | text - pgtap | public | has_cast | name, name, name, name, text | text pgtap | public | has_cast | name, name, name, text | text + pgtap | public | has_cast | name, name, name, name | text pgtap | public | has_cast | name, name, text | text - pgtap | public | has_check | name | text + pgtap | public | has_cast | name, name, name, name, text | text + pgtap | public | has_cast | name, name | text + pgtap | public | has_cast | name, name, name | text pgtap | public | has_check | name, name, text | text pgtap | public | has_check | name, text | text - pgtap | public | has_column | name, name | text + pgtap | public | has_check | name | text pgtap | public | has_column | name, name, name, text | text pgtap | public | has_column | name, name, text | text - pgtap | public | has_composite | name | text + pgtap | public | has_column | name, name | text pgtap | public | has_composite | name, name, text | text pgtap | public | has_composite | name, text | text - pgtap | public | has_domain | name | text - pgtap | public | has_domain | name, name | text + pgtap | public | has_composite | name | text pgtap | public | has_domain | name, name, text | text pgtap | public | has_domain | name, text | text - pgtap | public | has_enum | name | text - pgtap | public | has_enum | name, name | text + pgtap | public | has_domain | name | text + pgtap | public | has_domain | name, name | text pgtap | public | has_enum | name, name, text | text pgtap | public | has_enum | name, text | text - pgtap | public | has_extension | name | text - pgtap | public | has_extension | name, name | text + pgtap | public | has_enum | name | text + pgtap | public | has_enum | name, name | text pgtap | public | has_extension | name, name, text | text pgtap | public | has_extension | name, text | text - pgtap | public | has_fk | name | text + pgtap | public | has_extension | name | text + pgtap | public | has_extension | name, name | text pgtap | public | has_fk | name, name, text | text pgtap | public | has_fk | name, text | text - pgtap | public | has_foreign_table | name | text - pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_fk | name | text pgtap | public | has_foreign_table | name, name, text | text pgtap | public | has_foreign_table | name, text | text - pgtap | public | has_function | name | text - pgtap | public | has_function | name, name | text + pgtap | public | has_foreign_table | name | text + pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_function | name, name[], text | text pgtap | public | has_function | name, name, name[] | text - pgtap | public | has_function | name, name, name[], text | text - pgtap | public | has_function | name, name, text | text pgtap | public | has_function | name, name[] | text - pgtap | public | has_function | name, name[], text | text + pgtap | public | has_function | name, name, text | text pgtap | public | has_function | name, text | text - pgtap | public | has_group | name | text + pgtap | public | has_function | name | text + pgtap | public | has_function | name, name, name[], text | text + pgtap | public | has_function | name, name | text pgtap | public | has_group | name, text | text - pgtap | public | has_index | name, name | text - pgtap | public | has_index | name, name, name | text - pgtap | public | has_index | name, name, name, name | text - pgtap | public | has_index | name, name, name, name, text | text - pgtap | public | has_index | name, name, name, name[] | text - pgtap | public | has_index | name, name, name, name[], text | text + pgtap | public | has_group | name | text pgtap | public | has_index | name, name, name, text | text + pgtap | public | has_index | name, name, name, name[], text | text pgtap | public | has_index | name, name, name[] | text - pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name, name, name | text pgtap | public | has_index | name, name, text | text - pgtap | public | has_inherited_tables | name | text - pgtap | public | has_inherited_tables | name, name | text + pgtap | public | has_index | name, name, name, name[] | text + pgtap | public | has_index | name, name, name, name, text | text + pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name | text + pgtap | public | has_index | name, name, name | text pgtap | public | has_inherited_tables | name, name, text | text pgtap | public | has_inherited_tables | name, text | text - pgtap | public | has_language | name | text + pgtap | public | has_inherited_tables | name | text + pgtap | public | has_inherited_tables | name, name | text pgtap | public | has_language | name, text | text - pgtap | public | has_leftop | name, name | text - pgtap | public | has_leftop | name, name, name | text - pgtap | public | has_leftop | name, name, name, name | text - pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_language | name | text pgtap | public | has_leftop | name, name, name, text | text + pgtap | public | has_leftop | name, name, name, name | text pgtap | public | has_leftop | name, name, text | text - pgtap | public | has_materialized_view | name | text + pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_leftop | name, name | text + pgtap | public | has_leftop | name, name, name | text pgtap | public | has_materialized_view | name, name, text | text pgtap | public | has_materialized_view | name, text | text - pgtap | public | has_opclass | name | text - pgtap | public | has_opclass | name, name | text + pgtap | public | has_materialized_view | name | text pgtap | public | has_opclass | name, name, text | text pgtap | public | has_opclass | name, text | text - pgtap | public | has_operator | name, name, name | text - pgtap | public | has_operator | name, name, name, name | text - pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_opclass | name | text + pgtap | public | has_opclass | name, name | text + pgtap | public | has_operator | name, name, name, text | text pgtap | public | has_operator | name, name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, name | text pgtap | public | has_operator | name, name, name, name, text | text - pgtap | public | has_operator | name, name, name, text | text - pgtap | public | has_pk | name | text + pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_operator | name, name, name | text pgtap | public | has_pk | name, name, text | text pgtap | public | has_pk | name, text | text - pgtap | public | has_relation | name | text + pgtap | public | has_pk | name | text pgtap | public | has_relation | name, name, text | text pgtap | public | has_relation | name, text | text - pgtap | public | has_rightop | name, name | text - pgtap | public | has_rightop | name, name, name | text - pgtap | public | has_rightop | name, name, name, name | text - pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_relation | name | text pgtap | public | has_rightop | name, name, name, text | text + pgtap | public | has_rightop | name, name, name, name | text pgtap | public | has_rightop | name, name, text | text - pgtap | public | has_role | name | text + pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_rightop | name, name | text + pgtap | public | has_rightop | name, name, name | text pgtap | public | has_role | name, text | text - pgtap | public | has_rule | name, name | text - pgtap | public | has_rule | name, name, name | text + pgtap | public | has_role | name | text pgtap | public | has_rule | name, name, name, text | text pgtap | public | has_rule | name, name, text | text - pgtap | public | has_schema | name | text + pgtap | public | has_rule | name, name | text + pgtap | public | has_rule | name, name, name | text pgtap | public | has_schema | name, text | text - pgtap | public | has_sequence | name | text - pgtap | public | has_sequence | name, name | text + pgtap | public | has_schema | name | text pgtap | public | has_sequence | name, name, text | text pgtap | public | has_sequence | name, text | text - pgtap | public | has_table | name | text - pgtap | public | has_table | name, name | text + pgtap | public | has_sequence | name | text + pgtap | public | has_sequence | name, name | text pgtap | public | has_table | name, name, text | text pgtap | public | has_table | name, text | text - pgtap | public | has_tablespace | name | text - pgtap | public | has_tablespace | name, text | text + pgtap | public | has_table | name | text + pgtap | public | has_table | name, name | text pgtap | public | has_tablespace | name, text, text | text - pgtap | public | has_trigger | name, name | text - pgtap | public | has_trigger | name, name, name | text + pgtap | public | has_tablespace | name, text | text + pgtap | public | has_tablespace | name | text pgtap | public | has_trigger | name, name, name, text | text pgtap | public | has_trigger | name, name, text | text - pgtap | public | has_type | name | text - pgtap | public | has_type | name, name | text + pgtap | public | has_trigger | name, name | text + pgtap | public | has_trigger | name, name, name | text pgtap | public | has_type | name, name, text | text pgtap | public | has_type | name, text | text + pgtap | public | has_type | name | text + pgtap | public | has_type | name, name | text pgtap | public | has_unique | text | text pgtap | public | has_unique | text, text | text pgtap | public | has_unique | text, text, text | text - pgtap | public | has_user | name | text pgtap | public | has_user | name, text | text - pgtap | public | has_view | name | text - pgtap | public | has_view | name, name | text + pgtap | public | has_user | name | text pgtap | public | has_view | name, name, text | text pgtap | public | has_view | name, text | text - pgtap | public | hasnt_cast | name, name | text - pgtap | public | hasnt_cast | name, name, name | text - pgtap | public | hasnt_cast | name, name, name, name | text - pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | has_view | name | text + pgtap | public | has_view | name, name | text pgtap | public | hasnt_cast | name, name, name, text | text + pgtap | public | hasnt_cast | name, name, name, name | text pgtap | public | hasnt_cast | name, name, text | text - pgtap | public | hasnt_column | name, name | text + pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | hasnt_cast | name, name | text + pgtap | public | hasnt_cast | name, name, name | text pgtap | public | hasnt_column | name, name, name, text | text pgtap | public | hasnt_column | name, name, text | text - pgtap | public | hasnt_composite | name | text + pgtap | public | hasnt_column | name, name | text pgtap | public | hasnt_composite | name, name, text | text pgtap | public | hasnt_composite | name, text | text - pgtap | public | hasnt_domain | name | text - pgtap | public | hasnt_domain | name, name | text + pgtap | public | hasnt_composite | name | text pgtap | public | hasnt_domain | name, name, text | text pgtap | public | hasnt_domain | name, text | text - pgtap | public | hasnt_enum | name | text - pgtap | public | hasnt_enum | name, name | text + pgtap | public | hasnt_domain | name | text + pgtap | public | hasnt_domain | name, name | text pgtap | public | hasnt_enum | name, name, text | text pgtap | public | hasnt_enum | name, text | text - pgtap | public | hasnt_extension | name | text - pgtap | public | hasnt_extension | name, name | text + pgtap | public | hasnt_enum | name | text + pgtap | public | hasnt_enum | name, name | text pgtap | public | hasnt_extension | name, name, text | text pgtap | public | hasnt_extension | name, text | text - pgtap | public | hasnt_fk | name | text + pgtap | public | hasnt_extension | name | text + pgtap | public | hasnt_extension | name, name | text pgtap | public | hasnt_fk | name, name, text | text pgtap | public | hasnt_fk | name, text | text - pgtap | public | hasnt_foreign_table | name | text - pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_fk | name | text pgtap | public | hasnt_foreign_table | name, name, text | text pgtap | public | hasnt_foreign_table | name, text | text - pgtap | public | hasnt_function | name | text - pgtap | public | hasnt_function | name, name | text + pgtap | public | hasnt_foreign_table | name | text + pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_function | name, name[], text | text pgtap | public | hasnt_function | name, name, name[] | text - pgtap | public | hasnt_function | name, name, name[], text | text - pgtap | public | hasnt_function | name, name, text | text pgtap | public | hasnt_function | name, name[] | text - pgtap | public | hasnt_function | name, name[], text | text + pgtap | public | hasnt_function | name, name, text | text pgtap | public | hasnt_function | name, text | text - pgtap | public | hasnt_group | name | text + pgtap | public | hasnt_function | name | text + pgtap | public | hasnt_function | name, name, name[], text | text + pgtap | public | hasnt_function | name, name | text pgtap | public | hasnt_group | name, text | text - pgtap | public | hasnt_index | name, name | text - pgtap | public | hasnt_index | name, name, name | text + pgtap | public | hasnt_group | name | text pgtap | public | hasnt_index | name, name, name, text | text pgtap | public | hasnt_index | name, name, text | text - pgtap | public | hasnt_inherited_tables | name | text - pgtap | public | hasnt_inherited_tables | name, name | text + pgtap | public | hasnt_index | name, name | text + pgtap | public | hasnt_index | name, name, name | text pgtap | public | hasnt_inherited_tables | name, name, text | text pgtap | public | hasnt_inherited_tables | name, text | text - pgtap | public | hasnt_language | name | text + pgtap | public | hasnt_inherited_tables | name | text + pgtap | public | hasnt_inherited_tables | name, name | text pgtap | public | hasnt_language | name, text | text - pgtap | public | hasnt_leftop | name, name | text - pgtap | public | hasnt_leftop | name, name, name | text - pgtap | public | hasnt_leftop | name, name, name, name | text - pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_language | name | text pgtap | public | hasnt_leftop | name, name, name, text | text + pgtap | public | hasnt_leftop | name, name, name, name | text pgtap | public | hasnt_leftop | name, name, text | text - pgtap | public | hasnt_materialized_view | name | text + pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_leftop | name, name | text + pgtap | public | hasnt_leftop | name, name, name | text pgtap | public | hasnt_materialized_view | name, name, text | text pgtap | public | hasnt_materialized_view | name, text | text - pgtap | public | hasnt_opclass | name | text - pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_materialized_view | name | text pgtap | public | hasnt_opclass | name, name, text | text pgtap | public | hasnt_opclass | name, text | text - pgtap | public | hasnt_operator | name, name, name | text - pgtap | public | hasnt_operator | name, name, name, name | text - pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_opclass | name | text + pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_operator | name, name, name, text | text pgtap | public | hasnt_operator | name, name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name | text pgtap | public | hasnt_operator | name, name, name, name, text | text - pgtap | public | hasnt_operator | name, name, name, text | text - pgtap | public | hasnt_pk | name | text + pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name | text pgtap | public | hasnt_pk | name, name, text | text pgtap | public | hasnt_pk | name, text | text - pgtap | public | hasnt_relation | name | text + pgtap | public | hasnt_pk | name | text pgtap | public | hasnt_relation | name, name, text | text pgtap | public | hasnt_relation | name, text | text - pgtap | public | hasnt_rightop | name, name | text - pgtap | public | hasnt_rightop | name, name, name | text - pgtap | public | hasnt_rightop | name, name, name, name | text - pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_relation | name | text pgtap | public | hasnt_rightop | name, name, name, text | text + pgtap | public | hasnt_rightop | name, name, name, name | text pgtap | public | hasnt_rightop | name, name, text | text - pgtap | public | hasnt_role | name | text + pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_rightop | name, name | text + pgtap | public | hasnt_rightop | name, name, name | text pgtap | public | hasnt_role | name, text | text - pgtap | public | hasnt_rule | name, name | text - pgtap | public | hasnt_rule | name, name, name | text + pgtap | public | hasnt_role | name | text pgtap | public | hasnt_rule | name, name, name, text | text pgtap | public | hasnt_rule | name, name, text | text - pgtap | public | hasnt_schema | name | text + pgtap | public | hasnt_rule | name, name | text + pgtap | public | hasnt_rule | name, name, name | text pgtap | public | hasnt_schema | name, text | text - pgtap | public | hasnt_sequence | name | text + pgtap | public | hasnt_schema | name | text pgtap | public | hasnt_sequence | name, name, text | text pgtap | public | hasnt_sequence | name, text | text - pgtap | public | hasnt_table | name | text - pgtap | public | hasnt_table | name, name | text + pgtap | public | hasnt_sequence | name | text pgtap | public | hasnt_table | name, name, text | text pgtap | public | hasnt_table | name, text | text - pgtap | public | hasnt_tablespace | name | text + pgtap | public | hasnt_table | name | text + pgtap | public | hasnt_table | name, name | text pgtap | public | hasnt_tablespace | name, text | text - pgtap | public | hasnt_trigger | name, name | text - pgtap | public | hasnt_trigger | name, name, name | text + pgtap | public | hasnt_tablespace | name | text pgtap | public | hasnt_trigger | name, name, name, text | text pgtap | public | hasnt_trigger | name, name, text | text - pgtap | public | hasnt_type | name | text - pgtap | public | hasnt_type | name, name | text + pgtap | public | hasnt_trigger | name, name | text + pgtap | public | hasnt_trigger | name, name, name | text pgtap | public | hasnt_type | name, name, text | text pgtap | public | hasnt_type | name, text | text - pgtap | public | hasnt_user | name | text + pgtap | public | hasnt_type | name | text + pgtap | public | hasnt_type | name, name | text pgtap | public | hasnt_user | name, text | text - pgtap | public | hasnt_view | name | text - pgtap | public | hasnt_view | name, name | text + pgtap | public | hasnt_user | name | text pgtap | public | hasnt_view | name, name, text | text pgtap | public | hasnt_view | name, text | text + pgtap | public | hasnt_view | name | text + pgtap | public | hasnt_view | name, name | text pgtap | public | ialike | anyelement, text | text pgtap | public | ialike | anyelement, text, text | text pgtap | public | imatches | anyelement, text | text pgtap | public | imatches | anyelement, text, text | text pgtap | public | in_todo | | boolean + pgtap | public | index_is_primary | name, name, name, text | text pgtap | public | index_is_primary | name | text pgtap | public | index_is_primary | name, name | text pgtap | public | index_is_primary | name, name, name | text - pgtap | public | index_is_primary | name, name, name, text | text - pgtap | public | index_is_type | name, name | text - pgtap | public | index_is_type | name, name, name | text pgtap | public | index_is_type | name, name, name, name | text pgtap | public | index_is_type | name, name, name, name, text | text + pgtap | public | index_is_type | name, name | text + pgtap | public | index_is_type | name, name, name | text + pgtap | public | index_is_unique | name, name, name, text | text pgtap | public | index_is_unique | name | text pgtap | public | index_is_unique | name, name | text pgtap | public | index_is_unique | name, name, name | text - pgtap | public | index_is_unique | name, name, name, text | text - pgtap | public | index_owner_is | name, name, name | text + pgtap | public | index_owner_is | name, name, name, text | text pgtap | public | index_owner_is | name, name, name, name | text pgtap | public | index_owner_is | name, name, name, name, text | text - pgtap | public | index_owner_is | name, name, name, text | text + pgtap | public | index_owner_is | name, name, name | text + pgtap | public | indexes_are | name, name[], text | text pgtap | public | indexes_are | name, name, name[] | text - pgtap | public | indexes_are | name, name, name[], text | text pgtap | public | indexes_are | name, name[] | text - pgtap | public | indexes_are | name, name[], text | text - pgtap | public | is | anyelement, anyelement | text + pgtap | public | indexes_are | name, name, name[], text | text pgtap | public | is | anyelement, anyelement, text | text - pgtap | public | is_aggregate | name | text - pgtap | public | is_aggregate | name, name | text + pgtap | public | is | anyelement, anyelement | text + pgtap | public | is_aggregate | name, name[], text | text pgtap | public | is_aggregate | name, name, name[] | text - pgtap | public | is_aggregate | name, name, name[], text | text - pgtap | public | is_aggregate | name, name, text | text pgtap | public | is_aggregate | name, name[] | text - pgtap | public | is_aggregate | name, name[], text | text + pgtap | public | is_aggregate | name, name, text | text pgtap | public | is_aggregate | name, text | text - pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_aggregate | name | text + pgtap | public | is_aggregate | name, name, name[], text | text + pgtap | public | is_aggregate | name, name | text + pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text pgtap | public | is_ancestor_of | name, name, integer | text - pgtap | public | is_ancestor_of | name, name, integer, text | text pgtap | public | is_ancestor_of | name, name, name, name | text - pgtap | public | is_ancestor_of | name, name, name, name, integer | text - pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text - pgtap | public | is_ancestor_of | name, name, name, name, text | text pgtap | public | is_ancestor_of | name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, integer | text + pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_ancestor_of | name, name, integer, text | text + pgtap | public | is_clustered | name, name, name, text | text pgtap | public | is_clustered | name | text pgtap | public | is_clustered | name, name | text pgtap | public | is_clustered | name, name, name | text - pgtap | public | is_clustered | name, name, name, text | text - pgtap | public | is_definer | name | text - pgtap | public | is_definer | name, name | text + pgtap | public | is_definer | name, name[], text | text pgtap | public | is_definer | name, name, name[] | text - pgtap | public | is_definer | name, name, name[], text | text - pgtap | public | is_definer | name, name, text | text pgtap | public | is_definer | name, name[] | text - pgtap | public | is_definer | name, name[], text | text + pgtap | public | is_definer | name, name, text | text pgtap | public | is_definer | name, text | text - pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_definer | name | text + pgtap | public | is_definer | name, name, name[], text | text + pgtap | public | is_definer | name, name | text + pgtap | public | is_descendent_of | name, name, name, name, integer, text | text pgtap | public | is_descendent_of | name, name, integer | text - pgtap | public | is_descendent_of | name, name, integer, text | text pgtap | public | is_descendent_of | name, name, name, name | text - pgtap | public | is_descendent_of | name, name, name, name, integer | text - pgtap | public | is_descendent_of | name, name, name, name, integer, text | text - pgtap | public | is_descendent_of | name, name, name, name, text | text pgtap | public | is_descendent_of | name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, integer | text + pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_descendent_of | name, name, integer, text | text pgtap | public | is_empty | text | text pgtap | public | is_empty | text, text | text - pgtap | public | is_indexed | name, name | text - pgtap | public | is_indexed | name, name, name | text pgtap | public | is_indexed | name, name, name, text | text + pgtap | public | is_indexed | name, name[], text | text pgtap | public | is_indexed | name, name, name[] | text - pgtap | public | is_indexed | name, name, name[], text | text pgtap | public | is_indexed | name, name[] | text - pgtap | public | is_indexed | name, name[], text | text - pgtap | public | is_member_of | name, name | text - pgtap | public | is_member_of | name, name, text | text - pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_indexed | name, name, name[], text | text + pgtap | public | is_indexed | name, name | text + pgtap | public | is_indexed | name, name, name | text pgtap | public | is_member_of | name, name[], text | text - pgtap | public | is_normal_function | name | text - pgtap | public | is_normal_function | name, name | text + pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_member_of | name, name, text | text + pgtap | public | is_member_of | name, name | text + pgtap | public | is_normal_function | name, name[], text | text pgtap | public | is_normal_function | name, name, name[] | text - pgtap | public | is_normal_function | name, name, name[], text | text - pgtap | public | is_normal_function | name, name, text | text pgtap | public | is_normal_function | name, name[] | text - pgtap | public | is_normal_function | name, name[], text | text + pgtap | public | is_normal_function | name, name, text | text pgtap | public | is_normal_function | name, text | text - pgtap | public | is_partition_of | name, name | text + pgtap | public | is_normal_function | name | text + pgtap | public | is_normal_function | name, name, name[], text | text + pgtap | public | is_normal_function | name, name | text pgtap | public | is_partition_of | name, name, name, name | text - pgtap | public | is_partition_of | name, name, name, name, text | text pgtap | public | is_partition_of | name, name, text | text - pgtap | public | is_partitioned | name | text - pgtap | public | is_partitioned | name, name | text + pgtap | public | is_partition_of | name, name, name, name, text | text + pgtap | public | is_partition_of | name, name | text pgtap | public | is_partitioned | name, name, text | text pgtap | public | is_partitioned | name, text | text - pgtap | public | is_procedure | name | text - pgtap | public | is_procedure | name, name | text + pgtap | public | is_partitioned | name | text + pgtap | public | is_partitioned | name, name | text + pgtap | public | is_procedure | name, name[], text | text pgtap | public | is_procedure | name, name, name[] | text - pgtap | public | is_procedure | name, name, name[], text | text - pgtap | public | is_procedure | name, name, text | text pgtap | public | is_procedure | name, name[] | text - pgtap | public | is_procedure | name, name[], text | text + pgtap | public | is_procedure | name, name, text | text pgtap | public | is_procedure | name, text | text - pgtap | public | is_strict | name | text - pgtap | public | is_strict | name, name | text + pgtap | public | is_procedure | name | text + pgtap | public | is_procedure | name, name, name[], text | text + pgtap | public | is_procedure | name, name | text + pgtap | public | is_strict | name, name[], text | text pgtap | public | is_strict | name, name, name[] | text - pgtap | public | is_strict | name, name, name[], text | text - pgtap | public | is_strict | name, name, text | text pgtap | public | is_strict | name, name[] | text - pgtap | public | is_strict | name, name[], text | text + pgtap | public | is_strict | name, name, text | text pgtap | public | is_strict | name, text | text - pgtap | public | is_superuser | name | text + pgtap | public | is_strict | name | text + pgtap | public | is_strict | name, name, name[], text | text + pgtap | public | is_strict | name, name | text pgtap | public | is_superuser | name, text | text - pgtap | public | is_window | name | text - pgtap | public | is_window | name, name | text + pgtap | public | is_superuser | name | text + pgtap | public | is_window | name, name[], text | text pgtap | public | is_window | name, name, name[] | text - pgtap | public | is_window | name, name, name[], text | text - pgtap | public | is_window | name, name, text | text pgtap | public | is_window | name, name[] | text - pgtap | public | is_window | name, name[], text | text + pgtap | public | is_window | name, name, text | text pgtap | public | is_window | name, text | text + pgtap | public | is_window | name | text + pgtap | public | is_window | name, name, name[], text | text + pgtap | public | is_window | name, name | text pgtap | public | isa_ok | anyelement, regtype | text pgtap | public | isa_ok | anyelement, regtype, text | text - pgtap | public | isnt | anyelement, anyelement | text pgtap | public | isnt | anyelement, anyelement, text | text - pgtap | public | isnt_aggregate | name | text - pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt | anyelement, anyelement | text + pgtap | public | isnt_aggregate | name, name[], text | text pgtap | public | isnt_aggregate | name, name, name[] | text - pgtap | public | isnt_aggregate | name, name, name[], text | text - pgtap | public | isnt_aggregate | name, name, text | text pgtap | public | isnt_aggregate | name, name[] | text - pgtap | public | isnt_aggregate | name, name[], text | text + pgtap | public | isnt_aggregate | name, name, text | text pgtap | public | isnt_aggregate | name, text | text - pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_aggregate | name | text + pgtap | public | isnt_aggregate | name, name, name[], text | text + pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text pgtap | public | isnt_ancestor_of | name, name, integer | text - pgtap | public | isnt_ancestor_of | name, name, integer, text | text pgtap | public | isnt_ancestor_of | name, name, name, name | text - pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text - pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text - pgtap | public | isnt_ancestor_of | name, name, name, name, text | text pgtap | public | isnt_ancestor_of | name, name, text | text - pgtap | public | isnt_definer | name | text - pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_ancestor_of | name, name, integer, text | text + pgtap | public | isnt_definer | name, name[], text | text pgtap | public | isnt_definer | name, name, name[] | text - pgtap | public | isnt_definer | name, name, name[], text | text - pgtap | public | isnt_definer | name, name, text | text pgtap | public | isnt_definer | name, name[] | text - pgtap | public | isnt_definer | name, name[], text | text + pgtap | public | isnt_definer | name, name, text | text pgtap | public | isnt_definer | name, text | text - pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_definer | name | text + pgtap | public | isnt_definer | name, name, name[], text | text + pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text pgtap | public | isnt_descendent_of | name, name, integer | text - pgtap | public | isnt_descendent_of | name, name, integer, text | text pgtap | public | isnt_descendent_of | name, name, name, name | text - pgtap | public | isnt_descendent_of | name, name, name, name, integer | text - pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text - pgtap | public | isnt_descendent_of | name, name, name, name, text | text pgtap | public | isnt_descendent_of | name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer | text + pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_descendent_of | name, name, integer, text | text pgtap | public | isnt_empty | text | text pgtap | public | isnt_empty | text, text | text - pgtap | public | isnt_member_of | name, name | text - pgtap | public | isnt_member_of | name, name, text | text - pgtap | public | isnt_member_of | name, name[] | text pgtap | public | isnt_member_of | name, name[], text | text - pgtap | public | isnt_normal_function | name | text - pgtap | public | isnt_normal_function | name, name | text + pgtap | public | isnt_member_of | name, name[] | text + pgtap | public | isnt_member_of | name, name, text | text + pgtap | public | isnt_member_of | name, name | text + pgtap | public | isnt_normal_function | name, name[], text | text pgtap | public | isnt_normal_function | name, name, name[] | text - pgtap | public | isnt_normal_function | name, name, name[], text | text - pgtap | public | isnt_normal_function | name, name, text | text pgtap | public | isnt_normal_function | name, name[] | text - pgtap | public | isnt_normal_function | name, name[], text | text + pgtap | public | isnt_normal_function | name, name, text | text pgtap | public | isnt_normal_function | name, text | text - pgtap | public | isnt_partitioned | name | text - pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_normal_function | name | text + pgtap | public | isnt_normal_function | name, name, name[], text | text + pgtap | public | isnt_normal_function | name, name | text pgtap | public | isnt_partitioned | name, name, text | text pgtap | public | isnt_partitioned | name, text | text - pgtap | public | isnt_procedure | name | text - pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_partitioned | name | text + pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_procedure | name, name[], text | text pgtap | public | isnt_procedure | name, name, name[] | text - pgtap | public | isnt_procedure | name, name, name[], text | text - pgtap | public | isnt_procedure | name, name, text | text pgtap | public | isnt_procedure | name, name[] | text - pgtap | public | isnt_procedure | name, name[], text | text + pgtap | public | isnt_procedure | name, name, text | text pgtap | public | isnt_procedure | name, text | text - pgtap | public | isnt_strict | name | text - pgtap | public | isnt_strict | name, name | text + pgtap | public | isnt_procedure | name | text + pgtap | public | isnt_procedure | name, name, name[], text | text + pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_strict | name, name[], text | text pgtap | public | isnt_strict | name, name, name[] | text - pgtap | public | isnt_strict | name, name, name[], text | text - pgtap | public | isnt_strict | name, name, text | text pgtap | public | isnt_strict | name, name[] | text - pgtap | public | isnt_strict | name, name[], text | text + pgtap | public | isnt_strict | name, name, text | text pgtap | public | isnt_strict | name, text | text - pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_strict | name | text + pgtap | public | isnt_strict | name, name, name[], text | text + pgtap | public | isnt_strict | name, name | text pgtap | public | isnt_superuser | name, text | text - pgtap | public | isnt_window | name | text - pgtap | public | isnt_window | name, name | text + pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_window | name, name[], text | text pgtap | public | isnt_window | name, name, name[] | text - pgtap | public | isnt_window | name, name, name[], text | text - pgtap | public | isnt_window | name, name, text | text pgtap | public | isnt_window | name, name[] | text - pgtap | public | isnt_window | name, name[], text | text + pgtap | public | isnt_window | name, name, text | text pgtap | public | isnt_window | name, text | text - pgtap | public | language_is_trusted | name | text + pgtap | public | isnt_window | name | text + pgtap | public | isnt_window | name, name, name[], text | text + pgtap | public | isnt_window | name, name | text pgtap | public | language_is_trusted | name, text | text - pgtap | public | language_owner_is | name, name | text + pgtap | public | language_is_trusted | name | text pgtap | public | language_owner_is | name, name, text | text + pgtap | public | language_owner_is | name, name | text pgtap | public | language_privs_are | name, name, name[] | text pgtap | public | language_privs_are | name, name, name[], text | text pgtap | public | languages_are | name[] | text @@ -2859,157 +2867,157 @@ order by pgtap | public | lives_ok | text, text | text pgtap | public | matches | anyelement, text | text pgtap | public | matches | anyelement, text, text | text - pgtap | public | materialized_view_owner_is | name, name | text - pgtap | public | materialized_view_owner_is | name, name, name | text pgtap | public | materialized_view_owner_is | name, name, name, text | text pgtap | public | materialized_view_owner_is | name, name, text | text - pgtap | public | materialized_views_are | name, name[] | text - pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_view_owner_is | name, name | text + pgtap | public | materialized_view_owner_is | name, name, name | text pgtap | public | materialized_views_are | name[] | text pgtap | public | materialized_views_are | name[], text | text + pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_views_are | name, name[] | text pgtap | public | no_plan | | SETOF boolean pgtap | public | num_failed | | integer pgtap | public | ok | boolean | text pgtap | public | ok | boolean, text | text - pgtap | public | opclass_owner_is | name, name | text - pgtap | public | opclass_owner_is | name, name, name | text pgtap | public | opclass_owner_is | name, name, name, text | text pgtap | public | opclass_owner_is | name, name, text | text - pgtap | public | opclasses_are | name, name[] | text - pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclass_owner_is | name, name | text + pgtap | public | opclass_owner_is | name, name, name | text pgtap | public | opclasses_are | name[] | text pgtap | public | opclasses_are | name[], text | text + pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclasses_are | name, name[] | text pgtap | public | operators_are | name, text[] | text - pgtap | public | operators_are | name, text[], text | text pgtap | public | operators_are | text[] | text pgtap | public | operators_are | text[], text | text + pgtap | public | operators_are | name, text[], text | text pgtap | public | os_name | | text + pgtap | public | partitions_are | name, name[], text | text pgtap | public | partitions_are | name, name, name[] | text - pgtap | public | partitions_are | name, name, name[], text | text pgtap | public | partitions_are | name, name[] | text - pgtap | public | partitions_are | name, name[], text | text - pgtap | public | pass | | text + pgtap | public | partitions_are | name, name, name[], text | text pgtap | public | pass | text | text - pgtap | public | performs_ok | text, numeric | text + pgtap | public | pass | | text pgtap | public | performs_ok | text, numeric, text | text - pgtap | public | performs_within | text, numeric, numeric | text + pgtap | public | performs_ok | text, numeric | text pgtap | public | performs_within | text, numeric, numeric, integer | text + pgtap | public | performs_within | text, numeric, numeric | text pgtap | public | performs_within | text, numeric, numeric, integer, text | text pgtap | public | performs_within | text, numeric, numeric, text | text pgtap | public | pg_version | | text pgtap | public | pg_version_num | | integer pgtap | public | pgtap_version | | numeric pgtap | public | plan | integer | text + pgtap | public | policies_are | name, name[], text | text pgtap | public | policies_are | name, name, name[] | text - pgtap | public | policies_are | name, name, name[], text | text pgtap | public | policies_are | name, name[] | text - pgtap | public | policies_are | name, name[], text | text + pgtap | public | policies_are | name, name, name[], text | text pgtap | public | policy_cmd_is | name, name, name, text | text + pgtap | public | policy_cmd_is | name, name, text, text | text pgtap | public | policy_cmd_is | name, name, name, text, text | text pgtap | public | policy_cmd_is | name, name, text | text - pgtap | public | policy_cmd_is | name, name, text, text | text - pgtap | public | policy_roles_are | name, name, name, name[] | text pgtap | public | policy_roles_are | name, name, name, name[], text | text pgtap | public | policy_roles_are | name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name, name[] | text pgtap | public | policy_roles_are | name, name, name[], text | text - pgtap | public | relation_owner_is | name, name | text - pgtap | public | relation_owner_is | name, name, name | text pgtap | public | relation_owner_is | name, name, name, text | text pgtap | public | relation_owner_is | name, name, text | text + pgtap | public | relation_owner_is | name, name | text + pgtap | public | relation_owner_is | name, name, name | text + pgtap | public | results_eq | text, refcursor | text + pgtap | public | results_eq | text, anyarray, text | text + pgtap | public | results_eq | text, text | text + pgtap | public | results_eq | text, refcursor, text | text pgtap | public | results_eq | refcursor, anyarray | text pgtap | public | results_eq | refcursor, anyarray, text | text - pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_eq | text, text, text | text + pgtap | public | results_eq | text, anyarray | text pgtap | public | results_eq | refcursor, refcursor, text | text - pgtap | public | results_eq | refcursor, text | text pgtap | public | results_eq | refcursor, text, text | text - pgtap | public | results_eq | text, anyarray | text - pgtap | public | results_eq | text, anyarray, text | text - pgtap | public | results_eq | text, refcursor | text - pgtap | public | results_eq | text, refcursor, text | text - pgtap | public | results_eq | text, text | text - pgtap | public | results_eq | text, text, text | text + pgtap | public | results_eq | refcursor, text | text + pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_ne | text, refcursor | text + pgtap | public | results_ne | text, anyarray, text | text + pgtap | public | results_ne | text, text | text + pgtap | public | results_ne | text, refcursor, text | text pgtap | public | results_ne | refcursor, anyarray | text pgtap | public | results_ne | refcursor, anyarray, text | text - pgtap | public | results_ne | refcursor, refcursor | text + pgtap | public | results_ne | text, text, text | text + pgtap | public | results_ne | text, anyarray | text pgtap | public | results_ne | refcursor, refcursor, text | text - pgtap | public | results_ne | refcursor, text | text pgtap | public | results_ne | refcursor, text, text | text - pgtap | public | results_ne | text, anyarray | text - pgtap | public | results_ne | text, anyarray, text | text - pgtap | public | results_ne | text, refcursor | text - pgtap | public | results_ne | text, refcursor, text | text - pgtap | public | results_ne | text, text | text - pgtap | public | results_ne | text, text, text | text + pgtap | public | results_ne | refcursor, text | text + pgtap | public | results_ne | refcursor, refcursor | text pgtap | public | roles_are | name[] | text pgtap | public | roles_are | name[], text | text pgtap | public | row_eq | text, anyelement | text pgtap | public | row_eq | text, anyelement, text | text - pgtap | public | rule_is_instead | name, name | text - pgtap | public | rule_is_instead | name, name, name | text pgtap | public | rule_is_instead | name, name, name, text | text pgtap | public | rule_is_instead | name, name, text | text + pgtap | public | rule_is_instead | name, name | text + pgtap | public | rule_is_instead | name, name, name | text pgtap | public | rule_is_on | name, name, name, text | text + pgtap | public | rule_is_on | name, name, text, text | text pgtap | public | rule_is_on | name, name, name, text, text | text pgtap | public | rule_is_on | name, name, text | text - pgtap | public | rule_is_on | name, name, text, text | text + pgtap | public | rules_are | name, name[], text | text pgtap | public | rules_are | name, name, name[] | text - pgtap | public | rules_are | name, name, name[], text | text pgtap | public | rules_are | name, name[] | text - pgtap | public | rules_are | name, name[], text | text - pgtap | public | runtests | | SETOF text - pgtap | public | runtests | name | SETOF text - pgtap | public | runtests | name, text | SETOF text + pgtap | public | rules_are | name, name, name[], text | text pgtap | public | runtests | text | SETOF text - pgtap | public | schema_owner_is | name, name | text + pgtap | public | runtests | name, text | SETOF text + pgtap | public | runtests | name | SETOF text + pgtap | public | runtests | | SETOF text pgtap | public | schema_owner_is | name, name, text | text + pgtap | public | schema_owner_is | name, name | text pgtap | public | schema_privs_are | name, name, name[] | text pgtap | public | schema_privs_are | name, name, name[], text | text pgtap | public | schemas_are | name[] | text pgtap | public | schemas_are | name[], text | text - pgtap | public | sequence_owner_is | name, name | text - pgtap | public | sequence_owner_is | name, name, name | text pgtap | public | sequence_owner_is | name, name, name, text | text pgtap | public | sequence_owner_is | name, name, text | text - pgtap | public | sequence_privs_are | name, name, name, name[] | text + pgtap | public | sequence_owner_is | name, name | text + pgtap | public | sequence_owner_is | name, name, name | text pgtap | public | sequence_privs_are | name, name, name, name[], text | text pgtap | public | sequence_privs_are | name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name, name[] | text pgtap | public | sequence_privs_are | name, name, name[], text | text - pgtap | public | sequences_are | name, name[] | text - pgtap | public | sequences_are | name, name[], text | text pgtap | public | sequences_are | name[] | text pgtap | public | sequences_are | name[], text | text + pgtap | public | sequences_are | name, name[], text | text + pgtap | public | sequences_are | name, name[] | text pgtap | public | server_privs_are | name, name, name[] | text pgtap | public | server_privs_are | name, name, name[], text | text - pgtap | public | set_eq | text, anyarray | text pgtap | public | set_eq | text, anyarray, text | text pgtap | public | set_eq | text, text | text pgtap | public | set_eq | text, text, text | text + pgtap | public | set_eq | text, anyarray | text pgtap | public | set_has | text, text | text pgtap | public | set_has | text, text, text | text pgtap | public | set_hasnt | text, text | text pgtap | public | set_hasnt | text, text, text | text - pgtap | public | set_ne | text, anyarray | text pgtap | public | set_ne | text, anyarray, text | text pgtap | public | set_ne | text, text | text pgtap | public | set_ne | text, text, text | text + pgtap | public | set_ne | text, anyarray | text pgtap | public | skip | integer | text - pgtap | public | skip | integer, text | text pgtap | public | skip | text | text pgtap | public | skip | why text, how_many integer | text - pgtap | public | table_owner_is | name, name | text - pgtap | public | table_owner_is | name, name, name | text + pgtap | public | skip | integer, text | text pgtap | public | table_owner_is | name, name, name, text | text pgtap | public | table_owner_is | name, name, text | text - pgtap | public | table_privs_are | name, name, name, name[] | text + pgtap | public | table_owner_is | name, name | text + pgtap | public | table_owner_is | name, name, name | text pgtap | public | table_privs_are | name, name, name, name[], text | text pgtap | public | table_privs_are | name, name, name[] | text + pgtap | public | table_privs_are | name, name, name, name[] | text pgtap | public | table_privs_are | name, name, name[], text | text - pgtap | public | tables_are | name, name[] | text - pgtap | public | tables_are | name, name[], text | text pgtap | public | tables_are | name[] | text pgtap | public | tables_are | name[], text | text - pgtap | public | tablespace_owner_is | name, name | text + pgtap | public | tables_are | name, name[], text | text + pgtap | public | tables_are | name, name[] | text pgtap | public | tablespace_owner_is | name, name, text | text + pgtap | public | tablespace_owner_is | name, name | text pgtap | public | tablespace_privs_are | name, name, name[] | text pgtap | public | tablespace_privs_are | name, name, name[], text | text pgtap | public | tablespaces_are | name[] | text @@ -3023,57 +3031,57 @@ order by pgtap | public | throws_matching | text, text | text pgtap | public | throws_matching | text, text, text | text pgtap | public | throws_ok | text | text - pgtap | public | throws_ok | text, character, text, text | text pgtap | public | throws_ok | text, integer | text - pgtap | public | throws_ok | text, integer, text | text - pgtap | public | throws_ok | text, integer, text, text | text pgtap | public | throws_ok | text, text | text + pgtap | public | throws_ok | text, character, text, text | text pgtap | public | throws_ok | text, text, text | text - pgtap | public | todo | how_many integer | SETOF boolean + pgtap | public | throws_ok | text, integer, text, text | text + pgtap | public | throws_ok | text, integer, text | text pgtap | public | todo | how_many integer, why text | SETOF boolean - pgtap | public | todo | why text | SETOF boolean pgtap | public | todo | why text, how_many integer | SETOF boolean + pgtap | public | todo | why text | SETOF boolean + pgtap | public | todo | how_many integer | SETOF boolean pgtap | public | todo_end | | SETOF boolean - pgtap | public | todo_start | | SETOF boolean pgtap | public | todo_start | text | SETOF boolean - pgtap | public | trigger_is | name, name, name | text - pgtap | public | trigger_is | name, name, name, name, name | text - pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | todo_start | | SETOF boolean pgtap | public | trigger_is | name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name | text + pgtap | public | trigger_is | name, name, name | text + pgtap | public | triggers_are | name, name[], text | text pgtap | public | triggers_are | name, name, name[] | text - pgtap | public | triggers_are | name, name, name[], text | text pgtap | public | triggers_are | name, name[] | text - pgtap | public | triggers_are | name, name[], text | text - pgtap | public | type_owner_is | name, name | text - pgtap | public | type_owner_is | name, name, name | text + pgtap | public | triggers_are | name, name, name[], text | text pgtap | public | type_owner_is | name, name, name, text | text pgtap | public | type_owner_is | name, name, text | text - pgtap | public | types_are | name, name[] | text - pgtap | public | types_are | name, name[], text | text + pgtap | public | type_owner_is | name, name | text + pgtap | public | type_owner_is | name, name, name | text pgtap | public | types_are | name[] | text pgtap | public | types_are | name[], text | text + pgtap | public | types_are | name, name[], text | text + pgtap | public | types_are | name, name[] | text pgtap | public | unalike | anyelement, text | text pgtap | public | unalike | anyelement, text, text | text pgtap | public | unialike | anyelement, text | text pgtap | public | unialike | anyelement, text, text | text pgtap | public | users_are | name[] | text pgtap | public | users_are | name[], text | text - pgtap | public | view_owner_is | name, name | text - pgtap | public | view_owner_is | name, name, name | text pgtap | public | view_owner_is | name, name, name, text | text pgtap | public | view_owner_is | name, name, text | text - pgtap | public | views_are | name, name[] | text - pgtap | public | views_are | name, name[], text | text + pgtap | public | view_owner_is | name, name | text + pgtap | public | view_owner_is | name, name, name | text pgtap | public | views_are | name[] | text pgtap | public | views_are | name[], text | text - pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | views_are | name, name[], text | text + pgtap | public | views_are | name, name[] | text pgtap | public | volatility_is | name, name, name[], text, text | text - pgtap | public | volatility_is | name, name, text | text - pgtap | public | volatility_is | name, name, text, text | text pgtap | public | volatility_is | name, name[], text | text - pgtap | public | volatility_is | name, name[], text, text | text - pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, name, text, text | text + pgtap | public | volatility_is | name, name, text | text pgtap | public | volatility_is | name, text, text | text + pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | volatility_is | name, name[], text, text | text plcoffee | pg_catalog | plcoffee_call_handler | | language_handler plcoffee | pg_catalog | plcoffee_call_validator | oid | void plcoffee | pg_catalog | plcoffee_inline_handler | internal | void @@ -3105,8 +3113,8 @@ order by plpgsql_check | public | plpgsql_profiler_remove_fake_queryid_hook | | void plpgsql_check | public | plpgsql_profiler_reset | funcoid regprocedure | void plpgsql_check | public | plpgsql_profiler_reset_all | | void - plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) plpgsql_check | public | plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) plv8 | pg_catalog | plv8_call_handler | | language_handler plv8 | pg_catalog | plv8_call_validator | oid | void plv8 | pg_catalog | plv8_info | | json @@ -3129,21 +3137,21 @@ order by postgis | public | _st_bestsrid | geography, geography | integer postgis | public | _st_contains | geom1 geometry, geom2 geometry | boolean postgis | public | _st_containsproperly | geom1 geometry, geom2 geometry | boolean - postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | _st_coveredby | geom1 geometry, geom2 geometry | boolean - postgis | public | _st_covers | geog1 geography, geog2 geography | boolean + postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | _st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_covers | geog1 geography, geog2 geography | boolean postgis | public | _st_crosses | geom1 geometry, geom2 geometry | boolean postgis | public | _st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | _st_distancetree | geography, geography | double precision postgis | public | _st_distancetree | geography, geography, double precision, boolean | double precision - postgis | public | _st_distanceuncached | geography, geography | double precision - postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distancetree | geography, geography | double precision postgis | public | _st_distanceuncached | geography, geography, double precision, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography | double precision postgis | public | _st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean postgis | public | _st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean postgis | public | _st_dwithinuncached | geography, geography, double precision, boolean | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean postgis | public | _st_equals | geom1 geometry, geom2 geometry | boolean postgis | public | _st_expand | geography, double precision | geography postgis | public | _st_geomfromgml | text, integer | geometry @@ -3159,8 +3167,8 @@ order by postgis | public | _st_voronoi | g1 geometry, clip geometry, tolerance double precision, return_polygons boolean | geometry postgis | public | _st_within | geom1 geometry, geom2 geometry | boolean postgis | public | addauth | text | boolean - postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | addgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | addgeometrycolumn | table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | box | box3d | box postgis | public | box | geometry | box @@ -3170,8 +3178,8 @@ order by postgis | public | box2d_out | box2d | cstring postgis | public | box2df_in | cstring | box2df postgis | public | box2df_out | box2df | cstring - postgis | public | box3d | box2d | box3d postgis | public | box3d | geometry | box3d + postgis | public | box3d | box2d | box3d postgis | public | box3d_in | cstring | box3d postgis | public | box3d_out | box3d | cstring postgis | public | box3dtobox | box3d | box @@ -3180,23 +3188,23 @@ order by postgis | public | checkauth | text, text | integer postgis | public | checkauth | text, text, text | integer postgis | public | checkauthtrigger | | trigger - postgis | public | contains_2d | box2df, box2df | boolean - postgis | public | contains_2d | box2df, geometry | boolean postgis | public | contains_2d | geometry, box2df | boolean + postgis | public | contains_2d | box2df, geometry | boolean + postgis | public | contains_2d | box2df, box2df | boolean postgis | public | disablelongtransactions | | text - postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrycolumn | table_name character varying, column_name character varying | text - postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text - postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrytable | table_name character varying | text + postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text postgis | public | enablelongtransactions | | text postgis | public | equals | geom1 geometry, geom2 geometry | boolean postgis | public | find_srid | character varying, character varying, character varying | integer postgis | public | geog_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geography | bytea | geography - postgis | public | geography | geography, integer, boolean | geography postgis | public | geography | geometry | geography + postgis | public | geography | geography, integer, boolean | geography postgis | public | geography_analyze | internal | boolean postgis | public | geography_cmp | geography, geography | integer postgis | public | geography_distance_knn | geography, geography | double precision @@ -3229,15 +3237,15 @@ order by postgis | public | geom2d_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geom3d_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geom4d_brin_inclusion_add_value | internal, internal, internal, internal | boolean - postgis | public | geometry | box2d | geometry + postgis | public | geometry | geometry, integer, boolean | geometry postgis | public | geometry | box3d | geometry + postgis | public | geometry | text | geometry + postgis | public | geometry | point | geometry postgis | public | geometry | bytea | geometry postgis | public | geometry | geography | geometry - postgis | public | geometry | geometry, integer, boolean | geometry postgis | public | geometry | path | geometry - postgis | public | geometry | point | geometry postgis | public | geometry | polygon | geometry - postgis | public | geometry | text | geometry + postgis | public | geometry | box2d | geometry postgis | public | geometry_above | geom1 geometry, geom2 geometry | boolean postgis | public | geometry_analyze | internal | boolean postgis | public | geometry_below | geom1 geometry, geom2 geometry | boolean @@ -3324,29 +3332,29 @@ order by postgis | public | gserialized_gist_joinsel_nd | internal, oid, internal, smallint | double precision postgis | public | gserialized_gist_sel_2d | internal, oid, internal, integer | double precision postgis | public | gserialized_gist_sel_nd | internal, oid, internal, integer | double precision - postgis | public | is_contained_2d | box2df, box2df | boolean - postgis | public | is_contained_2d | box2df, geometry | boolean postgis | public | is_contained_2d | geometry, box2df | boolean + postgis | public | is_contained_2d | box2df, geometry | boolean + postgis | public | is_contained_2d | box2df, box2df | boolean postgis | public | json | geometry | json postgis | public | jsonb | geometry | jsonb - postgis | public | lockrow | text, text, text | integer + postgis | public | lockrow | text, text, text, timestamp without time zone | integer postgis | public | lockrow | text, text, text, text | integer + postgis | public | lockrow | text, text, text | integer postgis | public | lockrow | text, text, text, text, timestamp without time zone | integer - postgis | public | lockrow | text, text, text, timestamp without time zone | integer postgis | public | longtransactionsenabled | | boolean - postgis | public | overlaps_2d | box2df, box2df | boolean - postgis | public | overlaps_2d | box2df, geometry | boolean postgis | public | overlaps_2d | geometry, box2df | boolean + postgis | public | overlaps_2d | box2df, geometry | boolean + postgis | public | overlaps_2d | box2df, box2df | boolean + postgis | public | overlaps_geog | gidx, gidx | boolean postgis | public | overlaps_geog | geography, gidx | boolean postgis | public | overlaps_geog | gidx, geography | boolean - postgis | public | overlaps_geog | gidx, gidx | boolean + postgis | public | overlaps_nd | gidx, gidx | boolean postgis | public | overlaps_nd | geometry, gidx | boolean postgis | public | overlaps_nd | gidx, geometry | boolean - postgis | public | overlaps_nd | gidx, gidx | boolean postgis | public | path | geometry | path postgis | public | pgis_asflatgeobuf_finalfn | internal | bytea - postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean, text | internal postgis | public | pgis_asgeobuf_finalfn | internal | bytea postgis | public | pgis_asgeobuf_transfn | internal, anyelement | internal @@ -3355,13 +3363,13 @@ order by postgis | public | pgis_asmvt_deserialfn | bytea, internal | internal postgis | public | pgis_asmvt_finalfn | internal | bytea postgis | public | pgis_asmvt_serialfn | internal | bytea + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement | internal - postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer | internal - postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text, text | internal - postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision, integer | internal postgis | public | pgis_geometry_clusterintersecting_finalfn | internal | geometry[] postgis | public | pgis_geometry_clusterwithin_finalfn | internal | geometry[] @@ -3372,8 +3380,8 @@ order by postgis | public | pgis_geometry_union_parallel_deserialfn | bytea, internal | internal postgis | public | pgis_geometry_union_parallel_finalfn | internal | geometry postgis | public | pgis_geometry_union_parallel_serialfn | internal | bytea - postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal postgis | public | point | geometry | point postgis | public | polygon | geometry | polygon postgis | public | populate_geometry_columns | tbl_oid oid, use_typmod boolean | integer @@ -3427,116 +3435,116 @@ order by postgis | public | st_3dperimeter | geometry | double precision postgis | public | st_3dshortestline | geom1 geometry, geom2 geometry | geometry postgis | public | st_addmeasure | geometry, double precision, double precision | geometry - postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_addpoint | geom1 geometry, geom2 geometry, integer | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision | geometry postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision | geometry - postgis | public | st_angle | line1 geometry, line2 geometry | double precision postgis | public | st_angle | pt1 geometry, pt2 geometry, pt3 geometry, pt4 geometry | double precision + postgis | public | st_angle | line1 geometry, line2 geometry | double precision postgis | public | st_area | geog geography, use_spheroid boolean | double precision - postgis | public | st_area | geometry | double precision postgis | public | st_area | text | double precision + postgis | public | st_area | geometry | double precision postgis | public | st_area2d | geometry | double precision postgis | public | st_asbinary | geography | bytea - postgis | public | st_asbinary | geography, text | bytea - postgis | public | st_asbinary | geometry | bytea postgis | public | st_asbinary | geometry, text | bytea + postgis | public | st_asbinary | geometry | bytea + postgis | public | st_asbinary | geography, text | bytea postgis | public | st_asencodedpolyline | geom geometry, nprecision integer | text - postgis | public | st_asewkb | geometry | bytea postgis | public | st_asewkb | geometry, text | bytea - postgis | public | st_asewkt | geography | text + postgis | public | st_asewkb | geometry | bytea + postgis | public | st_asewkt | text | text postgis | public | st_asewkt | geography, integer | text - postgis | public | st_asewkt | geometry | text + postgis | public | st_asewkt | geography | text postgis | public | st_asewkt | geometry, integer | text - postgis | public | st_asewkt | text | text + postgis | public | st_asewkt | geometry | text postgis | public | st_asflatgeobuf | anyelement | bytea postgis | public | st_asflatgeobuf | anyelement, boolean | bytea postgis | public | st_asflatgeobuf | anyelement, boolean, text | bytea postgis | public | st_asgeobuf | anyelement | bytea postgis | public | st_asgeobuf | anyelement, text | bytea - postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | text | text postgis | public | st_asgeojson | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text postgis | public | st_asgeojson | r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean | text - postgis | public | st_asgeojson | text | text - postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text - postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text postgis | public | st_asgml | text | text postgis | public | st_asgml | version integer, geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text postgis | public | st_asgml | version integer, geom geometry, maxdecimaldigits integer, options integer, nprefix text, id text | text - postgis | public | st_ashexewkb | geometry | text postgis | public | st_ashexewkb | geometry, text | text - postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text - postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_ashexewkb | geometry | text postgis | public | st_askml | text | text + postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text postgis | public | st_aslatlontext | geom geometry, tmpl text | text postgis | public | st_asmarc21 | geom geometry, format text | text postgis | public | st_asmvt | anyelement | bytea - postgis | public | st_asmvt | anyelement, text | bytea + postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea postgis | public | st_asmvt | anyelement, text, integer | bytea + postgis | public | st_asmvt | anyelement, text | bytea postgis | public | st_asmvt | anyelement, text, integer, text | bytea - postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea postgis | public | st_asmvtgeom | geom geometry, bounds box2d, extent integer, buffer integer, clip_geom boolean | geometry postgis | public | st_assvg | geog geography, rel integer, maxdecimaldigits integer | text postgis | public | st_assvg | geom geometry, rel integer, maxdecimaldigits integer | text postgis | public | st_assvg | text | text - postgis | public | st_astext | geography | text + postgis | public | st_astext | text | text postgis | public | st_astext | geography, integer | text - postgis | public | st_astext | geometry | text + postgis | public | st_astext | geography | text postgis | public | st_astext | geometry, integer | text - postgis | public | st_astext | text | text - postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astext | geometry | text postgis | public | st_astwkb | geom geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea postgis | public | st_asx3d | geom geometry, maxdecimaldigits integer, options integer | text - postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision postgis | public | st_azimuth | geom1 geometry, geom2 geometry | double precision + postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision postgis | public | st_bdmpolyfromtext | text, integer | geometry postgis | public | st_bdpolyfromtext | text, integer | geometry postgis | public | st_boundary | geometry | geometry postgis | public | st_boundingdiagonal | geom geometry, fits boolean | geometry postgis | public | st_box2dfromgeohash | text, integer | box2d - postgis | public | st_buffer | geography, double precision | geography - postgis | public | st_buffer | geography, double precision, integer | geography - postgis | public | st_buffer | geography, double precision, text | geography postgis | public | st_buffer | geom geometry, radius double precision, options text | geometry + postgis | public | st_buffer | geography, double precision, text | geography + postgis | public | st_buffer | geography, double precision, integer | geography postgis | public | st_buffer | geom geometry, radius double precision, quadsegs integer | geometry - postgis | public | st_buffer | text, double precision | geometry - postgis | public | st_buffer | text, double precision, integer | geometry postgis | public | st_buffer | text, double precision, text | geometry + postgis | public | st_buffer | geography, double precision | geography + postgis | public | st_buffer | text, double precision, integer | geometry + postgis | public | st_buffer | text, double precision | geometry postgis | public | st_buildarea | geometry | geometry + postgis | public | st_centroid | text | geometry postgis | public | st_centroid | geography, use_spheroid boolean | geography postgis | public | st_centroid | geometry | geometry - postgis | public | st_centroid | text | geometry postgis | public | st_chaikinsmoothing | geometry, integer, boolean | geometry postgis | public | st_cleangeometry | geometry | geometry postgis | public | st_clipbybox2d | geom geometry, box box2d | geometry postgis | public | st_closestpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_closestpointofapproach | geometry, geometry | double precision postgis | public | st_clusterdbscan | geometry, eps double precision, minpoints integer | integer - postgis | public | st_clusterintersecting | geometry | geometry[] postgis | public | st_clusterintersecting | geometry[] | geometry[] + postgis | public | st_clusterintersecting | geometry | geometry[] postgis | public | st_clusterkmeans | geom geometry, k integer, max_radius double precision | integer - postgis | public | st_clusterwithin | geometry, double precision | geometry[] postgis | public | st_clusterwithin | geometry[], double precision | geometry[] + postgis | public | st_clusterwithin | geometry, double precision | geometry[] postgis | public | st_collect | geom1 geometry, geom2 geometry | geometry - postgis | public | st_collect | geometry | geometry postgis | public | st_collect | geometry[] | geometry - postgis | public | st_collectionextract | geometry | geometry + postgis | public | st_collect | geometry | geometry postgis | public | st_collectionextract | geometry, integer | geometry + postgis | public | st_collectionextract | geometry | geometry postgis | public | st_collectionhomogenize | geometry | geometry postgis | public | st_combinebbox | box2d, geometry | box2d - postgis | public | st_combinebbox | box3d, box3d | box3d postgis | public | st_combinebbox | box3d, geometry | box3d + postgis | public | st_combinebbox | box3d, box3d | box3d postgis | public | st_concavehull | param_geom geometry, param_pctconvex double precision, param_allow_holes boolean | geometry postgis | public | st_contains | geom1 geometry, geom2 geometry | boolean postgis | public | st_containsproperly | geom1 geometry, geom2 geometry | boolean postgis | public | st_convexhull | geometry | geometry postgis | public | st_coorddim | geometry geometry | smallint - postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | st_coveredby | geom1 geometry, geom2 geometry | boolean postgis | public | st_coveredby | text, text | boolean - postgis | public | st_covers | geog1 geography, geog2 geography | boolean + postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | st_covers | geom1 geometry, geom2 geometry | boolean postgis | public | st_covers | text, text | boolean + postgis | public | st_covers | geog1 geography, geog2 geography | boolean postgis | public | st_cpawithin | geometry, geometry, double precision | boolean postgis | public | st_crosses | geom1 geometry, geom2 geometry | boolean postgis | public | st_curvetoline | geom geometry, tol double precision, toltype integer, flags integer | geometry @@ -3545,33 +3553,33 @@ order by postgis | public | st_difference | geom1 geometry, geom2 geometry, gridsize double precision | geometry postgis | public | st_dimension | geometry | integer postgis | public | st_disjoint | geom1 geometry, geom2 geometry | boolean - postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision postgis | public | st_distance | geom1 geometry, geom2 geometry | double precision postgis | public | st_distance | text, text | double precision + postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision postgis | public | st_distancecpa | geometry, geometry | double precision postgis | public | st_distancesphere | geom1 geometry, geom2 geometry | double precision postgis | public | st_distancesphere | geom1 geometry, geom2 geometry, radius double precision | double precision - postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry, spheroid | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision postgis | public | st_dump | geometry | SETOF geometry_dump postgis | public | st_dumppoints | geometry | SETOF geometry_dump postgis | public | st_dumprings | geometry | SETOF geometry_dump postgis | public | st_dumpsegments | geometry | SETOF geometry_dump + postgis | public | st_dwithin | text, text, double precision | boolean postgis | public | st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean postgis | public | st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | st_dwithin | text, text, double precision | boolean postgis | public | st_endpoint | geometry | geometry postgis | public | st_envelope | geometry | geometry postgis | public | st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_estimatedextent | text, text, text, boolean | box2d postgis | public | st_estimatedextent | text, text | box2d postgis | public | st_estimatedextent | text, text, text | box2d - postgis | public | st_estimatedextent | text, text, text, boolean | box2d - postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d + postgis | public | st_expand | box3d, double precision | box3d postgis | public | st_expand | box box3d, dx double precision, dy double precision, dz double precision | box3d postgis | public | st_expand | box2d, double precision | box2d - postgis | public | st_expand | box3d, double precision | box3d - postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry + postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d postgis | public | st_expand | geometry, double precision | geometry + postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry postgis | public | st_extent | geometry | box2d postgis | public | st_exteriorring | geometry | geometry postgis | public | st_filterbym | geometry, double precision, double precision, boolean | geometry @@ -3588,13 +3596,13 @@ order by postgis | public | st_forcepolygonccw | geometry | geometry postgis | public | st_forcepolygoncw | geometry | geometry postgis | public | st_forcerhr | geometry | geometry - postgis | public | st_forcesfs | geometry | geometry postgis | public | st_forcesfs | geometry, version text | geometry + postgis | public | st_forcesfs | geometry | geometry postgis | public | st_frechetdistance | geom1 geometry, geom2 geometry, double precision | double precision postgis | public | st_fromflatgeobuf | anyelement, bytea | SETOF anyelement postgis | public | st_fromflatgeobuftotable | text, text, bytea | void - postgis | public | st_generatepoints | area geometry, npoints integer | geometry postgis | public | st_generatepoints | area geometry, npoints integer, seed integer | geometry + postgis | public | st_generatepoints | area geometry, npoints integer | geometry postgis | public | st_geogfromtext | text | geography postgis | public | st_geogfromwkb | bytea | geography postgis | public | st_geographyfromtext | text | geography @@ -3602,8 +3610,8 @@ order by postgis | public | st_geohash | geom geometry, maxchars integer | text postgis | public | st_geomcollfromtext | text | geometry postgis | public | st_geomcollfromtext | text, integer | geometry - postgis | public | st_geomcollfromwkb | bytea | geometry postgis | public | st_geomcollfromwkb | bytea, integer | geometry + postgis | public | st_geomcollfromwkb | bytea | geometry postgis | public | st_geometricmedian | g geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean | geometry postgis | public | st_geometryfromtext | text | geometry postgis | public | st_geometryfromtext | text, integer | geometry @@ -3612,9 +3620,9 @@ order by postgis | public | st_geomfromewkb | bytea | geometry postgis | public | st_geomfromewkt | text | geometry postgis | public | st_geomfromgeohash | text, integer | geometry + postgis | public | st_geomfromgeojson | text | geometry postgis | public | st_geomfromgeojson | json | geometry postgis | public | st_geomfromgeojson | jsonb | geometry - postgis | public | st_geomfromgeojson | text | geometry postgis | public | st_geomfromgml | text | geometry postgis | public | st_geomfromgml | text, integer | geometry postgis | public | st_geomfromkml | text | geometry @@ -3622,8 +3630,8 @@ order by postgis | public | st_geomfromtext | text | geometry postgis | public | st_geomfromtext | text, integer | geometry postgis | public | st_geomfromtwkb | bytea | geometry - postgis | public | st_geomfromwkb | bytea | geometry postgis | public | st_geomfromwkb | bytea, integer | geometry + postgis | public | st_geomfromwkb | bytea | geometry postgis | public | st_gmltosql | text | geometry postgis | public | st_gmltosql | text, integer | geometry postgis | public | st_hasarc | geometry geometry | boolean @@ -3633,12 +3641,12 @@ order by postgis | public | st_hexagongrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record postgis | public | st_interiorringn | geometry, integer | geometry postgis | public | st_interpolatepoint | line geometry, point geometry | double precision - postgis | public | st_intersection | geography, geography | geography postgis | public | st_intersection | geom1 geometry, geom2 geometry, gridsize double precision | geometry postgis | public | st_intersection | text, text | geometry - postgis | public | st_intersects | geog1 geography, geog2 geography | boolean + postgis | public | st_intersection | geography, geography | geography postgis | public | st_intersects | geom1 geometry, geom2 geometry | boolean postgis | public | st_intersects | text, text | boolean + postgis | public | st_intersects | geog1 geography, geog2 geography | boolean postgis | public | st_isclosed | geometry | boolean postgis | public | st_iscollection | geometry | boolean postgis | public | st_isempty | geometry | boolean @@ -3646,15 +3654,15 @@ order by postgis | public | st_ispolygoncw | geometry | boolean postgis | public | st_isring | geometry | boolean postgis | public | st_issimple | geometry | boolean - postgis | public | st_isvalid | geometry | boolean postgis | public | st_isvalid | geometry, integer | boolean + postgis | public | st_isvalid | geometry | boolean postgis | public | st_isvaliddetail | geom geometry, flags integer | valid_detail - postgis | public | st_isvalidreason | geometry | text postgis | public | st_isvalidreason | geometry, integer | text + postgis | public | st_isvalidreason | geometry | text postgis | public | st_isvalidtrajectory | geometry | boolean postgis | public | st_length | geog geography, use_spheroid boolean | double precision - postgis | public | st_length | geometry | double precision postgis | public | st_length | text | double precision + postgis | public | st_length | geometry | double precision postgis | public | st_length2d | geometry | double precision postgis | public | st_length2dspheroid | geometry, spheroid | double precision postgis | public | st_lengthspheroid | geometry, spheroid | double precision @@ -3664,15 +3672,15 @@ order by postgis | public | st_linefrommultipoint | geometry | geometry postgis | public | st_linefromtext | text | geometry postgis | public | st_linefromtext | text, integer | geometry - postgis | public | st_linefromwkb | bytea | geometry postgis | public | st_linefromwkb | bytea, integer | geometry + postgis | public | st_linefromwkb | bytea | geometry postgis | public | st_lineinterpolatepoint | geometry, double precision | geometry postgis | public | st_lineinterpolatepoints | geometry, double precision, repeat boolean | geometry postgis | public | st_linelocatepoint | geom1 geometry, geom2 geometry | double precision - postgis | public | st_linemerge | geometry | geometry postgis | public | st_linemerge | geometry, boolean | geometry - postgis | public | st_linestringfromwkb | bytea | geometry + postgis | public | st_linemerge | geometry | geometry postgis | public | st_linestringfromwkb | bytea, integer | geometry + postgis | public | st_linestringfromwkb | bytea | geometry postgis | public | st_linesubstring | geometry, double precision, double precision | geometry postgis | public | st_linetocurve | geometry geometry | geometry postgis | public | st_locatealong | geometry geometry, measure double precision, leftrightoffset double precision | geometry @@ -3683,14 +3691,14 @@ order by postgis | public | st_makebox2d | geom1 geometry, geom2 geometry | box2d postgis | public | st_makeenvelope | double precision, double precision, double precision, double precision, integer | geometry postgis | public | st_makeline | geom1 geometry, geom2 geometry | geometry - postgis | public | st_makeline | geometry | geometry postgis | public | st_makeline | geometry[] | geometry + postgis | public | st_makeline | geometry | geometry + postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry postgis | public | st_makepoint | double precision, double precision | geometry postgis | public | st_makepoint | double precision, double precision, double precision | geometry - postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry postgis | public | st_makepointm | double precision, double precision, double precision | geometry - postgis | public | st_makepolygon | geometry | geometry postgis | public | st_makepolygon | geometry, geometry[] | geometry + postgis | public | st_makepolygon | geometry | geometry postgis | public | st_makevalid | geom geometry, params text | geometry postgis | public | st_makevalid | geometry | geometry postgis | public | st_maxdistance | geom1 geometry, geom2 geometry | double precision @@ -3704,25 +3712,25 @@ order by postgis | public | st_minimumclearanceline | geometry | geometry postgis | public | st_mlinefromtext | text | geometry postgis | public | st_mlinefromtext | text, integer | geometry - postgis | public | st_mlinefromwkb | bytea | geometry postgis | public | st_mlinefromwkb | bytea, integer | geometry + postgis | public | st_mlinefromwkb | bytea | geometry postgis | public | st_mpointfromtext | text | geometry postgis | public | st_mpointfromtext | text, integer | geometry - postgis | public | st_mpointfromwkb | bytea | geometry postgis | public | st_mpointfromwkb | bytea, integer | geometry + postgis | public | st_mpointfromwkb | bytea | geometry postgis | public | st_mpolyfromtext | text | geometry postgis | public | st_mpolyfromtext | text, integer | geometry - postgis | public | st_mpolyfromwkb | bytea | geometry postgis | public | st_mpolyfromwkb | bytea, integer | geometry + postgis | public | st_mpolyfromwkb | bytea | geometry postgis | public | st_multi | geometry | geometry postgis | public | st_multilinefromwkb | bytea | geometry postgis | public | st_multilinestringfromtext | text | geometry postgis | public | st_multilinestringfromtext | text, integer | geometry postgis | public | st_multipointfromtext | text | geometry - postgis | public | st_multipointfromwkb | bytea | geometry postgis | public | st_multipointfromwkb | bytea, integer | geometry - postgis | public | st_multipolyfromwkb | bytea | geometry + postgis | public | st_multipointfromwkb | bytea | geometry postgis | public | st_multipolyfromwkb | bytea, integer | geometry + postgis | public | st_multipolyfromwkb | bytea | geometry postgis | public | st_multipolygonfromtext | text | geometry postgis | public | st_multipolygonfromtext | text, integer | geometry postgis | public | st_ndims | geometry | smallint @@ -3743,13 +3751,13 @@ order by postgis | public | st_perimeter | geog geography, use_spheroid boolean | double precision postgis | public | st_perimeter | geometry | double precision postgis | public | st_perimeter2d | geometry | double precision - postgis | public | st_point | double precision, double precision | geometry postgis | public | st_point | double precision, double precision, srid integer | geometry + postgis | public | st_point | double precision, double precision | geometry postgis | public | st_pointfromgeohash | text, integer | geometry postgis | public | st_pointfromtext | text | geometry postgis | public | st_pointfromtext | text, integer | geometry - postgis | public | st_pointfromwkb | bytea | geometry postgis | public | st_pointfromwkb | bytea, integer | geometry + postgis | public | st_pointfromwkb | bytea | geometry postgis | public | st_pointinsidecircle | geometry, double precision, double precision, double precision | boolean postgis | public | st_pointm | xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer | geometry postgis | public | st_pointn | geometry, integer | geometry @@ -3759,35 +3767,35 @@ order by postgis | public | st_pointzm | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer | geometry postgis | public | st_polyfromtext | text | geometry postgis | public | st_polyfromtext | text, integer | geometry - postgis | public | st_polyfromwkb | bytea | geometry postgis | public | st_polyfromwkb | bytea, integer | geometry + postgis | public | st_polyfromwkb | bytea | geometry postgis | public | st_polygon | geometry, integer | geometry postgis | public | st_polygonfromtext | text | geometry postgis | public | st_polygonfromtext | text, integer | geometry - postgis | public | st_polygonfromwkb | bytea | geometry postgis | public | st_polygonfromwkb | bytea, integer | geometry - postgis | public | st_polygonize | geometry | geometry + postgis | public | st_polygonfromwkb | bytea | geometry postgis | public | st_polygonize | geometry[] | geometry + postgis | public | st_polygonize | geometry | geometry postgis | public | st_project | geog geography, distance double precision, azimuth double precision | geography postgis | public | st_quantizecoordinates | g geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer | geometry postgis | public | st_reduceprecision | geom geometry, gridsize double precision | geometry - postgis | public | st_relate | geom1 geometry, geom2 geometry | text postgis | public | st_relate | geom1 geometry, geom2 geometry, integer | text + postgis | public | st_relate | geom1 geometry, geom2 geometry | text postgis | public | st_relate | geom1 geometry, geom2 geometry, text | boolean postgis | public | st_relatematch | text, text | boolean postgis | public | st_removepoint | geometry, integer | geometry postgis | public | st_removerepeatedpoints | geom geometry, tolerance double precision | geometry postgis | public | st_reverse | geometry | geometry - postgis | public | st_rotate | geometry, double precision | geometry - postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry postgis | public | st_rotate | geometry, double precision, geometry | geometry + postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_rotate | geometry, double precision | geometry postgis | public | st_rotatex | geometry, double precision | geometry postgis | public | st_rotatey | geometry, double precision | geometry postgis | public | st_rotatez | geometry, double precision | geometry postgis | public | st_scale | geometry, double precision, double precision | geometry postgis | public | st_scale | geometry, double precision, double precision, double precision | geometry - postgis | public | st_scale | geometry, geometry | geometry postgis | public | st_scale | geometry, geometry, origin geometry | geometry + postgis | public | st_scale | geometry, geometry | geometry postgis | public | st_scroll | geometry, geometry | geometry postgis | public | st_segmentize | geog geography, max_segment_length double precision | geography postgis | public | st_segmentize | geometry, double precision | geometry @@ -3798,16 +3806,16 @@ order by postgis | public | st_sharedpaths | geom1 geometry, geom2 geometry | geometry postgis | public | st_shiftlongitude | geometry | geometry postgis | public | st_shortestline | geom1 geometry, geom2 geometry | geometry - postgis | public | st_simplify | geometry, double precision | geometry postgis | public | st_simplify | geometry, double precision, boolean | geometry + postgis | public | st_simplify | geometry, double precision | geometry postgis | public | st_simplifypolygonhull | geom geometry, vertex_fraction double precision, is_outer boolean | geometry postgis | public | st_simplifypreservetopology | geometry, double precision | geometry postgis | public | st_simplifyvw | geometry, double precision | geometry postgis | public | st_snap | geom1 geometry, geom2 geometry, double precision | geometry - postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry - postgis | public | st_snaptogrid | geometry, double precision | geometry postgis | public | st_snaptogrid | geometry, double precision, double precision | geometry + postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry postgis | public | st_snaptogrid | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision | geometry postgis | public | st_split | geom1 geometry, geom2 geometry | geometry postgis | public | st_square | size double precision, cell_i integer, cell_j integer, origin geometry | geometry postgis | public | st_squaregrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record @@ -3822,20 +3830,20 @@ order by postgis | public | st_symmetricdifference | geom1 geometry, geom2 geometry | geometry postgis | public | st_tileenvelope | zoom integer, x integer, y integer, bounds geometry, margin double precision | geometry postgis | public | st_touches | geom1 geometry, geom2 geometry | boolean - postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry - postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry postgis | public | st_transform | geom geometry, to_proj text | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry postgis | public | st_transform | geometry, integer | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry postgis | public | st_translate | geometry, double precision, double precision | geometry postgis | public | st_translate | geometry, double precision, double precision, double precision | geometry postgis | public | st_transscale | geometry, double precision, double precision, double precision, double precision | geometry postgis | public | st_triangulatepolygon | g1 geometry | geometry postgis | public | st_unaryunion | geometry, gridsize double precision | geometry - postgis | public | st_union | geom1 geometry, geom2 geometry | geometry postgis | public | st_union | geom1 geometry, geom2 geometry, gridsize double precision | geometry - postgis | public | st_union | geometry | geometry - postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry | geometry postgis | public | st_union | geometry[] | geometry + postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geometry | geometry postgis | public | st_voronoilines | g1 geometry, tolerance double precision, extend_to geometry | geometry postgis | public | st_voronoipolygons | g1 geometry, tolerance double precision, extend_to geometry | geometry postgis | public | st_within | geom1 geometry, geom2 geometry | boolean @@ -3912,8 +3920,8 @@ order by postgis_raster | public | _st_convertarray4ma | value double precision[] | double precision[] postgis_raster | public | _st_count | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint postgis_raster | public | _st_countagg_finalfn | agg agg_count | bigint - postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count postgis_raster | public | _st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean @@ -3923,10 +3931,10 @@ order by postgis_raster | public | _st_grayscale4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_hillshade4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_histogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, min double precision, max double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | _st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean - postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster + postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster postgis_raster | public | _st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | _st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_pixelascentroids | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) @@ -3941,37 +3949,37 @@ order by postgis_raster | public | _st_slope4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_summarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats postgis_raster | public | _st_summarystats_finalfn | internal | summarystats + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal postgis_raster | public | _st_summarystats_transfn | internal, raster, boolean, double precision | internal postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean | internal - postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal postgis_raster | public | _st_tile | rast raster, width integer, height integer, nband integer[], padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | _st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_tpi4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_tri4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_union_finalfn | internal | raster - postgis_raster | public | _st_union_transfn | internal, raster | internal - postgis_raster | public | _st_union_transfn | internal, raster, integer | internal postgis_raster | public | _st_union_transfn | internal, raster, integer, text | internal + postgis_raster | public | _st_union_transfn | internal, raster | internal postgis_raster | public | _st_union_transfn | internal, raster, text | internal + postgis_raster | public | _st_union_transfn | internal, raster, integer | internal postgis_raster | public | _st_union_transfn | internal, raster, unionarg[] | internal - postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record postgis_raster | public | _st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record postgis_raster | public | _st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record postgis_raster | public | _updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_raster | public | addoverviewconstraints | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, ovfactor integer | boolean postgis_raster | public | addoverviewconstraints | ovtable name, ovcolumn name, reftable name, refcolumn name, ovfactor integer | boolean - postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean postgis_raster | public | box3d | raster | box3d postgis_raster | public | bytea | raster | bytea - postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean postgis_raster | public | dropoverviewconstraints | ovtable name, ovcolumn name | boolean - postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean postgis_raster | public | geometry_contained_by_raster | geometry, raster | boolean postgis_raster | public | geometry_raster_contain | geometry, raster | boolean @@ -4000,108 +4008,108 @@ order by postgis_raster | public | raster_overright | raster, raster | boolean postgis_raster | public | raster_right | raster, raster | boolean postgis_raster | public | raster_same | raster, raster | boolean - postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster postgis_raster | public | st_addband | rast raster, index integer, outdbfile text, outdbindex integer[], nodataval double precision | raster - postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster postgis_raster | public | st_addband | rast raster, outdbfile text, outdbindex integer[], index integer, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster postgis_raster | public | st_addband | rast raster, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster postgis_raster | public | st_addband | torast raster, fromrast raster, fromband integer, torastindex integer | raster postgis_raster | public | st_addband | torast raster, fromrasts raster[], fromband integer, torastindex integer | raster postgis_raster | public | st_approxcount | rast raster, exclude_nodata_value boolean, sample_percent double precision | bigint - postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint - postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint postgis_raster | public | st_approxcount | rast raster, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantile double precision | double precision - postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record - postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantile double precision | double precision - postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxsummarystats | rast raster, exclude_nodata_value boolean, sample_percent double precision | summarystats - postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats - postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats postgis_raster | public | st_approxsummarystats | rast raster, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats postgis_raster | public | st_asbinary | raster, outasin boolean | bytea postgis_raster | public | st_asgdalraster | rast raster, format text, options text[], srid integer | bytea postgis_raster | public | st_ashexwkb | raster, outasin boolean | text - postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea - postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea + postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea postgis_raster | public | st_asjpeg | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea postgis_raster | public | st_asjpeg | rast raster, nbands integer[], quality integer | bytea - postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea postgis_raster | public | st_aspect | rast raster, nband integer, customextent raster, pixeltype text, units text, interpolate_nodata boolean | raster postgis_raster | public | st_aspect | rast raster, nband integer, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspng | rast raster, options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea postgis_raster | public | st_aspng | rast raster, nband integer, compression integer | bytea postgis_raster | public | st_aspng | rast raster, nband integer, options text[] | bytea postgis_raster | public | st_aspng | rast raster, nbands integer[], compression integer | bytea - postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea - postgis_raster | public | st_aspng | rast raster, options text[] | bytea - postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text[], value double precision[], nodataval double precision[], touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea postgis_raster | public | st_astiff | rast raster, compression text, srid integer | bytea postgis_raster | public | st_astiff | rast raster, nbands integer[], compression text, srid integer | bytea postgis_raster | public | st_astiff | rast raster, nbands integer[], options text[], srid integer | bytea - postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea postgis_raster | public | st_aswkb | raster, outasin boolean | bytea - postgis_raster | public | st_band | rast raster, nband integer | raster - postgis_raster | public | st_band | rast raster, nbands integer[] | raster postgis_raster | public | st_band | rast raster, nbands text, delimiter character | raster + postgis_raster | public | st_band | rast raster, nbands integer[] | raster + postgis_raster | public | st_band | rast raster, nband integer | raster postgis_raster | public | st_bandfilesize | rast raster, band integer | bigint postgis_raster | public | st_bandfiletimestamp | rast raster, band integer | bigint - postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean postgis_raster | public | st_bandisnodata | rast raster, forcechecking boolean | boolean + postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean postgis_raster | public | st_bandmetadata | rast raster, band integer | TABLE(pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) postgis_raster | public | st_bandmetadata | rast raster, band integer[] | TABLE(bandnum integer, pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) postgis_raster | public | st_bandnodatavalue | rast raster, band integer | double precision postgis_raster | public | st_bandpath | rast raster, band integer | text postgis_raster | public | st_bandpixeltype | rast raster, band integer | text - postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster - postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision[], crop boolean | raster - postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster postgis_raster | public | st_colormap | rast raster, colormap text, method text | raster postgis_raster | public | st_colormap | rast raster, nband integer, colormap text, method text | raster - postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_contains | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_containsproperly | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_contour | rast raster, bandnumber integer, level_interval double precision, level_base double precision, fixed_levels double precision[], polygonize boolean | TABLE(geom geometry, id integer, value double precision) postgis_raster | public | st_convexhull | raster | geometry - postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint postgis_raster | public | st_count | rast raster, nband integer, exclude_nodata_value boolean | bigint - postgis_raster | public | st_countagg | raster, boolean | bigint - postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint postgis_raster | public | st_countagg | raster, integer, boolean, double precision | bigint - postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_countagg | raster, boolean | bigint postgis_raster | public | st_coveredby | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_covers | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_createoverview | tab regclass, col name, factor integer, algo text | regclass postgis_raster | public | st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean postgis_raster | public | st_dfullywithin | rast1 raster, rast2 raster, distance double precision | boolean - postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_disjoint | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_distinct4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_dumpaspolygons | rast raster, band integer, exclude_nodata_value boolean | SETOF geomval postgis_raster | public | st_dumpvalues | rast raster, nband integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_dumpvalues | rast raster, nband integer[], exclude_nodata_value boolean | TABLE(nband integer, valarray double precision[]) @@ -4112,8 +4120,8 @@ order by postgis_raster | public | st_gdaldrivers | OUT idx integer, OUT short_name text, OUT long_name text, OUT can_read boolean, OUT can_write boolean, OUT create_options text | SETOF record postgis_raster | public | st_georeference | rast raster, format text | text postgis_raster | public | st_geotransform | raster, OUT imag double precision, OUT jmag double precision, OUT theta_i double precision, OUT theta_ij double precision, OUT xoffset double precision, OUT yoffset double precision | record - postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster postgis_raster | public | st_grayscale | rastbandargset rastbandarg[], extenttype text | raster + postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster postgis_raster | public | st_hasnoband | rast raster, nband integer | boolean postgis_raster | public | st_height | raster | integer postgis_raster | public | st_hillshade | rast raster, nband integer, customextent raster, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster @@ -4123,76 +4131,76 @@ order by postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_interpolateraster | geom geometry, options text, rast raster, bandnumber integer | raster - postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval - postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval - postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval - postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision | raster postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster - postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster postgis_raster | public | st_intersects | rast raster, geom geometry, nband integer | boolean - postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean - postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_intersects | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean + postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | st_invdistweight4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | st_iscoveragetile | rast raster, coverage raster, tilewidth integer, tileheight integer | boolean postgis_raster | public | st_isempty | rast raster | boolean postgis_raster | public | st_makeemptycoverage | tilewidth integer, tileheight integer, width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | SETOF raster - postgis_raster | public | st_makeemptyraster | rast raster | raster - postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster + postgis_raster | public | st_makeemptyraster | rast raster | raster + postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster postgis_raster | public | st_mapalgebra | rast raster, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebra | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster postgis_raster | public | st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster postgis_raster | public | st_mapalgebraexpr | rast raster, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebraexpr | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster - postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster postgis_raster | public | st_mapalgebrafct | rast1 raster, rast2 raster, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster postgis_raster | public | st_mapalgebrafctngb | rast raster, band integer, pixeltype text, ngbwidth integer, ngbheight integer, onerastngbuserfunc regprocedure, nodatamode text, VARIADIC args text[] | raster - postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_max4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision - postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_mean4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_memsize | raster | integer postgis_raster | public | st_metadata | rast raster, OUT upperleftx double precision, OUT upperlefty double precision, OUT width integer, OUT height integer, OUT scalex double precision, OUT scaley double precision, OUT skewx double precision, OUT skewy double precision, OUT srid integer, OUT numbands integer | record - postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_min4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_minconvexhull | rast raster, nband integer | geometry postgis_raster | public | st_mindist4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | st_minpossiblevalue | pixeltype text | double precision + postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, band integer, pt geometry, exclude_nodata_value boolean | double precision - postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, pt geometry, exclude_nodata_value boolean | double precision - postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] - postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_neighborhood | rast raster, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_neighborhood | rast raster, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_notsamealignmentreason | rast1 raster, rast2 raster | text postgis_raster | public | st_numbands | raster | integer - postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_overlaps | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_pixelascentroid | rast raster, x integer, y integer | geometry postgis_raster | public | st_pixelascentroids | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) postgis_raster | public | st_pixelaspoint | rast raster, x integer, y integer | geometry @@ -4201,20 +4209,20 @@ order by postgis_raster | public | st_pixelaspolygons | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) postgis_raster | public | st_pixelheight | raster | double precision postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) - postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelofvalue | rast raster, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelofvalue | rast raster, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelwidth | raster | double precision postgis_raster | public | st_polygon | rast raster, band integer | geometry postgis_raster | public | st_quantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, nband integer, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record - postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_range4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer | double precision postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer, yr integer | double precision @@ -4222,18 +4230,18 @@ order by postgis_raster | public | st_rastertoworldcoordy | rast raster, yr integer | double precision postgis_raster | public | st_rastfromhexwkb | text | raster postgis_raster | public | st_rastfromwkb | bytea | raster - postgis_raster | public | st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster postgis_raster | public | st_reclass | rast raster, nband integer, reclassexpr text, pixeltype text, nodataval double precision | raster + postgis_raster | public | st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster postgis_raster | public | st_reclass | rast raster, reclassexpr text, pixeltype text | raster - postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster postgis_raster | public | st_resample | rast raster, ref raster, usescale boolean, algorithm text, maxerr double precision | raster - postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_resample | rast raster, width integer, height integer, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster - postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster postgis_raster | public | st_rescale | rast raster, scalexy double precision, algorithm text, maxerr double precision | raster - postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_resize | rast raster, width integer, height integer, algorithm text, maxerr double precision | raster postgis_raster | public | st_resize | rast raster, width text, height text, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_reskew | rast raster, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_reskew | rast raster, skewxy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_retile | tab regclass, col name, ext geometry, sfx double precision, sfy double precision, tw integer, th integer, algo text | SETOF raster @@ -4250,106 +4258,106 @@ order by postgis_raster | public | st_setbandnodatavalue | rast raster, band integer, nodatavalue double precision, forcechecking boolean | raster postgis_raster | public | st_setbandnodatavalue | rast raster, nodatavalue double precision | raster postgis_raster | public | st_setbandpath | rast raster, band integer, outdbpath text, outdbindex integer, force boolean | raster - postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster postgis_raster | public | st_setgeoreference | rast raster, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster postgis_raster | public | st_setgeotransform | rast raster, imag double precision, jmag double precision, theta_i double precision, theta_ij double precision, xoffset double precision, yoffset double precision | raster postgis_raster | public | st_setm | rast raster, geom geometry, resample text, band integer | geometry postgis_raster | public | st_setrotation | rast raster, rotation double precision | raster - postgis_raster | public | st_setscale | rast raster, scale double precision | raster postgis_raster | public | st_setscale | rast raster, scalex double precision, scaley double precision | raster - postgis_raster | public | st_setskew | rast raster, skew double precision | raster + postgis_raster | public | st_setscale | rast raster, scale double precision | raster postgis_raster | public | st_setskew | rast raster, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setskew | rast raster, skew double precision | raster postgis_raster | public | st_setsrid | rast raster, srid integer | raster postgis_raster | public | st_setupperleft | rast raster, upperleftx double precision, upperlefty double precision | raster - postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster - postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster postgis_raster | public | st_setvalue | rast raster, nband integer, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster postgis_raster | public | st_setvalue | rast raster, x integer, y integer, newvalue double precision | raster - postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster - postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster + postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster postgis_raster | public | st_setvalues | rast raster, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster postgis_raster | public | st_setz | rast raster, geom geometry, resample text, band integer | geometry postgis_raster | public | st_skewx | raster | double precision postgis_raster | public | st_skewy | raster | double precision postgis_raster | public | st_slope | rast raster, nband integer, customextent raster, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster postgis_raster | public | st_slope | rast raster, nband integer, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster - postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalexy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_srid | raster | integer - postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_stddev4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision - postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_sum4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_summary | rast raster | text - postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats postgis_raster | public | st_summarystats | rast raster, nband integer, exclude_nodata_value boolean | summarystats - postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats - postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats postgis_raster | public | st_summarystatsagg | raster, integer, boolean, double precision | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats postgis_raster | public | st_tile | rast raster, nband integer, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | st_tile | rast raster, nband integer[], width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | st_tile | rast raster, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster - postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_touches | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_tpi | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster postgis_raster | public | st_tpi | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster - postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster postgis_raster | public | st_transform | rast raster, srid integer, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster - postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_transform | rast raster, srid integer, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_tri | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster postgis_raster | public | st_tri | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster - postgis_raster | public | st_union | raster | raster postgis_raster | public | st_union | raster, integer | raster + postgis_raster | public | st_union | raster | raster + postgis_raster | public | st_union | raster, unionarg[] | raster postgis_raster | public | st_union | raster, integer, text | raster postgis_raster | public | st_union | raster, text | raster - postgis_raster | public | st_union | raster, unionarg[] | raster postgis_raster | public | st_upperleftx | raster | double precision postgis_raster | public | st_upperlefty | raster | double precision - postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision postgis_raster | public | st_value | rast raster, band integer, x integer, y integer, exclude_nodata_value boolean | double precision - postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision postgis_raster | public | st_value | rast raster, x integer, y integer, exclude_nodata_value boolean | double precision - postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision + postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rast raster, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuepercent | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | double precision postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_width | raster | integer - postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_within | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record postgis_raster | public | st_worldtorastercoord | rast raster, pt geometry, OUT columnx integer, OUT rowy integer | record - postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision | integer postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision, yw double precision | integer - postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordy | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordy | rast raster, yw double precision | integer - postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_raster | public | updaterastersrid | table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_sfcgal | public | postgis_sfcgal_full_version | | text postgis_sfcgal | public | postgis_sfcgal_noop | geometry | geometry postgis_sfcgal | public | postgis_sfcgal_scripts_installed | | text @@ -4383,8 +4391,8 @@ order by postgis_tiger_geocoder | tiger | drop_nation_tables_generate_script | param_schema text | text postgis_tiger_geocoder | tiger | drop_state_tables_generate_script | param_state text, param_schema text | text postgis_tiger_geocoder | tiger | end_soundex | character varying | character varying - postgis_tiger_geocoder | tiger | geocode | in_addy norm_addy, max_results integer, restrict_geom geometry, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record postgis_tiger_geocoder | tiger | geocode | input character varying, max_results integer, restrict_geom geometry, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record + postgis_tiger_geocoder | tiger | geocode | in_addy norm_addy, max_results integer, restrict_geom geometry, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record postgis_tiger_geocoder | tiger | geocode_address | parsed norm_addy, max_results integer, restrict_geom geometry, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record postgis_tiger_geocoder | tiger | geocode_intersection | roadway1 text, roadway2 text, in_state text, in_city text, in_zip text, num_results integer, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record postgis_tiger_geocoder | tiger | geocode_location | parsed norm_addy, restrict_geom geometry, OUT addy norm_addy, OUT geomout geometry, OUT rating integer | SETOF record @@ -4417,8 +4425,8 @@ order by postgis_tiger_geocoder | tiger | numeric_streets_equal | input_street character varying, output_street character varying | boolean postgis_tiger_geocoder | tiger | pagc_normalize_address | in_rawinput character varying | norm_addy postgis_tiger_geocoder | tiger | pprint_addy | input norm_addy | character varying - postgis_tiger_geocoder | tiger | rate_attributes | dirpa character varying, dirpb character varying, streetnamea character varying, streetnameb character varying, streettypea character varying, streettypeb character varying, dirsa character varying, dirsb character varying, locationa character varying, locationb character varying, prequalabr character varying | integer postgis_tiger_geocoder | tiger | rate_attributes | dirpa character varying, dirpb character varying, streetnamea character varying, streetnameb character varying, streettypea character varying, streettypeb character varying, dirsa character varying, dirsb character varying, prequalabr character varying | integer + postgis_tiger_geocoder | tiger | rate_attributes | dirpa character varying, dirpb character varying, streetnamea character varying, streetnameb character varying, streettypea character varying, streettypeb character varying, dirsa character varying, dirsb character varying, locationa character varying, locationb character varying, prequalabr character varying | integer postgis_tiger_geocoder | tiger | reverse_geocode | pt geometry, include_strnum_range boolean, OUT intpt geometry[], OUT addy norm_addy[], OUT street character varying[] | record postgis_tiger_geocoder | tiger | set_geocode_setting | setting_name text, setting_value text | text postgis_tiger_geocoder | tiger | setsearchpathforinstall | a_schema_name text | text @@ -4440,38 +4448,38 @@ order by postgis_topology | topology | addedge | atopology character varying, aline geometry | integer postgis_topology | topology | addface | atopology character varying, apoly geometry, force_new boolean | integer postgis_topology | topology | addnode | atopology character varying, apoint geometry, allowedgesplitting boolean, setcontainingface boolean | integer - postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer postgis_topology | topology | addtopogeometrycolumn | toponame character varying, schema character varying, tbl character varying, col character varying, ltype character varying, child integer | integer + postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer postgis_topology | topology | addtosearchpath | a_schema_name character varying | text - postgis_topology | topology | asgml | tg topogeometry | text - postgis_topology | topology | asgml | tg topogeometry, nsprefix text | text postgis_topology | topology | asgml | tg topogeometry, nsprefix text, prec integer, options integer, vis regclass | text - postgis_topology | topology | asgml | tg topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text postgis_topology | topology | asgml | tg topogeometry, nsprefix text, prec integer, opts integer | text + postgis_topology | topology | asgml | tg topogeometry, nsprefix text | text postgis_topology | topology | asgml | tg topogeometry, nsprefix_in text, precision_in integer, options_in integer, visitedtable regclass, idprefix text, gmlver integer | text - postgis_topology | topology | asgml | tg topogeometry, visitedtable regclass | text + postgis_topology | topology | asgml | tg topogeometry | text + postgis_topology | topology | asgml | tg topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text postgis_topology | topology | asgml | tg topogeometry, visitedtable regclass, nsprefix text | text + postgis_topology | topology | asgml | tg topogeometry, visitedtable regclass | text postgis_topology | topology | astopojson | tg topogeometry, edgemaptable regclass | text postgis_topology | topology | cleartopogeom | tg topogeometry | topogeometry postgis_topology | topology | copytopology | atopology character varying, newtopo character varying | integer - postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topogeometry postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer, tg_objs topoelementarray | topogeometry + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topogeometry postgis_topology | topology | createtopology | atopology character varying, srid integer, prec double precision, hasz boolean | integer - postgis_topology | topology | createtopology | character varying | integer postgis_topology | topology | createtopology | character varying, integer | integer postgis_topology | topology | createtopology | toponame character varying, srid integer, prec double precision | integer + postgis_topology | topology | createtopology | character varying | integer postgis_topology | topology | droptopogeometrycolumn | schema character varying, tbl character varying, col character varying | text postgis_topology | topology | droptopology | atopology character varying | text postgis_topology | topology | equals | tg1 topogeometry, tg2 topogeometry | boolean - postgis_topology | topology | findlayer | layer_table regclass, feature_column name | layer postgis_topology | topology | findlayer | schema_name name, table_name name, feature_column name | layer - postgis_topology | topology | findlayer | tg topogeometry | layer postgis_topology | topology | findlayer | topology_id integer, layer_id integer | layer + postgis_topology | topology | findlayer | layer_table regclass, feature_column name | layer + postgis_topology | topology | findlayer | tg topogeometry | layer postgis_topology | topology | findtopology | integer | topology - postgis_topology | topology | findtopology | name, name, name | topology - postgis_topology | topology | findtopology | regclass, name | topology postgis_topology | topology | findtopology | text | topology postgis_topology | topology | findtopology | topogeometry | topology + postgis_topology | topology | findtopology | name, name, name | topology + postgis_topology | topology | findtopology | regclass, name | topology postgis_topology | topology | geometry | topogeom topogeometry | geometry postgis_topology | topology | geometrytype | tg topogeometry | text postgis_topology | topology | getedgebypoint | atopology character varying, apoint geometry, tol1 double precision | integer @@ -4480,8 +4488,8 @@ order by postgis_topology | topology | getnodebypoint | atopology character varying, apoint geometry, tol1 double precision | integer postgis_topology | topology | getnodeedges | atopology character varying, anode integer | SETOF getfaceedges_returntype postgis_topology | topology | getringedges | atopology character varying, anedge integer, maxedges integer | SETOF getfaceedges_returntype - postgis_topology | topology | gettopogeomelementarray | tg topogeometry | topoelementarray postgis_topology | topology | gettopogeomelementarray | toponame character varying, layer_id integer, tgid integer | topoelementarray + postgis_topology | topology | gettopogeomelementarray | tg topogeometry | topoelementarray postgis_topology | topology | gettopogeomelements | tg topogeometry | SETOF topoelement postgis_topology | topology | gettopogeomelements | toponame character varying, layerid integer, tgid integer | SETOF topoelement postgis_topology | topology | gettopologyid | toponame character varying | integer @@ -4663,13 +4671,13 @@ order by rum | public | rum_timetz_compare_prefix | time with time zone, time with time zone, smallint, internal | integer rum | public | rum_timetz_extract_query | time with time zone, internal, smallint, internal, internal | internal rum | public | rum_timetz_extract_value | time with time zone, internal | internal - rum | public | rum_ts_distance | tsvector, rum_distance_query | real - rum | public | rum_ts_distance | tsvector, tsquery | real rum | public | rum_ts_distance | tsvector, tsquery, integer | real + rum | public | rum_ts_distance | tsvector, tsquery | real + rum | public | rum_ts_distance | tsvector, rum_distance_query | real rum | public | rum_ts_join_pos | internal, internal | bytea - rum | public | rum_ts_score | tsvector, rum_distance_query | real - rum | public | rum_ts_score | tsvector, tsquery | real rum | public | rum_ts_score | tsvector, tsquery, integer | real + rum | public | rum_ts_score | tsvector, tsquery | real + rum | public | rum_ts_score | tsvector, rum_distance_query | real rum | public | rum_tsquery_addon_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean rum | public | rum_tsquery_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean rum | public | rum_tsquery_distance | internal, smallint, tsvector, integer, internal, internal, internal, internal, internal | double precision @@ -4723,10 +4731,10 @@ order by sslinfo | public | ssl_version | | text supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void - tablefunc | public | connectby | text, text, text, text, integer | SETOF record tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record - tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record tablefunc | public | connectby | text, text, text, text, text, integer, text | SETOF record + tablefunc | public | connectby | text, text, text, text, integer | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record tablefunc | public | crosstab | text | SETOF record tablefunc | public | crosstab | text, integer | SETOF record tablefunc | public | crosstab | text, text | SETOF record @@ -4933,8 +4941,8 @@ order by timescaledb | public | chunk_compression_stats | hypertable regclass | TABLE(chunk_schema name, chunk_name name, compression_status text, before_compression_table_bytes bigint, before_compression_index_bytes bigint, before_compression_toast_bytes bigint, before_compression_total_bytes bigint, after_compression_table_bytes bigint, after_compression_index_bytes bigint, after_compression_toast_bytes bigint, after_compression_total_bytes bigint, node_name name) timescaledb | public | chunks_detailed_size | hypertable regclass | TABLE(chunk_schema name, chunk_name name, table_bytes bigint, index_bytes bigint, toast_bytes bigint, total_bytes bigint, node_name name) timescaledb | public | compress_chunk | uncompressed_chunk regclass, if_not_compressed boolean, recompress boolean | regclass - timescaledb | public | create_hypertable | relation regclass, dimension _timescaledb_internal.dimension_info, create_default_indexes boolean, if_not_exists boolean, migrate_data boolean | TABLE(hypertable_id integer, created boolean) timescaledb | public | create_hypertable | relation regclass, time_column_name name, partitioning_column name, number_partitions integer, associated_schema_name name, associated_table_prefix name, chunk_time_interval anyelement, create_default_indexes boolean, if_not_exists boolean, partitioning_func regproc, migrate_data boolean, chunk_target_size text, chunk_sizing_func regproc, time_partitioning_func regproc | TABLE(hypertable_id integer, schema_name name, table_name name, created boolean) + timescaledb | public | create_hypertable | relation regclass, dimension _timescaledb_internal.dimension_info, create_default_indexes boolean, if_not_exists boolean, migrate_data boolean | TABLE(hypertable_id integer, created boolean) timescaledb | public | decompress_chunk | uncompressed_chunk regclass, if_compressed boolean | regclass timescaledb | public | delete_job | job_id integer | void timescaledb | public | detach_tablespace | tablespace name, hypertable regclass, if_attached boolean | integer @@ -4951,10 +4959,10 @@ order by timescaledb | public | hypertable_detailed_size | hypertable regclass | TABLE(table_bytes bigint, index_bytes bigint, toast_bytes bigint, total_bytes bigint, node_name name) timescaledb | public | hypertable_index_size | index_name regclass | bigint timescaledb | public | hypertable_size | hypertable regclass | bigint - timescaledb | public | interpolate | value bigint, prev record, next record | bigint timescaledb | public | interpolate | value double precision, prev record, next record | double precision - timescaledb | public | interpolate | value integer, prev record, next record | integer timescaledb | public | interpolate | value real, prev record, next record | real + timescaledb | public | interpolate | value bigint, prev record, next record | bigint + timescaledb | public | interpolate | value integer, prev record, next record | integer timescaledb | public | interpolate | value smallint, prev record, next record | smallint timescaledb | public | last | anyelement, "any" | anyelement timescaledb | public | locf | value anyelement, prev anyelement, treat_null_as_missing boolean | anyelement @@ -4975,28 +4983,28 @@ order by timescaledb | public | show_chunks | relation regclass, older_than "any", newer_than "any", created_before "any", created_after "any" | SETOF regclass timescaledb | public | show_tablespaces | hypertable regclass | SETOF name timescaledb | public | time_bucket | bucket_width bigint, ts bigint | bigint - timescaledb | public | time_bucket | bucket_width bigint, ts bigint, "offset" bigint | bigint - timescaledb | public | time_bucket | bucket_width integer, ts integer | integer - timescaledb | public | time_bucket | bucket_width integer, ts integer, "offset" integer | integer - timescaledb | public | time_bucket | bucket_width interval, ts date | date - timescaledb | public | time_bucket | bucket_width interval, ts date, "offset" interval | date - timescaledb | public | time_bucket | bucket_width interval, ts date, origin date | date - timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone | timestamp with time zone timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone, "offset" interval | timestamp with time zone timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone, origin timestamp with time zone | timestamp with time zone - timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone, timezone text, origin timestamp with time zone, "offset" interval | timestamp with time zone - timescaledb | public | time_bucket | bucket_width interval, ts timestamp without time zone | timestamp without time zone + timescaledb | public | time_bucket | bucket_width smallint, ts smallint, "offset" smallint | smallint timescaledb | public | time_bucket | bucket_width interval, ts timestamp without time zone, "offset" interval | timestamp without time zone - timescaledb | public | time_bucket | bucket_width interval, ts timestamp without time zone, origin timestamp without time zone | timestamp without time zone + timescaledb | public | time_bucket | bucket_width interval, ts timestamp without time zone | timestamp without time zone + timescaledb | public | time_bucket | bucket_width integer, ts integer | integer + timescaledb | public | time_bucket | bucket_width bigint, ts bigint, "offset" bigint | bigint timescaledb | public | time_bucket | bucket_width smallint, ts smallint | smallint - timescaledb | public | time_bucket | bucket_width smallint, ts smallint, "offset" smallint | smallint - timescaledb | public | time_bucket_gapfill | bucket_width bigint, ts bigint, start bigint, finish bigint | bigint - timescaledb | public | time_bucket_gapfill | bucket_width integer, ts integer, start integer, finish integer | integer + timescaledb | public | time_bucket | bucket_width interval, ts date | date + timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone, timezone text, origin timestamp with time zone, "offset" interval | timestamp with time zone + timescaledb | public | time_bucket | bucket_width interval, ts date, "offset" interval | date + timescaledb | public | time_bucket | bucket_width interval, ts timestamp without time zone, origin timestamp without time zone | timestamp without time zone + timescaledb | public | time_bucket | bucket_width integer, ts integer, "offset" integer | integer + timescaledb | public | time_bucket | bucket_width interval, ts timestamp with time zone | timestamp with time zone + timescaledb | public | time_bucket | bucket_width interval, ts date, origin date | date + timescaledb | public | time_bucket_gapfill | bucket_width interval, ts timestamp with time zone, timezone text, start timestamp with time zone, finish timestamp with time zone | timestamp with time zone timescaledb | public | time_bucket_gapfill | bucket_width interval, ts date, start date, finish date | date + timescaledb | public | time_bucket_gapfill | bucket_width smallint, ts smallint, start smallint, finish smallint | smallint timescaledb | public | time_bucket_gapfill | bucket_width interval, ts timestamp with time zone, start timestamp with time zone, finish timestamp with time zone | timestamp with time zone - timescaledb | public | time_bucket_gapfill | bucket_width interval, ts timestamp with time zone, timezone text, start timestamp with time zone, finish timestamp with time zone | timestamp with time zone + timescaledb | public | time_bucket_gapfill | bucket_width bigint, ts bigint, start bigint, finish bigint | bigint timescaledb | public | time_bucket_gapfill | bucket_width interval, ts timestamp without time zone, start timestamp without time zone, finish timestamp without time zone | timestamp without time zone - timescaledb | public | time_bucket_gapfill | bucket_width smallint, ts smallint, start smallint, finish smallint | smallint + timescaledb | public | time_bucket_gapfill | bucket_width integer, ts integer, start integer, finish integer | integer timescaledb | public | timescaledb_post_restore | | boolean timescaledb | public | timescaledb_pre_restore | | boolean timescaledb | timescaledb_experimental | add_policies | relation regclass, if_not_exists boolean, refresh_start_offset "any", refresh_end_offset "any", compress_after "any", drop_after "any" | boolean @@ -5004,49 +5012,48 @@ order by timescaledb | timescaledb_experimental | remove_all_policies | relation regclass, if_exists boolean | boolean timescaledb | timescaledb_experimental | remove_policies | relation regclass, if_exists boolean, VARIADIC policy_names text[] | boolean timescaledb | timescaledb_experimental | show_policies | relation regclass | SETOF jsonb - timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts date | date - timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts date, origin date | date - timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone | timestamp with time zone - timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone, origin timestamp with time zone | timestamp with time zone timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone, origin timestamp with time zone, timezone text | timestamp with time zone - timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone, timezone text | timestamp with time zone + timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone, origin timestamp with time zone | timestamp with time zone timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp without time zone | timestamp without time zone + timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone, timezone text | timestamp with time zone + timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts date | date timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp without time zone, origin timestamp without time zone | timestamp without time zone + timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts timestamp with time zone | timestamp with time zone + timescaledb | timescaledb_experimental | time_bucket_ng | bucket_width interval, ts date, origin date | date tsm_system_rows | public | system_rows | internal | tsm_handler - tsm_system_time | public | system_time | internal | tsm_handler - unaccent | public | unaccent | regdictionary, text | text unaccent | public | unaccent | text | text + unaccent | public | unaccent | regdictionary, text | text unaccent | public | unaccent_init | internal | internal unaccent | public | unaccent_lexize | internal, internal, internal, internal | internal - uuid-ossp | public | uuid_generate_v1 | | uuid - uuid-ossp | public | uuid_generate_v1mc | | uuid - uuid-ossp | public | uuid_generate_v3 | namespace uuid, name text | uuid - uuid-ossp | public | uuid_generate_v4 | | uuid - uuid-ossp | public | uuid_generate_v5 | namespace uuid, name text | uuid - uuid-ossp | public | uuid_nil | | uuid - uuid-ossp | public | uuid_ns_dns | | uuid - uuid-ossp | public | uuid_ns_oid | | uuid - uuid-ossp | public | uuid_ns_url | | uuid - uuid-ossp | public | uuid_ns_x500 | | uuid - vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + uuid-ossp | extensions | uuid_generate_v1 | | uuid + uuid-ossp | extensions | uuid_generate_v1mc | | uuid + uuid-ossp | extensions | uuid_generate_v3 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_generate_v4 | | uuid + uuid-ossp | extensions | uuid_generate_v5 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_nil | | uuid + uuid-ossp | extensions | uuid_ns_dns | | uuid + uuid-ossp | extensions | uuid_ns_oid | | uuid + uuid-ossp | extensions | uuid_ns_url | | uuid + uuid-ossp | extensions | uuid_ns_x500 | | uuid + vector | public | array_to_halfvec | real[], integer, boolean | halfvec vector | public | array_to_halfvec | integer[], integer, boolean | halfvec vector | public | array_to_halfvec | numeric[], integer, boolean | halfvec - vector | public | array_to_halfvec | real[], integer, boolean | halfvec - vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec vector | public | array_to_sparsevec | integer[], integer, boolean | sparsevec vector | public | array_to_sparsevec | numeric[], integer, boolean | sparsevec - vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec - vector | public | array_to_vector | double precision[], integer, boolean | vector + vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_vector | real[], integer, boolean | vector vector | public | array_to_vector | integer[], integer, boolean | vector vector | public | array_to_vector | numeric[], integer, boolean | vector - vector | public | array_to_vector | real[], integer, boolean | vector - vector | public | avg | halfvec | halfvec + vector | public | array_to_vector | double precision[], integer, boolean | vector vector | public | avg | vector | vector - vector | public | binary_quantize | halfvec | bit + vector | public | avg | halfvec | halfvec vector | public | binary_quantize | vector | bit + vector | public | binary_quantize | halfvec | bit + vector | public | cosine_distance | vector, vector | double precision vector | public | cosine_distance | halfvec, halfvec | double precision vector | public | cosine_distance | sparsevec, sparsevec | double precision - vector | public | cosine_distance | vector, vector | double precision vector | public | halfvec | halfvec, integer, boolean | halfvec vector | public | halfvec_accum | double precision[], halfvec | double precision[] vector | public | halfvec_add | halfvec, halfvec | halfvec @@ -5078,24 +5085,24 @@ order by vector | public | hnsw_halfvec_support | internal | internal vector | public | hnsw_sparsevec_support | internal | internal vector | public | hnswhandler | internal | index_am_handler + vector | public | inner_product | vector, vector | double precision vector | public | inner_product | halfvec, halfvec | double precision vector | public | inner_product | sparsevec, sparsevec | double precision - vector | public | inner_product | vector, vector | double precision vector | public | ivfflat_bit_support | internal | internal vector | public | ivfflat_halfvec_support | internal | internal vector | public | ivfflathandler | internal | index_am_handler vector | public | jaccard_distance | bit, bit | double precision + vector | public | l1_distance | vector, vector | double precision vector | public | l1_distance | halfvec, halfvec | double precision vector | public | l1_distance | sparsevec, sparsevec | double precision - vector | public | l1_distance | vector, vector | double precision + vector | public | l2_distance | vector, vector | double precision vector | public | l2_distance | halfvec, halfvec | double precision vector | public | l2_distance | sparsevec, sparsevec | double precision - vector | public | l2_distance | vector, vector | double precision vector | public | l2_norm | halfvec | double precision vector | public | l2_norm | sparsevec | double precision + vector | public | l2_normalize | vector | vector vector | public | l2_normalize | halfvec | halfvec vector | public | l2_normalize | sparsevec | sparsevec - vector | public | l2_normalize | vector | vector vector | public | sparsevec | sparsevec, integer, boolean | sparsevec vector | public | sparsevec_cmp | sparsevec, sparsevec | integer vector | public | sparsevec_eq | sparsevec, sparsevec | boolean @@ -5115,8 +5122,8 @@ order by vector | public | sparsevec_typmod_in | cstring[] | integer vector | public | subvector | halfvec, integer, integer | halfvec vector | public | subvector | vector, integer, integer | vector - vector | public | sum | halfvec | halfvec vector | public | sum | vector | vector + vector | public | sum | halfvec | halfvec vector | public | vector | vector, integer, boolean | vector vector | public | vector_accum | double precision[], vector | double precision[] vector | public | vector_add | vector, vector | vector @@ -5124,8 +5131,8 @@ order by vector | public | vector_cmp | vector, vector | integer vector | public | vector_combine | double precision[], double precision[] | double precision[] vector | public | vector_concat | vector, vector | vector - vector | public | vector_dims | halfvec | integer vector | public | vector_dims | vector | integer + vector | public | vector_dims | halfvec | integer vector | public | vector_eq | vector, vector | boolean vector | public | vector_ge | vector, vector | boolean vector | public | vector_gt | vector, vector | boolean @@ -5190,9 +5197,9 @@ order by xml2 | public | xpath_bool | text, text | boolean xml2 | public | xpath_list | text, text | text xml2 | public | xpath_list | text, text, text | text + xml2 | public | xpath_nodeset | text, text, text, text | text xml2 | public | xpath_nodeset | text, text | text xml2 | public | xpath_nodeset | text, text, text | text - xml2 | public | xpath_nodeset | text, text, text, text | text xml2 | public | xpath_number | text, text | real xml2 | public | xpath_string | text, text | text xml2 | public | xpath_table | text, text, text, text, text | SETOF record @@ -5372,59 +5379,70 @@ order by pg_stat_monitor | public | pg_stat_monitor | wal_bytes pg_stat_monitor | public | pg_stat_monitor | wal_fpi pg_stat_monitor | public | pg_stat_monitor | wal_records - pg_stat_statements | public | pg_stat_statements | blk_read_time - pg_stat_statements | public | pg_stat_statements | blk_write_time - pg_stat_statements | public | pg_stat_statements | calls - pg_stat_statements | public | pg_stat_statements | dbid - pg_stat_statements | public | pg_stat_statements | jit_emission_count - pg_stat_statements | public | pg_stat_statements | jit_emission_time - pg_stat_statements | public | pg_stat_statements | jit_functions - pg_stat_statements | public | pg_stat_statements | jit_generation_time - pg_stat_statements | public | pg_stat_statements | jit_inlining_count - pg_stat_statements | public | pg_stat_statements | jit_inlining_time - pg_stat_statements | public | pg_stat_statements | jit_optimization_count - pg_stat_statements | public | pg_stat_statements | jit_optimization_time - pg_stat_statements | public | pg_stat_statements | local_blks_dirtied - pg_stat_statements | public | pg_stat_statements | local_blks_hit - pg_stat_statements | public | pg_stat_statements | local_blks_read - pg_stat_statements | public | pg_stat_statements | local_blks_written - pg_stat_statements | public | pg_stat_statements | max_exec_time - pg_stat_statements | public | pg_stat_statements | max_plan_time - pg_stat_statements | public | pg_stat_statements | mean_exec_time - pg_stat_statements | public | pg_stat_statements | mean_plan_time - pg_stat_statements | public | pg_stat_statements | min_exec_time - pg_stat_statements | public | pg_stat_statements | min_plan_time - pg_stat_statements | public | pg_stat_statements | plans - pg_stat_statements | public | pg_stat_statements | query - pg_stat_statements | public | pg_stat_statements | queryid - pg_stat_statements | public | pg_stat_statements | rows - pg_stat_statements | public | pg_stat_statements | shared_blks_dirtied - pg_stat_statements | public | pg_stat_statements | shared_blks_hit - pg_stat_statements | public | pg_stat_statements | shared_blks_read - pg_stat_statements | public | pg_stat_statements | shared_blks_written - pg_stat_statements | public | pg_stat_statements | stddev_exec_time - pg_stat_statements | public | pg_stat_statements | stddev_plan_time - pg_stat_statements | public | pg_stat_statements | temp_blk_read_time - pg_stat_statements | public | pg_stat_statements | temp_blk_write_time - pg_stat_statements | public | pg_stat_statements | temp_blks_read - pg_stat_statements | public | pg_stat_statements | temp_blks_written - pg_stat_statements | public | pg_stat_statements | toplevel - pg_stat_statements | public | pg_stat_statements | total_exec_time - pg_stat_statements | public | pg_stat_statements | total_plan_time - pg_stat_statements | public | pg_stat_statements | userid - pg_stat_statements | public | pg_stat_statements | wal_bytes - pg_stat_statements | public | pg_stat_statements | wal_fpi - pg_stat_statements | public | pg_stat_statements | wal_records - pg_stat_statements | public | pg_stat_statements_info | dealloc - pg_stat_statements | public | pg_stat_statements_info | stats_reset + pg_stat_statements | extensions | pg_stat_statements | blk_read_time + pg_stat_statements | extensions | pg_stat_statements | blk_write_time + pg_stat_statements | extensions | pg_stat_statements | calls + pg_stat_statements | extensions | pg_stat_statements | dbid + pg_stat_statements | extensions | pg_stat_statements | jit_emission_count + pg_stat_statements | extensions | pg_stat_statements | jit_emission_time + pg_stat_statements | extensions | pg_stat_statements | jit_functions + pg_stat_statements | extensions | pg_stat_statements | jit_generation_time + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_count + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_time + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_count + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_time + pg_stat_statements | extensions | pg_stat_statements | local_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | local_blks_hit + pg_stat_statements | extensions | pg_stat_statements | local_blks_read + pg_stat_statements | extensions | pg_stat_statements | local_blks_written + pg_stat_statements | extensions | pg_stat_statements | max_exec_time + pg_stat_statements | extensions | pg_stat_statements | max_plan_time + pg_stat_statements | extensions | pg_stat_statements | mean_exec_time + pg_stat_statements | extensions | pg_stat_statements | mean_plan_time + pg_stat_statements | extensions | pg_stat_statements | min_exec_time + pg_stat_statements | extensions | pg_stat_statements | min_plan_time + pg_stat_statements | extensions | pg_stat_statements | plans + pg_stat_statements | extensions | pg_stat_statements | query + pg_stat_statements | extensions | pg_stat_statements | queryid + pg_stat_statements | extensions | pg_stat_statements | rows + pg_stat_statements | extensions | pg_stat_statements | shared_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | shared_blks_hit + pg_stat_statements | extensions | pg_stat_statements | shared_blks_read + pg_stat_statements | extensions | pg_stat_statements | shared_blks_written + pg_stat_statements | extensions | pg_stat_statements | stddev_exec_time + pg_stat_statements | extensions | pg_stat_statements | stddev_plan_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | temp_blks_read + pg_stat_statements | extensions | pg_stat_statements | temp_blks_written + pg_stat_statements | extensions | pg_stat_statements | toplevel + pg_stat_statements | extensions | pg_stat_statements | total_exec_time + pg_stat_statements | extensions | pg_stat_statements | total_plan_time + pg_stat_statements | extensions | pg_stat_statements | userid + pg_stat_statements | extensions | pg_stat_statements | wal_bytes + pg_stat_statements | extensions | pg_stat_statements | wal_fpi + pg_stat_statements | extensions | pg_stat_statements | wal_records + pg_stat_statements | extensions | pg_stat_statements_info | dealloc + pg_stat_statements | extensions | pg_stat_statements_info | stats_reset pg_tle | pgtle | feature_info | feature pg_tle | pgtle | feature_info | obj_identity pg_tle | pgtle | feature_info | proname pg_tle | pgtle | feature_info | schema_name + pgmq | pgmq | a_foo | archived_at + pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | message + pgmq | pgmq | a_foo | msg_id + pgmq | pgmq | a_foo | read_ct + pgmq | pgmq | a_foo | vt pgmq | pgmq | meta | created_at pgmq | pgmq | meta | is_partitioned pgmq | pgmq | meta | is_unlogged pgmq | pgmq | meta | queue_name + pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | message + pgmq | pgmq | q_foo | msg_id + pgmq | pgmq | q_foo | read_ct + pgmq | pgmq | q_foo | vt pgsodium | pgsodium | decrypted_key | associated_data pgsodium | pgsodium | decrypted_key | comment pgsodium | pgsodium | decrypted_key | created @@ -6318,5 +6336,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1086 rows) +(1097 rows) diff --git a/nix/tests/expected/pg_stat_monitor.out b/nix/tests/expected/z_15_pg_stat_monitor.out similarity index 100% rename from nix/tests/expected/pg_stat_monitor.out rename to nix/tests/expected/z_15_pg_stat_monitor.out diff --git a/nix/tests/expected/pgroonga.out b/nix/tests/expected/z_15_pgroonga.out similarity index 100% rename from nix/tests/expected/pgroonga.out rename to nix/tests/expected/z_15_pgroonga.out diff --git a/nix/tests/expected/pgvector.out b/nix/tests/expected/z_15_pgvector.out similarity index 100% rename from nix/tests/expected/pgvector.out rename to nix/tests/expected/z_15_pgvector.out diff --git a/nix/tests/expected/plv8.out b/nix/tests/expected/z_15_plv8.out similarity index 66% rename from nix/tests/expected/plv8.out rename to nix/tests/expected/z_15_plv8.out index f24c8583d..bf909f0a8 100644 --- a/nix/tests/expected/plv8.out +++ b/nix/tests/expected/z_15_plv8.out @@ -1,3 +1,9 @@ +/* +This test is excluded from the Postgres 17 suite because it does not ship +with the Supabase PG17 image +*/ +create extension if not exists plv8; +NOTICE: extension "plv8" already exists, skipping create schema v; -- create a function to perform some JavaScript operations create function v.multiply_numbers(a integer, b integer) diff --git a/nix/tests/expected/rum.out b/nix/tests/expected/z_15_rum.out similarity index 65% rename from nix/tests/expected/rum.out rename to nix/tests/expected/z_15_rum.out index ba8a40264..1296befa7 100644 --- a/nix/tests/expected/rum.out +++ b/nix/tests/expected/z_15_rum.out @@ -1,3 +1,6 @@ +/* +This extension is excluded from oriole-17 because it uses an unsupported index type +*/ create schema v; create table v.test_rum( t text, @@ -20,18 +23,18 @@ values create index rumidx on v.test_rum using rum (a rum_tsvector_ops); select t, - a <=> to_tsquery('english', 'beautiful | place') as rank + round(a <=> to_tsquery('english', 'beautiful | place')) as rank from v.test_rum where a @@ to_tsquery('english', 'beautiful | place') order by a <=> to_tsquery('english', 'beautiful | place'); - t | rank ----------------------------------+---------- - it looks like a beautiful place | 8.22467 - the situation is most beautiful | 16.44934 - it is a beautiful | 16.44934 + t | rank +---------------------------------+------ + it looks like a beautiful place | 8 + the situation is most beautiful | 16 + it is a beautiful | 16 (3 rows) drop schema v cascade; diff --git a/nix/tests/expected/timescale.out b/nix/tests/expected/z_15_timescale.out similarity index 87% rename from nix/tests/expected/timescale.out rename to nix/tests/expected/z_15_timescale.out index 0812954ec..d0c0f2fcb 100644 --- a/nix/tests/expected/timescale.out +++ b/nix/tests/expected/z_15_timescale.out @@ -1,3 +1,9 @@ +/* +This test is excluded from the Postgres 17 suite because it does not ship +with the Supabase PG17 image +*/ +create extension if not exists timescaledb; +NOTICE: extension "timescaledb" already exists, skipping -- Confirm we're running the apache version show timescaledb.license; timescaledb.license diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out new file mode 100644 index 000000000..d611dc0fb --- /dev/null +++ b/nix/tests/expected/z_17_ext_interface.out @@ -0,0 +1,5324 @@ +/* + +The purpose of this test is to monitor the SQL interface exposed +by Postgres extensions so we have to manually review/approve any difference +that emerge as versions change. + +*/ +/* + +List all extensions that are not enabled +If a new entry shows up in this list, that means a new extension has been +added and you should `create extension ...` to enable it in ./nix/tests/prime + +*/ +select + name +from + pg_available_extensions +where + installed_version is null +order by + name asc; + name +------------------------ + pg_cron + postgis_tiger_geocoder + tsm_system_time +(3 rows) + +/* + +Monitor relocatability and config of each extension +- lesson learned from pg_cron + +*/ +select + extname as extension_name, + extrelocatable as is_relocatable +from + pg_extension +order by + extname asc; + extension_name | is_relocatable +------------------------------+---------------- + address_standardizer | t + address_standardizer_data_us | t + amcheck | t + autoinc | t + bloom | t + btree_gin | t + btree_gist | t + citext | t + cube | t + dblink | t + dict_int | t + dict_xsyn | t + earthdistance | t + file_fdw | t + fuzzystrmatch | t + hstore | t + http | f + hypopg | t + index_advisor | t + insert_username | t + intagg | t + intarray | t + isn | t + lo | t + ltree | t + moddatetime | t + orioledb | t + pageinspect | t + pg_backtrace | t + pg_buffercache | t + pg_freespacemap | t + pg_graphql | f + pg_hashids | t + pg_jsonschema | f + pg_net | f + pg_prewarm | t + pg_repack | f + pg_stat_monitor | t + pg_stat_statements | t + pg_surgery | t + pg_tle | f + pg_trgm | t + pg_visibility | t + pg_walinspect | t + pgaudit | t + pgcrypto | t + pgjwt | f + pgmq | f + pgroonga | f + pgroonga_database | f + pgrouting | t + pgrowlocks | t + pgsodium | f + pgstattuple | t + pgtap | t + plpgsql | f + plpgsql_check | f + postgis | f + postgis_raster | f + postgis_sfcgal | t + postgis_topology | f + postgres_fdw | t + refint | t + rum | t + seg | t + sslinfo | t + supabase_vault | f + tablefunc | t + tcn | t + tsm_system_rows | t + unaccent | t + uuid-ossp | t + vector | t + wrappers | f + xml2 | f +(75 rows) + +/* + +Monitor extension public function interface + +*/ +select + e.extname as extension_name, + n.nspname as schema_name, + p.proname as function_name, + pg_catalog.pg_get_function_identity_arguments(p.oid) as argument_types, + pg_catalog.pg_get_function_result(p.oid) as return_type +from + pg_catalog.pg_proc p + join pg_catalog.pg_namespace n + on n.oid = p.pronamespace + join pg_catalog.pg_depend d + on d.objid = p.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid +where + d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') +order by + e.extname, + n.nspname, + p.proname, + pg_catalog.pg_get_function_identity_arguments(p.oid); + extension_name | schema_name | function_name | argument_types | return_type +----------------------+----------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record + address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr + address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr + amcheck | public | bt_index_check | index regclass | void + amcheck | public | bt_index_check | index regclass, heapallindexed boolean | void + amcheck | public | bt_index_check | index regclass, heapallindexed boolean, checkunique boolean | void + amcheck | public | bt_index_parent_check | index regclass | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean, checkunique boolean | void + amcheck | public | verify_heapam | relation regclass, on_error_stop boolean, check_toast boolean, skip text, startblock bigint, endblock bigint, OUT blkno bigint, OUT offnum integer, OUT attnum integer, OUT msg text | SETOF record + autoinc | public | autoinc | | trigger + bloom | public | blhandler | internal | index_am_handler + btree_gin | public | gin_btree_consistent | internal, smallint, anyelement, integer, internal, internal | boolean + btree_gin | public | gin_compare_prefix_anyenum | anyenum, anyenum, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bit | bit, bit, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bool | boolean, boolean, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bpchar | character, character, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bytea | bytea, bytea, smallint, internal | integer + btree_gin | public | gin_compare_prefix_char | "char", "char", smallint, internal | integer + btree_gin | public | gin_compare_prefix_cidr | cidr, cidr, smallint, internal | integer + btree_gin | public | gin_compare_prefix_date | date, date, smallint, internal | integer + btree_gin | public | gin_compare_prefix_float4 | real, real, smallint, internal | integer + btree_gin | public | gin_compare_prefix_float8 | double precision, double precision, smallint, internal | integer + btree_gin | public | gin_compare_prefix_inet | inet, inet, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int2 | smallint, smallint, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int4 | integer, integer, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int8 | bigint, bigint, smallint, internal | integer + btree_gin | public | gin_compare_prefix_interval | interval, interval, smallint, internal | integer + btree_gin | public | gin_compare_prefix_macaddr | macaddr, macaddr, smallint, internal | integer + btree_gin | public | gin_compare_prefix_macaddr8 | macaddr8, macaddr8, smallint, internal | integer + btree_gin | public | gin_compare_prefix_money | money, money, smallint, internal | integer + btree_gin | public | gin_compare_prefix_name | name, name, smallint, internal | integer + btree_gin | public | gin_compare_prefix_numeric | numeric, numeric, smallint, internal | integer + btree_gin | public | gin_compare_prefix_oid | oid, oid, smallint, internal | integer + btree_gin | public | gin_compare_prefix_text | text, text, smallint, internal | integer + btree_gin | public | gin_compare_prefix_time | time without time zone, time without time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timestamp | timestamp without time zone, timestamp without time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timestamptz | timestamp with time zone, timestamp with time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timetz | time with time zone, time with time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_uuid | uuid, uuid, smallint, internal | integer + btree_gin | public | gin_compare_prefix_varbit | bit varying, bit varying, smallint, internal | integer + btree_gin | public | gin_enum_cmp | anyenum, anyenum | integer + btree_gin | public | gin_extract_query_anyenum | anyenum, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bit | bit, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bool | boolean, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bpchar | character, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bytea | bytea, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_char | "char", internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_cidr | cidr, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_date | date, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_float4 | real, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_float8 | double precision, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_inet | inet, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int2 | smallint, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int4 | integer, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int8 | bigint, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_interval | interval, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_macaddr | macaddr, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_macaddr8 | macaddr8, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_money | money, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_name | name, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_numeric | numeric, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_oid | oid, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_text | text, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_time | time without time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timestamp | timestamp without time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timestamptz | timestamp with time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timetz | time with time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_uuid | uuid, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_varbit | bit varying, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_value_anyenum | anyenum, internal | internal + btree_gin | public | gin_extract_value_bit | bit, internal | internal + btree_gin | public | gin_extract_value_bool | boolean, internal | internal + btree_gin | public | gin_extract_value_bpchar | character, internal | internal + btree_gin | public | gin_extract_value_bytea | bytea, internal | internal + btree_gin | public | gin_extract_value_char | "char", internal | internal + btree_gin | public | gin_extract_value_cidr | cidr, internal | internal + btree_gin | public | gin_extract_value_date | date, internal | internal + btree_gin | public | gin_extract_value_float4 | real, internal | internal + btree_gin | public | gin_extract_value_float8 | double precision, internal | internal + btree_gin | public | gin_extract_value_inet | inet, internal | internal + btree_gin | public | gin_extract_value_int2 | smallint, internal | internal + btree_gin | public | gin_extract_value_int4 | integer, internal | internal + btree_gin | public | gin_extract_value_int8 | bigint, internal | internal + btree_gin | public | gin_extract_value_interval | interval, internal | internal + btree_gin | public | gin_extract_value_macaddr | macaddr, internal | internal + btree_gin | public | gin_extract_value_macaddr8 | macaddr8, internal | internal + btree_gin | public | gin_extract_value_money | money, internal | internal + btree_gin | public | gin_extract_value_name | name, internal | internal + btree_gin | public | gin_extract_value_numeric | numeric, internal | internal + btree_gin | public | gin_extract_value_oid | oid, internal | internal + btree_gin | public | gin_extract_value_text | text, internal | internal + btree_gin | public | gin_extract_value_time | time without time zone, internal | internal + btree_gin | public | gin_extract_value_timestamp | timestamp without time zone, internal | internal + btree_gin | public | gin_extract_value_timestamptz | timestamp with time zone, internal | internal + btree_gin | public | gin_extract_value_timetz | time with time zone, internal | internal + btree_gin | public | gin_extract_value_uuid | uuid, internal | internal + btree_gin | public | gin_extract_value_varbit | bit varying, internal | internal + btree_gin | public | gin_numeric_cmp | numeric, numeric | integer + btree_gist | public | cash_dist | money, money | money + btree_gist | public | date_dist | date, date | integer + btree_gist | public | float4_dist | real, real | real + btree_gist | public | float8_dist | double precision, double precision | double precision + btree_gist | public | gbt_bit_compress | internal | internal + btree_gist | public | gbt_bit_consistent | internal, bit, smallint, oid, internal | boolean + btree_gist | public | gbt_bit_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bit_picksplit | internal, internal | internal + btree_gist | public | gbt_bit_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_bit_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_bool_compress | internal | internal + btree_gist | public | gbt_bool_consistent | internal, boolean, smallint, oid, internal | boolean + btree_gist | public | gbt_bool_fetch | internal | internal + btree_gist | public | gbt_bool_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bool_picksplit | internal, internal | internal + btree_gist | public | gbt_bool_same | gbtreekey2, gbtreekey2, internal | internal + btree_gist | public | gbt_bool_union | internal, internal | gbtreekey2 + btree_gist | public | gbt_bpchar_compress | internal | internal + btree_gist | public | gbt_bpchar_consistent | internal, character, smallint, oid, internal | boolean + btree_gist | public | gbt_bytea_compress | internal | internal + btree_gist | public | gbt_bytea_consistent | internal, bytea, smallint, oid, internal | boolean + btree_gist | public | gbt_bytea_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bytea_picksplit | internal, internal | internal + btree_gist | public | gbt_bytea_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_bytea_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_cash_compress | internal | internal + btree_gist | public | gbt_cash_consistent | internal, money, smallint, oid, internal | boolean + btree_gist | public | gbt_cash_distance | internal, money, smallint, oid, internal | double precision + btree_gist | public | gbt_cash_fetch | internal | internal + btree_gist | public | gbt_cash_penalty | internal, internal, internal | internal + btree_gist | public | gbt_cash_picksplit | internal, internal | internal + btree_gist | public | gbt_cash_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_cash_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_date_compress | internal | internal + btree_gist | public | gbt_date_consistent | internal, date, smallint, oid, internal | boolean + btree_gist | public | gbt_date_distance | internal, date, smallint, oid, internal | double precision + btree_gist | public | gbt_date_fetch | internal | internal + btree_gist | public | gbt_date_penalty | internal, internal, internal | internal + btree_gist | public | gbt_date_picksplit | internal, internal | internal + btree_gist | public | gbt_date_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_date_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_decompress | internal | internal + btree_gist | public | gbt_enum_compress | internal | internal + btree_gist | public | gbt_enum_consistent | internal, anyenum, smallint, oid, internal | boolean + btree_gist | public | gbt_enum_fetch | internal | internal + btree_gist | public | gbt_enum_penalty | internal, internal, internal | internal + btree_gist | public | gbt_enum_picksplit | internal, internal | internal + btree_gist | public | gbt_enum_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_enum_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_float4_compress | internal | internal + btree_gist | public | gbt_float4_consistent | internal, real, smallint, oid, internal | boolean + btree_gist | public | gbt_float4_distance | internal, real, smallint, oid, internal | double precision + btree_gist | public | gbt_float4_fetch | internal | internal + btree_gist | public | gbt_float4_penalty | internal, internal, internal | internal + btree_gist | public | gbt_float4_picksplit | internal, internal | internal + btree_gist | public | gbt_float4_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_float4_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_float8_compress | internal | internal + btree_gist | public | gbt_float8_consistent | internal, double precision, smallint, oid, internal | boolean + btree_gist | public | gbt_float8_distance | internal, double precision, smallint, oid, internal | double precision + btree_gist | public | gbt_float8_fetch | internal | internal + btree_gist | public | gbt_float8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_float8_picksplit | internal, internal | internal + btree_gist | public | gbt_float8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_float8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_inet_compress | internal | internal + btree_gist | public | gbt_inet_consistent | internal, inet, smallint, oid, internal | boolean + btree_gist | public | gbt_inet_penalty | internal, internal, internal | internal + btree_gist | public | gbt_inet_picksplit | internal, internal | internal + btree_gist | public | gbt_inet_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_inet_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_int2_compress | internal | internal + btree_gist | public | gbt_int2_consistent | internal, smallint, smallint, oid, internal | boolean + btree_gist | public | gbt_int2_distance | internal, smallint, smallint, oid, internal | double precision + btree_gist | public | gbt_int2_fetch | internal | internal + btree_gist | public | gbt_int2_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int2_picksplit | internal, internal | internal + btree_gist | public | gbt_int2_same | gbtreekey4, gbtreekey4, internal | internal + btree_gist | public | gbt_int2_union | internal, internal | gbtreekey4 + btree_gist | public | gbt_int4_compress | internal | internal + btree_gist | public | gbt_int4_consistent | internal, integer, smallint, oid, internal | boolean + btree_gist | public | gbt_int4_distance | internal, integer, smallint, oid, internal | double precision + btree_gist | public | gbt_int4_fetch | internal | internal + btree_gist | public | gbt_int4_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int4_picksplit | internal, internal | internal + btree_gist | public | gbt_int4_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_int4_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_int8_compress | internal | internal + btree_gist | public | gbt_int8_consistent | internal, bigint, smallint, oid, internal | boolean + btree_gist | public | gbt_int8_distance | internal, bigint, smallint, oid, internal | double precision + btree_gist | public | gbt_int8_fetch | internal | internal + btree_gist | public | gbt_int8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int8_picksplit | internal, internal | internal + btree_gist | public | gbt_int8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_int8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_intv_compress | internal | internal + btree_gist | public | gbt_intv_consistent | internal, interval, smallint, oid, internal | boolean + btree_gist | public | gbt_intv_decompress | internal | internal + btree_gist | public | gbt_intv_distance | internal, interval, smallint, oid, internal | double precision + btree_gist | public | gbt_intv_fetch | internal | internal + btree_gist | public | gbt_intv_penalty | internal, internal, internal | internal + btree_gist | public | gbt_intv_picksplit | internal, internal | internal + btree_gist | public | gbt_intv_same | gbtreekey32, gbtreekey32, internal | internal + btree_gist | public | gbt_intv_union | internal, internal | gbtreekey32 + btree_gist | public | gbt_macad8_compress | internal | internal + btree_gist | public | gbt_macad8_consistent | internal, macaddr8, smallint, oid, internal | boolean + btree_gist | public | gbt_macad8_fetch | internal | internal + btree_gist | public | gbt_macad8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_macad8_picksplit | internal, internal | internal + btree_gist | public | gbt_macad8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_macad8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_macad_compress | internal | internal + btree_gist | public | gbt_macad_consistent | internal, macaddr, smallint, oid, internal | boolean + btree_gist | public | gbt_macad_fetch | internal | internal + btree_gist | public | gbt_macad_penalty | internal, internal, internal | internal + btree_gist | public | gbt_macad_picksplit | internal, internal | internal + btree_gist | public | gbt_macad_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_macad_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_numeric_compress | internal | internal + btree_gist | public | gbt_numeric_consistent | internal, numeric, smallint, oid, internal | boolean + btree_gist | public | gbt_numeric_penalty | internal, internal, internal | internal + btree_gist | public | gbt_numeric_picksplit | internal, internal | internal + btree_gist | public | gbt_numeric_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_numeric_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_oid_compress | internal | internal + btree_gist | public | gbt_oid_consistent | internal, oid, smallint, oid, internal | boolean + btree_gist | public | gbt_oid_distance | internal, oid, smallint, oid, internal | double precision + btree_gist | public | gbt_oid_fetch | internal | internal + btree_gist | public | gbt_oid_penalty | internal, internal, internal | internal + btree_gist | public | gbt_oid_picksplit | internal, internal | internal + btree_gist | public | gbt_oid_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_oid_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_text_compress | internal | internal + btree_gist | public | gbt_text_consistent | internal, text, smallint, oid, internal | boolean + btree_gist | public | gbt_text_penalty | internal, internal, internal | internal + btree_gist | public | gbt_text_picksplit | internal, internal | internal + btree_gist | public | gbt_text_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_text_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_time_compress | internal | internal + btree_gist | public | gbt_time_consistent | internal, time without time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_time_distance | internal, time without time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_time_fetch | internal | internal + btree_gist | public | gbt_time_penalty | internal, internal, internal | internal + btree_gist | public | gbt_time_picksplit | internal, internal | internal + btree_gist | public | gbt_time_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_time_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_timetz_compress | internal | internal + btree_gist | public | gbt_timetz_consistent | internal, time with time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_ts_compress | internal | internal + btree_gist | public | gbt_ts_consistent | internal, timestamp without time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_ts_distance | internal, timestamp without time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_ts_fetch | internal | internal + btree_gist | public | gbt_ts_penalty | internal, internal, internal | internal + btree_gist | public | gbt_ts_picksplit | internal, internal | internal + btree_gist | public | gbt_ts_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_ts_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_tstz_compress | internal | internal + btree_gist | public | gbt_tstz_consistent | internal, timestamp with time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_tstz_distance | internal, timestamp with time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_uuid_compress | internal | internal + btree_gist | public | gbt_uuid_consistent | internal, uuid, smallint, oid, internal | boolean + btree_gist | public | gbt_uuid_fetch | internal | internal + btree_gist | public | gbt_uuid_penalty | internal, internal, internal | internal + btree_gist | public | gbt_uuid_picksplit | internal, internal | internal + btree_gist | public | gbt_uuid_same | gbtreekey32, gbtreekey32, internal | internal + btree_gist | public | gbt_uuid_union | internal, internal | gbtreekey32 + btree_gist | public | gbt_var_decompress | internal | internal + btree_gist | public | gbt_var_fetch | internal | internal + btree_gist | public | gbtreekey16_in | cstring | gbtreekey16 + btree_gist | public | gbtreekey16_out | gbtreekey16 | cstring + btree_gist | public | gbtreekey2_in | cstring | gbtreekey2 + btree_gist | public | gbtreekey2_out | gbtreekey2 | cstring + btree_gist | public | gbtreekey32_in | cstring | gbtreekey32 + btree_gist | public | gbtreekey32_out | gbtreekey32 | cstring + btree_gist | public | gbtreekey4_in | cstring | gbtreekey4 + btree_gist | public | gbtreekey4_out | gbtreekey4 | cstring + btree_gist | public | gbtreekey8_in | cstring | gbtreekey8 + btree_gist | public | gbtreekey8_out | gbtreekey8 | cstring + btree_gist | public | gbtreekey_var_in | cstring | gbtreekey_var + btree_gist | public | gbtreekey_var_out | gbtreekey_var | cstring + btree_gist | public | int2_dist | smallint, smallint | smallint + btree_gist | public | int4_dist | integer, integer | integer + btree_gist | public | int8_dist | bigint, bigint | bigint + btree_gist | public | interval_dist | interval, interval | interval + btree_gist | public | oid_dist | oid, oid | oid + btree_gist | public | time_dist | time without time zone, time without time zone | interval + btree_gist | public | ts_dist | timestamp without time zone, timestamp without time zone | interval + btree_gist | public | tstz_dist | timestamp with time zone, timestamp with time zone | interval + citext | public | citext | boolean | citext + citext | public | citext | character | citext + citext | public | citext | inet | citext + citext | public | citext_cmp | citext, citext | integer + citext | public | citext_eq | citext, citext | boolean + citext | public | citext_ge | citext, citext | boolean + citext | public | citext_gt | citext, citext | boolean + citext | public | citext_hash | citext | integer + citext | public | citext_hash_extended | citext, bigint | bigint + citext | public | citext_larger | citext, citext | citext + citext | public | citext_le | citext, citext | boolean + citext | public | citext_lt | citext, citext | boolean + citext | public | citext_ne | citext, citext | boolean + citext | public | citext_pattern_cmp | citext, citext | integer + citext | public | citext_pattern_ge | citext, citext | boolean + citext | public | citext_pattern_gt | citext, citext | boolean + citext | public | citext_pattern_le | citext, citext | boolean + citext | public | citext_pattern_lt | citext, citext | boolean + citext | public | citext_smaller | citext, citext | citext + citext | public | citextin | cstring | citext + citext | public | citextout | citext | cstring + citext | public | citextrecv | internal | citext + citext | public | citextsend | citext | bytea + citext | public | max | citext | citext + citext | public | min | citext | citext + citext | public | regexp_match | citext, citext | text[] + citext | public | regexp_match | citext, citext, text | text[] + citext | public | regexp_matches | citext, citext | SETOF text[] + citext | public | regexp_matches | citext, citext, text | SETOF text[] + citext | public | regexp_replace | citext, citext, text | text + citext | public | regexp_replace | citext, citext, text, text | text + citext | public | regexp_split_to_array | citext, citext | text[] + citext | public | regexp_split_to_array | citext, citext, text | text[] + citext | public | regexp_split_to_table | citext, citext | SETOF text + citext | public | regexp_split_to_table | citext, citext, text | SETOF text + citext | public | replace | citext, citext, citext | text + citext | public | split_part | citext, citext, integer | text + citext | public | strpos | citext, citext | integer + citext | public | texticlike | citext, citext | boolean + citext | public | texticlike | citext, text | boolean + citext | public | texticnlike | citext, citext | boolean + citext | public | texticnlike | citext, text | boolean + citext | public | texticregexeq | citext, citext | boolean + citext | public | texticregexeq | citext, text | boolean + citext | public | texticregexne | citext, citext | boolean + citext | public | texticregexne | citext, text | boolean + citext | public | translate | citext, citext, text | text + cube | public | cube | cube, double precision | cube + cube | public | cube | cube, double precision, double precision | cube + cube | public | cube | double precision | cube + cube | public | cube | double precision, double precision | cube + cube | public | cube | double precision[] | cube + cube | public | cube | double precision[], double precision[] | cube + cube | public | cube_cmp | cube, cube | integer + cube | public | cube_contained | cube, cube | boolean + cube | public | cube_contains | cube, cube | boolean + cube | public | cube_coord | cube, integer | double precision + cube | public | cube_coord_llur | cube, integer | double precision + cube | public | cube_dim | cube | integer + cube | public | cube_distance | cube, cube | double precision + cube | public | cube_enlarge | cube, double precision, integer | cube + cube | public | cube_eq | cube, cube | boolean + cube | public | cube_ge | cube, cube | boolean + cube | public | cube_gt | cube, cube | boolean + cube | public | cube_in | cstring | cube + cube | public | cube_inter | cube, cube | cube + cube | public | cube_is_point | cube | boolean + cube | public | cube_le | cube, cube | boolean + cube | public | cube_ll_coord | cube, integer | double precision + cube | public | cube_lt | cube, cube | boolean + cube | public | cube_ne | cube, cube | boolean + cube | public | cube_out | cube | cstring + cube | public | cube_overlap | cube, cube | boolean + cube | public | cube_recv | internal | cube + cube | public | cube_send | cube | bytea + cube | public | cube_size | cube | double precision + cube | public | cube_subset | cube, integer[] | cube + cube | public | cube_union | cube, cube | cube + cube | public | cube_ur_coord | cube, integer | double precision + cube | public | distance_chebyshev | cube, cube | double precision + cube | public | distance_taxicab | cube, cube | double precision + cube | public | g_cube_consistent | internal, cube, smallint, oid, internal | boolean + cube | public | g_cube_distance | internal, cube, smallint, oid, internal | double precision + cube | public | g_cube_penalty | internal, internal, internal | internal + cube | public | g_cube_picksplit | internal, internal | internal + cube | public | g_cube_same | cube, cube, internal | internal + cube | public | g_cube_union | internal, internal | cube + dblink | public | dblink | text | SETOF record + dblink | public | dblink | text, boolean | SETOF record + dblink | public | dblink | text, text | SETOF record + dblink | public | dblink | text, text, boolean | SETOF record + dblink | public | dblink_build_sql_delete | text, int2vector, integer, text[] | text + dblink | public | dblink_build_sql_insert | text, int2vector, integer, text[], text[] | text + dblink | public | dblink_build_sql_update | text, int2vector, integer, text[], text[] | text + dblink | public | dblink_cancel_query | text | text + dblink | public | dblink_close | text | text + dblink | public | dblink_close | text, boolean | text + dblink | public | dblink_close | text, text | text + dblink | public | dblink_close | text, text, boolean | text + dblink | public | dblink_connect | text | text + dblink | public | dblink_connect | text, text | text + dblink | public | dblink_connect_u | text | text + dblink | public | dblink_connect_u | text, text | text + dblink | public | dblink_current_query | | text + dblink | public | dblink_disconnect | | text + dblink | public | dblink_disconnect | text | text + dblink | public | dblink_error_message | text | text + dblink | public | dblink_exec | text | text + dblink | public | dblink_exec | text, boolean | text + dblink | public | dblink_exec | text, text | text + dblink | public | dblink_exec | text, text, boolean | text + dblink | public | dblink_fdw_validator | options text[], catalog oid | void + dblink | public | dblink_fetch | text, integer | SETOF record + dblink | public | dblink_fetch | text, integer, boolean | SETOF record + dblink | public | dblink_fetch | text, text, integer | SETOF record + dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record + dblink | public | dblink_get_connections | | text[] + dblink | public | dblink_get_notify | conname text, OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record + dblink | public | dblink_get_notify | OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record + dblink | public | dblink_get_pkey | text | SETOF dblink_pkey_results + dblink | public | dblink_get_result | text | SETOF record + dblink | public | dblink_get_result | text, boolean | SETOF record + dblink | public | dblink_is_busy | text | integer + dblink | public | dblink_open | text, text | text + dblink | public | dblink_open | text, text, boolean | text + dblink | public | dblink_open | text, text, text | text + dblink | public | dblink_open | text, text, text, boolean | text + dblink | public | dblink_send_query | text, text | integer + dict_int | public | dintdict_init | internal | internal + dict_int | public | dintdict_lexize | internal, internal, internal, internal | internal + dict_xsyn | public | dxsyn_init | internal | internal + dict_xsyn | public | dxsyn_lexize | internal, internal, internal, internal | internal + earthdistance | public | earth | | double precision + earthdistance | public | earth_box | earth, double precision | cube + earthdistance | public | earth_distance | earth, earth | double precision + earthdistance | public | gc_to_sec | double precision | double precision + earthdistance | public | geo_distance | point, point | double precision + earthdistance | public | latitude | earth | double precision + earthdistance | public | ll_to_earth | double precision, double precision | earth + earthdistance | public | longitude | earth | double precision + earthdistance | public | sec_to_gc | double precision | double precision + file_fdw | public | file_fdw_handler | | fdw_handler + file_fdw | public | file_fdw_validator | text[], oid | void + fuzzystrmatch | public | difference | text, text | integer + fuzzystrmatch | public | dmetaphone | text | text + fuzzystrmatch | public | dmetaphone_alt | text | text + fuzzystrmatch | public | levenshtein | text, text | integer + fuzzystrmatch | public | levenshtein | text, text, integer, integer, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer, integer, integer, integer | integer + fuzzystrmatch | public | metaphone | text, integer | text + fuzzystrmatch | public | soundex | text | text + fuzzystrmatch | public | text_soundex | text | text + hstore | public | akeys | hstore | text[] + hstore | public | avals | hstore | text[] + hstore | public | defined | hstore, text | boolean + hstore | public | delete | hstore, hstore | hstore + hstore | public | delete | hstore, text | hstore + hstore | public | delete | hstore, text[] | hstore + hstore | public | each | hs hstore, OUT key text, OUT value text | SETOF record + hstore | public | exist | hstore, text | boolean + hstore | public | exists_all | hstore, text[] | boolean + hstore | public | exists_any | hstore, text[] | boolean + hstore | public | fetchval | hstore, text | text + hstore | public | ghstore_compress | internal | internal + hstore | public | ghstore_consistent | internal, hstore, smallint, oid, internal | boolean + hstore | public | ghstore_decompress | internal | internal + hstore | public | ghstore_in | cstring | ghstore + hstore | public | ghstore_options | internal | void + hstore | public | ghstore_out | ghstore | cstring + hstore | public | ghstore_penalty | internal, internal, internal | internal + hstore | public | ghstore_picksplit | internal, internal | internal + hstore | public | ghstore_same | ghstore, ghstore, internal | internal + hstore | public | ghstore_union | internal, internal | ghstore + hstore | public | gin_consistent_hstore | internal, smallint, hstore, integer, internal, internal | boolean + hstore | public | gin_extract_hstore | hstore, internal | internal + hstore | public | gin_extract_hstore_query | hstore, internal, smallint, internal, internal | internal + hstore | public | hs_concat | hstore, hstore | hstore + hstore | public | hs_contained | hstore, hstore | boolean + hstore | public | hs_contains | hstore, hstore | boolean + hstore | public | hstore | record | hstore + hstore | public | hstore | text, text | hstore + hstore | public | hstore | text[] | hstore + hstore | public | hstore | text[], text[] | hstore + hstore | public | hstore_cmp | hstore, hstore | integer + hstore | public | hstore_eq | hstore, hstore | boolean + hstore | public | hstore_ge | hstore, hstore | boolean + hstore | public | hstore_gt | hstore, hstore | boolean + hstore | public | hstore_hash | hstore | integer + hstore | public | hstore_hash_extended | hstore, bigint | bigint + hstore | public | hstore_in | cstring | hstore + hstore | public | hstore_le | hstore, hstore | boolean + hstore | public | hstore_lt | hstore, hstore | boolean + hstore | public | hstore_ne | hstore, hstore | boolean + hstore | public | hstore_out | hstore | cstring + hstore | public | hstore_recv | internal | hstore + hstore | public | hstore_send | hstore | bytea + hstore | public | hstore_subscript_handler | internal | internal + hstore | public | hstore_to_array | hstore | text[] + hstore | public | hstore_to_json | hstore | json + hstore | public | hstore_to_json_loose | hstore | json + hstore | public | hstore_to_jsonb | hstore | jsonb + hstore | public | hstore_to_jsonb_loose | hstore | jsonb + hstore | public | hstore_to_matrix | hstore | text[] + hstore | public | hstore_version_diag | hstore | integer + hstore | public | isdefined | hstore, text | boolean + hstore | public | isexists | hstore, text | boolean + hstore | public | populate_record | anyelement, hstore | anyelement + hstore | public | skeys | hstore | SETOF text + hstore | public | slice | hstore, text[] | hstore + hstore | public | slice_array | hstore, text[] | text[] + hstore | public | svals | hstore | SETOF text + hstore | public | tconvert | text, text | hstore + http | public | bytea_to_text | data bytea | text + http | public | http | request http_request | http_response + http | public | http_delete | uri character varying | http_response + http | public | http_delete | uri character varying, content character varying, content_type character varying | http_response + http | public | http_get | uri character varying | http_response + http | public | http_get | uri character varying, data jsonb | http_response + http | public | http_head | uri character varying | http_response + http | public | http_header | field character varying, value character varying | http_header + http | public | http_list_curlopt | | TABLE(curlopt text, value text) + http | public | http_patch | uri character varying, content character varying, content_type character varying | http_response + http | public | http_post | uri character varying, content character varying, content_type character varying | http_response + http | public | http_post | uri character varying, data jsonb | http_response + http | public | http_put | uri character varying, content character varying, content_type character varying | http_response + http | public | http_reset_curlopt | | boolean + http | public | http_set_curlopt | curlopt character varying, value character varying | boolean + http | public | text_to_bytea | data text | bytea + http | public | urlencode | data jsonb | text + http | public | urlencode | string bytea | text + http | public | urlencode | string character varying | text + hypopg | public | hypopg | OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid | SETOF record + hypopg | public | hypopg_create_index | sql_order text, OUT indexrelid oid, OUT indexname text | SETOF record + hypopg | public | hypopg_drop_index | indexid oid | boolean + hypopg | public | hypopg_get_indexdef | indexid oid | text + hypopg | public | hypopg_hidden_indexes | | TABLE(indexid oid) + hypopg | public | hypopg_hide_index | indexid oid | boolean + hypopg | public | hypopg_relation_size | indexid oid | bigint + hypopg | public | hypopg_reset | | void + hypopg | public | hypopg_reset_index | | void + hypopg | public | hypopg_unhide_all_indexes | | void + hypopg | public | hypopg_unhide_index | indexid oid | boolean + index_advisor | public | index_advisor | query text | TABLE(startup_cost_before jsonb, startup_cost_after jsonb, total_cost_before jsonb, total_cost_after jsonb, index_statements text[], errors text[]) + insert_username | public | insert_username | | trigger + intagg | public | int_agg_final_array | internal | integer[] + intagg | public | int_agg_state | internal, integer | internal + intagg | public | int_array_aggregate | integer | integer[] + intagg | public | int_array_enum | integer[] | SETOF integer + intarray | public | _int_contained | integer[], integer[] | boolean + intarray | public | _int_contained_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_contained_sel | internal, oid, internal, integer | double precision + intarray | public | _int_contains | integer[], integer[] | boolean + intarray | public | _int_contains_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_contains_sel | internal, oid, internal, integer | double precision + intarray | public | _int_different | integer[], integer[] | boolean + intarray | public | _int_inter | integer[], integer[] | integer[] + intarray | public | _int_matchsel | internal, oid, internal, integer | double precision + intarray | public | _int_overlap | integer[], integer[] | boolean + intarray | public | _int_overlap_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_overlap_sel | internal, oid, internal, integer | double precision + intarray | public | _int_same | integer[], integer[] | boolean + intarray | public | _int_union | integer[], integer[] | integer[] + intarray | public | _intbig_in | cstring | intbig_gkey + intarray | public | _intbig_out | intbig_gkey | cstring + intarray | public | boolop | integer[], query_int | boolean + intarray | public | bqarr_in | cstring | query_int + intarray | public | bqarr_out | query_int | cstring + intarray | public | g_int_compress | internal | internal + intarray | public | g_int_consistent | internal, integer[], smallint, oid, internal | boolean + intarray | public | g_int_decompress | internal | internal + intarray | public | g_int_options | internal | void + intarray | public | g_int_penalty | internal, internal, internal | internal + intarray | public | g_int_picksplit | internal, internal | internal + intarray | public | g_int_same | integer[], integer[], internal | internal + intarray | public | g_int_union | internal, internal | integer[] + intarray | public | g_intbig_compress | internal | internal + intarray | public | g_intbig_consistent | internal, integer[], smallint, oid, internal | boolean + intarray | public | g_intbig_decompress | internal | internal + intarray | public | g_intbig_options | internal | void + intarray | public | g_intbig_penalty | internal, internal, internal | internal + intarray | public | g_intbig_picksplit | internal, internal | internal + intarray | public | g_intbig_same | intbig_gkey, intbig_gkey, internal | internal + intarray | public | g_intbig_union | internal, internal | intbig_gkey + intarray | public | ginint4_consistent | internal, smallint, integer[], integer, internal, internal, internal, internal | boolean + intarray | public | ginint4_queryextract | integer[], internal, smallint, internal, internal, internal, internal | internal + intarray | public | icount | integer[] | integer + intarray | public | idx | integer[], integer | integer + intarray | public | intarray_del_elem | integer[], integer | integer[] + intarray | public | intarray_push_array | integer[], integer[] | integer[] + intarray | public | intarray_push_elem | integer[], integer | integer[] + intarray | public | intset | integer | integer[] + intarray | public | intset_subtract | integer[], integer[] | integer[] + intarray | public | intset_union_elem | integer[], integer | integer[] + intarray | public | querytree | query_int | text + intarray | public | rboolop | query_int, integer[] | boolean + intarray | public | sort | integer[] | integer[] + intarray | public | sort | integer[], text | integer[] + intarray | public | sort_asc | integer[] | integer[] + intarray | public | sort_desc | integer[] | integer[] + intarray | public | subarray | integer[], integer | integer[] + intarray | public | subarray | integer[], integer, integer | integer[] + intarray | public | uniq | integer[] | integer[] + isn | public | btean13cmp | ean13, ean13 | integer + isn | public | btean13cmp | ean13, isbn | integer + isn | public | btean13cmp | ean13, isbn13 | integer + isn | public | btean13cmp | ean13, ismn | integer + isn | public | btean13cmp | ean13, ismn13 | integer + isn | public | btean13cmp | ean13, issn | integer + isn | public | btean13cmp | ean13, issn13 | integer + isn | public | btean13cmp | ean13, upc | integer + isn | public | btisbn13cmp | isbn13, ean13 | integer + isn | public | btisbn13cmp | isbn13, isbn | integer + isn | public | btisbn13cmp | isbn13, isbn13 | integer + isn | public | btisbncmp | isbn, ean13 | integer + isn | public | btisbncmp | isbn, isbn | integer + isn | public | btisbncmp | isbn, isbn13 | integer + isn | public | btismn13cmp | ismn13, ean13 | integer + isn | public | btismn13cmp | ismn13, ismn | integer + isn | public | btismn13cmp | ismn13, ismn13 | integer + isn | public | btismncmp | ismn, ean13 | integer + isn | public | btismncmp | ismn, ismn | integer + isn | public | btismncmp | ismn, ismn13 | integer + isn | public | btissn13cmp | issn13, ean13 | integer + isn | public | btissn13cmp | issn13, issn | integer + isn | public | btissn13cmp | issn13, issn13 | integer + isn | public | btissncmp | issn, ean13 | integer + isn | public | btissncmp | issn, issn | integer + isn | public | btissncmp | issn, issn13 | integer + isn | public | btupccmp | upc, ean13 | integer + isn | public | btupccmp | upc, upc | integer + isn | public | ean13_in | cstring | ean13 + isn | public | ean13_out | ean13 | cstring + isn | public | ean13_out | isbn13 | cstring + isn | public | ean13_out | ismn13 | cstring + isn | public | ean13_out | issn13 | cstring + isn | public | hashean13 | ean13 | integer + isn | public | hashisbn | isbn | integer + isn | public | hashisbn13 | isbn13 | integer + isn | public | hashismn | ismn | integer + isn | public | hashismn13 | ismn13 | integer + isn | public | hashissn | issn | integer + isn | public | hashissn13 | issn13 | integer + isn | public | hashupc | upc | integer + isn | public | is_valid | ean13 | boolean + isn | public | is_valid | isbn | boolean + isn | public | is_valid | isbn13 | boolean + isn | public | is_valid | ismn | boolean + isn | public | is_valid | ismn13 | boolean + isn | public | is_valid | issn | boolean + isn | public | is_valid | issn13 | boolean + isn | public | is_valid | upc | boolean + isn | public | isbn | ean13 | isbn + isn | public | isbn13 | ean13 | isbn13 + isn | public | isbn13_in | cstring | isbn13 + isn | public | isbn_in | cstring | isbn + isn | public | ismn | ean13 | ismn + isn | public | ismn13 | ean13 | ismn13 + isn | public | ismn13_in | cstring | ismn13 + isn | public | ismn_in | cstring | ismn + isn | public | isn_out | isbn | cstring + isn | public | isn_out | ismn | cstring + isn | public | isn_out | issn | cstring + isn | public | isn_out | upc | cstring + isn | public | isn_weak | | boolean + isn | public | isn_weak | boolean | boolean + isn | public | isneq | ean13, ean13 | boolean + isn | public | isneq | ean13, isbn | boolean + isn | public | isneq | ean13, isbn13 | boolean + isn | public | isneq | ean13, ismn | boolean + isn | public | isneq | ean13, ismn13 | boolean + isn | public | isneq | ean13, issn | boolean + isn | public | isneq | ean13, issn13 | boolean + isn | public | isneq | ean13, upc | boolean + isn | public | isneq | isbn, ean13 | boolean + isn | public | isneq | isbn, isbn | boolean + isn | public | isneq | isbn, isbn13 | boolean + isn | public | isneq | isbn13, ean13 | boolean + isn | public | isneq | isbn13, isbn | boolean + isn | public | isneq | isbn13, isbn13 | boolean + isn | public | isneq | ismn, ean13 | boolean + isn | public | isneq | ismn, ismn | boolean + isn | public | isneq | ismn, ismn13 | boolean + isn | public | isneq | ismn13, ean13 | boolean + isn | public | isneq | ismn13, ismn | boolean + isn | public | isneq | ismn13, ismn13 | boolean + isn | public | isneq | issn, ean13 | boolean + isn | public | isneq | issn, issn | boolean + isn | public | isneq | issn, issn13 | boolean + isn | public | isneq | issn13, ean13 | boolean + isn | public | isneq | issn13, issn | boolean + isn | public | isneq | issn13, issn13 | boolean + isn | public | isneq | upc, ean13 | boolean + isn | public | isneq | upc, upc | boolean + isn | public | isnge | ean13, ean13 | boolean + isn | public | isnge | ean13, isbn | boolean + isn | public | isnge | ean13, isbn13 | boolean + isn | public | isnge | ean13, ismn | boolean + isn | public | isnge | ean13, ismn13 | boolean + isn | public | isnge | ean13, issn | boolean + isn | public | isnge | ean13, issn13 | boolean + isn | public | isnge | ean13, upc | boolean + isn | public | isnge | isbn, ean13 | boolean + isn | public | isnge | isbn, isbn | boolean + isn | public | isnge | isbn, isbn13 | boolean + isn | public | isnge | isbn13, ean13 | boolean + isn | public | isnge | isbn13, isbn | boolean + isn | public | isnge | isbn13, isbn13 | boolean + isn | public | isnge | ismn, ean13 | boolean + isn | public | isnge | ismn, ismn | boolean + isn | public | isnge | ismn, ismn13 | boolean + isn | public | isnge | ismn13, ean13 | boolean + isn | public | isnge | ismn13, ismn | boolean + isn | public | isnge | ismn13, ismn13 | boolean + isn | public | isnge | issn, ean13 | boolean + isn | public | isnge | issn, issn | boolean + isn | public | isnge | issn, issn13 | boolean + isn | public | isnge | issn13, ean13 | boolean + isn | public | isnge | issn13, issn | boolean + isn | public | isnge | issn13, issn13 | boolean + isn | public | isnge | upc, ean13 | boolean + isn | public | isnge | upc, upc | boolean + isn | public | isngt | ean13, ean13 | boolean + isn | public | isngt | ean13, isbn | boolean + isn | public | isngt | ean13, isbn13 | boolean + isn | public | isngt | ean13, ismn | boolean + isn | public | isngt | ean13, ismn13 | boolean + isn | public | isngt | ean13, issn | boolean + isn | public | isngt | ean13, issn13 | boolean + isn | public | isngt | ean13, upc | boolean + isn | public | isngt | isbn, ean13 | boolean + isn | public | isngt | isbn, isbn | boolean + isn | public | isngt | isbn, isbn13 | boolean + isn | public | isngt | isbn13, ean13 | boolean + isn | public | isngt | isbn13, isbn | boolean + isn | public | isngt | isbn13, isbn13 | boolean + isn | public | isngt | ismn, ean13 | boolean + isn | public | isngt | ismn, ismn | boolean + isn | public | isngt | ismn, ismn13 | boolean + isn | public | isngt | ismn13, ean13 | boolean + isn | public | isngt | ismn13, ismn | boolean + isn | public | isngt | ismn13, ismn13 | boolean + isn | public | isngt | issn, ean13 | boolean + isn | public | isngt | issn, issn | boolean + isn | public | isngt | issn, issn13 | boolean + isn | public | isngt | issn13, ean13 | boolean + isn | public | isngt | issn13, issn | boolean + isn | public | isngt | issn13, issn13 | boolean + isn | public | isngt | upc, ean13 | boolean + isn | public | isngt | upc, upc | boolean + isn | public | isnle | ean13, ean13 | boolean + isn | public | isnle | ean13, isbn | boolean + isn | public | isnle | ean13, isbn13 | boolean + isn | public | isnle | ean13, ismn | boolean + isn | public | isnle | ean13, ismn13 | boolean + isn | public | isnle | ean13, issn | boolean + isn | public | isnle | ean13, issn13 | boolean + isn | public | isnle | ean13, upc | boolean + isn | public | isnle | isbn, ean13 | boolean + isn | public | isnle | isbn, isbn | boolean + isn | public | isnle | isbn, isbn13 | boolean + isn | public | isnle | isbn13, ean13 | boolean + isn | public | isnle | isbn13, isbn | boolean + isn | public | isnle | isbn13, isbn13 | boolean + isn | public | isnle | ismn, ean13 | boolean + isn | public | isnle | ismn, ismn | boolean + isn | public | isnle | ismn, ismn13 | boolean + isn | public | isnle | ismn13, ean13 | boolean + isn | public | isnle | ismn13, ismn | boolean + isn | public | isnle | ismn13, ismn13 | boolean + isn | public | isnle | issn, ean13 | boolean + isn | public | isnle | issn, issn | boolean + isn | public | isnle | issn, issn13 | boolean + isn | public | isnle | issn13, ean13 | boolean + isn | public | isnle | issn13, issn | boolean + isn | public | isnle | issn13, issn13 | boolean + isn | public | isnle | upc, ean13 | boolean + isn | public | isnle | upc, upc | boolean + isn | public | isnlt | ean13, ean13 | boolean + isn | public | isnlt | ean13, isbn | boolean + isn | public | isnlt | ean13, isbn13 | boolean + isn | public | isnlt | ean13, ismn | boolean + isn | public | isnlt | ean13, ismn13 | boolean + isn | public | isnlt | ean13, issn | boolean + isn | public | isnlt | ean13, issn13 | boolean + isn | public | isnlt | ean13, upc | boolean + isn | public | isnlt | isbn, ean13 | boolean + isn | public | isnlt | isbn, isbn | boolean + isn | public | isnlt | isbn, isbn13 | boolean + isn | public | isnlt | isbn13, ean13 | boolean + isn | public | isnlt | isbn13, isbn | boolean + isn | public | isnlt | isbn13, isbn13 | boolean + isn | public | isnlt | ismn, ean13 | boolean + isn | public | isnlt | ismn, ismn | boolean + isn | public | isnlt | ismn, ismn13 | boolean + isn | public | isnlt | ismn13, ean13 | boolean + isn | public | isnlt | ismn13, ismn | boolean + isn | public | isnlt | ismn13, ismn13 | boolean + isn | public | isnlt | issn, ean13 | boolean + isn | public | isnlt | issn, issn | boolean + isn | public | isnlt | issn, issn13 | boolean + isn | public | isnlt | issn13, ean13 | boolean + isn | public | isnlt | issn13, issn | boolean + isn | public | isnlt | issn13, issn13 | boolean + isn | public | isnlt | upc, ean13 | boolean + isn | public | isnlt | upc, upc | boolean + isn | public | isnne | ean13, ean13 | boolean + isn | public | isnne | ean13, isbn | boolean + isn | public | isnne | ean13, isbn13 | boolean + isn | public | isnne | ean13, ismn | boolean + isn | public | isnne | ean13, ismn13 | boolean + isn | public | isnne | ean13, issn | boolean + isn | public | isnne | ean13, issn13 | boolean + isn | public | isnne | ean13, upc | boolean + isn | public | isnne | isbn, ean13 | boolean + isn | public | isnne | isbn, isbn | boolean + isn | public | isnne | isbn, isbn13 | boolean + isn | public | isnne | isbn13, ean13 | boolean + isn | public | isnne | isbn13, isbn | boolean + isn | public | isnne | isbn13, isbn13 | boolean + isn | public | isnne | ismn, ean13 | boolean + isn | public | isnne | ismn, ismn | boolean + isn | public | isnne | ismn, ismn13 | boolean + isn | public | isnne | ismn13, ean13 | boolean + isn | public | isnne | ismn13, ismn | boolean + isn | public | isnne | ismn13, ismn13 | boolean + isn | public | isnne | issn, ean13 | boolean + isn | public | isnne | issn, issn | boolean + isn | public | isnne | issn, issn13 | boolean + isn | public | isnne | issn13, ean13 | boolean + isn | public | isnne | issn13, issn | boolean + isn | public | isnne | issn13, issn13 | boolean + isn | public | isnne | upc, ean13 | boolean + isn | public | isnne | upc, upc | boolean + isn | public | issn | ean13 | issn + isn | public | issn13 | ean13 | issn13 + isn | public | issn13_in | cstring | issn13 + isn | public | issn_in | cstring | issn + isn | public | make_valid | ean13 | ean13 + isn | public | make_valid | isbn | isbn + isn | public | make_valid | isbn13 | isbn13 + isn | public | make_valid | ismn | ismn + isn | public | make_valid | ismn13 | ismn13 + isn | public | make_valid | issn | issn + isn | public | make_valid | issn13 | issn13 + isn | public | make_valid | upc | upc + isn | public | upc | ean13 | upc + isn | public | upc_in | cstring | upc + lo | public | lo_manage | | trigger + lo | public | lo_oid | lo | oid + ltree | public | _lt_q_regex | ltree[], lquery[] | boolean + ltree | public | _lt_q_rregex | lquery[], ltree[] | boolean + ltree | public | _ltq_extract_regex | ltree[], lquery | ltree + ltree | public | _ltq_regex | ltree[], lquery | boolean + ltree | public | _ltq_rregex | lquery, ltree[] | boolean + ltree | public | _ltree_compress | internal | internal + ltree | public | _ltree_consistent | internal, ltree[], smallint, oid, internal | boolean + ltree | public | _ltree_extract_isparent | ltree[], ltree | ltree + ltree | public | _ltree_extract_risparent | ltree[], ltree | ltree + ltree | public | _ltree_gist_options | internal | void + ltree | public | _ltree_isparent | ltree[], ltree | boolean + ltree | public | _ltree_penalty | internal, internal, internal | internal + ltree | public | _ltree_picksplit | internal, internal | internal + ltree | public | _ltree_r_isparent | ltree, ltree[] | boolean + ltree | public | _ltree_r_risparent | ltree, ltree[] | boolean + ltree | public | _ltree_risparent | ltree[], ltree | boolean + ltree | public | _ltree_same | ltree_gist, ltree_gist, internal | internal + ltree | public | _ltree_union | internal, internal | ltree_gist + ltree | public | _ltxtq_exec | ltree[], ltxtquery | boolean + ltree | public | _ltxtq_extract_exec | ltree[], ltxtquery | ltree + ltree | public | _ltxtq_rexec | ltxtquery, ltree[] | boolean + ltree | public | hash_ltree | ltree | integer + ltree | public | hash_ltree_extended | ltree, bigint | bigint + ltree | public | index | ltree, ltree | integer + ltree | public | index | ltree, ltree, integer | integer + ltree | public | lca | ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree[] | ltree + ltree | public | lquery_in | cstring | lquery + ltree | public | lquery_out | lquery | cstring + ltree | public | lquery_recv | internal | lquery + ltree | public | lquery_send | lquery | bytea + ltree | public | lt_q_regex | ltree, lquery[] | boolean + ltree | public | lt_q_rregex | lquery[], ltree | boolean + ltree | public | ltq_regex | ltree, lquery | boolean + ltree | public | ltq_rregex | lquery, ltree | boolean + ltree | public | ltree2text | ltree | text + ltree | public | ltree_addltree | ltree, ltree | ltree + ltree | public | ltree_addtext | ltree, text | ltree + ltree | public | ltree_cmp | ltree, ltree | integer + ltree | public | ltree_compress | internal | internal + ltree | public | ltree_consistent | internal, ltree, smallint, oid, internal | boolean + ltree | public | ltree_decompress | internal | internal + ltree | public | ltree_eq | ltree, ltree | boolean + ltree | public | ltree_ge | ltree, ltree | boolean + ltree | public | ltree_gist_in | cstring | ltree_gist + ltree | public | ltree_gist_options | internal | void + ltree | public | ltree_gist_out | ltree_gist | cstring + ltree | public | ltree_gt | ltree, ltree | boolean + ltree | public | ltree_in | cstring | ltree + ltree | public | ltree_isparent | ltree, ltree | boolean + ltree | public | ltree_le | ltree, ltree | boolean + ltree | public | ltree_lt | ltree, ltree | boolean + ltree | public | ltree_ne | ltree, ltree | boolean + ltree | public | ltree_out | ltree | cstring + ltree | public | ltree_penalty | internal, internal, internal | internal + ltree | public | ltree_picksplit | internal, internal | internal + ltree | public | ltree_recv | internal | ltree + ltree | public | ltree_risparent | ltree, ltree | boolean + ltree | public | ltree_same | ltree_gist, ltree_gist, internal | internal + ltree | public | ltree_send | ltree | bytea + ltree | public | ltree_textadd | text, ltree | ltree + ltree | public | ltree_union | internal, internal | ltree_gist + ltree | public | ltreeparentsel | internal, oid, internal, integer | double precision + ltree | public | ltxtq_exec | ltree, ltxtquery | boolean + ltree | public | ltxtq_in | cstring | ltxtquery + ltree | public | ltxtq_out | ltxtquery | cstring + ltree | public | ltxtq_recv | internal | ltxtquery + ltree | public | ltxtq_rexec | ltxtquery, ltree | boolean + ltree | public | ltxtq_send | ltxtquery | bytea + ltree | public | nlevel | ltree | integer + ltree | public | subltree | ltree, integer, integer | ltree + ltree | public | subpath | ltree, integer | ltree + ltree | public | subpath | ltree, integer, integer | ltree + ltree | public | text2ltree | text | ltree + moddatetime | public | moddatetime | | trigger + orioledb | public | orioledb_commit_hash | | text + orioledb | public | orioledb_compression_max_level | | bigint + orioledb | public | orioledb_evict_pages | relid oid, maxlevel integer | void + orioledb | public | orioledb_get_evicted_trees | OUT datoid oid, OUT relnode oid, OUT root_downlink bigint, OUT file_length bigint | SETOF record + orioledb | public | orioledb_get_index_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record + orioledb | public | orioledb_get_table_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record + orioledb | public | orioledb_has_retained_undo | | boolean + orioledb | public | orioledb_idx_structure | relid oid, tree_name text, options character varying, depth integer | text + orioledb | public | orioledb_index_description | datoid oid, relid oid, relnode oid, index_type text, OUT name text, OUT description text | record + orioledb | public | orioledb_index_oids | OUT datoid oid, OUT table_reloid oid, OUT table_relnode oid, OUT index_reloid oid, OUT index_relnode oid, OUT index_type text | SETOF record + orioledb | public | orioledb_index_rows | relid oid, OUT total integer, OUT dead integer | record + orioledb | public | orioledb_page_stats | OUT pool_name text, OUT busy_pages bigint, OUT free_pages bigint, OUT dirty_pages bigint, OUT all_pages bigint | SETOF record + orioledb | public | orioledb_parallel_debug_start | | void + orioledb | public | orioledb_parallel_debug_stop | | void + orioledb | public | orioledb_recovery_synchronized | | boolean + orioledb | public | orioledb_relation_size | relid oid | bigint + orioledb | public | orioledb_sys_tree_check | num integer, force_map_check boolean | boolean + orioledb | public | orioledb_sys_tree_rows | num integer | SETOF jsonb + orioledb | public | orioledb_sys_tree_structure | num integer, options character varying, depth integer | text + orioledb | public | orioledb_table_description | datoid oid, relid oid, relnode oid | text + orioledb | public | orioledb_table_description | relid oid | text + orioledb | public | orioledb_table_oids | OUT datoid oid, OUT reloid oid, OUT relnode oid | SETOF record + orioledb | public | orioledb_table_pages | relid oid, OUT blkno bigint, OUT level integer, OUT rightlink bigint, OUT hikey jsonb | SETOF record + orioledb | public | orioledb_tableam_handler | internal | table_am_handler + orioledb | public | orioledb_tbl_are_indices_equal | idx_oid1 regclass, idx_oid2 regclass | boolean + orioledb | public | orioledb_tbl_bin_structure | relid oid, print_bytes boolean, depth integer | text + orioledb | public | orioledb_tbl_check | relid oid, force_map_check boolean | boolean + orioledb | public | orioledb_tbl_compression_check | level bigint, relid oid, ranges integer[] | text + orioledb | public | orioledb_tbl_indices | relid oid | text + orioledb | public | orioledb_tbl_structure | relid oid, options character varying, depth integer | text + orioledb | public | orioledb_ucm_check | | boolean + orioledb | public | orioledb_version | | text + orioledb | public | orioledb_write_pages | relid oid | void + orioledb | public | pg_stopevent_reset | eventname text | boolean + orioledb | public | pg_stopevent_set | eventname text, condition jsonpath | void + orioledb | public | pg_stopevents | OUT stopevent text, OUT condition jsonpath, OUT waiter_pids integer[] | SETOF record + orioledb | public | s3_get | objectname text | text + orioledb | public | s3_put | objectname text, filename text | text + pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record + pageinspect | public | brin_page_type | page bytea | text + pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid + pageinspect | public | bt_metap | relname text, OUT magic integer, OUT version integer, OUT root bigint, OUT level bigint, OUT fastroot bigint, OUT fastlevel bigint, OUT last_cleanup_num_delpages bigint, OUT last_cleanup_num_tuples double precision, OUT allequalimage boolean | record + pageinspect | public | bt_page_items | page bytea, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text, OUT dead boolean, OUT htid tid, OUT tids tid[] | SETOF record + pageinspect | public | bt_page_items | relname text, blkno bigint, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text, OUT dead boolean, OUT htid tid, OUT tids tid[] | SETOF record + pageinspect | public | bt_page_stats | relname text, blkno bigint, OUT blkno bigint, OUT type "char", OUT live_items integer, OUT dead_items integer, OUT avg_item_size integer, OUT page_size integer, OUT free_size integer, OUT btpo_prev bigint, OUT btpo_next bigint, OUT btpo_level bigint, OUT btpo_flags integer | record + pageinspect | public | fsm_page_contents | page bytea | text + pageinspect | public | get_raw_page | text, bigint | bytea + pageinspect | public | get_raw_page | text, text, bigint | bytea + pageinspect | public | gin_leafpage_items | page bytea, OUT first_tid tid, OUT nbytes smallint, OUT tids tid[] | SETOF record + pageinspect | public | gin_metapage_info | page bytea, OUT pending_head bigint, OUT pending_tail bigint, OUT tail_free_size integer, OUT n_pending_pages bigint, OUT n_pending_tuples bigint, OUT n_total_pages bigint, OUT n_entry_pages bigint, OUT n_data_pages bigint, OUT n_entries bigint, OUT version integer | record + pageinspect | public | gin_page_opaque_info | page bytea, OUT rightlink bigint, OUT maxoff integer, OUT flags text[] | record + pageinspect | public | gist_page_items | page bytea, index_oid regclass, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT dead boolean, OUT keys text | SETOF record + pageinspect | public | gist_page_items_bytea | page bytea, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT dead boolean, OUT key_data bytea | SETOF record + pageinspect | public | gist_page_opaque_info | page bytea, OUT lsn pg_lsn, OUT nsn pg_lsn, OUT rightlink bigint, OUT flags text[] | record + pageinspect | public | hash_bitmap_info | index_oid regclass, blkno bigint, OUT bitmapblkno bigint, OUT bitmapbit integer, OUT bitstatus boolean | SETOF record + pageinspect | public | hash_metapage_info | page bytea, OUT magic bigint, OUT version bigint, OUT ntuples double precision, OUT ffactor integer, OUT bsize integer, OUT bmsize integer, OUT bmshift integer, OUT maxbucket bigint, OUT highmask bigint, OUT lowmask bigint, OUT ovflpoint bigint, OUT firstfree bigint, OUT nmaps bigint, OUT procid oid, OUT spares bigint[], OUT mapp bigint[] | record + pageinspect | public | hash_page_items | page bytea, OUT itemoffset integer, OUT ctid tid, OUT data bigint | SETOF record + pageinspect | public | hash_page_stats | page bytea, OUT live_items integer, OUT dead_items integer, OUT page_size integer, OUT free_size integer, OUT hasho_prevblkno bigint, OUT hasho_nextblkno bigint, OUT hasho_bucket bigint, OUT hasho_flag integer, OUT hasho_page_id integer | record + pageinspect | public | hash_page_type | page bytea | text + pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, do_detoast boolean, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record + pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record + pageinspect | public | heap_page_items | page bytea, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_data bytea | SETOF record + pageinspect | public | heap_tuple_infomask_flags | t_infomask integer, t_infomask2 integer, OUT raw_flags text[], OUT combined_flags text[] | record + pageinspect | public | page_checksum | page bytea, blkno bigint | smallint + pageinspect | public | page_header | page bytea, OUT lsn pg_lsn, OUT checksum smallint, OUT flags smallint, OUT lower integer, OUT upper integer, OUT special integer, OUT pagesize integer, OUT version smallint, OUT prune_xid xid | record + pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text | bytea[] + pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] + pg_backtrace | public | pg_backtrace_init | | void + pg_buffercache | public | pg_buffercache_evict | integer | boolean + pg_buffercache | public | pg_buffercache_pages | | SETOF record + pg_freespacemap | public | pg_freespace | regclass, bigint | smallint + pg_freespacemap | public | pg_freespace | rel regclass, OUT blkno bigint, OUT avail smallint | SETOF record + pg_graphql | graphql | _internal_resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb + pg_graphql | graphql | comment_directive | comment_ text | jsonb + pg_graphql | graphql | exception | message text | text + pg_graphql | graphql | get_schema_version | | integer + pg_graphql | graphql | increment_schema_version | | event_trigger + pg_graphql | graphql | resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb + pg_graphql | graphql_public | graphql | "operationName" text, query text, variables jsonb, extensions jsonb | jsonb + pg_hashids | public | hash_decode | text, text, integer | integer + pg_hashids | public | hash_encode | bigint | text + pg_hashids | public | hash_encode | bigint, text | text + pg_hashids | public | hash_encode | bigint, text, integer | text + pg_hashids | public | id_decode | text | bigint[] + pg_hashids | public | id_decode | text, text | bigint[] + pg_hashids | public | id_decode | text, text, integer | bigint[] + pg_hashids | public | id_decode | text, text, integer, text | bigint[] + pg_hashids | public | id_decode_once | text | bigint + pg_hashids | public | id_decode_once | text, text | bigint + pg_hashids | public | id_decode_once | text, text, integer | bigint + pg_hashids | public | id_decode_once | text, text, integer, text | bigint + pg_hashids | public | id_encode | bigint | text + pg_hashids | public | id_encode | bigint, text | text + pg_hashids | public | id_encode | bigint, text, integer | text + pg_hashids | public | id_encode | bigint, text, integer, text | text + pg_hashids | public | id_encode | bigint[] | text + pg_hashids | public | id_encode | bigint[], text | text + pg_hashids | public | id_encode | bigint[], text, integer | text + pg_hashids | public | id_encode | bigint[], text, integer, text | text + pg_jsonschema | public | json_matches_schema | schema json, instance json | boolean + pg_jsonschema | public | jsonb_matches_schema | schema json, instance jsonb | boolean + pg_jsonschema | public | jsonschema_is_valid | schema json | boolean + pg_jsonschema | public | jsonschema_validation_errors | schema json, instance json | text[] + pg_net | net | _await_response | request_id bigint | boolean + pg_net | net | _encode_url_with_params_array | url text, params_array text[] | text + pg_net | net | _http_collect_response | request_id bigint, async boolean | net.http_response_result + pg_net | net | _urlencode_string | string character varying | text + pg_net | net | check_worker_is_up | | void + pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | worker_restart | | boolean + pg_prewarm | public | autoprewarm_dump_now | | bigint + pg_prewarm | public | autoprewarm_start_worker | | void + pg_prewarm | public | pg_prewarm | regclass, mode text, fork text, first_block bigint, last_block bigint | bigint + pg_repack | repack | conflicted_triggers | oid | SETOF name + pg_repack | repack | create_index_type | oid, oid | void + pg_repack | repack | create_log_table | oid | void + pg_repack | repack | create_table | oid, name | void + pg_repack | repack | disable_autovacuum | regclass | void + pg_repack | repack | get_alter_col_storage | oid | text + pg_repack | repack | get_assign | oid, text | text + pg_repack | repack | get_columns_for_create_as | oid | text + pg_repack | repack | get_compare_pkey | oid, text | text + pg_repack | repack | get_create_index_type | oid, name | text + pg_repack | repack | get_create_trigger | relid oid, pkid oid | text + pg_repack | repack | get_drop_columns | oid, text | text + pg_repack | repack | get_enable_trigger | relid oid | text + pg_repack | repack | get_index_columns | oid | text + pg_repack | repack | get_order_by | oid, oid | text + pg_repack | repack | get_storage_param | oid | text + pg_repack | repack | get_table_and_inheritors | regclass | regclass[] + pg_repack | repack | oid2text | oid | text + pg_repack | repack | repack_apply | sql_peek cstring, sql_insert cstring, sql_delete cstring, sql_update cstring, sql_pop cstring, count integer | integer + pg_repack | repack | repack_drop | oid, integer | void + pg_repack | repack | repack_index_swap | oid | void + pg_repack | repack | repack_indexdef | oid, oid, name, boolean | text + pg_repack | repack | repack_swap | oid | void + pg_repack | repack | repack_trigger | | trigger + pg_repack | repack | version | | text + pg_repack | repack | version_sql | | text + pg_stat_monitor | public | decode_error_level | elevel integer | text + pg_stat_monitor | public | get_cmd_type | cmd_type integer | text + pg_stat_monitor | public | get_histogram_timings | | text + pg_stat_monitor | public | histogram | _bucket integer, _quryid bigint | SETOF record + pg_stat_monitor | public | pg_stat_monitor_internal | showtext boolean, OUT bucket bigint, OUT userid oid, OUT username text, OUT dbid oid, OUT datname text, OUT client_ip bigint, OUT queryid bigint, OUT planid bigint, OUT query text, OUT query_plan text, OUT pgsm_query_id bigint, OUT top_queryid bigint, OUT top_query text, OUT application_name text, OUT relations text, OUT cmd_type integer, OUT elevel integer, OUT sqlcode text, OUT message text, OUT bucket_start_time timestamp with time zone, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT resp_calls text, OUT cpu_user_time double precision, OUT cpu_sys_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT comments text, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone, OUT toplevel boolean, OUT bucket_done boolean | SETOF record + pg_stat_monitor | public | pg_stat_monitor_reset | | void + pg_stat_monitor | public | pg_stat_monitor_version | | text + pg_stat_monitor | public | pgsm_create_11_view | | integer + pg_stat_monitor | public | pgsm_create_13_view | | integer + pg_stat_monitor | public | pgsm_create_14_view | | integer + pg_stat_monitor | public | pgsm_create_15_view | | integer + pg_stat_monitor | public | pgsm_create_17_view | | integer + pg_stat_monitor | public | pgsm_create_view | | integer + pg_stat_monitor | public | range | | text[] + pg_stat_statements | extensions | pg_stat_statements | showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone | SETOF record + pg_stat_statements | extensions | pg_stat_statements_info | OUT dealloc bigint, OUT stats_reset timestamp with time zone | record + pg_stat_statements | extensions | pg_stat_statements_reset | userid oid, dbid oid, queryid bigint, minmax_only boolean | timestamp with time zone + pg_surgery | public | heap_force_freeze | reloid regclass, tids tid[] | void + pg_surgery | public | heap_force_kill | reloid regclass, tids tid[] | void + pg_tle | pgtle | available_extension_versions | OUT name name, OUT version text, OUT superuser boolean, OUT trusted boolean, OUT relocatable boolean, OUT schema name, OUT requires name[], OUT comment text | SETOF record + pg_tle | pgtle | available_extensions | OUT name name, OUT default_version text, OUT comment text | SETOF record + pg_tle | pgtle | create_base_type | typenamespace regnamespace, typename name, infunc regprocedure, outfunc regprocedure, internallength integer, alignment text, storage text | void + pg_tle | pgtle | create_base_type_if_not_exists | typenamespace regnamespace, typename name, infunc regprocedure, outfunc regprocedure, internallength integer, alignment text, storage text | boolean + pg_tle | pgtle | create_operator_func | typenamespace regnamespace, typename name, opfunc regprocedure | void + pg_tle | pgtle | create_operator_func_if_not_exists | typenamespace regnamespace, typename name, opfunc regprocedure | boolean + pg_tle | pgtle | create_shell_type | typenamespace regnamespace, typename name | void + pg_tle | pgtle | create_shell_type_if_not_exists | typenamespace regnamespace, typename name | boolean + pg_tle | pgtle | extension_update_paths | name name, OUT source text, OUT target text, OUT path text | SETOF record + pg_tle | pgtle | install_extension | name text, version text, description text, ext text, requires text[] | boolean + pg_tle | pgtle | install_extension_version_sql | name text, version text, ext text | boolean + pg_tle | pgtle | install_update_path | name text, fromvers text, tovers text, ext text | boolean + pg_tle | pgtle | pg_tle_feature_info_sql_drop | | event_trigger + pg_tle | pgtle | register_feature | proc regproc, feature pgtle.pg_tle_features | void + pg_tle | pgtle | register_feature_if_not_exists | proc regproc, feature pgtle.pg_tle_features | boolean + pg_tle | pgtle | set_default_version | name text, version text | boolean + pg_tle | pgtle | uninstall_extension | extname text | boolean + pg_tle | pgtle | uninstall_extension | extname text, version text | boolean + pg_tle | pgtle | uninstall_extension_if_exists | extname text | boolean + pg_tle | pgtle | uninstall_update_path | extname text, fromvers text, tovers text | boolean + pg_tle | pgtle | uninstall_update_path_if_exists | extname text, fromvers text, tovers text | boolean + pg_tle | pgtle | unregister_feature | proc regproc, feature pgtle.pg_tle_features | void + pg_tle | pgtle | unregister_feature_if_exists | proc regproc, feature pgtle.pg_tle_features | boolean + pg_trgm | public | gin_extract_query_trgm | text, internal, smallint, internal, internal, internal, internal | internal + pg_trgm | public | gin_extract_value_trgm | text, internal | internal + pg_trgm | public | gin_trgm_consistent | internal, smallint, text, integer, internal, internal, internal, internal | boolean + pg_trgm | public | gin_trgm_triconsistent | internal, smallint, text, integer, internal, internal, internal | "char" + pg_trgm | public | gtrgm_compress | internal | internal + pg_trgm | public | gtrgm_consistent | internal, text, smallint, oid, internal | boolean + pg_trgm | public | gtrgm_decompress | internal | internal + pg_trgm | public | gtrgm_distance | internal, text, smallint, oid, internal | double precision + pg_trgm | public | gtrgm_in | cstring | gtrgm + pg_trgm | public | gtrgm_options | internal | void + pg_trgm | public | gtrgm_out | gtrgm | cstring + pg_trgm | public | gtrgm_penalty | internal, internal, internal | internal + pg_trgm | public | gtrgm_picksplit | internal, internal | internal + pg_trgm | public | gtrgm_same | gtrgm, gtrgm, internal | internal + pg_trgm | public | gtrgm_union | internal, internal | gtrgm + pg_trgm | public | set_limit | real | real + pg_trgm | public | show_limit | | real + pg_trgm | public | show_trgm | text | text[] + pg_trgm | public | similarity | text, text | real + pg_trgm | public | similarity_dist | text, text | real + pg_trgm | public | similarity_op | text, text | boolean + pg_trgm | public | strict_word_similarity | text, text | real + pg_trgm | public | strict_word_similarity_commutator_op | text, text | boolean + pg_trgm | public | strict_word_similarity_dist_commutator_op | text, text | real + pg_trgm | public | strict_word_similarity_dist_op | text, text | real + pg_trgm | public | strict_word_similarity_op | text, text | boolean + pg_trgm | public | word_similarity | text, text | real + pg_trgm | public | word_similarity_commutator_op | text, text | boolean + pg_trgm | public | word_similarity_dist_commutator_op | text, text | real + pg_trgm | public | word_similarity_dist_op | text, text | real + pg_trgm | public | word_similarity_op | text, text | boolean + pg_visibility | public | pg_check_frozen | regclass, OUT t_ctid tid | SETOF tid + pg_visibility | public | pg_check_visible | regclass, OUT t_ctid tid | SETOF tid + pg_visibility | public | pg_truncate_visibility_map | regclass | void + pg_visibility | public | pg_visibility | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | record + pg_visibility | public | pg_visibility | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | SETOF record + pg_visibility | public | pg_visibility_map | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | record + pg_visibility | public | pg_visibility_map | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | SETOF record + pg_visibility | public | pg_visibility_map_summary | regclass, OUT all_visible bigint, OUT all_frozen bigint | record + pg_walinspect | public | pg_get_wal_record_info | in_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | record + pg_walinspect | public | pg_get_wal_records_info | start_lsn pg_lsn, end_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | SETOF record + pg_walinspect | public | pg_get_wal_stats | start_lsn pg_lsn, end_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record + pgaudit | public | pgaudit_ddl_command_end | | event_trigger + pgaudit | public | pgaudit_sql_drop | | event_trigger + pgcrypto | extensions | armor | bytea | text + pgcrypto | extensions | armor | bytea, text[], text[] | text + pgcrypto | extensions | crypt | text, text | text + pgcrypto | extensions | dearmor | text | bytea + pgcrypto | extensions | decrypt | bytea, bytea, text | bytea + pgcrypto | extensions | decrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | digest | bytea, text | bytea + pgcrypto | extensions | digest | text, text | bytea + pgcrypto | extensions | encrypt | bytea, bytea, text | bytea + pgcrypto | extensions | encrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | gen_random_bytes | integer | bytea + pgcrypto | extensions | gen_random_uuid | | uuid + pgcrypto | extensions | gen_salt | text | text + pgcrypto | extensions | gen_salt | text, integer | text + pgcrypto | extensions | hmac | bytea, bytea, text | bytea + pgcrypto | extensions | hmac | text, text, text | bytea + pgcrypto | extensions | pgp_armor_headers | text, OUT key text, OUT value text | SETOF record + pgcrypto | extensions | pgp_key_id | bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text, text | text + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt | bytea, text | text + pgcrypto | extensions | pgp_sym_decrypt | bytea, text, text | text + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea + pgjwt | extensions | algorithm_sign | signables text, secret text, algorithm text | text + pgjwt | extensions | sign | payload json, secret text, algorithm text | text + pgjwt | extensions | try_cast_double | inp text | double precision + pgjwt | extensions | url_decode | data text | bytea + pgjwt | extensions | url_encode | data bytea | text + pgjwt | extensions | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) + pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean + pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _get_partition_col | partition_interval text | text + pgmq | pgmq | _get_pg_partman_major_version | | integer + pgmq | pgmq | _get_pg_partman_schema | | text + pgmq | pgmq | archive | queue_name text, msg_id bigint | boolean + pgmq | pgmq | archive | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | convert_archive_partitioned | table_name text, partition_interval text, retention_interval text, leading_partition integer | void + pgmq | pgmq | create | queue_name text | void + pgmq | pgmq | create_non_partitioned | queue_name text | void + pgmq | pgmq | create_partitioned | queue_name text, partition_interval text, retention_interval text | void + pgmq | pgmq | create_unlogged | queue_name text | void + pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean + pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean + pgmq | pgmq | format_table_name | queue_name text, prefix text | text + pgmq | pgmq | list_queues | | SETOF pgmq.queue_record + pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result + pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result + pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record + pgmq | pgmq | purge_queue | queue_name text | bigint + pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint + pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record + pgmq | pgmq | validate_queue_name | queue_name text | void + pgroonga | pgroonga | command | groongacommand text | text + pgroonga | pgroonga | command | groongacommand text, arguments text[] | text + pgroonga | pgroonga | command_escape_value | value text | text + pgroonga | pgroonga | contain_varchar_array | character varying[], character varying | boolean + pgroonga | pgroonga | escape | value bigint | text + pgroonga | pgroonga | escape | value boolean | text + pgroonga | pgroonga | escape | value double precision | text + pgroonga | pgroonga | escape | value integer | text + pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value smallint | text + pgroonga | pgroonga | escape | value text | text + pgroonga | pgroonga | escape | value text, special_characters text | text + pgroonga | pgroonga | escape | value timestamp with time zone | text + pgroonga | pgroonga | escape | value timestamp without time zone | text + pgroonga | pgroonga | flush | indexname cstring | boolean + pgroonga | pgroonga | highlight_html | target text, keywords text[] | text + pgroonga | pgroonga | match_in_text | text, text[] | boolean + pgroonga | pgroonga | match_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | match_in_varchar | character varying, character varying[] | boolean + pgroonga | pgroonga | match_jsonb | jsonb, text | boolean + pgroonga | pgroonga | match_positions_byte | target text, keywords text[] | integer[] + pgroonga | pgroonga | match_positions_character | target text, keywords text[] | integer[] + pgroonga | pgroonga | match_query | character varying, character varying | boolean + pgroonga | pgroonga | match_query | text, text | boolean + pgroonga | pgroonga | match_query | text[], text | boolean + pgroonga | pgroonga | match_regexp | character varying, character varying | boolean + pgroonga | pgroonga | match_regexp | text, text | boolean + pgroonga | pgroonga | match_script_jsonb | jsonb, text | boolean + pgroonga | pgroonga | match_term | target character varying, term character varying | boolean + pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean + pgroonga | pgroonga | match_term | target text, term text | boolean + pgroonga | pgroonga | match_term | target text[], term text | boolean + pgroonga | pgroonga | match_text | text, text | boolean + pgroonga | pgroonga | match_text_array | text[], text | boolean + pgroonga | pgroonga | match_varchar | character varying, character varying | boolean + pgroonga | pgroonga | prefix_in_text | text, text[] | boolean + pgroonga | pgroonga | prefix_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | prefix_rk_in_text | text, text[] | boolean + pgroonga | pgroonga | prefix_rk_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | prefix_rk_text | text, text | boolean + pgroonga | pgroonga | prefix_rk_text_array | text[], text | boolean + pgroonga | pgroonga | prefix_text | text, text | boolean + pgroonga | pgroonga | prefix_text_array | text[], text | boolean + pgroonga | pgroonga | query_escape | query text | text + pgroonga | pgroonga | query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text + pgroonga | pgroonga | query_extract_keywords | query text | text[] + pgroonga | pgroonga | query_in_text | text, text[] | boolean + pgroonga | pgroonga | query_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | query_in_varchar | character varying, character varying[] | boolean + pgroonga | pgroonga | query_jsonb | jsonb, text | boolean + pgroonga | pgroonga | query_text | text, text | boolean + pgroonga | pgroonga | query_text_array | text[], text | boolean + pgroonga | pgroonga | query_varchar | character varying, character varying | boolean + pgroonga | pgroonga | regexp_text | text, text | boolean + pgroonga | pgroonga | regexp_varchar | character varying, character varying | boolean + pgroonga | pgroonga | score | "row" record | double precision + pgroonga | pgroonga | script_jsonb | jsonb, text | boolean + pgroonga | pgroonga | script_text | text, text | boolean + pgroonga | pgroonga | script_text_array | text[], text | boolean + pgroonga | pgroonga | script_varchar | character varying, character varying | boolean + pgroonga | pgroonga | similar_text | text, text | boolean + pgroonga | pgroonga | similar_text_array | text[], text | boolean + pgroonga | pgroonga | similar_varchar | character varying, character varying | boolean + pgroonga | pgroonga | snippet_html | target text, keywords text[], width integer | text[] + pgroonga | pgroonga | table_name | indexname cstring | text + pgroonga | public | pgroonga_command | groongacommand text | text + pgroonga | public | pgroonga_command | groongacommand text, arguments text[] | text + pgroonga | public | pgroonga_command_escape_value | value text | text + pgroonga | public | pgroonga_contain_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_equal_query_text_array | targets text[], query text | boolean + pgroonga | public | pgroonga_equal_query_varchar_array | targets character varying[], query text | boolean + pgroonga | public | pgroonga_equal_text | target text, other text | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_escape | value bigint | text + pgroonga | public | pgroonga_escape | value boolean | text + pgroonga | public | pgroonga_escape | value double precision | text + pgroonga | public | pgroonga_escape | value integer | text + pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value smallint | text + pgroonga | public | pgroonga_escape | value text | text + pgroonga | public | pgroonga_escape | value text, special_characters text | text + pgroonga | public | pgroonga_escape | value timestamp with time zone | text + pgroonga | public | pgroonga_escape | value timestamp without time zone | text + pgroonga | public | pgroonga_flush | indexname cstring | boolean + pgroonga | public | pgroonga_handler | internal | index_am_handler + pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text + pgroonga | public | pgroonga_highlight_html | target text, keywords text[], indexname cstring | text + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[], indexname cstring | text[] + pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text + pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text + pgroonga | public | pgroonga_is_writable | | boolean + pgroonga | public | pgroonga_match_in_text | text, text[] | boolean + pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_match_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[], indexname cstring | integer[] + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[], indexname cstring | integer[] + pgroonga | public | pgroonga_match_query | character varying, character varying | boolean + pgroonga | public | pgroonga_match_query | text, text | boolean + pgroonga | public | pgroonga_match_query | text[], text | boolean + pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean + pgroonga | public | pgroonga_match_regexp | text, text | boolean + pgroonga | public | pgroonga_match_script_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean + pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean + pgroonga | public | pgroonga_match_term | target text, term text | boolean + pgroonga | public | pgroonga_match_term | target text[], term text | boolean + pgroonga | public | pgroonga_match_text | text, text | boolean + pgroonga | public | pgroonga_match_text_array | text[], text | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_array_condition_with_scorers | target text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_match_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_normalize | target text | text + pgroonga | public | pgroonga_normalize | target text, normalizername text | text + pgroonga | public | pgroonga_not_prefix_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_prefix_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_prefix_in_varchar_array | character varying[], character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_varchar_array | character varying[], character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_text | text, text | boolean + pgroonga | public | pgroonga_prefix_rk_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_rk_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_prefix_rk_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_text | text, text | boolean + pgroonga | public | pgroonga_prefix_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_escape | query text | text + pgroonga | public | pgroonga_query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text + pgroonga | public | pgroonga_query_extract_keywords | query text, index_name text | text[] + pgroonga | public | pgroonga_query_in_text | text, text[] | boolean + pgroonga | public | pgroonga_query_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_query_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_query_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_query_text | text, text | boolean + pgroonga | public | pgroonga_query_text_array | text[], text | boolean + pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_array_condition_with_scorers | targets text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_query_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_regexp_in_text | text, text[] | boolean + pgroonga | public | pgroonga_regexp_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_regexp_text | text, text | boolean + pgroonga | public | pgroonga_regexp_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_result_to_jsonb_objects | result jsonb | jsonb + pgroonga | public | pgroonga_result_to_recordset | result jsonb | SETOF record + pgroonga | public | pgroonga_score | "row" record | double precision + pgroonga | public | pgroonga_score | tableoid oid, ctid tid | double precision + pgroonga | public | pgroonga_script_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_script_text | text, text | boolean + pgroonga | public | pgroonga_script_text_array | text[], text | boolean + pgroonga | public | pgroonga_script_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_set_writable | newwritable boolean | boolean + pgroonga | public | pgroonga_similar_text | text, text | boolean + pgroonga | public | pgroonga_similar_text_array | text[], text | boolean + pgroonga | public | pgroonga_similar_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_snippet_html | target text, keywords text[], width integer | text[] + pgroonga | public | pgroonga_table_name | indexname cstring | text + pgroonga | public | pgroonga_tokenize | target text, VARIADIC options text[] | json[] + pgroonga | public | pgroonga_vacuum | | boolean + pgroonga | public | pgroonga_wal_apply | | bigint + pgroonga | public | pgroonga_wal_apply | indexname cstring | bigint + pgroonga | public | pgroonga_wal_set_applied_position | | boolean + pgroonga | public | pgroonga_wal_set_applied_position | block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring, block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_status | | TABLE(name text, oid oid, current_block bigint, current_offset bigint, current_size bigint, last_block bigint, last_offset bigint, last_size bigint) + pgroonga | public | pgroonga_wal_truncate | | bigint + pgroonga | public | pgroonga_wal_truncate | indexname cstring | bigint + pgroonga_database | public | pgroonga_database_remove | | boolean + pgrouting | public | _pgr_alphashape | text, alpha double precision, OUT seq1 bigint, OUT textgeom text | SETOF record + pgrouting | public | _pgr_array_reverse | anyarray | anyarray + pgrouting | public | _pgr_articulationpoints | edges_sql text, OUT seq integer, OUT node bigint | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bddijkstra | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bddijkstra | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_biconnectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record + pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bipartite | edges_sql text, OUT node bigint, OUT color bigint | SETOF record + pgrouting | public | _pgr_boost_version | | text + pgrouting | public | _pgr_breadthfirstsearch | edges_sql text, from_vids anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bridges | edges_sql text, OUT seq integer, OUT edge bigint | SETOF record + pgrouting | public | _pgr_build_type | | text + pgrouting | public | _pgr_checkcolumn | text, text, text, is_optional boolean, dryrun boolean | boolean + pgrouting | public | _pgr_checkquery | text | text + pgrouting | public | _pgr_checkverttab | vertname text, columnsarr text[], reporterrs integer, fnname text, OUT sname text, OUT vname text | record + pgrouting | public | _pgr_chinesepostman | edges_sql text, only_cost boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_compilation_date | | text + pgrouting | public | _pgr_compiler_version | | text + pgrouting | public | _pgr_connectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_contraction | edges_sql text, contraction_order bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record + pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_createindex | tabname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_dagshortestpath | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dagshortestpath | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_depthfirstsearch | edges_sql text, root_vids anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, anyarray, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, anyarray, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, bigint, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstravia | edges_sql text, via_vids anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_drivingdistance | edges_sql text, start_vids anyarray, distance double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgecoloring | edges_sql text, OUT edge_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edwardmoore | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edwardmoore | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_endpoint | g geometry | geometry + pgrouting | public | _pgr_floydwarshall | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_get_statement | o_sql text | text + pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumnname | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_gettablename | tab text, reporterrs integer, fnname text, OUT sname text, OUT tname text | record + pgrouting | public | _pgr_git_hash | | text + pgrouting | public | _pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnindexed | tab text, col text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnintable | tab text, col text | boolean + pgrouting | public | _pgr_isplanar | text | boolean + pgrouting | public | _pgr_johnson | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_kruskal | text, anyarray, fn_suffix text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_ksp | edges_sql text, start_vid bigint, end_vid bigint, k integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_lengauertarjandominatortree | edges_sql text, root_vid bigint, OUT seq integer, OUT vid bigint, OUT idom bigint | SETOF record + pgrouting | public | _pgr_lib_version | | text + pgrouting | public | _pgr_linegraph | text, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision | SETOF record + pgrouting | public | _pgr_linegraphfull | text, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint | SETOF record + pgrouting | public | _pgr_makeconnected | text, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint | SETOF record + pgrouting | public | _pgr_maxcardinalitymatch | edges_sql text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record + pgrouting | public | _pgr_maxflow | edges_sql text, combinations_sql text, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | _pgr_maxflow | edges_sql text, sources anyarray, targets anyarray, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, sources anyarray, targets anyarray, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_msg | msgkind integer, fnname text, msg text | void + pgrouting | public | _pgr_onerror | errcond boolean, reporterrs integer, fnname text, msgerr text, hinto text, msgok text | void + pgrouting | public | _pgr_operating_system | | text + pgrouting | public | _pgr_parameter_check | fn text, sql text, big boolean | boolean + pgrouting | public | _pgr_pgsql_version | | text + pgrouting | public | _pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_pointtoid | point geometry, tolerance double precision, vertname text, srid integer | bigint + pgrouting | public | _pgr_prim | text, anyarray, order_by text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_quote_ident | idname text | text + pgrouting | public | _pgr_sequentialvertexcoloring | edges_sql text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | _pgr_startpoint | g geometry | geometry + pgrouting | public | _pgr_stoerwagner | edges_sql text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record + pgrouting | public | _pgr_strongcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_topologicalsort | edges_sql text, OUT seq integer, OUT sorted_v bigint | SETOF record + pgrouting | public | _pgr_transitiveclosure | edges_sql text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | _pgr_trsp | sql text, source_eid integer, source_pos double precision, target_eid integer, target_pos double precision, directed boolean, has_reverse_cost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspvia | text, text, anyarray, boolean, boolean, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspvia_withpoints | text, text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspviavertices | sql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | _pgr_tsp | matrix_row_sql text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_tspeuclidean | coordinates_sql text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_versionless | v1 text, v2 text | boolean + pgrouting | public | _pgr_vrponedepot | text, text, text, integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_withpoints | edges_sql text, points_sql text, combinations_sql text, directed boolean, driving_side character, details boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpoints | edges_sql text, points_sql text, start_pids anyarray, end_pids anyarray, directed boolean, driving_side character, details boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsdd | edges_sql text, points_sql text, start_pid anyarray, distance double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsksp | edges_sql text, points_sql text, start_pid bigint, end_pid bigint, k integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsvia | sql text, via_edges bigint[], fraction double precision[], directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsvia | text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_alphashape | geometry, alpha double precision | geometry + pgrouting | public | pgr_analyzegraph | text, double precision, the_geom text, id text, source text, target text, rows_where text | character varying + pgrouting | public | pgr_analyzeoneway | text, text[], text[], text[], text[], two_way_if_null boolean, oneway text, source text, target text | text + pgrouting | public | pgr_articulationpoints | text, OUT node bigint | SETOF bigint + pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_biconnectedcomponents | text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bipartite | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_breadthfirstsearch | text, anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_breadthfirstsearch | text, bigint, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bridges | text, OUT edge bigint | SETOF bigint + pgrouting | public | pgr_chinesepostman | text, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_chinesepostmancost | text | double precision + pgrouting | public | pgr_connectedcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_contraction | text, bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_createtopology | text, double precision, the_geom text, id text, source text, target text, rows_where text, clean boolean | character varying + pgrouting | public | pgr_createverticestable | text, the_geom text, source text, target text, rows_where text | text + pgrouting | public | pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, text, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_degree | text, text, dryrun boolean, OUT node bigint, OUT degree bigint | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, bigint, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, bigint, anyarray, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, text, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, bigint, anyarray, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstravia | text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, bigint, double precision, directed boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgecoloring | text, OUT edge_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_extractvertices | text, dryrun boolean, OUT id bigint, OUT in_edges bigint[], OUT out_edges bigint[], OUT x double precision, OUT y double precision, OUT geom geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry[], double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_floydwarshall | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_full_version | OUT version text, OUT build_type text, OUT compile_date text, OUT library text, OUT system text, OUT postgresql text, OUT compiler text, OUT boost text, OUT hash text | record + pgrouting | public | pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_isplanar | text | boolean + pgrouting | public | pgr_johnson | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskal | text, OUT edge bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_kruskalbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskalbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_ksp | text, bigint, bigint, integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_lengauertarjandominatortree | text, bigint, OUT seq integer, OUT vertex_id bigint, OUT idom bigint | SETOF record + pgrouting | public | pgr_linegraph | text, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision | SETOF record + pgrouting | public | pgr_linegraphfull | text, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint | SETOF record + pgrouting | public | pgr_makeconnected | text, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint | SETOF record + pgrouting | public | pgr_maxcardinalitymatch | text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record + pgrouting | public | pgr_maxcardinalitymatch | text, OUT edge bigint | SETOF bigint + pgrouting | public | pgr_maxflow | text, anyarray, anyarray | bigint + pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint + pgrouting | public | pgr_maxflow | text, bigint, anyarray | bigint + pgrouting | public | pgr_maxflow | text, bigint, bigint | bigint + pgrouting | public | pgr_maxflow | text, text | bigint + pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, bigint, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, bigint, bigint | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision + pgrouting | public | pgr_nodenetwork | text, double precision, id text, the_geom text, table_ending text, rows_where text, outall boolean | text + pgrouting | public | pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | pgr_prim | text, OUT edge bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_primbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_sequentialvertexcoloring | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_stoerwagner | text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record + pgrouting | public | pgr_strongcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_topologicalsort | text, OUT seq integer, OUT sorted_v bigint | SETOF record + pgrouting | public | pgr_transitiveclosure | text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | pgr_trsp | text, integer, double precision, integer, double precision, boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, integer, integer, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trspvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_trspvia_withpoints | text, text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_trspviaedges | text, integer[], double precision[], boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trspviavertices | text, anyarray, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_tsp | text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_tspeuclidean | text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_version | | text + pgrouting | public | pgr_vrponedepot | text, text, text, integer, OUT oid integer, OUT opos integer, OUT vid integer, OUT tarrival integer, OUT tdepart integer | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, anyarray, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, anyarray, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscostmatrix | text, text, anyarray, directed boolean, driving_side character, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, bigint, double precision, directed boolean, driving_side character, details boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsksp | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrowlocks | public | pgrowlocks | relname text, OUT locked_row tid, OUT locker xid, OUT multi boolean, OUT xids xid[], OUT modes text[], OUT pids integer[] | SETOF record + pgsodium | pgsodium | create_key | key_type pgsodium.key_type, name text, raw_key bytea, raw_key_nonce bytea, parent_key uuid, key_context bytea, expires timestamp with time zone, associated_data text | pgsodium.valid_key + pgsodium | pgsodium | create_mask_view | relid oid, debug boolean | void + pgsodium | pgsodium | create_mask_view | relid oid, subid integer, debug boolean | void + pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_keygen | | bytea + pgsodium | pgsodium | crypto_aead_det_noncegen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_keygen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_noncegen | | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_keygen | | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512_keygen | | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_keygen | | bytea + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key bytea | boolean + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_box | message bytea, nonce bytea, public bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_box_new_keypair | | pgsodium.crypto_box_keypair + pgsodium | pgsodium | crypto_box_new_seed | | bytea + pgsodium | pgsodium | crypto_box_noncegen | | bytea + pgsodium | pgsodium | crypto_box_open | ciphertext bytea, nonce bytea, public bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_box_seal | message bytea, public_key bytea | bytea + pgsodium | pgsodium | crypto_box_seal_open | ciphertext bytea, public_key bytea, secret_key bytea | bytea + pgsodium | pgsodium | crypto_box_seed_new_keypair | seed bytea | pgsodium.crypto_box_keypair + pgsodium | pgsodium | crypto_cmp | text, text | boolean + pgsodium | pgsodium | crypto_generichash | message bytea, key bigint, context bytea | bytea + pgsodium | pgsodium | crypto_generichash | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_generichash | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_generichash_keygen | | bytea + pgsodium | pgsodium | crypto_hash_sha256 | message bytea | bytea + pgsodium | pgsodium | crypto_hash_sha512 | message bytea | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size integer, subkey_id bigint, context bytea, primary_key uuid | bytea + pgsodium | pgsodium | crypto_kdf_keygen | | bytea + pgsodium | pgsodium | crypto_kx_client_session_keys | client_pk bytea, client_sk bytea, server_pk bytea | pgsodium.crypto_kx_session + pgsodium | pgsodium | crypto_kx_new_keypair | | pgsodium.crypto_kx_keypair + pgsodium | pgsodium | crypto_kx_new_seed | | bytea + pgsodium | pgsodium | crypto_kx_seed_new_keypair | seed bytea | pgsodium.crypto_kx_keypair + pgsodium | pgsodium | crypto_kx_server_session_keys | server_pk bytea, server_sk bytea, client_pk bytea | pgsodium.crypto_kx_session + pgsodium | pgsodium | crypto_pwhash | password bytea, salt bytea | bytea + pgsodium | pgsodium | crypto_pwhash_saltgen | | bytea + pgsodium | pgsodium | crypto_pwhash_str | password bytea | bytea + pgsodium | pgsodium | crypto_pwhash_str_verify | hashed_password bytea, password bytea | boolean + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretbox_keygen | | bytea + pgsodium | pgsodium | crypto_secretbox_noncegen | | bytea + pgsodium | pgsodium | crypto_secretbox_open | ciphertext bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_secretbox_open | message bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_secretbox_open | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretstream_keygen | | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key bigint, context bytea | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_shorthash_keygen | | bytea + pgsodium | pgsodium | crypto_sign | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_detached | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_final_create | state bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_final_verify | state bytea, signature bytea, key bytea | boolean + pgsodium | pgsodium | crypto_sign_init | | bytea + pgsodium | pgsodium | crypto_sign_new_keypair | | pgsodium.crypto_sign_keypair + pgsodium | pgsodium | crypto_sign_new_seed | | bytea + pgsodium | pgsodium | crypto_sign_open | signed_message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_seed_new_keypair | seed bytea | pgsodium.crypto_sign_keypair + pgsodium | pgsodium | crypto_sign_update | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg | message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg1 | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg2 | cur_state bytea, initial_state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_verify_detached | sig bytea, message bytea, key bytea | boolean + pgsodium | pgsodium | crypto_signcrypt_new_keypair | | pgsodium.crypto_signcrypt_keypair + pgsodium | pgsodium | crypto_signcrypt_sign_after | state bytea, sender_sk bytea, ciphertext bytea | bytea + pgsodium | pgsodium | crypto_signcrypt_sign_before | sender bytea, recipient bytea, sender_sk bytea, recipient_pk bytea, additional bytea | pgsodium.crypto_signcrypt_state_key + pgsodium | pgsodium | crypto_signcrypt_verify_after | state bytea, signature bytea, sender_pk bytea, ciphertext bytea | boolean + pgsodium | pgsodium | crypto_signcrypt_verify_before | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, recipient_sk bytea | pgsodium.crypto_signcrypt_state_key + pgsodium | pgsodium | crypto_signcrypt_verify_public | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, ciphertext bytea | boolean + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_keygen | | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_noncegen | | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor_ic | bytea, bytea, bigint, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor_ic | bytea, bytea, bigint, bytea | bytea + pgsodium | pgsodium | decrypted_columns | relid oid | text + pgsodium | pgsodium | derive_key | key_id bigint, key_len integer, context bytea | bytea + pgsodium | pgsodium | disable_security_label_trigger | | void + pgsodium | pgsodium | enable_security_label_trigger | | void + pgsodium | pgsodium | encrypted_column | relid oid, m record | text + pgsodium | pgsodium | encrypted_columns | relid oid | text + pgsodium | pgsodium | get_key_by_id | uuid | pgsodium.valid_key + pgsodium | pgsodium | get_key_by_name | text | pgsodium.valid_key + pgsodium | pgsodium | get_named_keys | filter text | SETOF pgsodium.valid_key + pgsodium | pgsodium | has_mask | role regrole, source_name text | boolean + pgsodium | pgsodium | key_encrypt_secret_raw_key | | trigger + pgsodium | pgsodium | mask_columns | source_relid oid | TABLE(attname name, key_id text, key_id_column text, associated_column text, nonce_column text, format_type text) + pgsodium | pgsodium | mask_role | masked_role regrole, source_name text, view_name text | void + pgsodium | pgsodium | pgsodium_derive | key_id bigint, key_len integer, context bytea | bytea + pgsodium | pgsodium | quote_assoc | text, boolean | text + pgsodium | pgsodium | randombytes_buf | size integer | bytea + pgsodium | pgsodium | randombytes_buf_deterministic | size integer, seed bytea | bytea + pgsodium | pgsodium | randombytes_new_seed | | bytea + pgsodium | pgsodium | randombytes_random | | integer + pgsodium | pgsodium | randombytes_uniform | upper_bound integer | integer + pgsodium | pgsodium | sodium_base642bin | base64 text | bytea + pgsodium | pgsodium | sodium_bin2base64 | bin bytea | text + pgsodium | pgsodium | trg_mask_update | | event_trigger + pgsodium | pgsodium | update_mask | target oid, debug boolean | void + pgsodium | pgsodium | update_masks | debug boolean | void + pgsodium | pgsodium | version | | text + pgstattuple | public | pg_relpages | relname regclass | bigint + pgstattuple | public | pg_relpages | relname text | bigint + pgstattuple | public | pgstatginindex | relname regclass, OUT version integer, OUT pending_pages integer, OUT pending_tuples bigint | record + pgstattuple | public | pgstathashindex | relname regclass, OUT version integer, OUT bucket_pages bigint, OUT overflow_pages bigint, OUT bitmap_pages bigint, OUT unused_pages bigint, OUT live_items bigint, OUT dead_items bigint, OUT free_percent double precision | record + pgstattuple | public | pgstatindex | relname regclass, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record + pgstattuple | public | pgstatindex | relname text, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record + pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple | reloid regclass, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple_approx | reloid regclass, OUT table_len bigint, OUT scanned_percent double precision, OUT approx_tuple_count bigint, OUT approx_tuple_len bigint, OUT approx_tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT approx_free_space bigint, OUT approx_free_percent double precision | record + pgtap | public | _add | text, integer | integer + pgtap | public | _add | text, integer, text | integer + pgtap | public | _alike | boolean, anyelement, text, text | text + pgtap | public | _ancestor_of | name, name, integer | boolean + pgtap | public | _ancestor_of | name, name, name, name, integer | boolean + pgtap | public | _are | text, name[], name[], text | text + pgtap | public | _areni | text, text[], text[], text | text + pgtap | public | _array_to_sorted_string | name[], text | text + pgtap | public | _assets_are | text, text[], text[], text | text + pgtap | public | _cast_exists | name, name | boolean + pgtap | public | _cast_exists | name, name, name | boolean + pgtap | public | _cast_exists | name, name, name, name | boolean + pgtap | public | _cdi | name, name, anyelement | text + pgtap | public | _cdi | name, name, anyelement, text | text + pgtap | public | _cdi | name, name, name, anyelement, text | text + pgtap | public | _cexists | name, name | boolean + pgtap | public | _cexists | name, name, name | boolean + pgtap | public | _ckeys | name, character | name[] + pgtap | public | _ckeys | name, name, character | name[] + pgtap | public | _cleanup | | boolean + pgtap | public | _cmp_types | oid, name | boolean + pgtap | public | _col_is_null | name, name, name, text, boolean | text + pgtap | public | _col_is_null | name, name, text, boolean | text + pgtap | public | _constraint | name, character, name[], text, text | text + pgtap | public | _constraint | name, name, character, name[], text, text | text + pgtap | public | _contract_on | text | "char" + pgtap | public | _currtest | | integer + pgtap | public | _db_privs | | name[] + pgtap | public | _def_is | text, text, anyelement, text | text + pgtap | public | _definer | name | boolean + pgtap | public | _definer | name, name | boolean + pgtap | public | _definer | name, name, name[] | boolean + pgtap | public | _definer | name, name[] | boolean + pgtap | public | _dexists | name | boolean + pgtap | public | _dexists | name, name | boolean + pgtap | public | _do_ne | text, text, text, text | text + pgtap | public | _docomp | text, text, text, text | text + pgtap | public | _error_diag | text, text, text, text, text, text, text, text, text, text | text + pgtap | public | _expand_context | character | text + pgtap | public | _expand_on | character | text + pgtap | public | _expand_vol | character | text + pgtap | public | _ext_exists | name | boolean + pgtap | public | _ext_exists | name, name | boolean + pgtap | public | _extensions | | SETOF name + pgtap | public | _extensions | name | SETOF name + pgtap | public | _extras | character, name, name[] | name[] + pgtap | public | _extras | character, name[] | name[] + pgtap | public | _extras | character[], name, name[] | name[] + pgtap | public | _extras | character[], name[] | name[] + pgtap | public | _finish | integer, integer, integer, boolean | SETOF text + pgtap | public | _fkexists | name, name, name[] | boolean + pgtap | public | _fkexists | name, name[] | boolean + pgtap | public | _fprivs_are | text, name, name[], text | text + pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text + pgtap | public | _func_compare | name, name, boolean, text | text + pgtap | public | _func_compare | name, name, name[], anyelement, anyelement, text | text + pgtap | public | _func_compare | name, name, name[], boolean, text | text + pgtap | public | _funkargs | name[] | text + pgtap | public | _get | text | integer + pgtap | public | _get_ac_privs | name, text | text[] + pgtap | public | _get_col_ns_type | name, name, name | text + pgtap | public | _get_col_privs | name, text, name | text[] + pgtap | public | _get_col_type | name, name | text + pgtap | public | _get_col_type | name, name, name | text + pgtap | public | _get_context | name, name | "char" + pgtap | public | _get_db_owner | name | name + pgtap | public | _get_db_privs | name, text | text[] + pgtap | public | _get_dtype | name | text + pgtap | public | _get_dtype | name, text, boolean | text + pgtap | public | _get_fdw_privs | name, text | text[] + pgtap | public | _get_func_owner | name, name, name[] | name + pgtap | public | _get_func_owner | name, name[] | name + pgtap | public | _get_func_privs | text, text | text[] + pgtap | public | _get_index_owner | name, name | name + pgtap | public | _get_index_owner | name, name, name | name + pgtap | public | _get_lang_privs | name, text | text[] + pgtap | public | _get_language_owner | name | name + pgtap | public | _get_latest | text | integer[] + pgtap | public | _get_latest | text, integer | integer + pgtap | public | _get_note | integer | text + pgtap | public | _get_note | text | text + pgtap | public | _get_opclass_owner | name | name + pgtap | public | _get_opclass_owner | name, name | name + pgtap | public | _get_rel_owner | character, name | name + pgtap | public | _get_rel_owner | character, name, name | name + pgtap | public | _get_rel_owner | character[], name | name + pgtap | public | _get_rel_owner | character[], name, name | name + pgtap | public | _get_rel_owner | name | name + pgtap | public | _get_rel_owner | name, name | name + pgtap | public | _get_schema_owner | name | name + pgtap | public | _get_schema_privs | name, text | text[] + pgtap | public | _get_sequence_privs | name, text | text[] + pgtap | public | _get_server_privs | name, text | text[] + pgtap | public | _get_table_privs | name, text | text[] + pgtap | public | _get_tablespace_owner | name | name + pgtap | public | _get_tablespaceprivs | name, text | text[] + pgtap | public | _get_type_owner | name | name + pgtap | public | _get_type_owner | name, name | name + pgtap | public | _got_func | name | boolean + pgtap | public | _got_func | name, name | boolean + pgtap | public | _got_func | name, name, name[] | boolean + pgtap | public | _got_func | name, name[] | boolean + pgtap | public | _grolist | name | oid[] + pgtap | public | _has_def | name, name | boolean + pgtap | public | _has_def | name, name, name | boolean + pgtap | public | _has_group | name | boolean + pgtap | public | _has_role | name | boolean + pgtap | public | _has_type | name, character[] | boolean + pgtap | public | _has_type | name, name, character[] | boolean + pgtap | public | _has_user | name | boolean + pgtap | public | _hasc | name, character | boolean + pgtap | public | _hasc | name, name, character | boolean + pgtap | public | _have_index | name, name | boolean + pgtap | public | _have_index | name, name, name | boolean + pgtap | public | _ident_array_to_sorted_string | name[], text | text + pgtap | public | _ident_array_to_string | name[], text | text + pgtap | public | _ikeys | name, name | text[] + pgtap | public | _ikeys | name, name, name | text[] + pgtap | public | _inherited | name | boolean + pgtap | public | _inherited | name, name | boolean + pgtap | public | _is_indexed | name, name, text[] | boolean + pgtap | public | _is_instead | name, name | boolean + pgtap | public | _is_instead | name, name, name | boolean + pgtap | public | _is_schema | name | boolean + pgtap | public | _is_super | name | boolean + pgtap | public | _is_trusted | name | boolean + pgtap | public | _is_verbose | | boolean + pgtap | public | _keys | name, character | SETOF name[] + pgtap | public | _keys | name, name, character | SETOF name[] + pgtap | public | _lang | name | name + pgtap | public | _lang | name, name | name + pgtap | public | _lang | name, name, name[] | name + pgtap | public | _lang | name, name[] | name + pgtap | public | _missing | character, name, name[] | name[] + pgtap | public | _missing | character, name[] | name[] + pgtap | public | _missing | character[], name, name[] | name[] + pgtap | public | _missing | character[], name[] | name[] + pgtap | public | _nosuch | name, name, name[] | text + pgtap | public | _op_exists | name, name, name | boolean + pgtap | public | _op_exists | name, name, name, name | boolean + pgtap | public | _op_exists | name, name, name, name, name | boolean + pgtap | public | _opc_exists | name | boolean + pgtap | public | _opc_exists | name, name | boolean + pgtap | public | _partof | name, name | boolean + pgtap | public | _partof | name, name, name, name | boolean + pgtap | public | _parts | name | SETOF name + pgtap | public | _parts | name, name | SETOF name + pgtap | public | _pg_sv_column_array | oid, smallint[] | name[] + pgtap | public | _pg_sv_table_accessible | oid, oid | boolean + pgtap | public | _pg_sv_type_array | oid[] | name[] + pgtap | public | _prokind | p_oid oid | "char" + pgtap | public | _query | text | text + pgtap | public | _quote_ident_like | text, text | text + pgtap | public | _refine_vol | text | text + pgtap | public | _relcomp | text, anyarray, text, text | text + pgtap | public | _relcomp | text, text, text, text | text + pgtap | public | _relcomp | text, text, text, text, text | text + pgtap | public | _relexists | name | boolean + pgtap | public | _relexists | name, name | boolean + pgtap | public | _relne | text, anyarray, text, text | text + pgtap | public | _relne | text, text, text, text | text + pgtap | public | _returns | name | text + pgtap | public | _returns | name, name | text + pgtap | public | _returns | name, name, name[] | text + pgtap | public | _returns | name, name[] | text + pgtap | public | _rexists | character, name | boolean + pgtap | public | _rexists | character, name, name | boolean + pgtap | public | _rexists | character[], name | boolean + pgtap | public | _rexists | character[], name, name | boolean + pgtap | public | _rule_on | name, name | "char" + pgtap | public | _rule_on | name, name, name | "char" + pgtap | public | _runem | text[], boolean | SETOF text + pgtap | public | _runner | text[], text[], text[], text[], text[] | SETOF text + pgtap | public | _set | integer, integer | integer + pgtap | public | _set | text, integer | integer + pgtap | public | _set | text, integer, text | integer + pgtap | public | _strict | name | boolean + pgtap | public | _strict | name, name | boolean + pgtap | public | _strict | name, name, name[] | boolean + pgtap | public | _strict | name, name[] | boolean + pgtap | public | _table_privs | | name[] + pgtap | public | _temptable | anyarray, text | text + pgtap | public | _temptable | text, text | text + pgtap | public | _temptypes | text | text + pgtap | public | _time_trials | text, integer, numeric | SETOF _time_trial_type + pgtap | public | _tlike | boolean, text, text, text | text + pgtap | public | _todo | | text + pgtap | public | _trig | name, name | boolean + pgtap | public | _trig | name, name, name | boolean + pgtap | public | _type_func | "char", name | boolean + pgtap | public | _type_func | "char", name, name | boolean + pgtap | public | _type_func | "char", name, name, name[] | boolean + pgtap | public | _type_func | "char", name, name[] | boolean + pgtap | public | _types_are | name, name[], text, character[] | text + pgtap | public | _types_are | name[], text, character[] | text + pgtap | public | _unalike | boolean, anyelement, text, text | text + pgtap | public | _vol | name | text + pgtap | public | _vol | name, name | text + pgtap | public | _vol | name, name, name[] | text + pgtap | public | _vol | name, name[] | text + pgtap | public | add_result | boolean, boolean, text, text, text | integer + pgtap | public | alike | anyelement, text | text + pgtap | public | alike | anyelement, text, text | text + pgtap | public | any_column_privs_are | name, name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name, name[], text | text + pgtap | public | any_column_privs_are | name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name[], text | text + pgtap | public | bag_eq | text, anyarray | text + pgtap | public | bag_eq | text, anyarray, text | text + pgtap | public | bag_eq | text, text | text + pgtap | public | bag_eq | text, text, text | text + pgtap | public | bag_has | text, text | text + pgtap | public | bag_has | text, text, text | text + pgtap | public | bag_hasnt | text, text | text + pgtap | public | bag_hasnt | text, text, text | text + pgtap | public | bag_ne | text, anyarray | text + pgtap | public | bag_ne | text, anyarray, text | text + pgtap | public | bag_ne | text, text | text + pgtap | public | bag_ne | text, text, text | text + pgtap | public | can | name, name[] | text + pgtap | public | can | name, name[], text | text + pgtap | public | can | name[] | text + pgtap | public | can | name[], text | text + pgtap | public | cast_context_is | name, name, text | text + pgtap | public | cast_context_is | name, name, text, text | text + pgtap | public | casts_are | text[] | text + pgtap | public | casts_are | text[], text | text + pgtap | public | check_test | text, boolean | SETOF text + pgtap | public | check_test | text, boolean, text | SETOF text + pgtap | public | check_test | text, boolean, text, text | SETOF text + pgtap | public | check_test | text, boolean, text, text, text | SETOF text + pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text + pgtap | public | cmp_ok | anyelement, text, anyelement | text + pgtap | public | cmp_ok | anyelement, text, anyelement, text | text + pgtap | public | col_default_is | name, name, anyelement | text + pgtap | public | col_default_is | name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, name, text, text | text + pgtap | public | col_default_is | name, name, text | text + pgtap | public | col_default_is | name, name, text, text | text + pgtap | public | col_has_check | name, name | text + pgtap | public | col_has_check | name, name, name, text | text + pgtap | public | col_has_check | name, name, name[], text | text + pgtap | public | col_has_check | name, name, text | text + pgtap | public | col_has_check | name, name[] | text + pgtap | public | col_has_check | name, name[], text | text + pgtap | public | col_has_default | name, name | text + pgtap | public | col_has_default | name, name, name, text | text + pgtap | public | col_has_default | name, name, text | text + pgtap | public | col_hasnt_default | name, name | text + pgtap | public | col_hasnt_default | name, name, name, text | text + pgtap | public | col_hasnt_default | name, name, text | text + pgtap | public | col_is_fk | name, name | text + pgtap | public | col_is_fk | name, name, name, text | text + pgtap | public | col_is_fk | name, name, name[], text | text + pgtap | public | col_is_fk | name, name, text | text + pgtap | public | col_is_fk | name, name[] | text + pgtap | public | col_is_fk | name, name[], text | text + pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_is_null | table_name name, column_name name, description text | text + pgtap | public | col_is_pk | name, name | text + pgtap | public | col_is_pk | name, name, name, text | text + pgtap | public | col_is_pk | name, name, name[], text | text + pgtap | public | col_is_pk | name, name, text | text + pgtap | public | col_is_pk | name, name[] | text + pgtap | public | col_is_pk | name, name[], text | text + pgtap | public | col_is_unique | name, name | text + pgtap | public | col_is_unique | name, name, name | text + pgtap | public | col_is_unique | name, name, name, text | text + pgtap | public | col_is_unique | name, name, name[] | text + pgtap | public | col_is_unique | name, name, name[], text | text + pgtap | public | col_is_unique | name, name, text | text + pgtap | public | col_is_unique | name, name[] | text + pgtap | public | col_is_unique | name, name[], text | text + pgtap | public | col_isnt_fk | name, name | text + pgtap | public | col_isnt_fk | name, name, name, text | text + pgtap | public | col_isnt_fk | name, name, name[], text | text + pgtap | public | col_isnt_fk | name, name, text | text + pgtap | public | col_isnt_fk | name, name[] | text + pgtap | public | col_isnt_fk | name, name[], text | text + pgtap | public | col_isnt_pk | name, name | text + pgtap | public | col_isnt_pk | name, name, name, text | text + pgtap | public | col_isnt_pk | name, name, name[], text | text + pgtap | public | col_isnt_pk | name, name, text | text + pgtap | public | col_isnt_pk | name, name[] | text + pgtap | public | col_isnt_pk | name, name[], text | text + pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_not_null | table_name name, column_name name, description text | text + pgtap | public | col_type_is | name, name, name, name, text | text + pgtap | public | col_type_is | name, name, name, name, text, text | text + pgtap | public | col_type_is | name, name, name, text | text + pgtap | public | col_type_is | name, name, name, text, text | text + pgtap | public | col_type_is | name, name, text | text + pgtap | public | col_type_is | name, name, text, text | text + pgtap | public | collect_tap | character varying[] | text + pgtap | public | collect_tap | VARIADIC text[] | text + pgtap | public | column_privs_are | name, name, name, name, name[] | text + pgtap | public | column_privs_are | name, name, name, name, name[], text | text + pgtap | public | column_privs_are | name, name, name, name[] | text + pgtap | public | column_privs_are | name, name, name, name[], text | text + pgtap | public | columns_are | name, name, name[] | text + pgtap | public | columns_are | name, name, name[], text | text + pgtap | public | columns_are | name, name[] | text + pgtap | public | columns_are | name, name[], text | text + pgtap | public | composite_owner_is | name, name | text + pgtap | public | composite_owner_is | name, name, name | text + pgtap | public | composite_owner_is | name, name, name, text | text + pgtap | public | composite_owner_is | name, name, text | text + pgtap | public | database_privs_are | name, name, name[] | text + pgtap | public | database_privs_are | name, name, name[], text | text + pgtap | public | db_owner_is | name, name | text + pgtap | public | db_owner_is | name, name, text | text + pgtap | public | diag | msg anyelement | text + pgtap | public | diag | msg text | text + pgtap | public | diag | VARIADIC anyarray | text + pgtap | public | diag | VARIADIC text[] | text + pgtap | public | diag_test_name | text | text + pgtap | public | display_oper | name, oid | text + pgtap | public | do_tap | | SETOF text + pgtap | public | do_tap | name | SETOF text + pgtap | public | do_tap | name, text | SETOF text + pgtap | public | do_tap | text | SETOF text + pgtap | public | doesnt_imatch | anyelement, text | text + pgtap | public | doesnt_imatch | anyelement, text, text | text + pgtap | public | doesnt_match | anyelement, text | text + pgtap | public | doesnt_match | anyelement, text, text | text + pgtap | public | domain_type_is | name, text, name, text | text + pgtap | public | domain_type_is | name, text, name, text, text | text + pgtap | public | domain_type_is | name, text, text | text + pgtap | public | domain_type_is | name, text, text, text | text + pgtap | public | domain_type_is | text, text | text + pgtap | public | domain_type_is | text, text, text | text + pgtap | public | domain_type_isnt | name, text, name, text | text + pgtap | public | domain_type_isnt | name, text, name, text, text | text + pgtap | public | domain_type_isnt | name, text, text | text + pgtap | public | domain_type_isnt | name, text, text, text | text + pgtap | public | domain_type_isnt | text, text | text + pgtap | public | domain_type_isnt | text, text, text | text + pgtap | public | domains_are | name, name[] | text + pgtap | public | domains_are | name, name[], text | text + pgtap | public | domains_are | name[] | text + pgtap | public | domains_are | name[], text | text + pgtap | public | enum_has_labels | name, name, name[] | text + pgtap | public | enum_has_labels | name, name, name[], text | text + pgtap | public | enum_has_labels | name, name[] | text + pgtap | public | enum_has_labels | name, name[], text | text + pgtap | public | enums_are | name, name[] | text + pgtap | public | enums_are | name, name[], text | text + pgtap | public | enums_are | name[] | text + pgtap | public | enums_are | name[], text | text + pgtap | public | extensions_are | name, name[] | text + pgtap | public | extensions_are | name, name[], text | text + pgtap | public | extensions_are | name[] | text + pgtap | public | extensions_are | name[], text | text + pgtap | public | fail | | text + pgtap | public | fail | text | text + pgtap | public | fdw_privs_are | name, name, name[] | text + pgtap | public | fdw_privs_are | name, name, name[], text | text + pgtap | public | findfuncs | name, text | text[] + pgtap | public | findfuncs | name, text, text | text[] + pgtap | public | findfuncs | text | text[] + pgtap | public | findfuncs | text, text | text[] + pgtap | public | finish | exception_on_failure boolean | SETOF text + pgtap | public | fk_ok | name, name, name, name | text + pgtap | public | fk_ok | name, name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name[], name, name, name[] | text + pgtap | public | fk_ok | name, name, name[], name, name, name[], text | text + pgtap | public | fk_ok | name, name[], name, name[] | text + pgtap | public | fk_ok | name, name[], name, name[], text | text + pgtap | public | foreign_table_owner_is | name, name | text + pgtap | public | foreign_table_owner_is | name, name, name | text + pgtap | public | foreign_table_owner_is | name, name, name, text | text + pgtap | public | foreign_table_owner_is | name, name, text | text + pgtap | public | foreign_tables_are | name, name[] | text + pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_tables_are | name[] | text + pgtap | public | foreign_tables_are | name[], text | text + pgtap | public | function_lang_is | name, name | text + pgtap | public | function_lang_is | name, name, name | text + pgtap | public | function_lang_is | name, name, name, text | text + pgtap | public | function_lang_is | name, name, name[], name | text + pgtap | public | function_lang_is | name, name, name[], name, text | text + pgtap | public | function_lang_is | name, name, text | text + pgtap | public | function_lang_is | name, name[], name | text + pgtap | public | function_lang_is | name, name[], name, text | text + pgtap | public | function_owner_is | name, name, name[], name | text + pgtap | public | function_owner_is | name, name, name[], name, text | text + pgtap | public | function_owner_is | name, name[], name | text + pgtap | public | function_owner_is | name, name[], name, text | text + pgtap | public | function_privs_are | name, name, name[], name, name[] | text + pgtap | public | function_privs_are | name, name, name[], name, name[], text | text + pgtap | public | function_privs_are | name, name[], name, name[] | text + pgtap | public | function_privs_are | name, name[], name, name[], text | text + pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_returns | name, name, name[], text, text | text + pgtap | public | function_returns | name, name, text | text + pgtap | public | function_returns | name, name, text, text | text + pgtap | public | function_returns | name, name[], text | text + pgtap | public | function_returns | name, name[], text, text | text + pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, text, text | text + pgtap | public | functions_are | name, name[] | text + pgtap | public | functions_are | name, name[], text | text + pgtap | public | functions_are | name[] | text + pgtap | public | functions_are | name[], text | text + pgtap | public | groups_are | name[] | text + pgtap | public | groups_are | name[], text | text + pgtap | public | has_cast | name, name | text + pgtap | public | has_cast | name, name, name | text + pgtap | public | has_cast | name, name, name, name | text + pgtap | public | has_cast | name, name, name, name, text | text + pgtap | public | has_cast | name, name, name, text | text + pgtap | public | has_cast | name, name, text | text + pgtap | public | has_check | name | text + pgtap | public | has_check | name, name, text | text + pgtap | public | has_check | name, text | text + pgtap | public | has_column | name, name | text + pgtap | public | has_column | name, name, name, text | text + pgtap | public | has_column | name, name, text | text + pgtap | public | has_composite | name | text + pgtap | public | has_composite | name, name, text | text + pgtap | public | has_composite | name, text | text + pgtap | public | has_domain | name | text + pgtap | public | has_domain | name, name | text + pgtap | public | has_domain | name, name, text | text + pgtap | public | has_domain | name, text | text + pgtap | public | has_enum | name | text + pgtap | public | has_enum | name, name | text + pgtap | public | has_enum | name, name, text | text + pgtap | public | has_enum | name, text | text + pgtap | public | has_extension | name | text + pgtap | public | has_extension | name, name | text + pgtap | public | has_extension | name, name, text | text + pgtap | public | has_extension | name, text | text + pgtap | public | has_fk | name | text + pgtap | public | has_fk | name, name, text | text + pgtap | public | has_fk | name, text | text + pgtap | public | has_foreign_table | name | text + pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_foreign_table | name, name, text | text + pgtap | public | has_foreign_table | name, text | text + pgtap | public | has_function | name | text + pgtap | public | has_function | name, name | text + pgtap | public | has_function | name, name, name[] | text + pgtap | public | has_function | name, name, name[], text | text + pgtap | public | has_function | name, name, text | text + pgtap | public | has_function | name, name[] | text + pgtap | public | has_function | name, name[], text | text + pgtap | public | has_function | name, text | text + pgtap | public | has_group | name | text + pgtap | public | has_group | name, text | text + pgtap | public | has_index | name, name | text + pgtap | public | has_index | name, name, name | text + pgtap | public | has_index | name, name, name, name | text + pgtap | public | has_index | name, name, name, name, text | text + pgtap | public | has_index | name, name, name, name[] | text + pgtap | public | has_index | name, name, name, name[], text | text + pgtap | public | has_index | name, name, name, text | text + pgtap | public | has_index | name, name, name[] | text + pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name, text | text + pgtap | public | has_inherited_tables | name | text + pgtap | public | has_inherited_tables | name, name | text + pgtap | public | has_inherited_tables | name, name, text | text + pgtap | public | has_inherited_tables | name, text | text + pgtap | public | has_language | name | text + pgtap | public | has_language | name, text | text + pgtap | public | has_leftop | name, name | text + pgtap | public | has_leftop | name, name, name | text + pgtap | public | has_leftop | name, name, name, name | text + pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_leftop | name, name, name, text | text + pgtap | public | has_leftop | name, name, text | text + pgtap | public | has_materialized_view | name | text + pgtap | public | has_materialized_view | name, name, text | text + pgtap | public | has_materialized_view | name, text | text + pgtap | public | has_opclass | name | text + pgtap | public | has_opclass | name, name | text + pgtap | public | has_opclass | name, name, text | text + pgtap | public | has_opclass | name, text | text + pgtap | public | has_operator | name, name, name | text + pgtap | public | has_operator | name, name, name, name | text + pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_operator | name, name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, text | text + pgtap | public | has_pk | name | text + pgtap | public | has_pk | name, name, text | text + pgtap | public | has_pk | name, text | text + pgtap | public | has_relation | name | text + pgtap | public | has_relation | name, name, text | text + pgtap | public | has_relation | name, text | text + pgtap | public | has_rightop | name, name | text + pgtap | public | has_rightop | name, name, name | text + pgtap | public | has_rightop | name, name, name, name | text + pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_rightop | name, name, name, text | text + pgtap | public | has_rightop | name, name, text | text + pgtap | public | has_role | name | text + pgtap | public | has_role | name, text | text + pgtap | public | has_rule | name, name | text + pgtap | public | has_rule | name, name, name | text + pgtap | public | has_rule | name, name, name, text | text + pgtap | public | has_rule | name, name, text | text + pgtap | public | has_schema | name | text + pgtap | public | has_schema | name, text | text + pgtap | public | has_sequence | name | text + pgtap | public | has_sequence | name, name | text + pgtap | public | has_sequence | name, name, text | text + pgtap | public | has_sequence | name, text | text + pgtap | public | has_table | name | text + pgtap | public | has_table | name, name | text + pgtap | public | has_table | name, name, text | text + pgtap | public | has_table | name, text | text + pgtap | public | has_tablespace | name | text + pgtap | public | has_tablespace | name, text | text + pgtap | public | has_tablespace | name, text, text | text + pgtap | public | has_trigger | name, name | text + pgtap | public | has_trigger | name, name, name | text + pgtap | public | has_trigger | name, name, name, text | text + pgtap | public | has_trigger | name, name, text | text + pgtap | public | has_type | name | text + pgtap | public | has_type | name, name | text + pgtap | public | has_type | name, name, text | text + pgtap | public | has_type | name, text | text + pgtap | public | has_unique | text | text + pgtap | public | has_unique | text, text | text + pgtap | public | has_unique | text, text, text | text + pgtap | public | has_user | name | text + pgtap | public | has_user | name, text | text + pgtap | public | has_view | name | text + pgtap | public | has_view | name, name | text + pgtap | public | has_view | name, name, text | text + pgtap | public | has_view | name, text | text + pgtap | public | hasnt_cast | name, name | text + pgtap | public | hasnt_cast | name, name, name | text + pgtap | public | hasnt_cast | name, name, name, name | text + pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | hasnt_cast | name, name, name, text | text + pgtap | public | hasnt_cast | name, name, text | text + pgtap | public | hasnt_column | name, name | text + pgtap | public | hasnt_column | name, name, name, text | text + pgtap | public | hasnt_column | name, name, text | text + pgtap | public | hasnt_composite | name | text + pgtap | public | hasnt_composite | name, name, text | text + pgtap | public | hasnt_composite | name, text | text + pgtap | public | hasnt_domain | name | text + pgtap | public | hasnt_domain | name, name | text + pgtap | public | hasnt_domain | name, name, text | text + pgtap | public | hasnt_domain | name, text | text + pgtap | public | hasnt_enum | name | text + pgtap | public | hasnt_enum | name, name | text + pgtap | public | hasnt_enum | name, name, text | text + pgtap | public | hasnt_enum | name, text | text + pgtap | public | hasnt_extension | name | text + pgtap | public | hasnt_extension | name, name | text + pgtap | public | hasnt_extension | name, name, text | text + pgtap | public | hasnt_extension | name, text | text + pgtap | public | hasnt_fk | name | text + pgtap | public | hasnt_fk | name, name, text | text + pgtap | public | hasnt_fk | name, text | text + pgtap | public | hasnt_foreign_table | name | text + pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_foreign_table | name, name, text | text + pgtap | public | hasnt_foreign_table | name, text | text + pgtap | public | hasnt_function | name | text + pgtap | public | hasnt_function | name, name | text + pgtap | public | hasnt_function | name, name, name[] | text + pgtap | public | hasnt_function | name, name, name[], text | text + pgtap | public | hasnt_function | name, name, text | text + pgtap | public | hasnt_function | name, name[] | text + pgtap | public | hasnt_function | name, name[], text | text + pgtap | public | hasnt_function | name, text | text + pgtap | public | hasnt_group | name | text + pgtap | public | hasnt_group | name, text | text + pgtap | public | hasnt_index | name, name | text + pgtap | public | hasnt_index | name, name, name | text + pgtap | public | hasnt_index | name, name, name, text | text + pgtap | public | hasnt_index | name, name, text | text + pgtap | public | hasnt_inherited_tables | name | text + pgtap | public | hasnt_inherited_tables | name, name | text + pgtap | public | hasnt_inherited_tables | name, name, text | text + pgtap | public | hasnt_inherited_tables | name, text | text + pgtap | public | hasnt_language | name | text + pgtap | public | hasnt_language | name, text | text + pgtap | public | hasnt_leftop | name, name | text + pgtap | public | hasnt_leftop | name, name, name | text + pgtap | public | hasnt_leftop | name, name, name, name | text + pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_leftop | name, name, name, text | text + pgtap | public | hasnt_leftop | name, name, text | text + pgtap | public | hasnt_materialized_view | name | text + pgtap | public | hasnt_materialized_view | name, name, text | text + pgtap | public | hasnt_materialized_view | name, text | text + pgtap | public | hasnt_opclass | name | text + pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_opclass | name, name, text | text + pgtap | public | hasnt_opclass | name, text | text + pgtap | public | hasnt_operator | name, name, name | text + pgtap | public | hasnt_operator | name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, text | text + pgtap | public | hasnt_pk | name | text + pgtap | public | hasnt_pk | name, name, text | text + pgtap | public | hasnt_pk | name, text | text + pgtap | public | hasnt_relation | name | text + pgtap | public | hasnt_relation | name, name, text | text + pgtap | public | hasnt_relation | name, text | text + pgtap | public | hasnt_rightop | name, name | text + pgtap | public | hasnt_rightop | name, name, name | text + pgtap | public | hasnt_rightop | name, name, name, name | text + pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_rightop | name, name, name, text | text + pgtap | public | hasnt_rightop | name, name, text | text + pgtap | public | hasnt_role | name | text + pgtap | public | hasnt_role | name, text | text + pgtap | public | hasnt_rule | name, name | text + pgtap | public | hasnt_rule | name, name, name | text + pgtap | public | hasnt_rule | name, name, name, text | text + pgtap | public | hasnt_rule | name, name, text | text + pgtap | public | hasnt_schema | name | text + pgtap | public | hasnt_schema | name, text | text + pgtap | public | hasnt_sequence | name | text + pgtap | public | hasnt_sequence | name, name, text | text + pgtap | public | hasnt_sequence | name, text | text + pgtap | public | hasnt_table | name | text + pgtap | public | hasnt_table | name, name | text + pgtap | public | hasnt_table | name, name, text | text + pgtap | public | hasnt_table | name, text | text + pgtap | public | hasnt_tablespace | name | text + pgtap | public | hasnt_tablespace | name, text | text + pgtap | public | hasnt_trigger | name, name | text + pgtap | public | hasnt_trigger | name, name, name | text + pgtap | public | hasnt_trigger | name, name, name, text | text + pgtap | public | hasnt_trigger | name, name, text | text + pgtap | public | hasnt_type | name | text + pgtap | public | hasnt_type | name, name | text + pgtap | public | hasnt_type | name, name, text | text + pgtap | public | hasnt_type | name, text | text + pgtap | public | hasnt_user | name | text + pgtap | public | hasnt_user | name, text | text + pgtap | public | hasnt_view | name | text + pgtap | public | hasnt_view | name, name | text + pgtap | public | hasnt_view | name, name, text | text + pgtap | public | hasnt_view | name, text | text + pgtap | public | ialike | anyelement, text | text + pgtap | public | ialike | anyelement, text, text | text + pgtap | public | imatches | anyelement, text | text + pgtap | public | imatches | anyelement, text, text | text + pgtap | public | in_todo | | boolean + pgtap | public | index_is_primary | name | text + pgtap | public | index_is_primary | name, name | text + pgtap | public | index_is_primary | name, name, name | text + pgtap | public | index_is_primary | name, name, name, text | text + pgtap | public | index_is_type | name, name | text + pgtap | public | index_is_type | name, name, name | text + pgtap | public | index_is_type | name, name, name, name | text + pgtap | public | index_is_type | name, name, name, name, text | text + pgtap | public | index_is_unique | name | text + pgtap | public | index_is_unique | name, name | text + pgtap | public | index_is_unique | name, name, name | text + pgtap | public | index_is_unique | name, name, name, text | text + pgtap | public | index_owner_is | name, name, name | text + pgtap | public | index_owner_is | name, name, name, name | text + pgtap | public | index_owner_is | name, name, name, name, text | text + pgtap | public | index_owner_is | name, name, name, text | text + pgtap | public | indexes_are | name, name, name[] | text + pgtap | public | indexes_are | name, name, name[], text | text + pgtap | public | indexes_are | name, name[] | text + pgtap | public | indexes_are | name, name[], text | text + pgtap | public | is | anyelement, anyelement | text + pgtap | public | is | anyelement, anyelement, text | text + pgtap | public | is_aggregate | name | text + pgtap | public | is_aggregate | name, name | text + pgtap | public | is_aggregate | name, name, name[] | text + pgtap | public | is_aggregate | name, name, name[], text | text + pgtap | public | is_aggregate | name, name, text | text + pgtap | public | is_aggregate | name, name[] | text + pgtap | public | is_aggregate | name, name[], text | text + pgtap | public | is_aggregate | name, text | text + pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_ancestor_of | name, name, integer | text + pgtap | public | is_ancestor_of | name, name, integer, text | text + pgtap | public | is_ancestor_of | name, name, name, name | text + pgtap | public | is_ancestor_of | name, name, name, name, integer | text + pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text + pgtap | public | is_ancestor_of | name, name, name, name, text | text + pgtap | public | is_ancestor_of | name, name, text | text + pgtap | public | is_clustered | name | text + pgtap | public | is_clustered | name, name | text + pgtap | public | is_clustered | name, name, name | text + pgtap | public | is_clustered | name, name, name, text | text + pgtap | public | is_definer | name | text + pgtap | public | is_definer | name, name | text + pgtap | public | is_definer | name, name, name[] | text + pgtap | public | is_definer | name, name, name[], text | text + pgtap | public | is_definer | name, name, text | text + pgtap | public | is_definer | name, name[] | text + pgtap | public | is_definer | name, name[], text | text + pgtap | public | is_definer | name, text | text + pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_descendent_of | name, name, integer | text + pgtap | public | is_descendent_of | name, name, integer, text | text + pgtap | public | is_descendent_of | name, name, name, name | text + pgtap | public | is_descendent_of | name, name, name, name, integer | text + pgtap | public | is_descendent_of | name, name, name, name, integer, text | text + pgtap | public | is_descendent_of | name, name, name, name, text | text + pgtap | public | is_descendent_of | name, name, text | text + pgtap | public | is_empty | text | text + pgtap | public | is_empty | text, text | text + pgtap | public | is_indexed | name, name | text + pgtap | public | is_indexed | name, name, name | text + pgtap | public | is_indexed | name, name, name, text | text + pgtap | public | is_indexed | name, name, name[] | text + pgtap | public | is_indexed | name, name, name[], text | text + pgtap | public | is_indexed | name, name[] | text + pgtap | public | is_indexed | name, name[], text | text + pgtap | public | is_member_of | name, name | text + pgtap | public | is_member_of | name, name, text | text + pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_member_of | name, name[], text | text + pgtap | public | is_normal_function | name | text + pgtap | public | is_normal_function | name, name | text + pgtap | public | is_normal_function | name, name, name[] | text + pgtap | public | is_normal_function | name, name, name[], text | text + pgtap | public | is_normal_function | name, name, text | text + pgtap | public | is_normal_function | name, name[] | text + pgtap | public | is_normal_function | name, name[], text | text + pgtap | public | is_normal_function | name, text | text + pgtap | public | is_partition_of | name, name | text + pgtap | public | is_partition_of | name, name, name, name | text + pgtap | public | is_partition_of | name, name, name, name, text | text + pgtap | public | is_partition_of | name, name, text | text + pgtap | public | is_partitioned | name | text + pgtap | public | is_partitioned | name, name | text + pgtap | public | is_partitioned | name, name, text | text + pgtap | public | is_partitioned | name, text | text + pgtap | public | is_procedure | name | text + pgtap | public | is_procedure | name, name | text + pgtap | public | is_procedure | name, name, name[] | text + pgtap | public | is_procedure | name, name, name[], text | text + pgtap | public | is_procedure | name, name, text | text + pgtap | public | is_procedure | name, name[] | text + pgtap | public | is_procedure | name, name[], text | text + pgtap | public | is_procedure | name, text | text + pgtap | public | is_strict | name | text + pgtap | public | is_strict | name, name | text + pgtap | public | is_strict | name, name, name[] | text + pgtap | public | is_strict | name, name, name[], text | text + pgtap | public | is_strict | name, name, text | text + pgtap | public | is_strict | name, name[] | text + pgtap | public | is_strict | name, name[], text | text + pgtap | public | is_strict | name, text | text + pgtap | public | is_superuser | name | text + pgtap | public | is_superuser | name, text | text + pgtap | public | is_window | name | text + pgtap | public | is_window | name, name | text + pgtap | public | is_window | name, name, name[] | text + pgtap | public | is_window | name, name, name[], text | text + pgtap | public | is_window | name, name, text | text + pgtap | public | is_window | name, name[] | text + pgtap | public | is_window | name, name[], text | text + pgtap | public | is_window | name, text | text + pgtap | public | isa_ok | anyelement, regtype | text + pgtap | public | isa_ok | anyelement, regtype, text | text + pgtap | public | isnt | anyelement, anyelement | text + pgtap | public | isnt | anyelement, anyelement, text | text + pgtap | public | isnt_aggregate | name | text + pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt_aggregate | name, name, name[] | text + pgtap | public | isnt_aggregate | name, name, name[], text | text + pgtap | public | isnt_aggregate | name, name, text | text + pgtap | public | isnt_aggregate | name, name[] | text + pgtap | public | isnt_aggregate | name, name[], text | text + pgtap | public | isnt_aggregate | name, text | text + pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_ancestor_of | name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name, integer, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name, text | text + pgtap | public | isnt_ancestor_of | name, name, text | text + pgtap | public | isnt_definer | name | text + pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_definer | name, name, name[] | text + pgtap | public | isnt_definer | name, name, name[], text | text + pgtap | public | isnt_definer | name, name, text | text + pgtap | public | isnt_definer | name, name[] | text + pgtap | public | isnt_definer | name, name[], text | text + pgtap | public | isnt_definer | name, text | text + pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_descendent_of | name, name, integer | text + pgtap | public | isnt_descendent_of | name, name, integer, text | text + pgtap | public | isnt_descendent_of | name, name, name, name | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, text | text + pgtap | public | isnt_descendent_of | name, name, text | text + pgtap | public | isnt_empty | text | text + pgtap | public | isnt_empty | text, text | text + pgtap | public | isnt_member_of | name, name | text + pgtap | public | isnt_member_of | name, name, text | text + pgtap | public | isnt_member_of | name, name[] | text + pgtap | public | isnt_member_of | name, name[], text | text + pgtap | public | isnt_normal_function | name | text + pgtap | public | isnt_normal_function | name, name | text + pgtap | public | isnt_normal_function | name, name, name[] | text + pgtap | public | isnt_normal_function | name, name, name[], text | text + pgtap | public | isnt_normal_function | name, name, text | text + pgtap | public | isnt_normal_function | name, name[] | text + pgtap | public | isnt_normal_function | name, name[], text | text + pgtap | public | isnt_normal_function | name, text | text + pgtap | public | isnt_partitioned | name | text + pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_partitioned | name, name, text | text + pgtap | public | isnt_partitioned | name, text | text + pgtap | public | isnt_procedure | name | text + pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_procedure | name, name, name[] | text + pgtap | public | isnt_procedure | name, name, name[], text | text + pgtap | public | isnt_procedure | name, name, text | text + pgtap | public | isnt_procedure | name, name[] | text + pgtap | public | isnt_procedure | name, name[], text | text + pgtap | public | isnt_procedure | name, text | text + pgtap | public | isnt_strict | name | text + pgtap | public | isnt_strict | name, name | text + pgtap | public | isnt_strict | name, name, name[] | text + pgtap | public | isnt_strict | name, name, name[], text | text + pgtap | public | isnt_strict | name, name, text | text + pgtap | public | isnt_strict | name, name[] | text + pgtap | public | isnt_strict | name, name[], text | text + pgtap | public | isnt_strict | name, text | text + pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_superuser | name, text | text + pgtap | public | isnt_window | name | text + pgtap | public | isnt_window | name, name | text + pgtap | public | isnt_window | name, name, name[] | text + pgtap | public | isnt_window | name, name, name[], text | text + pgtap | public | isnt_window | name, name, text | text + pgtap | public | isnt_window | name, name[] | text + pgtap | public | isnt_window | name, name[], text | text + pgtap | public | isnt_window | name, text | text + pgtap | public | language_is_trusted | name | text + pgtap | public | language_is_trusted | name, text | text + pgtap | public | language_owner_is | name, name | text + pgtap | public | language_owner_is | name, name, text | text + pgtap | public | language_privs_are | name, name, name[] | text + pgtap | public | language_privs_are | name, name, name[], text | text + pgtap | public | languages_are | name[] | text + pgtap | public | languages_are | name[], text | text + pgtap | public | lives_ok | text | text + pgtap | public | lives_ok | text, text | text + pgtap | public | matches | anyelement, text | text + pgtap | public | matches | anyelement, text, text | text + pgtap | public | materialized_view_owner_is | name, name | text + pgtap | public | materialized_view_owner_is | name, name, name | text + pgtap | public | materialized_view_owner_is | name, name, name, text | text + pgtap | public | materialized_view_owner_is | name, name, text | text + pgtap | public | materialized_views_are | name, name[] | text + pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_views_are | name[] | text + pgtap | public | materialized_views_are | name[], text | text + pgtap | public | no_plan | | SETOF boolean + pgtap | public | num_failed | | integer + pgtap | public | ok | boolean | text + pgtap | public | ok | boolean, text | text + pgtap | public | opclass_owner_is | name, name | text + pgtap | public | opclass_owner_is | name, name, name | text + pgtap | public | opclass_owner_is | name, name, name, text | text + pgtap | public | opclass_owner_is | name, name, text | text + pgtap | public | opclasses_are | name, name[] | text + pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclasses_are | name[] | text + pgtap | public | opclasses_are | name[], text | text + pgtap | public | operators_are | name, text[] | text + pgtap | public | operators_are | name, text[], text | text + pgtap | public | operators_are | text[] | text + pgtap | public | operators_are | text[], text | text + pgtap | public | os_name | | text + pgtap | public | partitions_are | name, name, name[] | text + pgtap | public | partitions_are | name, name, name[], text | text + pgtap | public | partitions_are | name, name[] | text + pgtap | public | partitions_are | name, name[], text | text + pgtap | public | pass | | text + pgtap | public | pass | text | text + pgtap | public | performs_ok | text, numeric | text + pgtap | public | performs_ok | text, numeric, text | text + pgtap | public | performs_within | text, numeric, numeric | text + pgtap | public | performs_within | text, numeric, numeric, integer | text + pgtap | public | performs_within | text, numeric, numeric, integer, text | text + pgtap | public | performs_within | text, numeric, numeric, text | text + pgtap | public | pg_version | | text + pgtap | public | pg_version_num | | integer + pgtap | public | pgtap_version | | numeric + pgtap | public | plan | integer | text + pgtap | public | policies_are | name, name, name[] | text + pgtap | public | policies_are | name, name, name[], text | text + pgtap | public | policies_are | name, name[] | text + pgtap | public | policies_are | name, name[], text | text + pgtap | public | policy_cmd_is | name, name, name, text | text + pgtap | public | policy_cmd_is | name, name, name, text, text | text + pgtap | public | policy_cmd_is | name, name, text | text + pgtap | public | policy_cmd_is | name, name, text, text | text + pgtap | public | policy_roles_are | name, name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name, name[], text | text + pgtap | public | policy_roles_are | name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name[], text | text + pgtap | public | relation_owner_is | name, name | text + pgtap | public | relation_owner_is | name, name, name | text + pgtap | public | relation_owner_is | name, name, name, text | text + pgtap | public | relation_owner_is | name, name, text | text + pgtap | public | results_eq | refcursor, anyarray | text + pgtap | public | results_eq | refcursor, anyarray, text | text + pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_eq | refcursor, refcursor, text | text + pgtap | public | results_eq | refcursor, text | text + pgtap | public | results_eq | refcursor, text, text | text + pgtap | public | results_eq | text, anyarray | text + pgtap | public | results_eq | text, anyarray, text | text + pgtap | public | results_eq | text, refcursor | text + pgtap | public | results_eq | text, refcursor, text | text + pgtap | public | results_eq | text, text | text + pgtap | public | results_eq | text, text, text | text + pgtap | public | results_ne | refcursor, anyarray | text + pgtap | public | results_ne | refcursor, anyarray, text | text + pgtap | public | results_ne | refcursor, refcursor | text + pgtap | public | results_ne | refcursor, refcursor, text | text + pgtap | public | results_ne | refcursor, text | text + pgtap | public | results_ne | refcursor, text, text | text + pgtap | public | results_ne | text, anyarray | text + pgtap | public | results_ne | text, anyarray, text | text + pgtap | public | results_ne | text, refcursor | text + pgtap | public | results_ne | text, refcursor, text | text + pgtap | public | results_ne | text, text | text + pgtap | public | results_ne | text, text, text | text + pgtap | public | roles_are | name[] | text + pgtap | public | roles_are | name[], text | text + pgtap | public | row_eq | text, anyelement | text + pgtap | public | row_eq | text, anyelement, text | text + pgtap | public | rule_is_instead | name, name | text + pgtap | public | rule_is_instead | name, name, name | text + pgtap | public | rule_is_instead | name, name, name, text | text + pgtap | public | rule_is_instead | name, name, text | text + pgtap | public | rule_is_on | name, name, name, text | text + pgtap | public | rule_is_on | name, name, name, text, text | text + pgtap | public | rule_is_on | name, name, text | text + pgtap | public | rule_is_on | name, name, text, text | text + pgtap | public | rules_are | name, name, name[] | text + pgtap | public | rules_are | name, name, name[], text | text + pgtap | public | rules_are | name, name[] | text + pgtap | public | rules_are | name, name[], text | text + pgtap | public | runtests | | SETOF text + pgtap | public | runtests | name | SETOF text + pgtap | public | runtests | name, text | SETOF text + pgtap | public | runtests | text | SETOF text + pgtap | public | schema_owner_is | name, name | text + pgtap | public | schema_owner_is | name, name, text | text + pgtap | public | schema_privs_are | name, name, name[] | text + pgtap | public | schema_privs_are | name, name, name[], text | text + pgtap | public | schemas_are | name[] | text + pgtap | public | schemas_are | name[], text | text + pgtap | public | sequence_owner_is | name, name | text + pgtap | public | sequence_owner_is | name, name, name | text + pgtap | public | sequence_owner_is | name, name, name, text | text + pgtap | public | sequence_owner_is | name, name, text | text + pgtap | public | sequence_privs_are | name, name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name, name[], text | text + pgtap | public | sequence_privs_are | name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name[], text | text + pgtap | public | sequences_are | name, name[] | text + pgtap | public | sequences_are | name, name[], text | text + pgtap | public | sequences_are | name[] | text + pgtap | public | sequences_are | name[], text | text + pgtap | public | server_privs_are | name, name, name[] | text + pgtap | public | server_privs_are | name, name, name[], text | text + pgtap | public | set_eq | text, anyarray | text + pgtap | public | set_eq | text, anyarray, text | text + pgtap | public | set_eq | text, text | text + pgtap | public | set_eq | text, text, text | text + pgtap | public | set_has | text, text | text + pgtap | public | set_has | text, text, text | text + pgtap | public | set_hasnt | text, text | text + pgtap | public | set_hasnt | text, text, text | text + pgtap | public | set_ne | text, anyarray | text + pgtap | public | set_ne | text, anyarray, text | text + pgtap | public | set_ne | text, text | text + pgtap | public | set_ne | text, text, text | text + pgtap | public | skip | integer | text + pgtap | public | skip | integer, text | text + pgtap | public | skip | text | text + pgtap | public | skip | why text, how_many integer | text + pgtap | public | table_owner_is | name, name | text + pgtap | public | table_owner_is | name, name, name | text + pgtap | public | table_owner_is | name, name, name, text | text + pgtap | public | table_owner_is | name, name, text | text + pgtap | public | table_privs_are | name, name, name, name[] | text + pgtap | public | table_privs_are | name, name, name, name[], text | text + pgtap | public | table_privs_are | name, name, name[] | text + pgtap | public | table_privs_are | name, name, name[], text | text + pgtap | public | tables_are | name, name[] | text + pgtap | public | tables_are | name, name[], text | text + pgtap | public | tables_are | name[] | text + pgtap | public | tables_are | name[], text | text + pgtap | public | tablespace_owner_is | name, name | text + pgtap | public | tablespace_owner_is | name, name, text | text + pgtap | public | tablespace_privs_are | name, name, name[] | text + pgtap | public | tablespace_privs_are | name, name, name[], text | text + pgtap | public | tablespaces_are | name[] | text + pgtap | public | tablespaces_are | name[], text | text + pgtap | public | throws_ilike | text, text | text + pgtap | public | throws_ilike | text, text, text | text + pgtap | public | throws_imatching | text, text | text + pgtap | public | throws_imatching | text, text, text | text + pgtap | public | throws_like | text, text | text + pgtap | public | throws_like | text, text, text | text + pgtap | public | throws_matching | text, text | text + pgtap | public | throws_matching | text, text, text | text + pgtap | public | throws_ok | text | text + pgtap | public | throws_ok | text, character, text, text | text + pgtap | public | throws_ok | text, integer | text + pgtap | public | throws_ok | text, integer, text | text + pgtap | public | throws_ok | text, integer, text, text | text + pgtap | public | throws_ok | text, text | text + pgtap | public | throws_ok | text, text, text | text + pgtap | public | todo | how_many integer | SETOF boolean + pgtap | public | todo | how_many integer, why text | SETOF boolean + pgtap | public | todo | why text | SETOF boolean + pgtap | public | todo | why text, how_many integer | SETOF boolean + pgtap | public | todo_end | | SETOF boolean + pgtap | public | todo_start | | SETOF boolean + pgtap | public | todo_start | text | SETOF boolean + pgtap | public | trigger_is | name, name, name | text + pgtap | public | trigger_is | name, name, name, name, name | text + pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | trigger_is | name, name, name, text | text + pgtap | public | triggers_are | name, name, name[] | text + pgtap | public | triggers_are | name, name, name[], text | text + pgtap | public | triggers_are | name, name[] | text + pgtap | public | triggers_are | name, name[], text | text + pgtap | public | type_owner_is | name, name | text + pgtap | public | type_owner_is | name, name, name | text + pgtap | public | type_owner_is | name, name, name, text | text + pgtap | public | type_owner_is | name, name, text | text + pgtap | public | types_are | name, name[] | text + pgtap | public | types_are | name, name[], text | text + pgtap | public | types_are | name[] | text + pgtap | public | types_are | name[], text | text + pgtap | public | unalike | anyelement, text | text + pgtap | public | unalike | anyelement, text, text | text + pgtap | public | unialike | anyelement, text | text + pgtap | public | unialike | anyelement, text, text | text + pgtap | public | users_are | name[] | text + pgtap | public | users_are | name[], text | text + pgtap | public | view_owner_is | name, name | text + pgtap | public | view_owner_is | name, name, name | text + pgtap | public | view_owner_is | name, name, name, text | text + pgtap | public | view_owner_is | name, name, text | text + pgtap | public | views_are | name, name[] | text + pgtap | public | views_are | name, name[], text | text + pgtap | public | views_are | name[] | text + pgtap | public | views_are | name[], text | text + pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | volatility_is | name, name, name[], text, text | text + pgtap | public | volatility_is | name, name, text | text + pgtap | public | volatility_is | name, name, text, text | text + pgtap | public | volatility_is | name, name[], text | text + pgtap | public | volatility_is | name, name[], text, text | text + pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, text, text | text + plpgsql | pg_catalog | plpgsql_call_handler | | language_handler + plpgsql | pg_catalog | plpgsql_inline_handler | internal | void + plpgsql | pg_catalog | plpgsql_validator | oid | void + plpgsql_check | public | __plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | __plpgsql_show_dependency_tb | name text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_check_function | funcoid regprocedure, relid regclass, format text, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | SETOF text + plpgsql_check | public | plpgsql_check_function | name text, relid regclass, format text, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | SETOF text + plpgsql_check | public | plpgsql_check_function_tb | funcoid regprocedure, relid regclass, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | TABLE(functionid regproc, lineno integer, statement text, sqlstate text, message text, detail text, hint text, level text, "position" integer, query text, context text) + plpgsql_check | public | plpgsql_check_function_tb | name text, relid regclass, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | TABLE(functionid regproc, lineno integer, statement text, sqlstate text, message text, detail text, hint text, level text, "position" integer, query text, context text) + plpgsql_check | public | plpgsql_check_pragma | VARIADIC name text[] | integer + plpgsql_check | public | plpgsql_check_profiler | enable boolean | boolean + plpgsql_check | public | plpgsql_check_tracer | enable boolean, verbosity text | boolean + plpgsql_check | public | plpgsql_coverage_branches | funcoid regprocedure | double precision + plpgsql_check | public | plpgsql_coverage_branches | name text | double precision + plpgsql_check | public | plpgsql_coverage_statements | funcoid regprocedure | double precision + plpgsql_check | public | plpgsql_coverage_statements | name text | double precision + plpgsql_check | public | plpgsql_profiler_function_statements_tb | funcoid regprocedure | TABLE(stmtid integer, parent_stmtid integer, parent_note text, block_num integer, lineno integer, queryid bigint, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision, processed_rows bigint, stmtname text) + plpgsql_check | public | plpgsql_profiler_function_statements_tb | name text | TABLE(stmtid integer, parent_stmtid integer, parent_note text, block_num integer, lineno integer, queryid bigint, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision, processed_rows bigint, stmtname text) + plpgsql_check | public | plpgsql_profiler_function_tb | funcoid regprocedure | TABLE(lineno integer, stmt_lineno integer, queryids bigint[], cmds_on_row integer, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision[], processed_rows bigint[], source text) + plpgsql_check | public | plpgsql_profiler_function_tb | name text | TABLE(lineno integer, stmt_lineno integer, queryids bigint[], cmds_on_row integer, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision[], processed_rows bigint[], source text) + plpgsql_check | public | plpgsql_profiler_functions_all | | TABLE(funcoid regprocedure, exec_count bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, stddev_time double precision, min_time double precision, max_time double precision) + plpgsql_check | public | plpgsql_profiler_install_fake_queryid_hook | | void + plpgsql_check | public | plpgsql_profiler_remove_fake_queryid_hook | | void + plpgsql_check | public | plpgsql_profiler_reset | funcoid regprocedure | void + plpgsql_check | public | plpgsql_profiler_reset_all | | void + plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + postgis | public | _postgis_deprecate | oldname text, newname text, version text | void + postgis | public | _postgis_index_extent | tbl regclass, col text | box2d + postgis | public | _postgis_join_selectivity | regclass, text, regclass, text, text | double precision + postgis | public | _postgis_pgsql_version | | text + postgis | public | _postgis_scripts_pgsql_version | | text + postgis | public | _postgis_selectivity | tbl regclass, att_name text, geom geometry, mode text | double precision + postgis | public | _postgis_stats | tbl regclass, att_name text, text | text + postgis | public | _st_3ddfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_3ddwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_3dintersects | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_asgml | integer, geometry, integer, integer, text, text | text + postgis | public | _st_asx3d | integer, geometry, integer, integer, text | text + postgis | public | _st_bestsrid | geography | integer + postgis | public | _st_bestsrid | geography, geography | integer + postgis | public | _st_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_containsproperly | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean + postgis | public | _st_coveredby | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_covers | geog1 geography, geog2 geography | boolean + postgis | public | _st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_crosses | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_distancetree | geography, geography | double precision + postgis | public | _st_distancetree | geography, geography, double precision, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography | double precision + postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography, double precision, boolean | double precision + postgis | public | _st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean + postgis | public | _st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision, boolean | boolean + postgis | public | _st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_expand | geography, double precision | geography + postgis | public | _st_geomfromgml | text, integer | geometry + postgis | public | _st_intersects | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_linecrossingdirection | line1 geometry, line2 geometry | integer + postgis | public | _st_longestline | geom1 geometry, geom2 geometry | geometry + postgis | public | _st_maxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | _st_orderingequals | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_pointoutside | geography | geography + postgis | public | _st_sortablehash | geom geometry | bigint + postgis | public | _st_touches | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_voronoi | g1 geometry, clip geometry, tolerance double precision, return_polygons boolean | geometry + postgis | public | _st_within | geom1 geometry, geom2 geometry | boolean + postgis | public | addauth | text | boolean + postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | box | box3d | box + postgis | public | box | geometry | box + postgis | public | box2d | box3d | box2d + postgis | public | box2d | geometry | box2d + postgis | public | box2d_in | cstring | box2d + postgis | public | box2d_out | box2d | cstring + postgis | public | box2df_in | cstring | box2df + postgis | public | box2df_out | box2df | cstring + postgis | public | box3d | box2d | box3d + postgis | public | box3d | geometry | box3d + postgis | public | box3d_in | cstring | box3d + postgis | public | box3d_out | box3d | cstring + postgis | public | box3dtobox | box3d | box + postgis | public | bytea | geography | bytea + postgis | public | bytea | geometry | bytea + postgis | public | checkauth | text, text | integer + postgis | public | checkauth | text, text, text | integer + postgis | public | checkauthtrigger | | trigger + postgis | public | contains_2d | box2df, box2df | boolean + postgis | public | contains_2d | box2df, geometry | boolean + postgis | public | contains_2d | geometry, box2df | boolean + postgis | public | disablelongtransactions | | text + postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text + postgis | public | dropgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying | text + postgis | public | dropgeometrycolumn | table_name character varying, column_name character varying | text + postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text + postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrytable | table_name character varying | text + postgis | public | enablelongtransactions | | text + postgis | public | equals | geom1 geometry, geom2 geometry | boolean + postgis | public | find_srid | character varying, character varying, character varying | integer + postgis | public | geog_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geography | bytea | geography + postgis | public | geography | geography, integer, boolean | geography + postgis | public | geography | geometry | geography + postgis | public | geography_analyze | internal | boolean + postgis | public | geography_cmp | geography, geography | integer + postgis | public | geography_distance_knn | geography, geography | double precision + postgis | public | geography_eq | geography, geography | boolean + postgis | public | geography_ge | geography, geography | boolean + postgis | public | geography_gist_compress | internal | internal + postgis | public | geography_gist_consistent | internal, geography, integer | boolean + postgis | public | geography_gist_decompress | internal | internal + postgis | public | geography_gist_distance | internal, geography, integer | double precision + postgis | public | geography_gist_penalty | internal, internal, internal | internal + postgis | public | geography_gist_picksplit | internal, internal | internal + postgis | public | geography_gist_same | box2d, box2d, internal | internal + postgis | public | geography_gist_union | bytea, internal | internal + postgis | public | geography_gt | geography, geography | boolean + postgis | public | geography_in | cstring, oid, integer | geography + postgis | public | geography_le | geography, geography | boolean + postgis | public | geography_lt | geography, geography | boolean + postgis | public | geography_out | geography | cstring + postgis | public | geography_overlaps | geography, geography | boolean + postgis | public | geography_recv | internal, oid, integer | geography + postgis | public | geography_send | geography | bytea + postgis | public | geography_spgist_choose_nd | internal, internal | void + postgis | public | geography_spgist_compress_nd | internal | internal + postgis | public | geography_spgist_config_nd | internal, internal | void + postgis | public | geography_spgist_inner_consistent_nd | internal, internal | void + postgis | public | geography_spgist_leaf_consistent_nd | internal, internal | boolean + postgis | public | geography_spgist_picksplit_nd | internal, internal | void + postgis | public | geography_typmod_in | cstring[] | integer + postgis | public | geography_typmod_out | integer | cstring + postgis | public | geom2d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geom3d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geom4d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geometry | box2d | geometry + postgis | public | geometry | box3d | geometry + postgis | public | geometry | bytea | geometry + postgis | public | geometry | geography | geometry + postgis | public | geometry | geometry, integer, boolean | geometry + postgis | public | geometry | path | geometry + postgis | public | geometry | point | geometry + postgis | public | geometry | polygon | geometry + postgis | public | geometry | text | geometry + postgis | public | geometry_above | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_analyze | internal | boolean + postgis | public | geometry_below | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_cmp | geom1 geometry, geom2 geometry | integer + postgis | public | geometry_contained_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains_nd | geometry, geometry | boolean + postgis | public | geometry_distance_box | geom1 geometry, geom2 geometry | double precision + postgis | public | geometry_distance_centroid | geom1 geometry, geom2 geometry | double precision + postgis | public | geometry_distance_centroid_nd | geometry, geometry | double precision + postgis | public | geometry_distance_cpa | geometry, geometry | double precision + postgis | public | geometry_eq | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_ge | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_gist_compress_2d | internal | internal + postgis | public | geometry_gist_compress_nd | internal | internal + postgis | public | geometry_gist_consistent_2d | internal, geometry, integer | boolean + postgis | public | geometry_gist_consistent_nd | internal, geometry, integer | boolean + postgis | public | geometry_gist_decompress_2d | internal | internal + postgis | public | geometry_gist_decompress_nd | internal | internal + postgis | public | geometry_gist_distance_2d | internal, geometry, integer | double precision + postgis | public | geometry_gist_distance_nd | internal, geometry, integer | double precision + postgis | public | geometry_gist_penalty_2d | internal, internal, internal | internal + postgis | public | geometry_gist_penalty_nd | internal, internal, internal | internal + postgis | public | geometry_gist_picksplit_2d | internal, internal | internal + postgis | public | geometry_gist_picksplit_nd | internal, internal | internal + postgis | public | geometry_gist_same_2d | geom1 geometry, geom2 geometry, internal | internal + postgis | public | geometry_gist_same_nd | geometry, geometry, internal | internal + postgis | public | geometry_gist_sortsupport_2d | internal | void + postgis | public | geometry_gist_union_2d | bytea, internal | internal + postgis | public | geometry_gist_union_nd | bytea, internal | internal + postgis | public | geometry_gt | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_hash | geometry | integer + postgis | public | geometry_in | cstring | geometry + postgis | public | geometry_le | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_left | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_lt | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_out | geometry | cstring + postgis | public | geometry_overabove | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overbelow | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps_nd | geometry, geometry | boolean + postgis | public | geometry_overleft | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overright | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_recv | internal | geometry + postgis | public | geometry_right | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same_nd | geometry, geometry | boolean + postgis | public | geometry_send | geometry | bytea + postgis | public | geometry_sortsupport | internal | void + postgis | public | geometry_spgist_choose_2d | internal, internal | void + postgis | public | geometry_spgist_choose_3d | internal, internal | void + postgis | public | geometry_spgist_choose_nd | internal, internal | void + postgis | public | geometry_spgist_compress_2d | internal | internal + postgis | public | geometry_spgist_compress_3d | internal | internal + postgis | public | geometry_spgist_compress_nd | internal | internal + postgis | public | geometry_spgist_config_2d | internal, internal | void + postgis | public | geometry_spgist_config_3d | internal, internal | void + postgis | public | geometry_spgist_config_nd | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_2d | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_3d | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_nd | internal, internal | void + postgis | public | geometry_spgist_leaf_consistent_2d | internal, internal | boolean + postgis | public | geometry_spgist_leaf_consistent_3d | internal, internal | boolean + postgis | public | geometry_spgist_leaf_consistent_nd | internal, internal | boolean + postgis | public | geometry_spgist_picksplit_2d | internal, internal | void + postgis | public | geometry_spgist_picksplit_3d | internal, internal | void + postgis | public | geometry_spgist_picksplit_nd | internal, internal | void + postgis | public | geometry_typmod_in | cstring[] | integer + postgis | public | geometry_typmod_out | integer | cstring + postgis | public | geometry_within | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_within_nd | geometry, geometry | boolean + postgis | public | geometrytype | geography | text + postgis | public | geometrytype | geometry | text + postgis | public | geomfromewkb | bytea | geometry + postgis | public | geomfromewkt | text | geometry + postgis | public | get_proj4_from_srid | integer | text + postgis | public | gettransactionid | | xid + postgis | public | gidx_in | cstring | gidx + postgis | public | gidx_out | gidx | cstring + postgis | public | gserialized_gist_joinsel_2d | internal, oid, internal, smallint | double precision + postgis | public | gserialized_gist_joinsel_nd | internal, oid, internal, smallint | double precision + postgis | public | gserialized_gist_sel_2d | internal, oid, internal, integer | double precision + postgis | public | gserialized_gist_sel_nd | internal, oid, internal, integer | double precision + postgis | public | is_contained_2d | box2df, box2df | boolean + postgis | public | is_contained_2d | box2df, geometry | boolean + postgis | public | is_contained_2d | geometry, box2df | boolean + postgis | public | json | geometry | json + postgis | public | jsonb | geometry | jsonb + postgis | public | lockrow | text, text, text | integer + postgis | public | lockrow | text, text, text, text | integer + postgis | public | lockrow | text, text, text, text, timestamp without time zone | integer + postgis | public | lockrow | text, text, text, timestamp without time zone | integer + postgis | public | longtransactionsenabled | | boolean + postgis | public | overlaps_2d | box2df, box2df | boolean + postgis | public | overlaps_2d | box2df, geometry | boolean + postgis | public | overlaps_2d | geometry, box2df | boolean + postgis | public | overlaps_geog | geography, gidx | boolean + postgis | public | overlaps_geog | gidx, geography | boolean + postgis | public | overlaps_geog | gidx, gidx | boolean + postgis | public | overlaps_nd | geometry, gidx | boolean + postgis | public | overlaps_nd | gidx, geometry | boolean + postgis | public | overlaps_nd | gidx, gidx | boolean + postgis | public | path | geometry | path + postgis | public | pgis_asflatgeobuf_finalfn | internal | bytea + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean, text | internal + postgis | public | pgis_asgeobuf_finalfn | internal | bytea + postgis | public | pgis_asgeobuf_transfn | internal, anyelement | internal + postgis | public | pgis_asgeobuf_transfn | internal, anyelement, text | internal + postgis | public | pgis_asmvt_combinefn | internal, internal | internal + postgis | public | pgis_asmvt_deserialfn | bytea, internal | internal + postgis | public | pgis_asmvt_finalfn | internal | bytea + postgis | public | pgis_asmvt_serialfn | internal | bytea + postgis | public | pgis_asmvt_transfn | internal, anyelement | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text, text | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision, integer | internal + postgis | public | pgis_geometry_clusterintersecting_finalfn | internal | geometry[] + postgis | public | pgis_geometry_clusterwithin_finalfn | internal | geometry[] + postgis | public | pgis_geometry_collect_finalfn | internal | geometry + postgis | public | pgis_geometry_makeline_finalfn | internal | geometry + postgis | public | pgis_geometry_polygonize_finalfn | internal | geometry + postgis | public | pgis_geometry_union_parallel_combinefn | internal, internal | internal + postgis | public | pgis_geometry_union_parallel_deserialfn | bytea, internal | internal + postgis | public | pgis_geometry_union_parallel_finalfn | internal | geometry + postgis | public | pgis_geometry_union_parallel_serialfn | internal | bytea + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry, double precision | internal + postgis | public | point | geometry | point + postgis | public | polygon | geometry | polygon + postgis | public | populate_geometry_columns | tbl_oid oid, use_typmod boolean | integer + postgis | public | populate_geometry_columns | use_typmod boolean | text + postgis | public | postgis_addbbox | geometry | geometry + postgis | public | postgis_cache_bbox | | trigger + postgis | public | postgis_constraint_dims | geomschema text, geomtable text, geomcolumn text | integer + postgis | public | postgis_constraint_srid | geomschema text, geomtable text, geomcolumn text | integer + postgis | public | postgis_constraint_type | geomschema text, geomtable text, geomcolumn text | character varying + postgis | public | postgis_dropbbox | geometry | geometry + postgis | public | postgis_extensions_upgrade | | text + postgis | public | postgis_full_version | | text + postgis | public | postgis_geos_noop | geometry | geometry + postgis | public | postgis_geos_version | | text + postgis | public | postgis_getbbox | geometry | box2d + postgis | public | postgis_hasbbox | geometry | boolean + postgis | public | postgis_index_supportfn | internal | internal + postgis | public | postgis_lib_build_date | | text + postgis | public | postgis_lib_revision | | text + postgis | public | postgis_lib_version | | text + postgis | public | postgis_libjson_version | | text + postgis | public | postgis_liblwgeom_version | | text + postgis | public | postgis_libprotobuf_version | | text + postgis | public | postgis_libxml_version | | text + postgis | public | postgis_noop | geometry | geometry + postgis | public | postgis_proj_version | | text + postgis | public | postgis_scripts_build_date | | text + postgis | public | postgis_scripts_installed | | text + postgis | public | postgis_scripts_released | | text + postgis | public | postgis_svn_version | | text + postgis | public | postgis_transform_geometry | geom geometry, text, text, integer | geometry + postgis | public | postgis_type_name | geomname character varying, coord_dimension integer, use_new_name boolean | character varying + postgis | public | postgis_typmod_dims | integer | integer + postgis | public | postgis_typmod_srid | integer | integer + postgis | public | postgis_typmod_type | integer | text + postgis | public | postgis_version | | text + postgis | public | postgis_wagyu_version | | text + postgis | public | spheroid_in | cstring | spheroid + postgis | public | spheroid_out | spheroid | cstring + postgis | public | st_3dclosestpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_3ddfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_3ddistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_3ddwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_3dextent | geometry | box3d + postgis | public | st_3dintersects | geom1 geometry, geom2 geometry | boolean + postgis | public | st_3dlength | geometry | double precision + postgis | public | st_3dlineinterpolatepoint | geometry, double precision | geometry + postgis | public | st_3dlongestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_3dmakebox | geom1 geometry, geom2 geometry | box3d + postgis | public | st_3dmaxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_3dperimeter | geometry | double precision + postgis | public | st_3dshortestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_addmeasure | geometry, double precision, double precision | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry, integer | geometry + postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision | geometry + postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision | geometry + postgis | public | st_angle | line1 geometry, line2 geometry | double precision + postgis | public | st_angle | pt1 geometry, pt2 geometry, pt3 geometry, pt4 geometry | double precision + postgis | public | st_area | geog geography, use_spheroid boolean | double precision + postgis | public | st_area | geometry | double precision + postgis | public | st_area | text | double precision + postgis | public | st_area2d | geometry | double precision + postgis | public | st_asbinary | geography | bytea + postgis | public | st_asbinary | geography, text | bytea + postgis | public | st_asbinary | geometry | bytea + postgis | public | st_asbinary | geometry, text | bytea + postgis | public | st_asencodedpolyline | geom geometry, nprecision integer | text + postgis | public | st_asewkb | geometry | bytea + postgis | public | st_asewkb | geometry, text | bytea + postgis | public | st_asewkt | geography | text + postgis | public | st_asewkt | geography, integer | text + postgis | public | st_asewkt | geometry | text + postgis | public | st_asewkt | geometry, integer | text + postgis | public | st_asewkt | text | text + postgis | public | st_asflatgeobuf | anyelement | bytea + postgis | public | st_asflatgeobuf | anyelement, boolean | bytea + postgis | public | st_asflatgeobuf | anyelement, boolean, text | bytea + postgis | public | st_asgeobuf | anyelement | bytea + postgis | public | st_asgeobuf | anyelement, text | bytea + postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean | text + postgis | public | st_asgeojson | text | text + postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgml | text | text + postgis | public | st_asgml | version integer, geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | version integer, geom geometry, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_ashexewkb | geometry | text + postgis | public | st_ashexewkb | geometry, text | text + postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text + postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_askml | text | text + postgis | public | st_aslatlontext | geom geometry, tmpl text | text + postgis | public | st_asmarc21 | geom geometry, format text | text + postgis | public | st_asmvt | anyelement | bytea + postgis | public | st_asmvt | anyelement, text | bytea + postgis | public | st_asmvt | anyelement, text, integer | bytea + postgis | public | st_asmvt | anyelement, text, integer, text | bytea + postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea + postgis | public | st_asmvtgeom | geom geometry, bounds box2d, extent integer, buffer integer, clip_geom boolean | geometry + postgis | public | st_assvg | geog geography, rel integer, maxdecimaldigits integer | text + postgis | public | st_assvg | geom geometry, rel integer, maxdecimaldigits integer | text + postgis | public | st_assvg | text | text + postgis | public | st_astext | geography | text + postgis | public | st_astext | geography, integer | text + postgis | public | st_astext | geometry | text + postgis | public | st_astext | geometry, integer | text + postgis | public | st_astext | text | text + postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astwkb | geom geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_asx3d | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision + postgis | public | st_azimuth | geom1 geometry, geom2 geometry | double precision + postgis | public | st_bdmpolyfromtext | text, integer | geometry + postgis | public | st_bdpolyfromtext | text, integer | geometry + postgis | public | st_boundary | geometry | geometry + postgis | public | st_boundingdiagonal | geom geometry, fits boolean | geometry + postgis | public | st_box2dfromgeohash | text, integer | box2d + postgis | public | st_buffer | geography, double precision | geography + postgis | public | st_buffer | geography, double precision, integer | geography + postgis | public | st_buffer | geography, double precision, text | geography + postgis | public | st_buffer | geom geometry, radius double precision, options text | geometry + postgis | public | st_buffer | geom geometry, radius double precision, quadsegs integer | geometry + postgis | public | st_buffer | text, double precision | geometry + postgis | public | st_buffer | text, double precision, integer | geometry + postgis | public | st_buffer | text, double precision, text | geometry + postgis | public | st_buildarea | geometry | geometry + postgis | public | st_centroid | geography, use_spheroid boolean | geography + postgis | public | st_centroid | geometry | geometry + postgis | public | st_centroid | text | geometry + postgis | public | st_chaikinsmoothing | geometry, integer, boolean | geometry + postgis | public | st_cleangeometry | geometry | geometry + postgis | public | st_clipbybox2d | geom geometry, box box2d | geometry + postgis | public | st_closestpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_closestpointofapproach | geometry, geometry | double precision + postgis | public | st_clusterdbscan | geometry, eps double precision, minpoints integer | integer + postgis | public | st_clusterintersecting | geometry | geometry[] + postgis | public | st_clusterintersecting | geometry[] | geometry[] + postgis | public | st_clusterkmeans | geom geometry, k integer, max_radius double precision | integer + postgis | public | st_clusterwithin | geometry, double precision | geometry[] + postgis | public | st_clusterwithin | geometry[], double precision | geometry[] + postgis | public | st_collect | geom1 geometry, geom2 geometry | geometry + postgis | public | st_collect | geometry | geometry + postgis | public | st_collect | geometry[] | geometry + postgis | public | st_collectionextract | geometry | geometry + postgis | public | st_collectionextract | geometry, integer | geometry + postgis | public | st_collectionhomogenize | geometry | geometry + postgis | public | st_combinebbox | box2d, geometry | box2d + postgis | public | st_combinebbox | box3d, box3d | box3d + postgis | public | st_combinebbox | box3d, geometry | box3d + postgis | public | st_concavehull | param_geom geometry, param_pctconvex double precision, param_allow_holes boolean | geometry + postgis | public | st_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | st_containsproperly | geom1 geometry, geom2 geometry | boolean + postgis | public | st_convexhull | geometry | geometry + postgis | public | st_coorddim | geometry geometry | smallint + postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean + postgis | public | st_coveredby | geom1 geometry, geom2 geometry | boolean + postgis | public | st_coveredby | text, text | boolean + postgis | public | st_covers | geog1 geography, geog2 geography | boolean + postgis | public | st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | st_covers | text, text | boolean + postgis | public | st_cpawithin | geometry, geometry, double precision | boolean + postgis | public | st_crosses | geom1 geometry, geom2 geometry | boolean + postgis | public | st_curvetoline | geom geometry, tol double precision, toltype integer, flags integer | geometry + postgis | public | st_delaunaytriangles | g1 geometry, tolerance double precision, flags integer | geometry + postgis | public | st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_difference | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_dimension | geometry | integer + postgis | public | st_disjoint | geom1 geometry, geom2 geometry | boolean + postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision + postgis | public | st_distance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_distance | text, text | double precision + postgis | public | st_distancecpa | geometry, geometry | double precision + postgis | public | st_distancesphere | geom1 geometry, geom2 geometry | double precision + postgis | public | st_distancesphere | geom1 geometry, geom2 geometry, radius double precision | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry, spheroid | double precision + postgis | public | st_dump | geometry | SETOF geometry_dump + postgis | public | st_dumppoints | geometry | SETOF geometry_dump + postgis | public | st_dumprings | geometry | SETOF geometry_dump + postgis | public | st_dumpsegments | geometry | SETOF geometry_dump + postgis | public | st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean + postgis | public | st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_dwithin | text, text, double precision | boolean + postgis | public | st_endpoint | geometry | geometry + postgis | public | st_envelope | geometry | geometry + postgis | public | st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_estimatedextent | text, text | box2d + postgis | public | st_estimatedextent | text, text, text | box2d + postgis | public | st_estimatedextent | text, text, text, boolean | box2d + postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d + postgis | public | st_expand | box box3d, dx double precision, dy double precision, dz double precision | box3d + postgis | public | st_expand | box2d, double precision | box2d + postgis | public | st_expand | box3d, double precision | box3d + postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry + postgis | public | st_expand | geometry, double precision | geometry + postgis | public | st_extent | geometry | box2d + postgis | public | st_exteriorring | geometry | geometry + postgis | public | st_filterbym | geometry, double precision, double precision, boolean | geometry + postgis | public | st_findextent | text, text | box2d + postgis | public | st_findextent | text, text, text | box2d + postgis | public | st_flipcoordinates | geometry | geometry + postgis | public | st_force2d | geometry | geometry + postgis | public | st_force3d | geom geometry, zvalue double precision | geometry + postgis | public | st_force3dm | geom geometry, mvalue double precision | geometry + postgis | public | st_force3dz | geom geometry, zvalue double precision | geometry + postgis | public | st_force4d | geom geometry, zvalue double precision, mvalue double precision | geometry + postgis | public | st_forcecollection | geometry | geometry + postgis | public | st_forcecurve | geometry | geometry + postgis | public | st_forcepolygonccw | geometry | geometry + postgis | public | st_forcepolygoncw | geometry | geometry + postgis | public | st_forcerhr | geometry | geometry + postgis | public | st_forcesfs | geometry | geometry + postgis | public | st_forcesfs | geometry, version text | geometry + postgis | public | st_frechetdistance | geom1 geometry, geom2 geometry, double precision | double precision + postgis | public | st_fromflatgeobuf | anyelement, bytea | SETOF anyelement + postgis | public | st_fromflatgeobuftotable | text, text, bytea | void + postgis | public | st_generatepoints | area geometry, npoints integer | geometry + postgis | public | st_generatepoints | area geometry, npoints integer, seed integer | geometry + postgis | public | st_geogfromtext | text | geography + postgis | public | st_geogfromwkb | bytea | geography + postgis | public | st_geographyfromtext | text | geography + postgis | public | st_geohash | geog geography, maxchars integer | text + postgis | public | st_geohash | geom geometry, maxchars integer | text + postgis | public | st_geomcollfromtext | text | geometry + postgis | public | st_geomcollfromtext | text, integer | geometry + postgis | public | st_geomcollfromwkb | bytea | geometry + postgis | public | st_geomcollfromwkb | bytea, integer | geometry + postgis | public | st_geometricmedian | g geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean | geometry + postgis | public | st_geometryfromtext | text | geometry + postgis | public | st_geometryfromtext | text, integer | geometry + postgis | public | st_geometryn | geometry, integer | geometry + postgis | public | st_geometrytype | geometry | text + postgis | public | st_geomfromewkb | bytea | geometry + postgis | public | st_geomfromewkt | text | geometry + postgis | public | st_geomfromgeohash | text, integer | geometry + postgis | public | st_geomfromgeojson | json | geometry + postgis | public | st_geomfromgeojson | jsonb | geometry + postgis | public | st_geomfromgeojson | text | geometry + postgis | public | st_geomfromgml | text | geometry + postgis | public | st_geomfromgml | text, integer | geometry + postgis | public | st_geomfromkml | text | geometry + postgis | public | st_geomfrommarc21 | marc21xml text | geometry + postgis | public | st_geomfromtext | text | geometry + postgis | public | st_geomfromtext | text, integer | geometry + postgis | public | st_geomfromtwkb | bytea | geometry + postgis | public | st_geomfromwkb | bytea | geometry + postgis | public | st_geomfromwkb | bytea, integer | geometry + postgis | public | st_gmltosql | text | geometry + postgis | public | st_gmltosql | text, integer | geometry + postgis | public | st_hasarc | geometry geometry | boolean + postgis | public | st_hausdorffdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_hausdorffdistance | geom1 geometry, geom2 geometry, double precision | double precision + postgis | public | st_hexagon | size double precision, cell_i integer, cell_j integer, origin geometry | geometry + postgis | public | st_hexagongrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record + postgis | public | st_interiorringn | geometry, integer | geometry + postgis | public | st_interpolatepoint | line geometry, point geometry | double precision + postgis | public | st_intersection | geography, geography | geography + postgis | public | st_intersection | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_intersection | text, text | geometry + postgis | public | st_intersects | geog1 geography, geog2 geography | boolean + postgis | public | st_intersects | geom1 geometry, geom2 geometry | boolean + postgis | public | st_intersects | text, text | boolean + postgis | public | st_isclosed | geometry | boolean + postgis | public | st_iscollection | geometry | boolean + postgis | public | st_isempty | geometry | boolean + postgis | public | st_ispolygonccw | geometry | boolean + postgis | public | st_ispolygoncw | geometry | boolean + postgis | public | st_isring | geometry | boolean + postgis | public | st_issimple | geometry | boolean + postgis | public | st_isvalid | geometry | boolean + postgis | public | st_isvalid | geometry, integer | boolean + postgis | public | st_isvaliddetail | geom geometry, flags integer | valid_detail + postgis | public | st_isvalidreason | geometry | text + postgis | public | st_isvalidreason | geometry, integer | text + postgis | public | st_isvalidtrajectory | geometry | boolean + postgis | public | st_length | geog geography, use_spheroid boolean | double precision + postgis | public | st_length | geometry | double precision + postgis | public | st_length | text | double precision + postgis | public | st_length2d | geometry | double precision + postgis | public | st_length2dspheroid | geometry, spheroid | double precision + postgis | public | st_lengthspheroid | geometry, spheroid | double precision + postgis | public | st_letters | letters text, font json | geometry + postgis | public | st_linecrossingdirection | line1 geometry, line2 geometry | integer + postgis | public | st_linefromencodedpolyline | txtin text, nprecision integer | geometry + postgis | public | st_linefrommultipoint | geometry | geometry + postgis | public | st_linefromtext | text | geometry + postgis | public | st_linefromtext | text, integer | geometry + postgis | public | st_linefromwkb | bytea | geometry + postgis | public | st_linefromwkb | bytea, integer | geometry + postgis | public | st_lineinterpolatepoint | geometry, double precision | geometry + postgis | public | st_lineinterpolatepoints | geometry, double precision, repeat boolean | geometry + postgis | public | st_linelocatepoint | geom1 geometry, geom2 geometry | double precision + postgis | public | st_linemerge | geometry | geometry + postgis | public | st_linemerge | geometry, boolean | geometry + postgis | public | st_linestringfromwkb | bytea | geometry + postgis | public | st_linestringfromwkb | bytea, integer | geometry + postgis | public | st_linesubstring | geometry, double precision, double precision | geometry + postgis | public | st_linetocurve | geometry geometry | geometry + postgis | public | st_locatealong | geometry geometry, measure double precision, leftrightoffset double precision | geometry + postgis | public | st_locatebetween | geometry geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision | geometry + postgis | public | st_locatebetweenelevations | geometry geometry, fromelevation double precision, toelevation double precision | geometry + postgis | public | st_longestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_m | geometry | double precision + postgis | public | st_makebox2d | geom1 geometry, geom2 geometry | box2d + postgis | public | st_makeenvelope | double precision, double precision, double precision, double precision, integer | geometry + postgis | public | st_makeline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_makeline | geometry | geometry + postgis | public | st_makeline | geometry[] | geometry + postgis | public | st_makepoint | double precision, double precision | geometry + postgis | public | st_makepoint | double precision, double precision, double precision | geometry + postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry + postgis | public | st_makepointm | double precision, double precision, double precision | geometry + postgis | public | st_makepolygon | geometry | geometry + postgis | public | st_makepolygon | geometry, geometry[] | geometry + postgis | public | st_makevalid | geom geometry, params text | geometry + postgis | public | st_makevalid | geometry | geometry + postgis | public | st_maxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_maximuminscribedcircle | geometry, OUT center geometry, OUT nearest geometry, OUT radius double precision | record + postgis | public | st_memcollect | geometry | geometry + postgis | public | st_memsize | geometry | integer + postgis | public | st_memunion | geometry | geometry + postgis | public | st_minimumboundingcircle | inputgeom geometry, segs_per_quarter integer | geometry + postgis | public | st_minimumboundingradius | geometry, OUT center geometry, OUT radius double precision | record + postgis | public | st_minimumclearance | geometry | double precision + postgis | public | st_minimumclearanceline | geometry | geometry + postgis | public | st_mlinefromtext | text | geometry + postgis | public | st_mlinefromtext | text, integer | geometry + postgis | public | st_mlinefromwkb | bytea | geometry + postgis | public | st_mlinefromwkb | bytea, integer | geometry + postgis | public | st_mpointfromtext | text | geometry + postgis | public | st_mpointfromtext | text, integer | geometry + postgis | public | st_mpointfromwkb | bytea | geometry + postgis | public | st_mpointfromwkb | bytea, integer | geometry + postgis | public | st_mpolyfromtext | text | geometry + postgis | public | st_mpolyfromtext | text, integer | geometry + postgis | public | st_mpolyfromwkb | bytea | geometry + postgis | public | st_mpolyfromwkb | bytea, integer | geometry + postgis | public | st_multi | geometry | geometry + postgis | public | st_multilinefromwkb | bytea | geometry + postgis | public | st_multilinestringfromtext | text | geometry + postgis | public | st_multilinestringfromtext | text, integer | geometry + postgis | public | st_multipointfromtext | text | geometry + postgis | public | st_multipointfromwkb | bytea | geometry + postgis | public | st_multipointfromwkb | bytea, integer | geometry + postgis | public | st_multipolyfromwkb | bytea | geometry + postgis | public | st_multipolyfromwkb | bytea, integer | geometry + postgis | public | st_multipolygonfromtext | text | geometry + postgis | public | st_multipolygonfromtext | text, integer | geometry + postgis | public | st_ndims | geometry | smallint + postgis | public | st_node | g geometry | geometry + postgis | public | st_normalize | geom geometry | geometry + postgis | public | st_npoints | geometry | integer + postgis | public | st_nrings | geometry | integer + postgis | public | st_numgeometries | geometry | integer + postgis | public | st_numinteriorring | geometry | integer + postgis | public | st_numinteriorrings | geometry | integer + postgis | public | st_numpatches | geometry | integer + postgis | public | st_numpoints | geometry | integer + postgis | public | st_offsetcurve | line geometry, distance double precision, params text | geometry + postgis | public | st_orderingequals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_orientedenvelope | geometry | geometry + postgis | public | st_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | st_patchn | geometry, integer | geometry + postgis | public | st_perimeter | geog geography, use_spheroid boolean | double precision + postgis | public | st_perimeter | geometry | double precision + postgis | public | st_perimeter2d | geometry | double precision + postgis | public | st_point | double precision, double precision | geometry + postgis | public | st_point | double precision, double precision, srid integer | geometry + postgis | public | st_pointfromgeohash | text, integer | geometry + postgis | public | st_pointfromtext | text | geometry + postgis | public | st_pointfromtext | text, integer | geometry + postgis | public | st_pointfromwkb | bytea | geometry + postgis | public | st_pointfromwkb | bytea, integer | geometry + postgis | public | st_pointinsidecircle | geometry, double precision, double precision, double precision | boolean + postgis | public | st_pointm | xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer | geometry + postgis | public | st_pointn | geometry, integer | geometry + postgis | public | st_pointonsurface | geometry | geometry + postgis | public | st_points | geometry | geometry + postgis | public | st_pointz | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer | geometry + postgis | public | st_pointzm | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer | geometry + postgis | public | st_polyfromtext | text | geometry + postgis | public | st_polyfromtext | text, integer | geometry + postgis | public | st_polyfromwkb | bytea | geometry + postgis | public | st_polyfromwkb | bytea, integer | geometry + postgis | public | st_polygon | geometry, integer | geometry + postgis | public | st_polygonfromtext | text | geometry + postgis | public | st_polygonfromtext | text, integer | geometry + postgis | public | st_polygonfromwkb | bytea | geometry + postgis | public | st_polygonfromwkb | bytea, integer | geometry + postgis | public | st_polygonize | geometry | geometry + postgis | public | st_polygonize | geometry[] | geometry + postgis | public | st_project | geog geography, distance double precision, azimuth double precision | geography + postgis | public | st_quantizecoordinates | g geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer | geometry + postgis | public | st_reduceprecision | geom geometry, gridsize double precision | geometry + postgis | public | st_relate | geom1 geometry, geom2 geometry | text + postgis | public | st_relate | geom1 geometry, geom2 geometry, integer | text + postgis | public | st_relate | geom1 geometry, geom2 geometry, text | boolean + postgis | public | st_relatematch | text, text | boolean + postgis | public | st_removepoint | geometry, integer | geometry + postgis | public | st_removerepeatedpoints | geom geometry, tolerance double precision | geometry + postgis | public | st_reverse | geometry | geometry + postgis | public | st_rotate | geometry, double precision | geometry + postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_rotate | geometry, double precision, geometry | geometry + postgis | public | st_rotatex | geometry, double precision | geometry + postgis | public | st_rotatey | geometry, double precision | geometry + postgis | public | st_rotatez | geometry, double precision | geometry + postgis | public | st_scale | geometry, double precision, double precision | geometry + postgis | public | st_scale | geometry, double precision, double precision, double precision | geometry + postgis | public | st_scale | geometry, geometry | geometry + postgis | public | st_scale | geometry, geometry, origin geometry | geometry + postgis | public | st_scroll | geometry, geometry | geometry + postgis | public | st_segmentize | geog geography, max_segment_length double precision | geography + postgis | public | st_segmentize | geometry, double precision | geometry + postgis | public | st_seteffectivearea | geometry, double precision, integer | geometry + postgis | public | st_setpoint | geometry, integer, geometry | geometry + postgis | public | st_setsrid | geog geography, srid integer | geography + postgis | public | st_setsrid | geom geometry, srid integer | geometry + postgis | public | st_sharedpaths | geom1 geometry, geom2 geometry | geometry + postgis | public | st_shiftlongitude | geometry | geometry + postgis | public | st_shortestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_simplify | geometry, double precision | geometry + postgis | public | st_simplify | geometry, double precision, boolean | geometry + postgis | public | st_simplifypolygonhull | geom geometry, vertex_fraction double precision, is_outer boolean | geometry + postgis | public | st_simplifypreservetopology | geometry, double precision | geometry + postgis | public | st_simplifyvw | geometry, double precision | geometry + postgis | public | st_snap | geom1 geometry, geom2 geometry, double precision | geometry + postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_split | geom1 geometry, geom2 geometry | geometry + postgis | public | st_square | size double precision, cell_i integer, cell_j integer, origin geometry | geometry + postgis | public | st_squaregrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record + postgis | public | st_srid | geog geography | integer + postgis | public | st_srid | geom geometry | integer + postgis | public | st_startpoint | geometry | geometry + postgis | public | st_subdivide | geom geometry, maxvertices integer, gridsize double precision | SETOF geometry + postgis | public | st_summary | geography | text + postgis | public | st_summary | geometry | text + postgis | public | st_swapordinates | geom geometry, ords cstring | geometry + postgis | public | st_symdifference | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_symmetricdifference | geom1 geometry, geom2 geometry | geometry + postgis | public | st_tileenvelope | zoom integer, x integer, y integer, bounds geometry, margin double precision | geometry + postgis | public | st_touches | geom1 geometry, geom2 geometry | boolean + postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry + postgis | public | st_transform | geom geometry, to_proj text | geometry + postgis | public | st_transform | geometry, integer | geometry + postgis | public | st_translate | geometry, double precision, double precision | geometry + postgis | public | st_translate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_transscale | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_triangulatepolygon | g1 geometry | geometry + postgis | public | st_unaryunion | geometry, gridsize double precision | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_union | geometry | geometry + postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geometry[] | geometry + postgis | public | st_voronoilines | g1 geometry, tolerance double precision, extend_to geometry | geometry + postgis | public | st_voronoipolygons | g1 geometry, tolerance double precision, extend_to geometry | geometry + postgis | public | st_within | geom1 geometry, geom2 geometry | boolean + postgis | public | st_wkbtosql | wkb bytea | geometry + postgis | public | st_wkttosql | text | geometry + postgis | public | st_wrapx | geom geometry, wrap double precision, move double precision | geometry + postgis | public | st_x | geometry | double precision + postgis | public | st_xmax | box3d | double precision + postgis | public | st_xmin | box3d | double precision + postgis | public | st_y | geometry | double precision + postgis | public | st_ymax | box3d | double precision + postgis | public | st_ymin | box3d | double precision + postgis | public | st_z | geometry | double precision + postgis | public | st_zmax | box3d | double precision + postgis | public | st_zmflag | geometry | smallint + postgis | public | st_zmin | box3d | double precision + postgis | public | text | geometry | text + postgis | public | unlockrows | text | integer + postgis | public | updategeometrysrid | catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer | text + postgis | public | updategeometrysrid | character varying, character varying, character varying, integer | text + postgis | public | updategeometrysrid | character varying, character varying, integer | text + postgis_raster | public | __st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count + postgis_raster | public | _add_overview_constraint | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, factor integer | boolean + postgis_raster | public | _add_raster_constraint | cn name, sql text | boolean + postgis_raster | public | _add_raster_constraint_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | boolean + postgis_raster | public | _add_raster_constraint_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_extent | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_nodata_values | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_num_bands | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_out_db | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_pixel_types | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_scale | rastschema name, rasttable name, rastcolumn name, axis character | boolean + postgis_raster | public | _add_raster_constraint_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_srid | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_overview_constraint | ovschema name, ovtable name, ovcolumn name | boolean + postgis_raster | public | _drop_raster_constraint | rastschema name, rasttable name, cn name | boolean + postgis_raster | public | _drop_raster_constraint_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | boolean + postgis_raster | public | _drop_raster_constraint_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_extent | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_nodata_values | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_num_bands | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_out_db | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_pixel_types | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_regular_blocking | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_scale | rastschema name, rasttable name, rastcolumn name, axis character | boolean + postgis_raster | public | _drop_raster_constraint_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_srid | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _overview_constraint | ov raster, factor integer, refschema name, reftable name, refcolumn name | boolean + postgis_raster | public | _overview_constraint_info | ovschema name, ovtable name, ovcolumn name, OUT refschema name, OUT reftable name, OUT refcolumn name, OUT factor integer | record + postgis_raster | public | _raster_constraint_info_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | integer + postgis_raster | public | _raster_constraint_info_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_extent | rastschema name, rasttable name, rastcolumn name | geometry + postgis_raster | public | _raster_constraint_info_index | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_nodata_values | rastschema name, rasttable name, rastcolumn name | double precision[] + postgis_raster | public | _raster_constraint_info_num_bands | rastschema name, rasttable name, rastcolumn name | integer + postgis_raster | public | _raster_constraint_info_out_db | rastschema name, rasttable name, rastcolumn name | boolean[] + postgis_raster | public | _raster_constraint_info_pixel_types | rastschema name, rasttable name, rastcolumn name | text[] + postgis_raster | public | _raster_constraint_info_regular_blocking | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_scale | rastschema name, rasttable name, rastcolumn name, axis character | double precision + postgis_raster | public | _raster_constraint_info_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_srid | rastschema name, rasttable name, rastcolumn name | integer + postgis_raster | public | _raster_constraint_nodata_values | rast raster | numeric[] + postgis_raster | public | _raster_constraint_out_db | rast raster | boolean[] + postgis_raster | public | _raster_constraint_pixel_types | rast raster | text[] + postgis_raster | public | _st_aspect4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_asraster | geom geometry, scalex double precision, scaley double precision, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | _st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | _st_colormap | rast raster, nband integer, colormap text, method text | raster + postgis_raster | public | _st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_convertarray4ma | value double precision[] | double precision[] + postgis_raster | public | _st_count | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | _st_countagg_finalfn | agg agg_count | bigint + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count + postgis_raster | public | _st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | _st_dwithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | _st_gdalwarp | rast raster, algorithm text, maxerr double precision, srid integer, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, width integer, height integer | raster + postgis_raster | public | _st_grayscale4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_hillshade4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_histogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, min double precision, max double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | _st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | _st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | _st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_pixelascentroids | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | _st_pixelaspolygons | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | _st_quantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | _st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record + postgis_raster | public | _st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster + postgis_raster | public | _st_roughness4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_samealignment_finalfn | agg agg_samealignment | boolean + postgis_raster | public | _st_samealignment_transfn | agg agg_samealignment, rast raster | agg_samealignment + postgis_raster | public | _st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], hasnosetvalue boolean, nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | _st_slope4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_summarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | _st_summarystats_finalfn | internal | summarystats + postgis_raster | public | _st_summarystats_transfn | internal, raster, boolean, double precision | internal + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean | internal + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal + postgis_raster | public | _st_tile | rast raster, width integer, height integer, nband integer[], padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | _st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_tpi4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_tri4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_union_finalfn | internal | raster + postgis_raster | public | _st_union_transfn | internal, raster | internal + postgis_raster | public | _st_union_transfn | internal, raster, integer | internal + postgis_raster | public | _st_union_transfn | internal, raster, integer, text | internal + postgis_raster | public | _st_union_transfn | internal, raster, text | internal + postgis_raster | public | _st_union_transfn | internal, raster, unionarg[] | internal + postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | _updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | addoverviewconstraints | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, ovfactor integer | boolean + postgis_raster | public | addoverviewconstraints | ovtable name, ovcolumn name, reftable name, refcolumn name, ovfactor integer | boolean + postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | box3d | raster | box3d + postgis_raster | public | bytea | raster | bytea + postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean + postgis_raster | public | dropoverviewconstraints | ovtable name, ovcolumn name | boolean + postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | geometry_contained_by_raster | geometry, raster | boolean + postgis_raster | public | geometry_raster_contain | geometry, raster | boolean + postgis_raster | public | geometry_raster_overlap | geometry, raster | boolean + postgis_raster | public | postgis_gdal_version | | text + postgis_raster | public | postgis_noop | raster | geometry + postgis_raster | public | postgis_raster_lib_build_date | | text + postgis_raster | public | postgis_raster_lib_version | | text + postgis_raster | public | postgis_raster_scripts_installed | | text + postgis_raster | public | raster_above | raster, raster | boolean + postgis_raster | public | raster_below | raster, raster | boolean + postgis_raster | public | raster_contain | raster, raster | boolean + postgis_raster | public | raster_contained | raster, raster | boolean + postgis_raster | public | raster_contained_by_geometry | raster, geometry | boolean + postgis_raster | public | raster_eq | raster, raster | boolean + postgis_raster | public | raster_geometry_contain | raster, geometry | boolean + postgis_raster | public | raster_geometry_overlap | raster, geometry | boolean + postgis_raster | public | raster_hash | raster | integer + postgis_raster | public | raster_in | cstring | raster + postgis_raster | public | raster_left | raster, raster | boolean + postgis_raster | public | raster_out | raster | cstring + postgis_raster | public | raster_overabove | raster, raster | boolean + postgis_raster | public | raster_overbelow | raster, raster | boolean + postgis_raster | public | raster_overlap | raster, raster | boolean + postgis_raster | public | raster_overleft | raster, raster | boolean + postgis_raster | public | raster_overright | raster, raster | boolean + postgis_raster | public | raster_right | raster, raster | boolean + postgis_raster | public | raster_same | raster, raster | boolean + postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster + postgis_raster | public | st_addband | rast raster, index integer, outdbfile text, outdbindex integer[], nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, outdbfile text, outdbindex integer[], index integer, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | torast raster, fromrast raster, fromband integer, torastindex integer | raster + postgis_raster | public | st_addband | torast raster, fromrasts raster[], fromband integer, torastindex integer | raster + postgis_raster | public | st_approxcount | rast raster, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, sample_percent double precision | bigint + postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxsummarystats | rast raster, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, sample_percent double precision | summarystats + postgis_raster | public | st_asbinary | raster, outasin boolean | bytea + postgis_raster | public | st_asgdalraster | rast raster, format text, options text[], srid integer | bytea + postgis_raster | public | st_ashexwkb | raster, outasin boolean | text + postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea + postgis_raster | public | st_asjpeg | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nbands integer[], quality integer | bytea + postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea + postgis_raster | public | st_aspect | rast raster, nband integer, customextent raster, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspect | rast raster, nband integer, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspng | rast raster, nband integer, compression integer | bytea + postgis_raster | public | st_aspng | rast raster, nband integer, options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], compression integer | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_aspng | rast raster, options text[] | bytea + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text[], value double precision[], nodataval double precision[], touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_astiff | rast raster, compression text, srid integer | bytea + postgis_raster | public | st_astiff | rast raster, nbands integer[], compression text, srid integer | bytea + postgis_raster | public | st_astiff | rast raster, nbands integer[], options text[], srid integer | bytea + postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea + postgis_raster | public | st_aswkb | raster, outasin boolean | bytea + postgis_raster | public | st_band | rast raster, nband integer | raster + postgis_raster | public | st_band | rast raster, nbands integer[] | raster + postgis_raster | public | st_band | rast raster, nbands text, delimiter character | raster + postgis_raster | public | st_bandfilesize | rast raster, band integer | bigint + postgis_raster | public | st_bandfiletimestamp | rast raster, band integer | bigint + postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean + postgis_raster | public | st_bandisnodata | rast raster, forcechecking boolean | boolean + postgis_raster | public | st_bandmetadata | rast raster, band integer | TABLE(pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) + postgis_raster | public | st_bandmetadata | rast raster, band integer[] | TABLE(bandnum integer, pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) + postgis_raster | public | st_bandnodatavalue | rast raster, band integer | double precision + postgis_raster | public | st_bandpath | rast raster, band integer | text + postgis_raster | public | st_bandpixeltype | rast raster, band integer | text + postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, nodataval double precision, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_colormap | rast raster, colormap text, method text | raster + postgis_raster | public | st_colormap | rast raster, nband integer, colormap text, method text | raster + postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_contains | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_containsproperly | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_contour | rast raster, bandnumber integer, level_interval double precision, level_base double precision, fixed_levels double precision[], polygonize boolean | TABLE(geom geometry, id integer, value double precision) + postgis_raster | public | st_convexhull | raster | geometry + postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint + postgis_raster | public | st_count | rast raster, nband integer, exclude_nodata_value boolean | bigint + postgis_raster | public | st_countagg | raster, boolean | bigint + postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_countagg | raster, integer, boolean, double precision | bigint + postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_coveredby | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_covers | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_createoverview | tab regclass, col name, factor integer, algo text | regclass + postgis_raster | public | st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | st_dfullywithin | rast1 raster, rast2 raster, distance double precision | boolean + postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_disjoint | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_distinct4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_dumpaspolygons | rast raster, band integer, exclude_nodata_value boolean | SETOF geomval + postgis_raster | public | st_dumpvalues | rast raster, nband integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_dumpvalues | rast raster, nband integer[], exclude_nodata_value boolean | TABLE(nband integer, valarray double precision[]) + postgis_raster | public | st_dwithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | st_dwithin | rast1 raster, rast2 raster, distance double precision | boolean + postgis_raster | public | st_envelope | raster | geometry + postgis_raster | public | st_fromgdalraster | gdaldata bytea, srid integer | raster + postgis_raster | public | st_gdaldrivers | OUT idx integer, OUT short_name text, OUT long_name text, OUT can_read boolean, OUT can_write boolean, OUT create_options text | SETOF record + postgis_raster | public | st_georeference | rast raster, format text | text + postgis_raster | public | st_geotransform | raster, OUT imag double precision, OUT jmag double precision, OUT theta_i double precision, OUT theta_ij double precision, OUT xoffset double precision, OUT yoffset double precision | record + postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster + postgis_raster | public | st_grayscale | rastbandargset rastbandarg[], extenttype text | raster + postgis_raster | public | st_hasnoband | rast raster, nband integer | boolean + postgis_raster | public | st_height | raster | integer + postgis_raster | public | st_hillshade | rast raster, nband integer, customextent raster, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_hillshade | rast raster, nband integer, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_histogram | rast raster, nband integer, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_interpolateraster | geom geometry, options text, rast raster, bandnumber integer | raster + postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval + postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | st_intersects | rast raster, geom geometry, nband integer | boolean + postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean + postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_intersects | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_invdistweight4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_iscoveragetile | rast raster, coverage raster, tilewidth integer, tileheight integer | boolean + postgis_raster | public | st_isempty | rast raster | boolean + postgis_raster | public | st_makeemptycoverage | tilewidth integer, tileheight integer, width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | SETOF raster + postgis_raster | public | st_makeemptyraster | rast raster | raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, rast2 raster, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafctngb | rast raster, band integer, pixeltype text, ngbwidth integer, ngbheight integer, onerastngbuserfunc regprocedure, nodatamode text, VARIADIC args text[] | raster + postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_max4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_mean4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_memsize | raster | integer + postgis_raster | public | st_metadata | rast raster, OUT upperleftx double precision, OUT upperlefty double precision, OUT width integer, OUT height integer, OUT scalex double precision, OUT scaley double precision, OUT skewx double precision, OUT skewy double precision, OUT srid integer, OUT numbands integer | record + postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_min4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_minconvexhull | rast raster, nband integer | geometry + postgis_raster | public | st_mindist4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_minpossiblevalue | pixeltype text | double precision + postgis_raster | public | st_nearestvalue | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, band integer, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_notsamealignmentreason | rast1 raster, rast2 raster | text + postgis_raster | public | st_numbands | raster | integer + postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_overlaps | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_pixelascentroid | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelascentroids | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelaspoint | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelaspoints | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelaspolygon | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelaspolygons | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelheight | raster | double precision + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) + postgis_raster | public | st_pixelwidth | raster | double precision + postgis_raster | public | st_polygon | rast raster, band integer | geometry + postgis_raster | public | st_quantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, nband integer, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_range4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record + postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer | double precision + postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer, yr integer | double precision + postgis_raster | public | st_rastertoworldcoordy | rast raster, xr integer, yr integer | double precision + postgis_raster | public | st_rastertoworldcoordy | rast raster, yr integer | double precision + postgis_raster | public | st_rastfromhexwkb | text | raster + postgis_raster | public | st_rastfromwkb | bytea | raster + postgis_raster | public | st_reclass | rast raster, nband integer, reclassexpr text, pixeltype text, nodataval double precision | raster + postgis_raster | public | st_reclass | rast raster, reclassexpr text, pixeltype text | raster + postgis_raster | public | st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster + postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster + postgis_raster | public | st_resample | rast raster, ref raster, usescale boolean, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, width integer, height integer, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_rescale | rast raster, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, width integer, height integer, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, width text, height text, algorithm text, maxerr double precision | raster + postgis_raster | public | st_reskew | rast raster, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_reskew | rast raster, skewxy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_retile | tab regclass, col name, ext geometry, sfx double precision, sfy double precision, tw integer, th integer, algo text | SETOF raster + postgis_raster | public | st_rotation | raster | double precision + postgis_raster | public | st_roughness | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_roughness | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_samealignment | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_samealignment | raster | boolean + postgis_raster | public | st_samealignment | ulx1 double precision, uly1 double precision, scalex1 double precision, scaley1 double precision, skewx1 double precision, skewy1 double precision, ulx2 double precision, uly2 double precision, scalex2 double precision, scaley2 double precision, skewx2 double precision, skewy2 double precision | boolean + postgis_raster | public | st_scalex | raster | double precision + postgis_raster | public | st_scaley | raster | double precision + postgis_raster | public | st_setbandindex | rast raster, band integer, outdbindex integer, force boolean | raster + postgis_raster | public | st_setbandisnodata | rast raster, band integer | raster + postgis_raster | public | st_setbandnodatavalue | rast raster, band integer, nodatavalue double precision, forcechecking boolean | raster + postgis_raster | public | st_setbandnodatavalue | rast raster, nodatavalue double precision | raster + postgis_raster | public | st_setbandpath | rast raster, band integer, outdbpath text, outdbindex integer, force boolean | raster + postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster + postgis_raster | public | st_setgeoreference | rast raster, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setgeotransform | rast raster, imag double precision, jmag double precision, theta_i double precision, theta_ij double precision, xoffset double precision, yoffset double precision | raster + postgis_raster | public | st_setm | rast raster, geom geometry, resample text, band integer | geometry + postgis_raster | public | st_setrotation | rast raster, rotation double precision | raster + postgis_raster | public | st_setscale | rast raster, scale double precision | raster + postgis_raster | public | st_setscale | rast raster, scalex double precision, scaley double precision | raster + postgis_raster | public | st_setskew | rast raster, skew double precision | raster + postgis_raster | public | st_setskew | rast raster, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setsrid | rast raster, srid integer | raster + postgis_raster | public | st_setupperleft | rast raster, upperleftx double precision, upperlefty double precision | raster + postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, nband integer, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, x integer, y integer, newvalue double precision | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setz | rast raster, geom geometry, resample text, band integer | geometry + postgis_raster | public | st_skewx | raster | double precision + postgis_raster | public | st_skewy | raster | double precision + postgis_raster | public | st_slope | rast raster, nband integer, customextent raster, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_slope | rast raster, nband integer, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_srid | raster | integer + postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_stddev4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_sum4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_summary | rast raster | text + postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats + postgis_raster | public | st_summarystats | rast raster, nband integer, exclude_nodata_value boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean, double precision | summarystats + postgis_raster | public | st_tile | rast raster, nband integer, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_tile | rast raster, nband integer[], width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_tile | rast raster, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_touches | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_tpi | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_tpi | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_tri | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_tri | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_union | raster | raster + postgis_raster | public | st_union | raster, integer | raster + postgis_raster | public | st_union | raster, integer, text | raster + postgis_raster | public | st_union | raster, text | raster + postgis_raster | public | st_union | raster, unionarg[] | raster + postgis_raster | public | st_upperleftx | raster | double precision + postgis_raster | public | st_upperlefty | raster | double precision + postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision + postgis_raster | public | st_value | rast raster, band integer, x integer, y integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_value | rast raster, x integer, y integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_width | raster | integer + postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_within | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | st_worldtorastercoord | rast raster, pt geometry, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, yw double precision | integer + postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | updaterastersrid | table_name name, column_name name, new_srid integer | boolean + postgis_sfcgal | public | postgis_sfcgal_full_version | | text + postgis_sfcgal | public | postgis_sfcgal_noop | geometry | geometry + postgis_sfcgal | public | postgis_sfcgal_scripts_installed | | text + postgis_sfcgal | public | postgis_sfcgal_version | | text + postgis_sfcgal | public | st_3darea | geometry | double precision + postgis_sfcgal | public | st_3dconvexhull | geometry | geometry + postgis_sfcgal | public | st_3ddifference | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dintersection | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dunion | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dunion | geometry | geometry + postgis_sfcgal | public | st_alphashape | g1 geometry, alpha double precision, allow_holes boolean | geometry + postgis_sfcgal | public | st_approximatemedialaxis | geometry | geometry + postgis_sfcgal | public | st_constraineddelaunaytriangles | geometry | geometry + postgis_sfcgal | public | st_extrude | geometry, double precision, double precision, double precision | geometry + postgis_sfcgal | public | st_forcelhr | geometry | geometry + postgis_sfcgal | public | st_isplanar | geometry | boolean + postgis_sfcgal | public | st_issolid | geometry | boolean + postgis_sfcgal | public | st_makesolid | geometry | geometry + postgis_sfcgal | public | st_minkowskisum | geometry, geometry | geometry + postgis_sfcgal | public | st_optimalalphashape | g1 geometry, allow_holes boolean, nb_components integer | geometry + postgis_sfcgal | public | st_orientation | geometry | integer + postgis_sfcgal | public | st_straightskeleton | geometry | geometry + postgis_sfcgal | public | st_tesselate | geometry | geometry + postgis_sfcgal | public | st_volume | geometry | double precision + postgis_topology | topology | _asgmledge | edge_id integer, start_node integer, end_node integer, line geometry, visitedtable regclass, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _asgmlface | toponame text, face_id integer, visitedtable regclass, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _asgmlnode | id integer, point geometry, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _checkedgelinking | curedge_edge_id integer, prevedge_edge_id integer, prevedge_next_left_edge integer, prevedge_next_right_edge integer | topology.validatetopology_returntype + postgis_topology | topology | _st_adjacentedges | atopology character varying, anode integer, anedge integer | integer[] + postgis_topology | topology | _st_mintolerance | ageom geometry | double precision + postgis_topology | topology | _st_mintolerance | atopology character varying, ageom geometry | double precision + postgis_topology | topology | _validatetopologyedgelinking | bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | _validatetopologygetfaceshellmaximaledgering | atopology character varying, aface integer | geometry + postgis_topology | topology | _validatetopologygetringedges | starting_edge integer | integer[] + postgis_topology | topology | _validatetopologyrings | bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | addedge | atopology character varying, aline geometry | integer + postgis_topology | topology | addface | atopology character varying, apoly geometry, force_new boolean | integer + postgis_topology | topology | addnode | atopology character varying, apoint geometry, allowedgesplitting boolean, setcontainingface boolean | integer + postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer + postgis_topology | topology | addtopogeometrycolumn | toponame character varying, schema character varying, tbl character varying, col character varying, ltype character varying, child integer | integer + postgis_topology | topology | addtosearchpath | a_schema_name character varying | text + postgis_topology | topology | asgml | tg topology.topogeometry | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, vis regclass | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, opts integer | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix_in text, precision_in integer, options_in integer, visitedtable regclass, idprefix text, gmlver integer | text + postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass | text + postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass, nsprefix text | text + postgis_topology | topology | astopojson | tg topology.topogeometry, edgemaptable regclass | text + postgis_topology | topology | cleartopogeom | tg topology.topogeometry | topology.topogeometry + postgis_topology | topology | copytopology | atopology character varying, newtopo character varying | integer + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topology.topogeometry + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer, tg_objs topology.topoelementarray | topology.topogeometry + postgis_topology | topology | createtopology | atopology character varying, srid integer, prec double precision, hasz boolean | integer + postgis_topology | topology | createtopology | character varying | integer + postgis_topology | topology | createtopology | character varying, integer | integer + postgis_topology | topology | createtopology | toponame character varying, srid integer, prec double precision | integer + postgis_topology | topology | droptopogeometrycolumn | schema character varying, tbl character varying, col character varying | text + postgis_topology | topology | droptopology | atopology character varying | text + postgis_topology | topology | equals | tg1 topology.topogeometry, tg2 topology.topogeometry | boolean + postgis_topology | topology | findlayer | layer_table regclass, feature_column name | topology.layer + postgis_topology | topology | findlayer | schema_name name, table_name name, feature_column name | topology.layer + postgis_topology | topology | findlayer | tg topology.topogeometry | topology.layer + postgis_topology | topology | findlayer | topology_id integer, layer_id integer | topology.layer + postgis_topology | topology | findtopology | integer | topology.topology + postgis_topology | topology | findtopology | name, name, name | topology.topology + postgis_topology | topology | findtopology | regclass, name | topology.topology + postgis_topology | topology | findtopology | text | topology.topology + postgis_topology | topology | findtopology | topology.topogeometry | topology.topology + postgis_topology | topology | geometry | topogeom topology.topogeometry | geometry + postgis_topology | topology | geometrytype | tg topology.topogeometry | text + postgis_topology | topology | getedgebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getfacebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getfacecontainingpoint | atopology text, apoint geometry | integer + postgis_topology | topology | getnodebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getnodeedges | atopology character varying, anode integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | getringedges | atopology character varying, anedge integer, maxedges integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | gettopogeomelementarray | tg topology.topogeometry | topology.topoelementarray + postgis_topology | topology | gettopogeomelementarray | toponame character varying, layer_id integer, tgid integer | topology.topoelementarray + postgis_topology | topology | gettopogeomelements | tg topology.topogeometry | SETOF topology.topoelement + postgis_topology | topology | gettopogeomelements | toponame character varying, layerid integer, tgid integer | SETOF topology.topoelement + postgis_topology | topology | gettopologyid | toponame character varying | integer + postgis_topology | topology | gettopologyname | topoid integer | character varying + postgis_topology | topology | gettopologysrid | toponame character varying | integer + postgis_topology | topology | intersects | tg1 topology.topogeometry, tg2 topology.topogeometry | boolean + postgis_topology | topology | layertrigger | | trigger + postgis_topology | topology | polygonize | toponame character varying | text + postgis_topology | topology | populate_topology_layer | | TABLE(schema_name text, table_name text, feature_column text) + postgis_topology | topology | postgis_topology_scripts_installed | | text + postgis_topology | topology | relationtrigger | | trigger + postgis_topology | topology | removeunusedprimitives | atopology text, bbox geometry | integer + postgis_topology | topology | st_addedgemodface | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addedgenewfaces | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addisoedge | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addisonode | atopology character varying, aface integer, apoint geometry | integer + postgis_topology | topology | st_changeedgegeom | atopology character varying, anedge integer, acurve geometry | text + postgis_topology | topology | st_createtopogeo | atopology character varying, acollection geometry | text + postgis_topology | topology | st_geometrytype | tg topology.topogeometry | text + postgis_topology | topology | st_getfaceedges | toponame character varying, face_id integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | st_getfacegeometry | toponame character varying, aface integer | geometry + postgis_topology | topology | st_inittopogeo | atopology character varying | text + postgis_topology | topology | st_modedgeheal | toponame character varying, e1id integer, e2id integer | integer + postgis_topology | topology | st_modedgesplit | atopology character varying, anedge integer, apoint geometry | integer + postgis_topology | topology | st_moveisonode | atopology character varying, anode integer, apoint geometry | text + postgis_topology | topology | st_newedgeheal | toponame character varying, e1id integer, e2id integer | integer + postgis_topology | topology | st_newedgessplit | atopology character varying, anedge integer, apoint geometry | integer + postgis_topology | topology | st_remedgemodface | toponame character varying, e1id integer | integer + postgis_topology | topology | st_remedgenewface | toponame character varying, e1id integer | integer + postgis_topology | topology | st_remisonode | character varying, integer | text + postgis_topology | topology | st_removeisoedge | atopology character varying, anedge integer | text + postgis_topology | topology | st_removeisonode | atopology character varying, anode integer | text + postgis_topology | topology | st_simplify | tg topology.topogeometry, tolerance double precision | geometry + postgis_topology | topology | st_srid | tg topology.topogeometry | integer + postgis_topology | topology | topoelementarray_agg | topology.topoelement | topology.topoelementarray + postgis_topology | topology | topoelementarray_append | topology.topoelementarray, topology.topoelement | topology.topoelementarray + postgis_topology | topology | topogeo_addgeometry | atopology character varying, ageom geometry, tolerance double precision | void + postgis_topology | topology | topogeo_addlinestring | atopology character varying, aline geometry, tolerance double precision | SETOF integer + postgis_topology | topology | topogeo_addpoint | atopology character varying, apoint geometry, tolerance double precision | integer + postgis_topology | topology | topogeo_addpolygon | atopology character varying, apoly geometry, tolerance double precision | SETOF integer + postgis_topology | topology | topogeom_addelement | tg topology.topogeometry, el topology.topoelement | topology.topogeometry + postgis_topology | topology | topogeom_addtopogeom | tgt topology.topogeometry, src topology.topogeometry | topology.topogeometry + postgis_topology | topology | topogeom_remelement | tg topology.topogeometry, el topology.topoelement | topology.topogeometry + postgis_topology | topology | topologysummary | atopology character varying | text + postgis_topology | topology | totopogeom | ageom geometry, atopology character varying, alayer integer, atolerance double precision | topology.topogeometry + postgis_topology | topology | totopogeom | ageom geometry, tg topology.topogeometry, atolerance double precision | topology.topogeometry + postgis_topology | topology | validatetopology | toponame character varying, bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | validatetopologyrelation | toponame character varying | TABLE(error text, layer_id integer, topogeo_id integer, element_id integer) + postgres_fdw | public | postgres_fdw_disconnect | text | boolean + postgres_fdw | public | postgres_fdw_disconnect_all | | boolean + postgres_fdw | public | postgres_fdw_get_connections | OUT server_name text, OUT valid boolean | SETOF record + postgres_fdw | public | postgres_fdw_handler | | fdw_handler + postgres_fdw | public | postgres_fdw_validator | text[], oid | void + refint | public | check_foreign_key | | trigger + refint | public | check_primary_key | | trigger + rum | public | rum_anyarray_config | internal | void + rum | public | rum_anyarray_consistent | internal, smallint, anyarray, integer, internal, internal, internal, internal | boolean + rum | public | rum_anyarray_distance | anyarray, anyarray | double precision + rum | public | rum_anyarray_ordering | internal, smallint, anyarray, integer, internal, internal, internal, internal, internal | double precision + rum | public | rum_anyarray_similar | anyarray, anyarray | boolean + rum | public | rum_bit_compare_prefix | bit, bit, smallint, internal | integer + rum | public | rum_bit_extract_query | bit, internal, smallint, internal, internal | internal + rum | public | rum_bit_extract_value | bit, internal | internal + rum | public | rum_btree_consistent | internal, smallint, internal, integer, internal, internal, internal, internal | boolean + rum | public | rum_bytea_compare_prefix | bytea, bytea, smallint, internal | integer + rum | public | rum_bytea_extract_query | bytea, internal, smallint, internal, internal | internal + rum | public | rum_bytea_extract_value | bytea, internal | internal + rum | public | rum_char_compare_prefix | "char", "char", smallint, internal | integer + rum | public | rum_char_extract_query | "char", internal, smallint, internal, internal | internal + rum | public | rum_char_extract_value | "char", internal | internal + rum | public | rum_cidr_compare_prefix | cidr, cidr, smallint, internal | integer + rum | public | rum_cidr_extract_query | cidr, internal, smallint, internal, internal | internal + rum | public | rum_cidr_extract_value | cidr, internal | internal + rum | public | rum_date_compare_prefix | date, date, smallint, internal | integer + rum | public | rum_date_extract_query | date, internal, smallint, internal, internal | internal + rum | public | rum_date_extract_value | date, internal | internal + rum | public | rum_extract_anyarray | anyarray, internal, internal, internal, internal | internal + rum | public | rum_extract_anyarray_query | anyarray, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsquery | tsquery, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsquery_hash | tsquery, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsvector | tsvector, internal, internal, internal, internal | internal + rum | public | rum_extract_tsvector_hash | tsvector, internal, internal, internal, internal | internal + rum | public | rum_float4_compare_prefix | real, real, smallint, internal | integer + rum | public | rum_float4_config | internal | void + rum | public | rum_float4_distance | real, real | double precision + rum | public | rum_float4_extract_query | real, internal, smallint, internal, internal | internal + rum | public | rum_float4_extract_value | real, internal | internal + rum | public | rum_float4_key_distance | real, real, smallint | double precision + rum | public | rum_float4_left_distance | real, real | double precision + rum | public | rum_float4_outer_distance | real, real, smallint | double precision + rum | public | rum_float4_right_distance | real, real | double precision + rum | public | rum_float8_compare_prefix | double precision, double precision, smallint, internal | integer + rum | public | rum_float8_config | internal | void + rum | public | rum_float8_distance | double precision, double precision | double precision + rum | public | rum_float8_extract_query | double precision, internal, smallint, internal, internal | internal + rum | public | rum_float8_extract_value | double precision, internal | internal + rum | public | rum_float8_key_distance | double precision, double precision, smallint | double precision + rum | public | rum_float8_left_distance | double precision, double precision | double precision + rum | public | rum_float8_outer_distance | double precision, double precision, smallint | double precision + rum | public | rum_float8_right_distance | double precision, double precision | double precision + rum | public | rum_inet_compare_prefix | inet, inet, smallint, internal | integer + rum | public | rum_inet_extract_query | inet, internal, smallint, internal, internal | internal + rum | public | rum_inet_extract_value | inet, internal | internal + rum | public | rum_int2_compare_prefix | smallint, smallint, smallint, internal | integer + rum | public | rum_int2_config | internal | void + rum | public | rum_int2_distance | smallint, smallint | double precision + rum | public | rum_int2_extract_query | smallint, internal, smallint, internal, internal | internal + rum | public | rum_int2_extract_value | smallint, internal | internal + rum | public | rum_int2_key_distance | smallint, smallint, smallint | double precision + rum | public | rum_int2_left_distance | smallint, smallint | double precision + rum | public | rum_int2_outer_distance | smallint, smallint, smallint | double precision + rum | public | rum_int2_right_distance | smallint, smallint | double precision + rum | public | rum_int4_compare_prefix | integer, integer, smallint, internal | integer + rum | public | rum_int4_config | internal | void + rum | public | rum_int4_distance | integer, integer | double precision + rum | public | rum_int4_extract_query | integer, internal, smallint, internal, internal | internal + rum | public | rum_int4_extract_value | integer, internal | internal + rum | public | rum_int4_key_distance | integer, integer, smallint | double precision + rum | public | rum_int4_left_distance | integer, integer | double precision + rum | public | rum_int4_outer_distance | integer, integer, smallint | double precision + rum | public | rum_int4_right_distance | integer, integer | double precision + rum | public | rum_int8_compare_prefix | bigint, bigint, smallint, internal | integer + rum | public | rum_int8_config | internal | void + rum | public | rum_int8_distance | bigint, bigint | double precision + rum | public | rum_int8_extract_query | bigint, internal, smallint, internal, internal | internal + rum | public | rum_int8_extract_value | bigint, internal | internal + rum | public | rum_int8_key_distance | bigint, bigint, smallint | double precision + rum | public | rum_int8_left_distance | bigint, bigint | double precision + rum | public | rum_int8_outer_distance | bigint, bigint, smallint | double precision + rum | public | rum_int8_right_distance | bigint, bigint | double precision + rum | public | rum_interval_compare_prefix | interval, interval, smallint, internal | integer + rum | public | rum_interval_extract_query | interval, internal, smallint, internal, internal | internal + rum | public | rum_interval_extract_value | interval, internal | internal + rum | public | rum_macaddr_compare_prefix | macaddr, macaddr, smallint, internal | integer + rum | public | rum_macaddr_extract_query | macaddr, internal, smallint, internal, internal | internal + rum | public | rum_macaddr_extract_value | macaddr, internal | internal + rum | public | rum_money_compare_prefix | money, money, smallint, internal | integer + rum | public | rum_money_config | internal | void + rum | public | rum_money_distance | money, money | double precision + rum | public | rum_money_extract_query | money, internal, smallint, internal, internal | internal + rum | public | rum_money_extract_value | money, internal | internal + rum | public | rum_money_key_distance | money, money, smallint | double precision + rum | public | rum_money_left_distance | money, money | double precision + rum | public | rum_money_outer_distance | money, money, smallint | double precision + rum | public | rum_money_right_distance | money, money | double precision + rum | public | rum_numeric_cmp | numeric, numeric | integer + rum | public | rum_numeric_compare_prefix | numeric, numeric, smallint, internal | integer + rum | public | rum_numeric_extract_query | numeric, internal, smallint, internal, internal | internal + rum | public | rum_numeric_extract_value | numeric, internal | internal + rum | public | rum_oid_compare_prefix | oid, oid, smallint, internal | integer + rum | public | rum_oid_config | internal | void + rum | public | rum_oid_distance | oid, oid | double precision + rum | public | rum_oid_extract_query | oid, internal, smallint, internal, internal | internal + rum | public | rum_oid_extract_value | oid, internal | internal + rum | public | rum_oid_key_distance | oid, oid, smallint | double precision + rum | public | rum_oid_left_distance | oid, oid | double precision + rum | public | rum_oid_outer_distance | oid, oid, smallint | double precision + rum | public | rum_oid_right_distance | oid, oid | double precision + rum | public | rum_text_compare_prefix | text, text, smallint, internal | integer + rum | public | rum_text_extract_query | text, internal, smallint, internal, internal | internal + rum | public | rum_text_extract_value | text, internal | internal + rum | public | rum_time_compare_prefix | time without time zone, time without time zone, smallint, internal | integer + rum | public | rum_time_extract_query | time without time zone, internal, smallint, internal, internal | internal + rum | public | rum_time_extract_value | time without time zone, internal | internal + rum | public | rum_timestamp_compare_prefix | timestamp without time zone, timestamp without time zone, smallint, internal | integer + rum | public | rum_timestamp_config | internal | void + rum | public | rum_timestamp_consistent | internal, smallint, timestamp without time zone, integer, internal, internal, internal, internal | boolean + rum | public | rum_timestamp_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamp_extract_query | timestamp without time zone, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_timestamp_extract_value | timestamp without time zone, internal, internal, internal, internal | internal + rum | public | rum_timestamp_key_distance | timestamp without time zone, timestamp without time zone, smallint | double precision + rum | public | rum_timestamp_left_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamp_outer_distance | timestamp without time zone, timestamp without time zone, smallint | double precision + rum | public | rum_timestamp_right_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamptz_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timestamptz_key_distance | timestamp with time zone, timestamp with time zone, smallint | double precision + rum | public | rum_timestamptz_left_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timestamptz_right_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timetz_compare_prefix | time with time zone, time with time zone, smallint, internal | integer + rum | public | rum_timetz_extract_query | time with time zone, internal, smallint, internal, internal | internal + rum | public | rum_timetz_extract_value | time with time zone, internal | internal + rum | public | rum_ts_distance | tsvector, rum_distance_query | real + rum | public | rum_ts_distance | tsvector, tsquery | real + rum | public | rum_ts_distance | tsvector, tsquery, integer | real + rum | public | rum_ts_join_pos | internal, internal | bytea + rum | public | rum_ts_score | tsvector, rum_distance_query | real + rum | public | rum_ts_score | tsvector, tsquery | real + rum | public | rum_ts_score | tsvector, tsquery, integer | real + rum | public | rum_tsquery_addon_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsquery_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsquery_distance | internal, smallint, tsvector, integer, internal, internal, internal, internal, internal | double precision + rum | public | rum_tsquery_pre_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsvector_config | internal | void + rum | public | rum_varbit_compare_prefix | bit varying, bit varying, smallint, internal | integer + rum | public | rum_varbit_extract_query | bit varying, internal, smallint, internal, internal | internal + rum | public | rum_varbit_extract_value | bit varying, internal | internal + rum | public | rumhandler | internal | index_am_handler + rum | public | ruminv_extract_tsquery | tsquery, internal, internal, internal, internal | internal + rum | public | ruminv_extract_tsvector | tsvector, internal, smallint, internal, internal, internal, internal | internal + rum | public | ruminv_tsquery_config | internal | void + rum | public | ruminv_tsvector_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | tsquery_to_distance_query | tsquery | rum_distance_query + seg | public | gseg_consistent | internal, seg, smallint, oid, internal | boolean + seg | public | gseg_penalty | internal, internal, internal | internal + seg | public | gseg_picksplit | internal, internal | internal + seg | public | gseg_same | seg, seg, internal | internal + seg | public | gseg_union | internal, internal | seg + seg | public | seg_center | seg | real + seg | public | seg_cmp | seg, seg | integer + seg | public | seg_contained | seg, seg | boolean + seg | public | seg_contains | seg, seg | boolean + seg | public | seg_different | seg, seg | boolean + seg | public | seg_ge | seg, seg | boolean + seg | public | seg_gt | seg, seg | boolean + seg | public | seg_in | cstring | seg + seg | public | seg_inter | seg, seg | seg + seg | public | seg_le | seg, seg | boolean + seg | public | seg_left | seg, seg | boolean + seg | public | seg_lower | seg | real + seg | public | seg_lt | seg, seg | boolean + seg | public | seg_out | seg | cstring + seg | public | seg_over_left | seg, seg | boolean + seg | public | seg_over_right | seg, seg | boolean + seg | public | seg_overlap | seg, seg | boolean + seg | public | seg_right | seg, seg | boolean + seg | public | seg_same | seg, seg | boolean + seg | public | seg_size | seg | real + seg | public | seg_union | seg, seg | seg + seg | public | seg_upper | seg | real + sslinfo | public | ssl_cipher | | text + sslinfo | public | ssl_client_cert_present | | boolean + sslinfo | public | ssl_client_dn | | text + sslinfo | public | ssl_client_dn_field | text | text + sslinfo | public | ssl_client_serial | | numeric + sslinfo | public | ssl_extension_info | OUT name text, OUT value text, OUT critical boolean | SETOF record + sslinfo | public | ssl_is_used | | boolean + sslinfo | public | ssl_issuer_dn | | text + sslinfo | public | ssl_issuer_field | text | text + sslinfo | public | ssl_version | | text + supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid + supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void + tablefunc | public | connectby | text, text, text, text, integer | SETOF record + tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer, text | SETOF record + tablefunc | public | crosstab | text | SETOF record + tablefunc | public | crosstab | text, integer | SETOF record + tablefunc | public | crosstab | text, text | SETOF record + tablefunc | public | crosstab2 | text | SETOF tablefunc_crosstab_2 + tablefunc | public | crosstab3 | text | SETOF tablefunc_crosstab_3 + tablefunc | public | crosstab4 | text | SETOF tablefunc_crosstab_4 + tablefunc | public | normal_rand | integer, double precision, double precision | SETOF double precision + tcn | public | triggered_change_notification | | trigger + tsm_system_rows | public | system_rows | internal | tsm_handler + unaccent | public | unaccent | regdictionary, text | text + unaccent | public | unaccent | text | text + unaccent | public | unaccent_init | internal | internal + unaccent | public | unaccent_lexize | internal, internal, internal, internal | internal + uuid-ossp | extensions | uuid_generate_v1 | | uuid + uuid-ossp | extensions | uuid_generate_v1mc | | uuid + uuid-ossp | extensions | uuid_generate_v3 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_generate_v4 | | uuid + uuid-ossp | extensions | uuid_generate_v5 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_nil | | uuid + uuid-ossp | extensions | uuid_ns_dns | | uuid + uuid-ossp | extensions | uuid_ns_oid | | uuid + uuid-ossp | extensions | uuid_ns_url | | uuid + uuid-ossp | extensions | uuid_ns_x500 | | uuid + vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + vector | public | array_to_halfvec | integer[], integer, boolean | halfvec + vector | public | array_to_halfvec | numeric[], integer, boolean | halfvec + vector | public | array_to_halfvec | real[], integer, boolean | halfvec + vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | integer[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | numeric[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec + vector | public | array_to_vector | double precision[], integer, boolean | vector + vector | public | array_to_vector | integer[], integer, boolean | vector + vector | public | array_to_vector | numeric[], integer, boolean | vector + vector | public | array_to_vector | real[], integer, boolean | vector + vector | public | avg | halfvec | halfvec + vector | public | avg | vector | vector + vector | public | binary_quantize | halfvec | bit + vector | public | binary_quantize | vector | bit + vector | public | cosine_distance | halfvec, halfvec | double precision + vector | public | cosine_distance | sparsevec, sparsevec | double precision + vector | public | cosine_distance | vector, vector | double precision + vector | public | halfvec | halfvec, integer, boolean | halfvec + vector | public | halfvec_accum | double precision[], halfvec | double precision[] + vector | public | halfvec_add | halfvec, halfvec | halfvec + vector | public | halfvec_avg | double precision[] | halfvec + vector | public | halfvec_cmp | halfvec, halfvec | integer + vector | public | halfvec_combine | double precision[], double precision[] | double precision[] + vector | public | halfvec_concat | halfvec, halfvec | halfvec + vector | public | halfvec_eq | halfvec, halfvec | boolean + vector | public | halfvec_ge | halfvec, halfvec | boolean + vector | public | halfvec_gt | halfvec, halfvec | boolean + vector | public | halfvec_in | cstring, oid, integer | halfvec + vector | public | halfvec_l2_squared_distance | halfvec, halfvec | double precision + vector | public | halfvec_le | halfvec, halfvec | boolean + vector | public | halfvec_lt | halfvec, halfvec | boolean + vector | public | halfvec_mul | halfvec, halfvec | halfvec + vector | public | halfvec_ne | halfvec, halfvec | boolean + vector | public | halfvec_negative_inner_product | halfvec, halfvec | double precision + vector | public | halfvec_out | halfvec | cstring + vector | public | halfvec_recv | internal, oid, integer | halfvec + vector | public | halfvec_send | halfvec | bytea + vector | public | halfvec_spherical_distance | halfvec, halfvec | double precision + vector | public | halfvec_sub | halfvec, halfvec | halfvec + vector | public | halfvec_to_float4 | halfvec, integer, boolean | real[] + vector | public | halfvec_to_sparsevec | halfvec, integer, boolean | sparsevec + vector | public | halfvec_to_vector | halfvec, integer, boolean | vector + vector | public | halfvec_typmod_in | cstring[] | integer + vector | public | hamming_distance | bit, bit | double precision + vector | public | hnsw_bit_support | internal | internal + vector | public | hnsw_halfvec_support | internal | internal + vector | public | hnsw_sparsevec_support | internal | internal + vector | public | hnswhandler | internal | index_am_handler + vector | public | inner_product | halfvec, halfvec | double precision + vector | public | inner_product | sparsevec, sparsevec | double precision + vector | public | inner_product | vector, vector | double precision + vector | public | ivfflat_bit_support | internal | internal + vector | public | ivfflat_halfvec_support | internal | internal + vector | public | ivfflathandler | internal | index_am_handler + vector | public | jaccard_distance | bit, bit | double precision + vector | public | l1_distance | halfvec, halfvec | double precision + vector | public | l1_distance | sparsevec, sparsevec | double precision + vector | public | l1_distance | vector, vector | double precision + vector | public | l2_distance | halfvec, halfvec | double precision + vector | public | l2_distance | sparsevec, sparsevec | double precision + vector | public | l2_distance | vector, vector | double precision + vector | public | l2_norm | halfvec | double precision + vector | public | l2_norm | sparsevec | double precision + vector | public | l2_normalize | halfvec | halfvec + vector | public | l2_normalize | sparsevec | sparsevec + vector | public | l2_normalize | vector | vector + vector | public | sparsevec | sparsevec, integer, boolean | sparsevec + vector | public | sparsevec_cmp | sparsevec, sparsevec | integer + vector | public | sparsevec_eq | sparsevec, sparsevec | boolean + vector | public | sparsevec_ge | sparsevec, sparsevec | boolean + vector | public | sparsevec_gt | sparsevec, sparsevec | boolean + vector | public | sparsevec_in | cstring, oid, integer | sparsevec + vector | public | sparsevec_l2_squared_distance | sparsevec, sparsevec | double precision + vector | public | sparsevec_le | sparsevec, sparsevec | boolean + vector | public | sparsevec_lt | sparsevec, sparsevec | boolean + vector | public | sparsevec_ne | sparsevec, sparsevec | boolean + vector | public | sparsevec_negative_inner_product | sparsevec, sparsevec | double precision + vector | public | sparsevec_out | sparsevec | cstring + vector | public | sparsevec_recv | internal, oid, integer | sparsevec + vector | public | sparsevec_send | sparsevec | bytea + vector | public | sparsevec_to_halfvec | sparsevec, integer, boolean | halfvec + vector | public | sparsevec_to_vector | sparsevec, integer, boolean | vector + vector | public | sparsevec_typmod_in | cstring[] | integer + vector | public | subvector | halfvec, integer, integer | halfvec + vector | public | subvector | vector, integer, integer | vector + vector | public | sum | halfvec | halfvec + vector | public | sum | vector | vector + vector | public | vector | vector, integer, boolean | vector + vector | public | vector_accum | double precision[], vector | double precision[] + vector | public | vector_add | vector, vector | vector + vector | public | vector_avg | double precision[] | vector + vector | public | vector_cmp | vector, vector | integer + vector | public | vector_combine | double precision[], double precision[] | double precision[] + vector | public | vector_concat | vector, vector | vector + vector | public | vector_dims | halfvec | integer + vector | public | vector_dims | vector | integer + vector | public | vector_eq | vector, vector | boolean + vector | public | vector_ge | vector, vector | boolean + vector | public | vector_gt | vector, vector | boolean + vector | public | vector_in | cstring, oid, integer | vector + vector | public | vector_l2_squared_distance | vector, vector | double precision + vector | public | vector_le | vector, vector | boolean + vector | public | vector_lt | vector, vector | boolean + vector | public | vector_mul | vector, vector | vector + vector | public | vector_ne | vector, vector | boolean + vector | public | vector_negative_inner_product | vector, vector | double precision + vector | public | vector_norm | vector | double precision + vector | public | vector_out | vector | cstring + vector | public | vector_recv | internal, oid, integer | vector + vector | public | vector_send | vector | bytea + vector | public | vector_spherical_distance | vector, vector | double precision + vector | public | vector_sub | vector, vector | vector + vector | public | vector_to_float4 | vector, integer, boolean | real[] + vector | public | vector_to_halfvec | vector, integer, boolean | halfvec + vector | public | vector_to_sparsevec | vector, integer, boolean | sparsevec + vector | public | vector_typmod_in | cstring[] | integer + wrappers | public | airtable_fdw_handler | | fdw_handler + wrappers | public | airtable_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | airtable_fdw_validator | options text[], catalog oid | void + wrappers | public | auth0_fdw_handler | | fdw_handler + wrappers | public | auth0_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | auth0_fdw_validator | options text[], catalog oid | void + wrappers | public | big_query_fdw_handler | | fdw_handler + wrappers | public | big_query_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | big_query_fdw_validator | options text[], catalog oid | void + wrappers | public | click_house_fdw_handler | | fdw_handler + wrappers | public | click_house_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | click_house_fdw_validator | options text[], catalog oid | void + wrappers | public | cognito_fdw_handler | | fdw_handler + wrappers | public | cognito_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | cognito_fdw_validator | options text[], catalog oid | void + wrappers | public | firebase_fdw_handler | | fdw_handler + wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | firebase_fdw_validator | options text[], catalog oid | void + wrappers | public | hello_world_fdw_handler | | fdw_handler + wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void + wrappers | public | logflare_fdw_handler | | fdw_handler + wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | logflare_fdw_validator | options text[], catalog oid | void + wrappers | public | mssql_fdw_handler | | fdw_handler + wrappers | public | mssql_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | mssql_fdw_validator | options text[], catalog oid | void + wrappers | public | redis_fdw_handler | | fdw_handler + wrappers | public | redis_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | redis_fdw_validator | options text[], catalog oid | void + wrappers | public | s3_fdw_handler | | fdw_handler + wrappers | public | s3_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | s3_fdw_validator | options text[], catalog oid | void + wrappers | public | stripe_fdw_handler | | fdw_handler + wrappers | public | stripe_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | stripe_fdw_validator | options text[], catalog oid | void + wrappers | public | wasm_fdw_handler | | fdw_handler + wrappers | public | wasm_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | wasm_fdw_validator | options text[], catalog oid | void + xml2 | public | xml_encode_special_chars | text | text + xml2 | public | xml_valid | text | boolean + xml2 | public | xpath_bool | text, text | boolean + xml2 | public | xpath_list | text, text | text + xml2 | public | xpath_list | text, text, text | text + xml2 | public | xpath_nodeset | text, text | text + xml2 | public | xpath_nodeset | text, text, text | text + xml2 | public | xpath_nodeset | text, text, text, text | text + xml2 | public | xpath_number | text, text | real + xml2 | public | xpath_string | text, text | text + xml2 | public | xpath_table | text, text, text, text, text | SETOF record + xml2 | public | xslt_process | text, text | text + xml2 | public | xslt_process | text, text, text | text +(4729 rows) + +/* + +Monitor extension public table/view/matview/index interface + +*/ +select + e.extname as extension_name, + n.nspname as schema_name, + pc.relname as entity_name, + pa.attname +from + pg_catalog.pg_class pc + join pg_catalog.pg_namespace n + on n.oid = pc.relnamespace + join pg_catalog.pg_depend d + on d.objid = pc.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid + left join pg_catalog.pg_attribute pa + on pa.attrelid = pc.oid + and pa.attnum > 0 + and not pa.attisdropped +where + d.deptype = 'e' + and pc.relkind in ('r', 'v', 'm', 'i') +order by + e.extname, + n.nspname, + pc.relname, + pa.attname; + extension_name | schema_name | entity_name | attname +------------------------------+-------------+-------------------------+------------------------ + address_standardizer_data_us | public | us_gaz | id + address_standardizer_data_us | public | us_gaz | is_custom + address_standardizer_data_us | public | us_gaz | seq + address_standardizer_data_us | public | us_gaz | stdword + address_standardizer_data_us | public | us_gaz | token + address_standardizer_data_us | public | us_gaz | word + address_standardizer_data_us | public | us_lex | id + address_standardizer_data_us | public | us_lex | is_custom + address_standardizer_data_us | public | us_lex | seq + address_standardizer_data_us | public | us_lex | stdword + address_standardizer_data_us | public | us_lex | token + address_standardizer_data_us | public | us_lex | word + address_standardizer_data_us | public | us_rules | id + address_standardizer_data_us | public | us_rules | is_custom + address_standardizer_data_us | public | us_rules | rule + hypopg | public | hypopg_hidden_indexes | am_name + hypopg | public | hypopg_hidden_indexes | index_name + hypopg | public | hypopg_hidden_indexes | indexrelid + hypopg | public | hypopg_hidden_indexes | is_hypo + hypopg | public | hypopg_hidden_indexes | schema_name + hypopg | public | hypopg_hidden_indexes | table_name + hypopg | public | hypopg_list_indexes | am_name + hypopg | public | hypopg_list_indexes | index_name + hypopg | public | hypopg_list_indexes | indexrelid + hypopg | public | hypopg_list_indexes | schema_name + hypopg | public | hypopg_list_indexes | table_name + orioledb | public | orioledb_index | datoid + orioledb | public | orioledb_index | description + orioledb | public | orioledb_index | index_relnode + orioledb | public | orioledb_index | index_reloid + orioledb | public | orioledb_index | index_type + orioledb | public | orioledb_index | name + orioledb | public | orioledb_index | table_relnode + orioledb | public | orioledb_index | table_reloid + orioledb | public | orioledb_index_descr | datoid + orioledb | public | orioledb_index_descr | refcnt + orioledb | public | orioledb_index_descr | relnode + orioledb | public | orioledb_index_descr | reloid + orioledb | public | orioledb_table | datoid + orioledb | public | orioledb_table | description + orioledb | public | orioledb_table | relnode + orioledb | public | orioledb_table | reloid + orioledb | public | orioledb_table_descr | datoid + orioledb | public | orioledb_table_descr | refcnt + orioledb | public | orioledb_table_descr | relnode + orioledb | public | orioledb_table_descr | reloid + pg_buffercache | public | pg_buffercache | bufferid + pg_buffercache | public | pg_buffercache | isdirty + pg_buffercache | public | pg_buffercache | pinning_backends + pg_buffercache | public | pg_buffercache | relblocknumber + pg_buffercache | public | pg_buffercache | reldatabase + pg_buffercache | public | pg_buffercache | relfilenode + pg_buffercache | public | pg_buffercache | relforknumber + pg_buffercache | public | pg_buffercache | reltablespace + pg_buffercache | public | pg_buffercache | usagecount + pg_net | net | _http_response | content + pg_net | net | _http_response | content_type + pg_net | net | _http_response | created + pg_net | net | _http_response | error_msg + pg_net | net | _http_response | headers + pg_net | net | _http_response | id + pg_net | net | _http_response | status_code + pg_net | net | _http_response | timed_out + pg_net | net | http_request_queue | body + pg_net | net | http_request_queue | headers + pg_net | net | http_request_queue | id + pg_net | net | http_request_queue | method + pg_net | net | http_request_queue | timeout_milliseconds + pg_net | net | http_request_queue | url + pg_repack | repack | primary_keys | indexrelid + pg_repack | repack | primary_keys | indrelid + pg_repack | repack | tables | alter_col_storage + pg_repack | repack | tables | ckey + pg_repack | repack | tables | ckid + pg_repack | repack | tables | copy_data + pg_repack | repack | tables | create_log + pg_repack | repack | tables | create_pktype + pg_repack | repack | tables | create_table + pg_repack | repack | tables | create_trigger + pg_repack | repack | tables | delete_log + pg_repack | repack | tables | drop_columns + pg_repack | repack | tables | enable_trigger + pg_repack | repack | tables | lock_table + pg_repack | repack | tables | pkid + pg_repack | repack | tables | relid + pg_repack | repack | tables | relname + pg_repack | repack | tables | reltoastidxid + pg_repack | repack | tables | reltoastrelid + pg_repack | repack | tables | schemaname + pg_repack | repack | tables | sql_delete + pg_repack | repack | tables | sql_insert + pg_repack | repack | tables | sql_peek + pg_repack | repack | tables | sql_pop + pg_repack | repack | tables | sql_update + pg_repack | repack | tables | tablespace_orig + pg_stat_monitor | public | pg_stat_monitor | application_name + pg_stat_monitor | public | pg_stat_monitor | bucket + pg_stat_monitor | public | pg_stat_monitor | bucket_done + pg_stat_monitor | public | pg_stat_monitor | bucket_start_time + pg_stat_monitor | public | pg_stat_monitor | calls + pg_stat_monitor | public | pg_stat_monitor | client_ip + pg_stat_monitor | public | pg_stat_monitor | cmd_type + pg_stat_monitor | public | pg_stat_monitor | cmd_type_text + pg_stat_monitor | public | pg_stat_monitor | comments + pg_stat_monitor | public | pg_stat_monitor | cpu_sys_time + pg_stat_monitor | public | pg_stat_monitor | cpu_user_time + pg_stat_monitor | public | pg_stat_monitor | datname + pg_stat_monitor | public | pg_stat_monitor | dbid + pg_stat_monitor | public | pg_stat_monitor | elevel + pg_stat_monitor | public | pg_stat_monitor | jit_deform_count + pg_stat_monitor | public | pg_stat_monitor | jit_deform_time + pg_stat_monitor | public | pg_stat_monitor | jit_emission_count + pg_stat_monitor | public | pg_stat_monitor | jit_emission_time + pg_stat_monitor | public | pg_stat_monitor | jit_functions + pg_stat_monitor | public | pg_stat_monitor | jit_generation_time + pg_stat_monitor | public | pg_stat_monitor | jit_inlining_count + pg_stat_monitor | public | pg_stat_monitor | jit_inlining_time + pg_stat_monitor | public | pg_stat_monitor | jit_optimization_count + pg_stat_monitor | public | pg_stat_monitor | jit_optimization_time + pg_stat_monitor | public | pg_stat_monitor | local_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | local_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | local_blks_dirtied + pg_stat_monitor | public | pg_stat_monitor | local_blks_hit + pg_stat_monitor | public | pg_stat_monitor | local_blks_read + pg_stat_monitor | public | pg_stat_monitor | local_blks_written + pg_stat_monitor | public | pg_stat_monitor | max_exec_time + pg_stat_monitor | public | pg_stat_monitor | max_plan_time + pg_stat_monitor | public | pg_stat_monitor | mean_exec_time + pg_stat_monitor | public | pg_stat_monitor | mean_plan_time + pg_stat_monitor | public | pg_stat_monitor | message + pg_stat_monitor | public | pg_stat_monitor | min_exec_time + pg_stat_monitor | public | pg_stat_monitor | min_plan_time + pg_stat_monitor | public | pg_stat_monitor | minmax_stats_since + pg_stat_monitor | public | pg_stat_monitor | pgsm_query_id + pg_stat_monitor | public | pg_stat_monitor | planid + pg_stat_monitor | public | pg_stat_monitor | plans + pg_stat_monitor | public | pg_stat_monitor | query + pg_stat_monitor | public | pg_stat_monitor | query_plan + pg_stat_monitor | public | pg_stat_monitor | queryid + pg_stat_monitor | public | pg_stat_monitor | relations + pg_stat_monitor | public | pg_stat_monitor | resp_calls + pg_stat_monitor | public | pg_stat_monitor | rows + pg_stat_monitor | public | pg_stat_monitor | shared_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | shared_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | shared_blks_dirtied + pg_stat_monitor | public | pg_stat_monitor | shared_blks_hit + pg_stat_monitor | public | pg_stat_monitor | shared_blks_read + pg_stat_monitor | public | pg_stat_monitor | shared_blks_written + pg_stat_monitor | public | pg_stat_monitor | sqlcode + pg_stat_monitor | public | pg_stat_monitor | stats_since + pg_stat_monitor | public | pg_stat_monitor | stddev_exec_time + pg_stat_monitor | public | pg_stat_monitor | stddev_plan_time + pg_stat_monitor | public | pg_stat_monitor | temp_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | temp_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | temp_blks_read + pg_stat_monitor | public | pg_stat_monitor | temp_blks_written + pg_stat_monitor | public | pg_stat_monitor | top_query + pg_stat_monitor | public | pg_stat_monitor | top_queryid + pg_stat_monitor | public | pg_stat_monitor | toplevel + pg_stat_monitor | public | pg_stat_monitor | total_exec_time + pg_stat_monitor | public | pg_stat_monitor | total_plan_time + pg_stat_monitor | public | pg_stat_monitor | userid + pg_stat_monitor | public | pg_stat_monitor | username + pg_stat_monitor | public | pg_stat_monitor | wal_bytes + pg_stat_monitor | public | pg_stat_monitor | wal_fpi + pg_stat_monitor | public | pg_stat_monitor | wal_records + pg_stat_statements | extensions | pg_stat_statements | calls + pg_stat_statements | extensions | pg_stat_statements | dbid + pg_stat_statements | extensions | pg_stat_statements | jit_deform_count + pg_stat_statements | extensions | pg_stat_statements | jit_deform_time + pg_stat_statements | extensions | pg_stat_statements | jit_emission_count + pg_stat_statements | extensions | pg_stat_statements | jit_emission_time + pg_stat_statements | extensions | pg_stat_statements | jit_functions + pg_stat_statements | extensions | pg_stat_statements | jit_generation_time + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_count + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_time + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_count + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_time + pg_stat_statements | extensions | pg_stat_statements | local_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | local_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | local_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | local_blks_hit + pg_stat_statements | extensions | pg_stat_statements | local_blks_read + pg_stat_statements | extensions | pg_stat_statements | local_blks_written + pg_stat_statements | extensions | pg_stat_statements | max_exec_time + pg_stat_statements | extensions | pg_stat_statements | max_plan_time + pg_stat_statements | extensions | pg_stat_statements | mean_exec_time + pg_stat_statements | extensions | pg_stat_statements | mean_plan_time + pg_stat_statements | extensions | pg_stat_statements | min_exec_time + pg_stat_statements | extensions | pg_stat_statements | min_plan_time + pg_stat_statements | extensions | pg_stat_statements | minmax_stats_since + pg_stat_statements | extensions | pg_stat_statements | plans + pg_stat_statements | extensions | pg_stat_statements | query + pg_stat_statements | extensions | pg_stat_statements | queryid + pg_stat_statements | extensions | pg_stat_statements | rows + pg_stat_statements | extensions | pg_stat_statements | shared_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | shared_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | shared_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | shared_blks_hit + pg_stat_statements | extensions | pg_stat_statements | shared_blks_read + pg_stat_statements | extensions | pg_stat_statements | shared_blks_written + pg_stat_statements | extensions | pg_stat_statements | stats_since + pg_stat_statements | extensions | pg_stat_statements | stddev_exec_time + pg_stat_statements | extensions | pg_stat_statements | stddev_plan_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | temp_blks_read + pg_stat_statements | extensions | pg_stat_statements | temp_blks_written + pg_stat_statements | extensions | pg_stat_statements | toplevel + pg_stat_statements | extensions | pg_stat_statements | total_exec_time + pg_stat_statements | extensions | pg_stat_statements | total_plan_time + pg_stat_statements | extensions | pg_stat_statements | userid + pg_stat_statements | extensions | pg_stat_statements | wal_bytes + pg_stat_statements | extensions | pg_stat_statements | wal_fpi + pg_stat_statements | extensions | pg_stat_statements | wal_records + pg_stat_statements | extensions | pg_stat_statements_info | dealloc + pg_stat_statements | extensions | pg_stat_statements_info | stats_reset + pg_tle | pgtle | feature_info | feature + pg_tle | pgtle | feature_info | obj_identity + pg_tle | pgtle | feature_info | proname + pg_tle | pgtle | feature_info | schema_name + pgmq | pgmq | a_foo | archived_at + pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | message + pgmq | pgmq | a_foo | msg_id + pgmq | pgmq | a_foo | read_ct + pgmq | pgmq | a_foo | vt + pgmq | pgmq | meta | created_at + pgmq | pgmq | meta | is_partitioned + pgmq | pgmq | meta | is_unlogged + pgmq | pgmq | meta | queue_name + pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | message + pgmq | pgmq | q_foo | msg_id + pgmq | pgmq | q_foo | read_ct + pgmq | pgmq | q_foo | vt + pgsodium | pgsodium | decrypted_key | associated_data + pgsodium | pgsodium | decrypted_key | comment + pgsodium | pgsodium | decrypted_key | created + pgsodium | pgsodium | decrypted_key | decrypted_raw_key + pgsodium | pgsodium | decrypted_key | expires + pgsodium | pgsodium | decrypted_key | id + pgsodium | pgsodium | decrypted_key | key_context + pgsodium | pgsodium | decrypted_key | key_id + pgsodium | pgsodium | decrypted_key | key_type + pgsodium | pgsodium | decrypted_key | name + pgsodium | pgsodium | decrypted_key | parent_key + pgsodium | pgsodium | decrypted_key | raw_key + pgsodium | pgsodium | decrypted_key | raw_key_nonce + pgsodium | pgsodium | decrypted_key | status + pgsodium | pgsodium | key | associated_data + pgsodium | pgsodium | key | comment + pgsodium | pgsodium | key | created + pgsodium | pgsodium | key | expires + pgsodium | pgsodium | key | id + pgsodium | pgsodium | key | key_context + pgsodium | pgsodium | key | key_id + pgsodium | pgsodium | key | key_type + pgsodium | pgsodium | key | name + pgsodium | pgsodium | key | parent_key + pgsodium | pgsodium | key | raw_key + pgsodium | pgsodium | key | raw_key_nonce + pgsodium | pgsodium | key | status + pgsodium | pgsodium | key | user_data + pgsodium | pgsodium | mask_columns | associated_columns + pgsodium | pgsodium | mask_columns | attname + pgsodium | pgsodium | mask_columns | attrelid + pgsodium | pgsodium | mask_columns | format_type + pgsodium | pgsodium | mask_columns | key_id + pgsodium | pgsodium | mask_columns | key_id_column + pgsodium | pgsodium | mask_columns | nonce_column + pgsodium | pgsodium | masking_rule | associated_columns + pgsodium | pgsodium | masking_rule | attname + pgsodium | pgsodium | masking_rule | attnum + pgsodium | pgsodium | masking_rule | attrelid + pgsodium | pgsodium | masking_rule | col_description + pgsodium | pgsodium | masking_rule | format_type + pgsodium | pgsodium | masking_rule | key_id + pgsodium | pgsodium | masking_rule | key_id_column + pgsodium | pgsodium | masking_rule | nonce_column + pgsodium | pgsodium | masking_rule | priority + pgsodium | pgsodium | masking_rule | relname + pgsodium | pgsodium | masking_rule | relnamespace + pgsodium | pgsodium | masking_rule | security_invoker + pgsodium | pgsodium | masking_rule | view_name + pgsodium | pgsodium | valid_key | associated_data + pgsodium | pgsodium | valid_key | created + pgsodium | pgsodium | valid_key | expires + pgsodium | pgsodium | valid_key | id + pgsodium | pgsodium | valid_key | key_context + pgsodium | pgsodium | valid_key | key_id + pgsodium | pgsodium | valid_key | key_type + pgsodium | pgsodium | valid_key | name + pgsodium | pgsodium | valid_key | status + pgtap | public | pg_all_foreign_keys | fk_columns + pgtap | public | pg_all_foreign_keys | fk_constraint_name + pgtap | public | pg_all_foreign_keys | fk_schema_name + pgtap | public | pg_all_foreign_keys | fk_table_name + pgtap | public | pg_all_foreign_keys | fk_table_oid + pgtap | public | pg_all_foreign_keys | is_deferrable + pgtap | public | pg_all_foreign_keys | is_deferred + pgtap | public | pg_all_foreign_keys | match_type + pgtap | public | pg_all_foreign_keys | on_delete + pgtap | public | pg_all_foreign_keys | on_update + pgtap | public | pg_all_foreign_keys | pk_columns + pgtap | public | pg_all_foreign_keys | pk_constraint_name + pgtap | public | pg_all_foreign_keys | pk_index_name + pgtap | public | pg_all_foreign_keys | pk_schema_name + pgtap | public | pg_all_foreign_keys | pk_table_name + pgtap | public | pg_all_foreign_keys | pk_table_oid + pgtap | public | tap_funky | args + pgtap | public | tap_funky | is_definer + pgtap | public | tap_funky | is_strict + pgtap | public | tap_funky | is_visible + pgtap | public | tap_funky | kind + pgtap | public | tap_funky | langoid + pgtap | public | tap_funky | name + pgtap | public | tap_funky | oid + pgtap | public | tap_funky | owner + pgtap | public | tap_funky | returns + pgtap | public | tap_funky | returns_set + pgtap | public | tap_funky | schema + pgtap | public | tap_funky | volatility + postgis | public | geography_columns | coord_dimension + postgis | public | geography_columns | f_geography_column + postgis | public | geography_columns | f_table_catalog + postgis | public | geography_columns | f_table_name + postgis | public | geography_columns | f_table_schema + postgis | public | geography_columns | srid + postgis | public | geography_columns | type + postgis | public | geometry_columns | coord_dimension + postgis | public | geometry_columns | f_geometry_column + postgis | public | geometry_columns | f_table_catalog + postgis | public | geometry_columns | f_table_name + postgis | public | geometry_columns | f_table_schema + postgis | public | geometry_columns | srid + postgis | public | geometry_columns | type + postgis | public | spatial_ref_sys | auth_name + postgis | public | spatial_ref_sys | auth_srid + postgis | public | spatial_ref_sys | proj4text + postgis | public | spatial_ref_sys | srid + postgis | public | spatial_ref_sys | srtext + postgis_raster | public | raster_columns | blocksize_x + postgis_raster | public | raster_columns | blocksize_y + postgis_raster | public | raster_columns | extent + postgis_raster | public | raster_columns | nodata_values + postgis_raster | public | raster_columns | num_bands + postgis_raster | public | raster_columns | out_db + postgis_raster | public | raster_columns | pixel_types + postgis_raster | public | raster_columns | r_raster_column + postgis_raster | public | raster_columns | r_table_catalog + postgis_raster | public | raster_columns | r_table_name + postgis_raster | public | raster_columns | r_table_schema + postgis_raster | public | raster_columns | regular_blocking + postgis_raster | public | raster_columns | same_alignment + postgis_raster | public | raster_columns | scale_x + postgis_raster | public | raster_columns | scale_y + postgis_raster | public | raster_columns | spatial_index + postgis_raster | public | raster_columns | srid + postgis_raster | public | raster_overviews | o_raster_column + postgis_raster | public | raster_overviews | o_table_catalog + postgis_raster | public | raster_overviews | o_table_name + postgis_raster | public | raster_overviews | o_table_schema + postgis_raster | public | raster_overviews | overview_factor + postgis_raster | public | raster_overviews | r_raster_column + postgis_raster | public | raster_overviews | r_table_catalog + postgis_raster | public | raster_overviews | r_table_name + postgis_raster | public | raster_overviews | r_table_schema + postgis_topology | topology | layer | child_id + postgis_topology | topology | layer | feature_column + postgis_topology | topology | layer | feature_type + postgis_topology | topology | layer | layer_id + postgis_topology | topology | layer | level + postgis_topology | topology | layer | schema_name + postgis_topology | topology | layer | table_name + postgis_topology | topology | layer | topology_id + postgis_topology | topology | topology | hasz + postgis_topology | topology | topology | id + postgis_topology | topology | topology | name + postgis_topology | topology | topology | precision + postgis_topology | topology | topology | srid + supabase_vault | vault | secrets | created_at + supabase_vault | vault | secrets | description + supabase_vault | vault | secrets | id + supabase_vault | vault | secrets | key_id + supabase_vault | vault | secrets | name + supabase_vault | vault | secrets | nonce + supabase_vault | vault | secrets | secret + supabase_vault | vault | secrets | updated_at + wrappers | public | wrappers_fdw_stats | bytes_in + wrappers | public | wrappers_fdw_stats | bytes_out + wrappers | public | wrappers_fdw_stats | create_times + wrappers | public | wrappers_fdw_stats | created_at + wrappers | public | wrappers_fdw_stats | fdw_name + wrappers | public | wrappers_fdw_stats | metadata + wrappers | public | wrappers_fdw_stats | rows_in + wrappers | public | wrappers_fdw_stats | rows_out + wrappers | public | wrappers_fdw_stats | updated_at +(398 rows) + diff --git a/nix/tests/expected/z_17_pg_stat_monitor.out b/nix/tests/expected/z_17_pg_stat_monitor.out new file mode 100644 index 000000000..8b90c12fc --- /dev/null +++ b/nix/tests/expected/z_17_pg_stat_monitor.out @@ -0,0 +1,10 @@ +select + * +from + pg_stat_monitor +where + false; + bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | shared_blk_read_time | shared_blk_write_time | local_blk_read_time | local_blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time | jit_deform_count | jit_deform_time | stats_since | minmax_stats_since +--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+----------------------+-----------------------+---------------------+----------------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------+------------------+-----------------+-------------+-------------------- +(0 rows) + diff --git a/nix/tests/expected/z_17_pgvector.out b/nix/tests/expected/z_17_pgvector.out new file mode 100644 index 000000000..2c1cb1007 --- /dev/null +++ b/nix/tests/expected/z_17_pgvector.out @@ -0,0 +1,59 @@ +/* +This test excludes indexes shipped with pgvector because orioledb doesn't support them yet +*/ +create schema v; +create table v.items( + id serial primary key, + embedding vector(3), + half_embedding halfvec(3), + bit_embedding bit(3), + sparse_embedding sparsevec(3) +); +-- Populate some records +insert into v.items( + embedding, + half_embedding, + bit_embedding, + sparse_embedding +) +values + ('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'), + ('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3'); +-- Test op types +select + * +from + v.items +order by + embedding <-> '[2,3,5]', + embedding <=> '[2,3,5]', + embedding <+> '[2,3,5]', + embedding <#> '[2,3,5]', + half_embedding <-> '[2,3,5]', + half_embedding <=> '[2,3,5]', + half_embedding <+> '[2,3,5]', + half_embedding <#> '[2,3,5]', + sparse_embedding <-> '{2:4,3:1}/3', + sparse_embedding <=> '{2:4,3:1}/3', + sparse_embedding <+> '{2:4,3:1}/3', + sparse_embedding <#> '{2:4,3:1}/3', + bit_embedding <~> '011'; + id | embedding | half_embedding | bit_embedding | sparse_embedding +----+-----------+----------------+---------------+------------------ + 2 | [2,3,4] | [2,3,4] | 010 | {1:7}/3 + 1 | [1,2,3] | [1,2,3] | 101 | {1:4}/3 +(2 rows) + +select + avg(embedding), + avg(half_embedding) +from + v.items; + avg | avg +---------------+--------------- + [1.5,2.5,3.5] | [1.5,2.5,3.5] +(1 row) + +-- Cleanup +drop schema v cascade; +NOTICE: drop cascades to table v.items diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 7203eaa54..5116c419a 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -1,90 +1,85 @@ -create role postgres; -create extension address_standardizer; -create extension address_standardizer_data_us; -create extension adminpack; -create extension amcheck; -create extension autoinc; -create extension bloom; -create extension btree_gin; -create extension btree_gist; -create extension citext; -create extension cube; -create extension dblink; -create extension dict_int; -create extension dict_xsyn; -create extension earthdistance; -create extension file_fdw; -create extension fuzzystrmatch; -create extension http; -create extension hstore; -create extension hypopg; -create extension index_advisor; -create extension insert_username; -create extension intagg; -create extension intarray; -create extension isn; -create extension lo; -create extension ltree; -create extension moddatetime; -create extension old_snapshot; -create extension pageinspect; -create extension pg_backtrace; -create extension pg_buffercache; +-- disable notice messages becuase they differ between 15 and 17 +set client_min_messages = warning; + +create extension if not exists address_standardizer; +create extension if not exists address_standardizer_data_us; +create extension if not exists amcheck; +create extension if not exists autoinc; +create extension if not exists bloom; +create extension if not exists btree_gin; +create extension if not exists btree_gist; +create extension if not exists citext; +create extension if not exists cube; +create extension if not exists dblink; +create extension if not exists dict_int; +create extension if not exists dict_xsyn; +create extension if not exists earthdistance; +create extension if not exists file_fdw; +create extension if not exists fuzzystrmatch; +create extension if not exists http; +create extension if not exists hstore; +create extension if not exists hypopg; +create extension if not exists index_advisor; +create extension if not exists insert_username; +create extension if not exists intagg; +create extension if not exists intarray; +create extension if not exists isn; +create extension if not exists lo; +create extension if not exists ltree; +create extension if not exists moddatetime; +create extension if not exists pageinspect; +create extension if not exists pg_backtrace; +create extension if not exists pg_buffercache; /* TODO: Does not enable locally mode requires a change to postgresql.conf to set cron.database_name = 'testing' */ --- create extension pg_cron; +-- create extension if not exists pg_cron; -create extension pg_net; -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; -create extension pg_stat_statements; -create extension pg_surgery; -create extension pg_tle; -create extension pg_trgm; -create extension pg_visibility; -create extension pg_walinspect; -create extension pgaudit; -create extension pgcrypto; -create extension pgtap; -create extension pgjwt; -create extension pgroonga; -create extension pgroonga_database; -create extension pgsodium; -create extension pgrowlocks; -create extension pgstattuple; -create extension plpgsql_check; -create extension plv8; -create extension plcoffee; -create extension plls; -create extension postgis; -create extension postgis_raster; -create extension postgis_sfcgal; -create extension postgis_tiger_geocoder; -create extension postgis_topology; -create extension pgrouting; -- requires postgis -create extension postgres_fdw; -create extension rum; -create extension refint; -create extension seg; -create extension sslinfo; -create extension supabase_vault; -create extension tablefunc; -create extension tcn; -create extension timescaledb; -create extension tsm_system_rows; -create extension tsm_system_time; -create extension unaccent; -create extension "uuid-ossp"; -create extension vector; -create extension wrappers; -create extension xml2; +create extension if not exists pg_net; +create extension if not exists pg_graphql; +create extension if not exists pg_freespacemap; +create extension if not exists pg_hashids; +create extension if not exists pg_prewarm; +create extension if not exists pgmq; +create extension if not exists pg_jsonschema; +create extension if not exists pg_repack; +create extension if not exists pg_stat_monitor; +create extension if not exists pg_stat_statements; +create extension if not exists pg_surgery; +create extension if not exists pg_tle; +create extension if not exists pg_trgm; +create extension if not exists pg_visibility; +create extension if not exists pg_walinspect; +create extension if not exists pgaudit; +create extension if not exists pgcrypto; +create extension if not exists pgtap; +create extension if not exists pgjwt; +create extension if not exists pgroonga; +create extension if not exists pgroonga_database; +create extension if not exists pgsodium; +create extension if not exists pgrowlocks; +create extension if not exists pgstattuple; +create extension if not exists plpgsql_check; +create extension if not exists postgis; +create extension if not exists postgis_raster; +create extension if not exists postgis_sfcgal; +create extension if not exists postgis_topology; +create extension if not exists pgrouting; -- requires postgis +create extension if not exists postgres_fdw; +create extension if not exists rum; +create extension if not exists refint; +create extension if not exists seg; +create extension if not exists sslinfo; +create extension if not exists supabase_vault; +create extension if not exists tablefunc; +create extension if not exists tcn; +create extension if not exists tsm_system_rows; +-- create extension if not exists tsm_system_time; not supported in apache license +create extension if not exists unaccent; +create extension if not exists "uuid-ossp"; +create extension if not exists vector; +create extension if not exists wrappers; +create extension if not exists xml2; diff --git a/nix/tests/sql/pg_tle.sql b/nix/tests/sql/pg_tle.sql index 3af128026..2f6d71a05 100644 --- a/nix/tests/sql/pg_tle.sql +++ b/nix/tests/sql/pg_tle.sql @@ -1,3 +1,5 @@ +set client_min_messages = warning; + select pgtle.install_extension( 'pg_distance', @@ -26,8 +28,8 @@ select create extension pg_distance; -select manhattan_dist(1, 1, 5, 5); -select euclidean_dist(1, 1, 5, 5); +select manhattan_dist(1, 1, 5, 5)::numeric(10,2); +select euclidean_dist(1, 1, 5, 5)::numeric(10,2); SELECT pgtle.install_update_path( 'pg_distance', @@ -67,4 +69,5 @@ select -- Restore original state if any of the above fails drop extension pg_tle cascade; + create extension pg_tle; diff --git a/nix/tests/sql/z_15_ext_interface.sql b/nix/tests/sql/z_15_ext_interface.sql new file mode 100644 index 000000000..24ee03ea2 --- /dev/null +++ b/nix/tests/sql/z_15_ext_interface.sql @@ -0,0 +1,122 @@ +/* + +The purpose of this test is to monitor the SQL interface exposed +by Postgres extensions so we have to manually review/approve any difference +that emerge as versions change. + +*/ + + +/* + +List all extensions that are not enabled +If a new entry shows up in this list, that means a new extension has been +added and you should `create extension ...` to enable it in ./nix/tests/prime + +*/ +create extension if not exists adminpack; +create extension if not exists plv8; +create extension if not exists plcoffee; +create extension if not exists plls; +create extension if not exists old_snapshot; +create extension if not exists timescaledb; +create extension if not exists postgis_tiger_geocoder; + + +select + name +from + pg_available_extensions +where + installed_version is null +order by + name asc; + + +/* + +Monitor relocatability and config of each extension +- lesson learned from pg_cron + +*/ + +select + extname as extension_name, + extrelocatable as is_relocatable +from + pg_extension +order by + extname asc; + + +/* + +Monitor extension public function interface + +*/ + +select + e.extname as extension_name, + n.nspname as schema_name, + p.proname as function_name, + pg_catalog.pg_get_function_identity_arguments(p.oid) as argument_types, + pg_catalog.pg_get_function_result(p.oid) as return_type +from + pg_catalog.pg_proc p + join pg_catalog.pg_namespace n + on n.oid = p.pronamespace + join pg_catalog.pg_depend d + on d.objid = p.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid +where + d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') +order by + e.extname, + n.nspname, + p.proname, + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); + +/* + +Monitor extension public table/view/matview/index interface + +*/ + +select + e.extname as extension_name, + n.nspname as schema_name, + pc.relname as entity_name, + pa.attname +from + pg_catalog.pg_class pc + join pg_catalog.pg_namespace n + on n.oid = pc.relnamespace + join pg_catalog.pg_depend d + on d.objid = pc.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid + left join pg_catalog.pg_attribute pa + on pa.attrelid = pc.oid + and pa.attnum > 0 + and not pa.attisdropped +where + d.deptype = 'e' + and pc.relkind in ('r', 'v', 'm', 'i') +order by + e.extname, + n.nspname, + pc.relname, + pa.attname; diff --git a/nix/tests/sql/pg_stat_monitor.sql b/nix/tests/sql/z_15_pg_stat_monitor.sql similarity index 100% rename from nix/tests/sql/pg_stat_monitor.sql rename to nix/tests/sql/z_15_pg_stat_monitor.sql diff --git a/nix/tests/sql/pgroonga.sql b/nix/tests/sql/z_15_pgroonga.sql similarity index 100% rename from nix/tests/sql/pgroonga.sql rename to nix/tests/sql/z_15_pgroonga.sql diff --git a/nix/tests/sql/pgvector.sql b/nix/tests/sql/z_15_pgvector.sql similarity index 100% rename from nix/tests/sql/pgvector.sql rename to nix/tests/sql/z_15_pgvector.sql diff --git a/nix/tests/sql/plv8.sql b/nix/tests/sql/z_15_plv8.sql similarity index 63% rename from nix/tests/sql/plv8.sql rename to nix/tests/sql/z_15_plv8.sql index f58360f58..044d69cf9 100644 --- a/nix/tests/sql/plv8.sql +++ b/nix/tests/sql/z_15_plv8.sql @@ -1,3 +1,9 @@ +/* +This test is excluded from the Postgres 17 suite because it does not ship +with the Supabase PG17 image +*/ +create extension if not exists plv8; + create schema v; -- create a function to perform some JavaScript operations diff --git a/nix/tests/sql/rum.sql b/nix/tests/sql/z_15_rum.sql similarity index 80% rename from nix/tests/sql/rum.sql rename to nix/tests/sql/z_15_rum.sql index 4686c1245..6ae945975 100644 --- a/nix/tests/sql/rum.sql +++ b/nix/tests/sql/z_15_rum.sql @@ -1,3 +1,6 @@ +/* +This extension is excluded from oriole-17 because it uses an unsupported index type +*/ create schema v; create table v.test_rum( @@ -25,7 +28,7 @@ create index rumidx on v.test_rum using rum (a rum_tsvector_ops); select t, - a <=> to_tsquery('english', 'beautiful | place') as rank + round(a <=> to_tsquery('english', 'beautiful | place')) as rank from v.test_rum where diff --git a/nix/tests/sql/timescale.sql b/nix/tests/sql/z_15_timescale.sql similarity index 82% rename from nix/tests/sql/timescale.sql rename to nix/tests/sql/z_15_timescale.sql index baa96f48b..fd29bb17c 100644 --- a/nix/tests/sql/timescale.sql +++ b/nix/tests/sql/z_15_timescale.sql @@ -1,3 +1,9 @@ +/* +This test is excluded from the Postgres 17 suite because it does not ship +with the Supabase PG17 image +*/ +create extension if not exists timescaledb; + -- Confirm we're running the apache version show timescaledb.license; diff --git a/nix/tests/sql/extensions_sql_interface.sql b/nix/tests/sql/z_17_ext_interface.sql similarity index 100% rename from nix/tests/sql/extensions_sql_interface.sql rename to nix/tests/sql/z_17_ext_interface.sql diff --git a/nix/tests/sql/z_17_pg_stat_monitor.sql b/nix/tests/sql/z_17_pg_stat_monitor.sql new file mode 100644 index 000000000..69d996be8 --- /dev/null +++ b/nix/tests/sql/z_17_pg_stat_monitor.sql @@ -0,0 +1,6 @@ +select + * +from + pg_stat_monitor +where + false; diff --git a/nix/tests/sql/z_17_pgvector.sql b/nix/tests/sql/z_17_pgvector.sql new file mode 100644 index 000000000..c90219ca5 --- /dev/null +++ b/nix/tests/sql/z_17_pgvector.sql @@ -0,0 +1,52 @@ +/* +This test excludes indexes shipped with pgvector because orioledb doesn't support them yet +*/ +create schema v; + +create table v.items( + id serial primary key, + embedding vector(3), + half_embedding halfvec(3), + bit_embedding bit(3), + sparse_embedding sparsevec(3) +); + +-- Populate some records +insert into v.items( + embedding, + half_embedding, + bit_embedding, + sparse_embedding +) +values + ('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'), + ('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3'); + +-- Test op types +select + * +from + v.items +order by + embedding <-> '[2,3,5]', + embedding <=> '[2,3,5]', + embedding <+> '[2,3,5]', + embedding <#> '[2,3,5]', + half_embedding <-> '[2,3,5]', + half_embedding <=> '[2,3,5]', + half_embedding <+> '[2,3,5]', + half_embedding <#> '[2,3,5]', + sparse_embedding <-> '{2:4,3:1}/3', + sparse_embedding <=> '{2:4,3:1}/3', + sparse_embedding <+> '{2:4,3:1}/3', + sparse_embedding <#> '{2:4,3:1}/3', + bit_embedding <~> '011'; + +select + avg(embedding), + avg(half_embedding) +from + v.items; + +-- Cleanup +drop schema v cascade; diff --git a/nix/tests/util/pgsodium_getkey.sh b/nix/tests/util/pgsodium_getkey.sh index 106e3bf4a..7044d0f04 100755 --- a/nix/tests/util/pgsodium_getkey.sh +++ b/nix/tests/util/pgsodium_getkey.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail KEY_FILE="${1:-/tmp/pgsodium.key}" -if [[ ! -f "${KEY_FILE}" ]]; then - head -c 32 /dev/urandom | od -A n -t x1 | tr -d ' \n' > "${KEY_FILE}" +if [[ ! -f "$KEY_FILE" ]]; then + head -c 32 /dev/urandom | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE" fi -cat $KEY_FILE \ No newline at end of file +cat $KEY_FILE diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 3c4e9181e..125e365bd 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -112,41 +112,6 @@ MIGRATIONS_DIR=@MIGRATIONS_DIR@ POSTGRESQL_SCHEMA_SQL=@POSTGRESQL_SCHEMA_SQL@ PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ -psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres <<-EOSQL - create role postgres superuser login password '$PGPASSWORD'; - alter database postgres owner to postgres; -EOSQL - -# Use custom migration script if provided -if [ -n "$MIGRATION_FILE" ]; then - echo "$0: running user-provided migration file $MIGRATION_FILE" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -f "$MIGRATION_FILE" postgres -else - # Run default init scripts - for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -f "$sql" postgres - done - - # Alter user password - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" - - # Run additional schema files - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" - - # Run migrations as superuser - for sql in "$MIGRATIONS_DIR"/migrations/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$sql" postgres - done - - # Run PostgreSQL schema - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -f "$POSTGRESQL_SCHEMA_SQL" postgres -fi - -# Optional: Reset stats if needed -# psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -p "$PORTNO" -h localhost -c 'SELECT extensions.pg_stat_statements_reset(); SELECT pg_stat_reset();' postgres || true # Start interactive psql session exec psql -U "$PSQL_USER" -p "$PORTNO" -h localhost postgres diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 1ebae228f..ef2395aa9 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -1,28 +1,152 @@ -#!/usr/bin/env bash +#!@SHELL_PATH@ # shellcheck shell=bash [ ! -z "$DEBUG" ] && set -x -if [ "$1" == "15" ]; then +# Default values +SKIP_MIGRATIONS=false +PSQL_USER="postgres" +MIGRATION_FILE="" +DAEMONIZE=false +GETKEY_SCRIPT="" + +# Function to display help +print_help() { + echo "Usage: start-postgres-server [options] VERSION [PORT]" + echo + echo "Options:" + echo " --skip-migrations Skip running migrations and SQL statements" + echo " --migration-file FILE Provide a custom migration script" + echo " --user USER Specify the user/role to use (default: postgres)" + echo " --getkey-script SCRIPT Provide a custom path to the PGSODIUM_GETKEY_SCRIPT" + echo " -h, --help Show this help message" + echo + echo "VERSION must be one of: 15, orioledb-17" + echo "PORT is optional (default: @PGSQL_DEFAULT_PORT@)" +} + +start_postgres() { + local mode=$1 + local LOG_DIR="${DATDIR}_logs" + mkdir -p "$LOG_DIR" + local LOG_FILE="$LOG_DIR/postgres.log" + touch "$LOG_FILE" + if [ "$mode" = "daemon" ]; then + # Start the server + pg_ctl start -D "$DATDIR" -l "$LOG_FILE" \ + -o "--config-file=$DATDIR/postgresql.conf -p $PORTNO -k $DATDIR/tmp" + + # Give it a moment to write logs + sleep 1 + + # Check server status and logs + if ! pg_ctl status -D "$DATDIR"; then + echo "PostgreSQL failed to start. Full logs:" + cat "$LOG_FILE" + # You might also want to see the postmaster.pid if it exists + if [ -f "$DATDIR/postmaster.pid" ]; then + echo "postmaster.pid contents:" + cat "$DATDIR/postmaster.pid" + fi + return 1 + fi + else + # Foreground mode + exec postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k "/tmp" -F + fi +} + +stop_postgres() { + pg_ctl stop -D "$DATDIR" -m fast +} + +trap 'stop_postgres' SIGINT SIGTERM + +# Parse arguments +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case "$1" in + --skip-migrations) + SKIP_MIGRATIONS=true + shift + ;; + --migration-file) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + MIGRATION_FILE="$2" + shift 2 + else + echo "Error: --migration-file requires a filename" + exit 1 + fi + ;; + --user) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PSQL_USER="$2" + shift 2 + else + echo "Error: --user requires an argument" + exit 1 + fi + ;; + --getkey-script) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + GETKEY_SCRIPT="$2" + shift 2 + else + echo "Error: --getkey-script requires a script path" + exit 1 + fi + ;; + --daemonize) + DAEMONIZE=true + shift + ;; + -h|--help) + print_help + exit 0 + ;; + *) + if [[ "$1" =~ ^- ]]; then + echo "Unknown option: $1" + print_help + exit 1 + elif [[ -z "$VERSION" ]]; then + VERSION="$1" + shift + elif [[ -z "$PORTNO" ]]; then + PORTNO="$1" + shift + else + echo "Error: Unexpected argument: $1" + print_help + exit 1 + fi + ;; + esac +done +if [[ -n "${GETKEY_SCRIPT:-}" ]]; then + export PGSODIUM_GETKEY_SCRIPT="$GETKEY_SCRIPT" +else + PGSODIUM_GETKEY_SCRIPT="${PGSODIUM_GETKEY_SCRIPT:-@PGSODIUM_GETKEY@}" +fi +# Verify version and set binary directory +if [ "$VERSION" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" -elif [ "$1" == "16" ]; then - echo "Starting server for PSQL 16" - PSQL16=@PSQL16_BINDIR@ - BINDIR="$PSQL16" -elif [ "$1" == "orioledb-17" ]; then +elif [ "$VERSION" == "orioledb-17" ]; then echo "Starting server for PSQL ORIOLEDB 17" PSQLORIOLEDB17=@PSQLORIOLEDB17_BINDIR@ BINDIR="$PSQLORIOLEDB17" else - echo "Please provide a valid Postgres version (15, 16 or orioledb-16)" + echo "Please provide a valid Postgres version (15, orioledb-17)" exit 1 fi + +# Set environment variables and paths export PATH=$BINDIR/bin:$PATH PGSQL_SUPERUSER=@PGSQL_SUPERUSER@ PSQL_CONF_FILE=@PSQL_CONF_FILE@ -PGSODIUM_GETKEY_SCRIPT=@PGSODIUM_GETKEY@ -PORTNO="${2:-@PGSQL_DEFAULT_PORT@}" +PORTNO="${PORTNO:-@PGSQL_DEFAULT_PORT@}" SUPAUTILS_CONFIG_FILE=@SUPAUTILS_CONF_FILE@ LOGGING_CONFIG_FILE=@LOGGING_CONF_FILE@ READREPL_CONFIG_FILE=@READREPL_CONF_FILE@ @@ -30,25 +154,56 @@ PG_HBA_FILE=@PG_HBA@ PG_IDENT_FILE=@PG_IDENT@ EXTENSION_CUSTOM_SCRIPTS=@EXTENSION_CUSTOM_SCRIPTS_DIR@ GROONGA=@GROONGA_DIR@ +MIGRATIONS_DIR=@MIGRATIONS_DIR@ +POSTGRESQL_SCHEMA_SQL=@POSTGRESQL_SCHEMA_SQL@ +PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ +STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ +MECAB_LIB=@MECAB_LIB@ + +# Setup directories and locale settings DATDIR=$(mktemp -d) LOCALE_ARCHIVE=@LOCALES@ CURRENT_SYSTEM=@CURRENT_SYSTEM@ + +# Set locale environment export LOCALE_ARCHIVE export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 +export KEY_FILE="$DATDIR/pgsodium.key" +echo "KEY_FILE: $KEY_FILE" +echo "KEY_FILE contents:" +cat "$KEY_FILE" + +echo "PGSODIUM_GETKEY_SCRIPT: $PGSODIUM_GETKEY_SCRIPT" echo "NOTE: using port $PORTNO for server" -echo "NOTE: using temporary directory $DATDIR for data, which will not be removed" +echo "NOTE: using temporary directory $DATDIR for data" echo "NOTE: you are free to re-use this data directory at will" -initdb -U "$PGSQL_SUPERUSER" -D "$DATDIR" + +# Initialize database +if [ "$VERSION" = "orioledb-17" ]; then + initdb -D "$DATDIR" \ + --allow-group-access \ + --username="$PGSQL_SUPERUSER" \ + --locale-provider=icu \ + --encoding=UTF-8 \ + --icu-locale=en_US.UTF-8 +else + initdb -U "$PGSQL_SUPERUSER" -D "$DATDIR" +fi + +# Copy configuration files echo "NOTE: patching postgresql.conf files" cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf" cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf" cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf" cp -r "$EXTENSION_CUSTOM_SCRIPTS" "$DATDIR" + +# Configure supautils sed "s|supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.privileged_extensions_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" + +# Configure PostgreSQL sed -e "1i\\ include = '$DATDIR/supautils.conf'" \ -e "\$a\\ @@ -62,28 +217,122 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" +# Function to configure OrioleDB specific settings orioledb_config_items() { if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then # Remove items from postgresql.conf + echo "non-macos oriole conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" - #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf" - sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATADIR/postgresql.conf" - echo "default_table_access_method = 'orioledb'" >> "$DATADIR/postgresql.conf" + sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf" + echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" + elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then + # macOS specific configuration + echo "macOS detected, applying macOS specific configuration" + ls -la "$DATDIR" + + # Use perl instead of sed for macOS + perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" + perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf" + + perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ postgis,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ pgrouting,//g' "$DATDIR/supautils.conf" + + perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf" + + echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" + fi +} + +# Apply OrioleDB configuration if needed +orioledb_config_items "$VERSION" +# Configure Groonga +export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins + +# Start postgres +mkdir -p "$DATDIR/tmp" +chmod 1777 "$DATDIR/tmp" +start_postgres "daemon" +# Wait for PostgreSQL to start +for i in {1..60}; do + if pg_isready -h localhost -p "$PORTNO" -q; then + echo "PostgreSQL is ready" + break fi - if [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then - # Remove items from postgresql.conf - sed -i '' 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" - #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present - sed -i '' 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i '' 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf" - sed -i '' 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATADIR/postgresql.conf" - echo "default_table_access_method = 'orioledb'" >> "$DATADIR/postgresql.conf" + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL failed to start" + 'stop_postgres' 1 + fi +done +# Create orioledb extension if needed +if [ "$VERSION" = "orioledb-17" ]; then + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres -c "CREATE EXTENSION IF NOT EXISTS orioledb;" +fi + +# Skip migrations if requested +if [ "$SKIP_MIGRATIONS" = false ]; then + # Create postgres role and set ownership + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres <<-EOSQL + create role postgres superuser login password '$PGPASSWORD'; + alter database postgres owner to postgres; +EOSQL + then + 'stop_postgres' 1 fi -} -orioledb_config_items "$1" -export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins -postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k /tmp + + if [ -n "$MIGRATION_FILE" ]; then + echo "Running user-provided migration file $MIGRATION_FILE" + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -f "$MIGRATION_FILE" postgres; then + 'stop_postgres' 1 + fi + else + # Run default init scripts + for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do + echo "Running $sql" + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -f "$sql" postgres; then + 'stop_postgres' 1 + fi + done + + # Set superuser password + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then + 'stop_postgres' 1 + fi + + # Run additional schema files + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL"; then + 'stop_postgres' 1 + fi + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL"; then + 'stop_postgres' 1 + fi + + # Run migrations as superuser + for sql in "$MIGRATIONS_DIR"/migrations/*.sql; do + echo "Running $sql" + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -f "$sql" postgres; then + 'stop_postgres' 1 + fi + done + + # Run PostgreSQL schema + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -f "$POSTGRESQL_SCHEMA_SQL" postgres; then + 'stop_postgres' 1 + fi + fi +fi +echo "Shutting down PostgreSQL..." +stop_postgres + +# Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon +if [ "$DAEMONIZE" = true ]; then + start_postgres "daemon" +else + start_postgres "foreground" +fi From 608d57981c4e98af896b5a97ae4a8a9eb4409c1c Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 15 Jan 2025 01:06:13 -0500 Subject: [PATCH 084/271] feat: update oriole extension to beta9 (#1407) * feat: update oriole extension to beta9 * chore: testing suffix * chore: rm staging suffix * chore: update pg_regres for changes in oriole sql ext interface * chore: fix test database/dbmate tool to work with new start-server (#1410) --- ansible/vars.yml | 4 +- migrations/schema-orioledb-17.sql | 56 +++++++++-------------- nix/ext/orioledb.nix | 18 +++++--- nix/tests/expected/z_17_ext_interface.out | 7 +-- nix/tools/dbmate-tool.sh.in | 2 +- 5 files changed, 39 insertions(+), 48 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 813a133ba..dba3aff49 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.018-orioledb" - postgres15: "15.8.1.028" + postgresorioledb-17: "17.0.1.019-orioledb" + postgres15: "15.8.1.029" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index f28dc9a2e..531970c37 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -24,6 +24,13 @@ CREATE SCHEMA auth; CREATE SCHEMA extensions; +-- +-- Name: graphql; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql; + + -- -- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: - -- @@ -94,6 +101,20 @@ CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public; COMMENT ON EXTENSION orioledb IS 'OrioleDB -- the next generation transactional engine'; +-- +-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; + + +-- +-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; + + -- -- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - -- @@ -484,39 +505,6 @@ $_$; COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; --- --- Name: graphql(text, text, jsonb, jsonb); Type: FUNCTION; Schema: graphql_public; Owner: - --- - -CREATE FUNCTION graphql_public.graphql("operationName" text DEFAULT NULL::text, query text DEFAULT NULL::text, variables jsonb DEFAULT NULL::jsonb, extensions jsonb DEFAULT NULL::jsonb) RETURNS jsonb - LANGUAGE plpgsql - AS $$ - DECLARE - server_version float; - BEGIN - server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); - - IF server_version >= 14 THEN - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql extension is not enabled.' - ) - ) - ); - ELSE - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' - ) - ) - ); - END IF; - END; -$$; - - -- -- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - -- @@ -625,7 +613,7 @@ CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger SET default_tablespace = ''; -SET default_table_access_method = heap; +SET default_table_access_method = orioledb; -- -- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index ab6b9e39a..856539d56 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -6,19 +6,25 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "beta8"; - sha256 = "sha256-niyTQr1FQYEsKdxl/uVrKSiIR0DCnnT+DDkW47lsc80="; + rev = "beta9"; + sha256 = "sha256-z2EHWsY+hhtnYzAxOl2PWjqfyJ+wp9SCau5LKPT2ec0="; }; - version = "beta8"; + version = "beta9"; buildInputs = [ curl libkrb5 postgresql python3 openssl ]; buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5"; installPhase = '' runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} - cp *${postgresql.dlSuffix} $out/lib - cp *.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + # Copy the extension library + cp orioledb${postgresql.dlSuffix} $out/lib/ + + # Copy sql files from the sql directory + cp sql/*.sql $out/share/postgresql/extension/ + + # Copy control file + cp orioledb.control $out/share/postgresql/extension/ runHook postInstall ''; diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index d611dc0fb..5a0dc32d3 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1090,8 +1090,6 @@ order by orioledb | public | orioledb_index_oids | OUT datoid oid, OUT table_reloid oid, OUT table_relnode oid, OUT index_reloid oid, OUT index_relnode oid, OUT index_type text | SETOF record orioledb | public | orioledb_index_rows | relid oid, OUT total integer, OUT dead integer | record orioledb | public | orioledb_page_stats | OUT pool_name text, OUT busy_pages bigint, OUT free_pages bigint, OUT dirty_pages bigint, OUT all_pages bigint | SETOF record - orioledb | public | orioledb_parallel_debug_start | | void - orioledb | public | orioledb_parallel_debug_stop | | void orioledb | public | orioledb_recovery_synchronized | | boolean orioledb | public | orioledb_relation_size | relid oid | bigint orioledb | public | orioledb_sys_tree_check | num integer, force_map_check boolean | boolean @@ -1108,14 +1106,13 @@ order by orioledb | public | orioledb_tbl_compression_check | level bigint, relid oid, ranges integer[] | text orioledb | public | orioledb_tbl_indices | relid oid | text orioledb | public | orioledb_tbl_structure | relid oid, options character varying, depth integer | text + orioledb | public | orioledb_tree_stat | relid regclass, OUT level integer, OUT count bigint, OUT avgoccupied double precision, OUT avgvacated double precision | SETOF record orioledb | public | orioledb_ucm_check | | boolean orioledb | public | orioledb_version | | text orioledb | public | orioledb_write_pages | relid oid | void orioledb | public | pg_stopevent_reset | eventname text | boolean orioledb | public | pg_stopevent_set | eventname text, condition jsonpath | void orioledb | public | pg_stopevents | OUT stopevent text, OUT condition jsonpath, OUT waiter_pids integer[] | SETOF record - orioledb | public | s3_get | objectname text | text - orioledb | public | s3_put | objectname text, filename text | text pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record pageinspect | public | brin_page_type | page bytea | text pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid @@ -4888,7 +4885,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4729 rows) +(4726 rows) /* diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index b7aa0d26e..b41e83f0b 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -156,7 +156,7 @@ trim_schema() { } overmind_start() { cat > Procfile << EOF -postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" "$PSQL_VERSION" +postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations EOF overmind start -D echo "Waiting for overmind socket..." From d56b1391f8c0e7bf2b79f4ed77442eff8826e523 Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Thu, 16 Jan 2025 11:55:33 +0000 Subject: [PATCH 085/271] fix: salt install in all-in-one image --- docker/all-in-one/Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/all-in-one/Dockerfile b/docker/all-in-one/Dockerfile index d9e5f3fa2..92e033eea 100644 --- a/docker/all-in-one/Dockerfile +++ b/docker/all-in-one/Dockerfile @@ -160,13 +160,16 @@ ENV DEBIAN_FRONTEND noninteractive ENV SALT_VERSION 3006 # Install one-dir salt +RUN cat < /etc/apt/preferences.d/salt-pin-1001 +Package: salt-* +Pin: version ${SALT_VERSION}.* +Pin-Priority: 1001 +EOF + RUN mkdir /etc/apt/keyrings \ - && curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023-arm.gpg https://repo.saltproject.io/salt/py3/ubuntu/20.04/arm64/SALT-PROJECT-GPG-PUBKEY-2023.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023-arm.gpg arch=arm64] https://repo.saltproject.io/salt/py3/ubuntu/20.04/arm64/$SALT_VERSION focal main" | tee /etc/apt/sources.list.d/salt.list \ - && curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023-amd.gpg https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023-amd.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/$SALT_VERSION focal main" | tee -a /etc/apt/sources.list.d/salt.list \ - && apt-get clean && apt-get update \ - && apt-get install -y salt-minion + && curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring.pgp https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public \ + && curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources > /etc/apt/sources.list.d/salt.sources \ + && apt-get clean && apt-get update && apt-get install -y salt-minion ADD docker/all-in-one/etc/salt/minion /etc/salt/minion From f4d144c43f68943206fe0f4bd9b0ebe447b1bdcb Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Thu, 16 Jan 2025 11:56:45 +0000 Subject: [PATCH 086/271] chore: remove legacy ENV syntax --- docker/all-in-one/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/all-in-one/Dockerfile b/docker/all-in-one/Dockerfile index 92e033eea..ec0c51637 100644 --- a/docker/all-in-one/Dockerfile +++ b/docker/all-in-one/Dockerfile @@ -156,8 +156,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ #################### # Install salt #################### -ENV DEBIAN_FRONTEND noninteractive -ENV SALT_VERSION 3006 +ENV DEBIAN_FRONTEND=noninteractive +ENV SALT_VERSION=3006 # Install one-dir salt RUN cat < /etc/apt/preferences.d/salt-pin-1001 From 80161e40b4741e557dae02122211e797db3d2a81 Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Thu, 16 Jan 2025 14:27:44 +0000 Subject: [PATCH 087/271] chore: remove publish_to_fly step for aio image --- .github/workflows/dockerhub-release-aio.yml | 34 --------------------- 1 file changed, 34 deletions(-) diff --git a/.github/workflows/dockerhub-release-aio.yml b/.github/workflows/dockerhub-release-aio.yml index ce0efb597..e6717df9f 100644 --- a/.github/workflows/dockerhub-release-aio.yml +++ b/.github/workflows/dockerhub-release-aio.yml @@ -122,37 +122,3 @@ jobs: with: version: aio-${{ needs.settings.outputs.docker_version }} secrets: inherit - - publish_to_fly: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push to Fly - uses: superfly/flyctl-actions/setup-flyctl@dfdfedc86b296f5e5384f755a18bf400409a15d0 - with: - version: 0.1.64 - - run: | - docker pull ${{ needs.settings.outputs.image_tag }}_amd64 - docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}" - docker tag ${{ needs.settings.outputs.image_tag }}_amd64 "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}" - - flyctl auth docker - docker push "registry.fly.io/staging-${{ needs.settings.outputs.fly_image_tag }}" - docker push "registry.fly.io/prod-${{ needs.settings.outputs.fly_image_tag }}" - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Failed pushing AIO image to Fly.io" - SLACK_FOOTER: "" From 66fb5c1bcd49c918267fd7611189e54d9ff48781 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:04:34 +0800 Subject: [PATCH 088/271] fix: update pgsodium extension scripts (#1397) * fix: pgsodium after-create script * chore: bump version --- .../pgsodium/after-create.sql | 23 +++++++++++++++++++ .../pgsodium/before-create.sql | 9 ++++++++ ansible/vars.yml | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 ansible/files/postgresql_extension_custom_scripts/pgsodium/before-create.sql diff --git a/ansible/files/postgresql_extension_custom_scripts/pgsodium/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgsodium/after-create.sql index 907c67ebf..38242ab20 100644 --- a/ansible/files/postgresql_extension_custom_scripts/pgsodium/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/pgsodium/after-create.sql @@ -1,3 +1,26 @@ grant execute on function pgsodium.crypto_aead_det_decrypt(bytea, bytea, uuid, bytea) to service_role; grant execute on function pgsodium.crypto_aead_det_encrypt(bytea, bytea, uuid, bytea) to service_role; grant execute on function pgsodium.crypto_aead_det_keygen to service_role; + +CREATE OR REPLACE FUNCTION pgsodium.mask_role(masked_role regrole, source_name text, view_name text) +RETURNS void +LANGUAGE plpgsql +SECURITY DEFINER +SET search_path TO '' +AS $function$ +BEGIN + EXECUTE format( + 'GRANT SELECT ON pgsodium.key TO %s', + masked_role); + + EXECUTE format( + 'GRANT pgsodium_keyiduser, pgsodium_keyholder TO %s', + masked_role); + + EXECUTE format( + 'GRANT ALL ON %I TO %s', + view_name, + masked_role); + RETURN; +END +$function$; diff --git a/ansible/files/postgresql_extension_custom_scripts/pgsodium/before-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgsodium/before-create.sql new file mode 100644 index 000000000..fb82a46a3 --- /dev/null +++ b/ansible/files/postgresql_extension_custom_scripts/pgsodium/before-create.sql @@ -0,0 +1,9 @@ +do $$ +declare + _extversion text := @extversion@; + _r record; +begin + if _extversion is not null and _extversion != '3.1.8' then + raise exception 'only pgsodium 3.1.8 is supported'; + end if; +end $$; diff --git a/ansible/vars.yml b/ansible/vars.yml index dba3aff49..2a1cdb357 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.019-orioledb" - postgres15: "15.8.1.029" + postgresorioledb-17: "17.0.1.020-orioledb" + postgres15: "15.8.1.030" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 0dfeaae5c6b2691e64ec5786cbfa35956a8588e6 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 21 Jan 2025 18:02:59 -0500 Subject: [PATCH 089/271] Sam/postgis tiger fix (#1413) * chore: wip attempt to fix search paths for postgis_tiger_geocoder * chore: suffix for staging AMI * chore: newline * chore: fix pg_regress * fix: use postgis_extension_AddToSearchPath for extensions schema * chore: bump staging suffix * chore: resolve quotes to test * chore: bump versions --- ansible/vars.yml | 4 ++-- nix/ext/postgis.nix | 39 ++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 2a1cdb357..3d8d96252 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.020-orioledb" - postgres15: "15.8.1.030" + postgresorioledb-17: "17.0.1.021-orioledb" + postgres15: "15.8.1.031" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index 17b389e5c..2c8a36ce5 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -35,9 +35,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl pkg-config ]; dontDisableStatic = true; - # postgis config directory assumes /include /lib from the same root for json-c library - env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib"; + env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib"; preConfigure = '' sed -i 's@/usr/bin/file@${file}/bin/file@' configure @@ -45,6 +44,7 @@ stdenv.mkDerivation rec { makeFlags="PERL=${perl}/bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin docdir=$doc/share/doc/${pname}" ''; + postConfigure = '' sed -i "s|@mkdir -p \$(DESTDIR)\$(PGSQL_BINDIR)||g ; s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g @@ -54,28 +54,25 @@ stdenv.mkDerivation rec { " \ "raster/scripts/python/Makefile"; mkdir -p $out/bin - - # postgis' build system assumes it is being installed to the same place as postgresql, and looks - # for the postgres binary relative to $PREFIX. We gently support this system using an illusion. ln -s ${postgresql}/bin/postgres $out/bin/postgres ''; - # create aliases for all commands adding version information - postInstall = '' - # Teardown the illusory postgres used for building; see postConfigure. - rm $out/bin/postgres - - for prog in $out/bin/*; do # */ - ln -s $prog $prog-${version} - done - - for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do - sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" - done - - mkdir -p $doc/share/doc/postgis - mv doc/* $doc/share/doc/postgis/ - ''; +postInstall = '' + rm $out/bin/postgres + for prog in $out/bin/*; do # */ + ln -s $prog $prog-${version} + done + # Add function definition and usage to tiger geocoder files + for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do + sed -i "/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');" "$file" + done + # Original topology patching + for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do + sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" + done + mkdir -p $doc/share/doc/postgis + mv doc/* $doc/share/doc/postgis/ +''; passthru.tests.postgis = nixosTests.postgis; From 77cabd3bf37446f3081a5aca325b965e1f1e25b7 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 22 Jan 2025 21:29:38 +0200 Subject: [PATCH 090/271] fix: publish pg_upgrade scripts on vars.yml updates (#1414) --- .github/workflows/publish-nix-pgupgrade-scripts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 907f5e8e8..ac18fa7ab 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -7,6 +7,7 @@ on: - release/* paths: - '.github/workflows/publish-nix-pgupgrade-scripts.yml' + - 'ansible/vars.yml' workflow_dispatch: inputs: postgresVersion: From 9b2ba9a7f0cda43aed6d697e62ab1c811b5961a0 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 23 Jan 2025 00:45:45 +0800 Subject: [PATCH 091/271] feat: add `supautils.drop_trigger_grants` --- ansible/files/postgresql_config/supautils.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 584af6765..1970bc16f 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -1,5 +1,6 @@ supautils.extensions_parameter_overrides = '{"pg_cron":{"schema":"pg_catalog"}}' supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' +supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' # full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 @@ -8,6 +9,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' -supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, pg_stat_statements.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' +supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' From ebe4431bf21c28eb758981c7775b79999f17da1d Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 24 Jan 2025 15:21:01 -0500 Subject: [PATCH 092/271] chore: fixing tool used to run dbmate migration checks (#1419) * chore: fixing tool used to run dbmate migration checks * chore: include oriole version in testdb matrix going forward * chore: fix the nested single quote * fix: try to increase wait time to operation * chore: attempt to wait for orioledb loaded --- .github/workflows/test.yml | 2 +- nix/tools/dbmate-tool.sh.in | 79 +++++++++++++++++++++++++++++-------- 2 files changed, 64 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f343508a9..b6912b38f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Set PostgreSQL versions id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[] | select(. != "orioledb-17")' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c "split(\"\n\")[:-1]") echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: needs: prepare diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index b41e83f0b..8c489839b 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -19,28 +19,31 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ cleanup() { echo "Cleaning up..." - # Kill overmind processes first + # Kill postgres processes first + if pgrep -f "postgres" >/dev/null; then + pkill -TERM postgres || true + sleep 2 + fi + + # Then kill overmind if [ -S "./.overmind.sock" ]; then overmind kill || true sleep 2 fi - # Kill any remaining postgres processes - echo "Killing any remaining postgres processes..." - pkill -9 postgres || true - pkill -9 -f "tmux.*overmind.*postgresql" || true - - # Extra cleanup for tmux sessions + # Kill tmux sessions explicitly + pkill -f "tmux.*overmind.*postgresql" || true tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true + + # Force kill any stragglers + pkill -9 -f "(postgres|tmux.*overmind.*postgresql)" || true - # Remove socket and Procfile rm -f .overmind.sock Procfile - - # Verify cleanup - remaining=$(ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep || true) - if [ ! -z "$remaining" ]; then - echo "Warning: Some processes might still be running:" - echo "$remaining" + + # Final verification + if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep + return 1 fi } @@ -143,6 +146,24 @@ wait_for_postgres() { return 1 } +check_orioledb_ready() { + local max_attempts=30 + local attempt=1 + + while [ $attempt -le $max_attempts ]; do + if "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 -U "$PGSQL_SUPERUSER" -p "$PORTNO" -h localhost -d postgres -c "SELECT * FROM pg_am WHERE amname = 'orioledb'" | grep -q orioledb; then + echo "Orioledb extension is ready!" + return 0 + fi + echo "Waiting for orioledb to be ready (attempt $attempt/$max_attempts)..." + sleep 2 + attempt=$((attempt + 1)) + done + + echo "Orioledb failed to initialize after $max_attempts attempts" + return 1 +} + trim_schema() { case "$CURRENT_SYSTEM" in "x86_64-darwin"|"aarch64-darwin") @@ -165,7 +186,7 @@ EOF while [ $count -lt $max_wait ]; do if [ -S "./.overmind.sock" ]; then # Found the socket, give it a moment to be ready - sleep 2 + sleep 5 echo "Socket file found and ready" break fi @@ -174,6 +195,25 @@ EOF count=$((count + 1)) done } +perform_dump() { + local max_attempts=3 + local attempt=1 + + while [ $attempt -le $max_attempts ]; do + echo "Attempting dbmate dump (attempt $attempt/$max_attempts)" + + if dbmate dump; then + return 0 + fi + + echo "Dump attempt $attempt failed, waiting before retry..." + sleep 5 + attempt=$((attempt + 1)) + done + + echo "All dump attempts failed" + return 1 +} migrate_version() { echo "PSQL_VERSION: $PSQL_VERSION" overmind kill || true @@ -193,6 +233,13 @@ migrate_version() { echo "Failed to connect to PostgreSQL server" exit 1 fi + + if [ "$PSQL_VERSION" = "orioledb-17" ]; then + if ! check_orioledb_ready; then + echo "Failed to initialize orioledb extension" + exit 1 + fi + fi echo "PostgreSQL server is ready" @@ -233,7 +280,7 @@ EOSQL fi echo "Running dbmate dump with $PSQLBIN" - dbmate dump + perform_dump echo "CURRENT_SYSTEM: $CURRENT_SYSTEM" if [ -f "./db/schema.sql" ]; then From 5ccf795ab3f2792ae73d15942a9e18e3da908bd3 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 29 Jan 2025 23:39:18 +0200 Subject: [PATCH 093/271] chore: reduce keepalive time to 30m, interval to 60s (#1421) --- ansible/tasks/setup-system.yml | 14 ++++++++++++++ ansible/vars.yml | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ansible/tasks/setup-system.yml b/ansible/tasks/setup-system.yml index 0783813a4..c1285bf6c 100644 --- a/ansible/tasks/setup-system.yml +++ b/ansible/tasks/setup-system.yml @@ -183,3 +183,17 @@ ansible.posix.sysctl: name: 'net.ipv4.ip_local_port_range' value: '1025 65000' + +#Set Sysctl params specific to keepalives +- name: Set net.ipv4.tcp_keepalive_time=1800 + ansible.builtin.sysctl: + name: net.ipv4.tcp_keepalive_time + value: 1800 + state: present + when: debpkg_mode or nixpkg_mode +- name: Set net.ipv4.tcp_keepalive_intvl=60 + ansible.builtin.sysctl: + name: net.ipv4.tcp_keepalive_intvl + value: 60 + state: present + when: debpkg_mode or nixpkg_mode diff --git a/ansible/vars.yml b/ansible/vars.yml index 3d8d96252..cba563b18 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.021-orioledb" - postgres15: "15.8.1.031" + postgresorioledb-17: "17.0.1.022-orioledb" + postgres15: "15.8.1.032" # Non Postgres Extensions pgbouncer_release: "1.19.0" From aa9245185a4566bba94c522f06634c8f07da3d65 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 30 Jan 2025 11:14:34 -0500 Subject: [PATCH 094/271] fix: custom scripts were not configured to run correctly (#1422) * fix: custom scripts were not configured to run correctly * chore: updated pg_regress to reflect updated config --- nix/tests/expected/z_15_ext_interface.out | 2 +- nix/tests/expected/z_17_ext_interface.out | 2 +- nix/tools/run-server.sh.in | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 648693928..7f53984f3 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1339,7 +1339,7 @@ order by pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint pgmq | pgmq | detach_archive | queue_name text | void - pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean + pgmq | pgmq | drop_queue | queue_name text | boolean pgmq | pgmq | format_table_name | queue_name text, prefix text | text pgmq | pgmq | list_queues | | SETOF pgmq.queue_record pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 5a0dc32d3..7e2dc5fd2 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1360,7 +1360,7 @@ order by pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint pgmq | pgmq | detach_archive | queue_name text | void - pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean + pgmq | pgmq | drop_queue | queue_name text | boolean pgmq | pgmq | format_table_name | queue_name text, prefix text | text pgmq | pgmq | list_queues | | SETOF pgmq.queue_record pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index ef2395aa9..75c5f8de7 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -198,7 +198,8 @@ echo "NOTE: patching postgresql.conf files" cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf" cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf" cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf" -cp -r "$EXTENSION_CUSTOM_SCRIPTS" "$DATDIR" +mkdir -p "$DATDIR/extension-custom-scripts" +cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts" # Configure supautils sed "s|supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.privileged_extensions_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" From a0539d697bc81a24baf72e992714055ab3f8f9f3 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 30 Jan 2025 09:18:10 -0800 Subject: [PATCH 095/271] fix: bump gotrue version to v2.169.0 (#1423) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index cba563b18..7655a6833 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.022-orioledb" - postgres15: "15.8.1.032" + postgresorioledb-17: "17.0.1.029-orioledb" + postgres15: "15.8.1.033" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -22,8 +22,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.168.0 -gotrue_release_checksum: sha1:c303e004f59a58f7cbefda6fa669fc77deabe8e6 +gotrue_release: 2.169.0 +gotrue_release_checksum: sha1:1419b94683aac7ddc30355408b8e8b79e61146c4 aws_cli_release: "2.2.7" From e2bef24ace5f4ce9bd6405e790e47e7b96e5b5b5 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Sat, 1 Feb 2025 08:28:03 +0530 Subject: [PATCH 096/271] chore: bump adminmgr to 0.24.1 (#1424) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 7655a6833..7442b7b4a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.029-orioledb" - postgres15: "15.8.1.033" + postgresorioledb-17: "17.0.1.030-orioledb" + postgres15: "15.8.1.034" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -56,7 +56,7 @@ postgres_exporter_release_checksum: amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 adminapi_release: 0.71.1 -adminmgr_release: 0.24.0 +adminmgr_release: 0.24.1 # Postgres Extensions postgis_release: "3.3.2" From cc6d91ff8335adbd0964ab8eb5fb1826dfc7875b Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Mon, 3 Feb 2025 10:46:25 +0000 Subject: [PATCH 097/271] chore: bump supabase-admin-api version to 0.74.0 (#1425) --- ansible/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 7442b7b4a..617fa93a9 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -55,7 +55,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.71.1 +adminapi_release: 0.74.0 adminmgr_release: 0.24.1 # Postgres Extensions From 12d6584085648423e67b05f62507f5268567f650 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 3 Feb 2025 15:06:15 -0500 Subject: [PATCH 098/271] chore: remove unused/deprecated code --- .github/workflows/build-ccache.yml | 86 -- .github/workflows/dockerhub-release-15-8.yml | 104 -- .github/workflows/dockerhub-release-aio.yml | 124 -- .../workflows/dockerhub-release-orioledb.yml | 86 -- .github/workflows/dockerhub-release.yml | 102 -- .github/workflows/package-plv8.yml | 78 -- .github/workflows/test-pg-upgrade.yml | 133 --- Dockerfile | 998 ---------------- Dockerfile-158 | 221 ---- amazon-arm64.pkr.hcl | 278 ----- .../tasks/postgres-extensions/01-postgis.yml | 102 -- .../postgres-extensions/02-pgrouting.yml | 52 - .../tasks/postgres-extensions/03-pgtap.yml | 25 - .../tasks/postgres-extensions/04-pg_cron.yml | 30 - .../tasks/postgres-extensions/05-pgaudit.yml | 43 - .../tasks/postgres-extensions/06-pgjwt.yml | 17 - .../postgres-extensions/07-pgsql-http.yml | 43 - .../postgres-extensions/08-plpgsql_check.yml | 38 - .../postgres-extensions/09-pg-safeupdate.yml | 30 - .../postgres-extensions/10-timescaledb.yml | 36 - .../tasks/postgres-extensions/11-wal2json.yml | 17 - .../tasks/postgres-extensions/12-pljava.yml | 84 -- ansible/tasks/postgres-extensions/13-plv8.yml | 73 -- .../postgres-extensions/14-pg_plan_filter.yml | 23 - .../tasks/postgres-extensions/15-pg_net.yml | 37 - ansible/tasks/postgres-extensions/16-rum.yml | 34 - .../postgres-extensions/17-pg_hashids.yml | 22 - .../tasks/postgres-extensions/18-pgsodium.yml | 80 -- .../postgres-extensions/19-pg_graphql.yml | 3 - .../20-pg_stat_monitor.yml | 23 - .../postgres-extensions/22-pg_jsonschema.yml | 3 - .../tasks/postgres-extensions/23-vault.yml | 31 - .../tasks/postgres-extensions/24-pgroonga.yml | 85 -- .../tasks/postgres-extensions/25-wrappers.yml | 3 - .../tasks/postgres-extensions/26-hypopg.yml | 17 - .../postgres-extensions/27-pg_repack.yml | 38 - .../tasks/postgres-extensions/28-pgvector.yml | 23 - .../tasks/postgres-extensions/29-pg_tle.yml | 12 - .../99-finish_async_tasks.yml | 19 - ansible/vars.yml | 98 -- common.vars.pkr.hcl | 1 - digitalOcean.json | 45 - docker/all-in-one/Dockerfile | 317 ----- docker/all-in-one/README.md | 59 - docker/all-in-one/configure-shim.sh | 16 - docker/all-in-one/entrypoint.sh | 366 ------ docker/all-in-one/etc/adminapi/adminapi.yaml | 83 -- .../etc/fail2ban/filter.d/pgbouncer.conf | 2 - .../etc/fail2ban/filter.d/postgresql.conf | 8 - .../all-in-one/etc/fail2ban/jail.d/jail.local | 4 - .../etc/fail2ban/jail.d/pgbouncer.conf | 7 - .../etc/fail2ban/jail.d/postgresql.conf | 8 - .../all-in-one/etc/fail2ban/jail.d/sshd.local | 3 - docker/all-in-one/etc/gotrue.env | 9 - docker/all-in-one/etc/kong/kong.conf | 37 - docker/all-in-one/etc/kong/kong.yml | 94 -- .../etc/logrotate.d/postgresql.conf | 11 - docker/all-in-one/etc/logrotate.d/walg.conf | 9 - .../etc/pgbouncer-custom/custom-overrides.ini | 0 .../generated-optimizations.ini | 0 .../etc/pgbouncer-custom/ssl-config.ini | 4 - docker/all-in-one/etc/pgbouncer/pgbouncer.ini | 363 ------ docker/all-in-one/etc/pgbouncer/userlist.txt | 0 .../postgresql-custom/custom-overrides.conf | 0 .../generated-optimizations.conf | 0 .../postgresql-platform-defaults.conf | 7 - docker/all-in-one/etc/postgresql.schema.sql | 16 - docker/all-in-one/etc/postgresql/logging.conf | 33 - docker/all-in-one/etc/postgresql/pg_hba.conf | 94 -- docker/all-in-one/etc/postgrest/base.conf | 7 - docker/all-in-one/etc/postgrest/bootstrap.sh | 8 - .../all-in-one/etc/postgrest/generated.conf | 0 docker/all-in-one/etc/salt/minion | 71 -- docker/all-in-one/etc/sudoers.d/adminapi | 27 - .../etc/supa-shutdown/shutdown.conf | 1 - .../supervisor/base-services/adminapi.conf | 10 - .../supervisor/base-services/logrotate.conf | 11 - .../base-services/lsn-checkpoint-push.conf | 10 - .../base-services/pg_egress_collect.conf | 10 - .../supervisor/base-services/postgresql.conf | 13 - .../base-services/supa-shutdown.conf | 11 - .../etc/supervisor/services/envoy.conf | 10 - .../etc/supervisor/services/exporter.conf | 11 - .../etc/supervisor/services/fail2ban.conf | 9 - .../etc/supervisor/services/gotrue.conf | 10 - .../etc/supervisor/services/group.conf | 3 - .../etc/supervisor/services/kong.conf | 11 - .../etc/supervisor/services/pgbouncer.conf | 10 - .../etc/supervisor/services/postgrest.conf | 10 - .../etc/supervisor/supervisord.conf | 170 --- .../all-in-one/etc/tmpfiles.d/pgbouncer.conf | 2 - docker/all-in-one/etc/vector/vector.yaml | 306 ----- docker/all-in-one/healthcheck.sh | 46 - docker/all-in-one/init/configure-admin-mgr.sh | 8 - docker/all-in-one/init/configure-adminapi.sh | 56 - .../all-in-one/init/configure-autoshutdown.sh | 21 - docker/all-in-one/init/configure-envoy.sh | 53 - docker/all-in-one/init/configure-exporter.sh | 5 - docker/all-in-one/init/configure-fail2ban.sh | 6 - docker/all-in-one/init/configure-gotrue.sh | 40 - docker/all-in-one/init/configure-kong.sh | 48 - .../init/configure-pg_egress_collect.sh | 14 - docker/all-in-one/init/configure-pgbouncer.sh | 46 - docker/all-in-one/init/configure-postgrest.sh | 41 - docker/all-in-one/init/configure-vector.sh | 56 - docker/all-in-one/init/start-kong.sh | 7 - .../pg_egress_collect/pg_egress_collect.pl | 126 -- .../opt/postgres_exporter/queries.yml | 345 ------ docker/all-in-one/postgres-entrypoint.sh | 358 ------ docker/all-in-one/run-logrotate.sh | 8 - docker/all-in-one/shutdown.sh | 96 -- docker/cache/.gitkeep | 0 docker/orioledb/Dockerfile | 1059 ---------------- docker/orioledb/entrypoint.sh | 36 - ebssurrogate/scripts/chroot-bootstrap.sh | 204 ---- ebssurrogate/scripts/surrogate-bootstrap.sh | 324 ----- migrations/schema-16.sql | 1064 ----------------- testinfra/test_all_in_one.py | 135 --- testinfra/test_ami.py | 443 ------- 119 files changed, 10323 deletions(-) delete mode 100644 .github/workflows/build-ccache.yml delete mode 100644 .github/workflows/dockerhub-release-15-8.yml delete mode 100644 .github/workflows/dockerhub-release-aio.yml delete mode 100644 .github/workflows/dockerhub-release-orioledb.yml delete mode 100644 .github/workflows/dockerhub-release.yml delete mode 100644 .github/workflows/package-plv8.yml delete mode 100644 .github/workflows/test-pg-upgrade.yml delete mode 100644 Dockerfile delete mode 100644 Dockerfile-158 delete mode 100644 amazon-arm64.pkr.hcl delete mode 100644 ansible/tasks/postgres-extensions/01-postgis.yml delete mode 100644 ansible/tasks/postgres-extensions/02-pgrouting.yml delete mode 100644 ansible/tasks/postgres-extensions/03-pgtap.yml delete mode 100644 ansible/tasks/postgres-extensions/04-pg_cron.yml delete mode 100644 ansible/tasks/postgres-extensions/05-pgaudit.yml delete mode 100644 ansible/tasks/postgres-extensions/06-pgjwt.yml delete mode 100644 ansible/tasks/postgres-extensions/07-pgsql-http.yml delete mode 100644 ansible/tasks/postgres-extensions/08-plpgsql_check.yml delete mode 100644 ansible/tasks/postgres-extensions/09-pg-safeupdate.yml delete mode 100644 ansible/tasks/postgres-extensions/10-timescaledb.yml delete mode 100644 ansible/tasks/postgres-extensions/11-wal2json.yml delete mode 100644 ansible/tasks/postgres-extensions/12-pljava.yml delete mode 100644 ansible/tasks/postgres-extensions/13-plv8.yml delete mode 100644 ansible/tasks/postgres-extensions/14-pg_plan_filter.yml delete mode 100644 ansible/tasks/postgres-extensions/15-pg_net.yml delete mode 100644 ansible/tasks/postgres-extensions/16-rum.yml delete mode 100644 ansible/tasks/postgres-extensions/17-pg_hashids.yml delete mode 100644 ansible/tasks/postgres-extensions/18-pgsodium.yml delete mode 100644 ansible/tasks/postgres-extensions/19-pg_graphql.yml delete mode 100644 ansible/tasks/postgres-extensions/20-pg_stat_monitor.yml delete mode 100644 ansible/tasks/postgres-extensions/22-pg_jsonschema.yml delete mode 100644 ansible/tasks/postgres-extensions/23-vault.yml delete mode 100644 ansible/tasks/postgres-extensions/24-pgroonga.yml delete mode 100644 ansible/tasks/postgres-extensions/25-wrappers.yml delete mode 100644 ansible/tasks/postgres-extensions/26-hypopg.yml delete mode 100644 ansible/tasks/postgres-extensions/27-pg_repack.yml delete mode 100644 ansible/tasks/postgres-extensions/28-pgvector.yml delete mode 100644 ansible/tasks/postgres-extensions/29-pg_tle.yml delete mode 100644 ansible/tasks/postgres-extensions/99-finish_async_tasks.yml delete mode 100644 common.vars.pkr.hcl delete mode 100644 digitalOcean.json delete mode 100644 docker/all-in-one/Dockerfile delete mode 100644 docker/all-in-one/README.md delete mode 100755 docker/all-in-one/configure-shim.sh delete mode 100755 docker/all-in-one/entrypoint.sh delete mode 100644 docker/all-in-one/etc/adminapi/adminapi.yaml delete mode 100644 docker/all-in-one/etc/fail2ban/filter.d/pgbouncer.conf delete mode 100644 docker/all-in-one/etc/fail2ban/filter.d/postgresql.conf delete mode 100644 docker/all-in-one/etc/fail2ban/jail.d/jail.local delete mode 100644 docker/all-in-one/etc/fail2ban/jail.d/pgbouncer.conf delete mode 100644 docker/all-in-one/etc/fail2ban/jail.d/postgresql.conf delete mode 100644 docker/all-in-one/etc/fail2ban/jail.d/sshd.local delete mode 100644 docker/all-in-one/etc/gotrue.env delete mode 100644 docker/all-in-one/etc/kong/kong.conf delete mode 100644 docker/all-in-one/etc/kong/kong.yml delete mode 100644 docker/all-in-one/etc/logrotate.d/postgresql.conf delete mode 100644 docker/all-in-one/etc/logrotate.d/walg.conf delete mode 100644 docker/all-in-one/etc/pgbouncer-custom/custom-overrides.ini delete mode 100644 docker/all-in-one/etc/pgbouncer-custom/generated-optimizations.ini delete mode 100644 docker/all-in-one/etc/pgbouncer-custom/ssl-config.ini delete mode 100644 docker/all-in-one/etc/pgbouncer/pgbouncer.ini delete mode 100644 docker/all-in-one/etc/pgbouncer/userlist.txt delete mode 100644 docker/all-in-one/etc/postgresql-custom/custom-overrides.conf delete mode 100644 docker/all-in-one/etc/postgresql-custom/generated-optimizations.conf delete mode 100644 docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf delete mode 100644 docker/all-in-one/etc/postgresql.schema.sql delete mode 100644 docker/all-in-one/etc/postgresql/logging.conf delete mode 100755 docker/all-in-one/etc/postgresql/pg_hba.conf delete mode 100644 docker/all-in-one/etc/postgrest/base.conf delete mode 100755 docker/all-in-one/etc/postgrest/bootstrap.sh delete mode 100644 docker/all-in-one/etc/postgrest/generated.conf delete mode 100644 docker/all-in-one/etc/salt/minion delete mode 100644 docker/all-in-one/etc/sudoers.d/adminapi delete mode 100644 docker/all-in-one/etc/supa-shutdown/shutdown.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/adminapi.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/logrotate.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/lsn-checkpoint-push.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/pg_egress_collect.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/postgresql.conf delete mode 100644 docker/all-in-one/etc/supervisor/base-services/supa-shutdown.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/envoy.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/exporter.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/fail2ban.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/gotrue.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/group.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/kong.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/pgbouncer.conf delete mode 100644 docker/all-in-one/etc/supervisor/services/postgrest.conf delete mode 100644 docker/all-in-one/etc/supervisor/supervisord.conf delete mode 100644 docker/all-in-one/etc/tmpfiles.d/pgbouncer.conf delete mode 100644 docker/all-in-one/etc/vector/vector.yaml delete mode 100755 docker/all-in-one/healthcheck.sh delete mode 100755 docker/all-in-one/init/configure-admin-mgr.sh delete mode 100755 docker/all-in-one/init/configure-adminapi.sh delete mode 100755 docker/all-in-one/init/configure-autoshutdown.sh delete mode 100755 docker/all-in-one/init/configure-envoy.sh delete mode 100755 docker/all-in-one/init/configure-exporter.sh delete mode 100755 docker/all-in-one/init/configure-fail2ban.sh delete mode 100755 docker/all-in-one/init/configure-gotrue.sh delete mode 100755 docker/all-in-one/init/configure-kong.sh delete mode 100755 docker/all-in-one/init/configure-pg_egress_collect.sh delete mode 100755 docker/all-in-one/init/configure-pgbouncer.sh delete mode 100755 docker/all-in-one/init/configure-postgrest.sh delete mode 100755 docker/all-in-one/init/configure-vector.sh delete mode 100755 docker/all-in-one/init/start-kong.sh delete mode 100644 docker/all-in-one/opt/pg_egress_collect/pg_egress_collect.pl delete mode 100644 docker/all-in-one/opt/postgres_exporter/queries.yml delete mode 100755 docker/all-in-one/postgres-entrypoint.sh delete mode 100755 docker/all-in-one/run-logrotate.sh delete mode 100755 docker/all-in-one/shutdown.sh delete mode 100644 docker/cache/.gitkeep delete mode 100644 docker/orioledb/Dockerfile delete mode 100755 docker/orioledb/entrypoint.sh delete mode 100755 ebssurrogate/scripts/chroot-bootstrap.sh delete mode 100755 ebssurrogate/scripts/surrogate-bootstrap.sh delete mode 100644 migrations/schema-16.sql delete mode 100644 testinfra/test_all_in_one.py delete mode 100644 testinfra/test_ami.py diff --git a/.github/workflows/build-ccache.yml b/.github/workflows/build-ccache.yml deleted file mode 100644 index f296dd62f..000000000 --- a/.github/workflows/build-ccache.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Update ccache - -on: - push: - branches: - - develop - paths: - - ".github/workflows/build-ccache.yml" - - "ansible/vars.yml" - - "Dockerfile" - workflow_dispatch: - -env: - image_tag: public.ecr.aws/supabase/postgres:ccache -permissions: - contents: read - packages: write - id-token: write - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' - - build_image: - needs: settings - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - name: Configure AWS credentials - prod - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.PROD_AWS_ROLE }} - aws-region: "us-east-1" - - uses: docker/login-action@v2 - with: - registry: public.ecr.aws - - id: build - uses: docker/build-push-action@v5 - with: - push: true - target: buildcache - build-args: | - CACHE_EPOCH=${{ github.event.repository.updated_at }} - ${{ needs.settings.outputs.build_args }} - tags: ${{ env.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - - merge_manifest: - needs: build_image - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - name: Configure AWS credentials - prod - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.PROD_AWS_ROLE }} - aws-region: "us-east-1" - - uses: docker/login-action@v2 - with: - registry: public.ecr.aws - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ env.image_tag }} \ - ${{ env.image_tag }}_amd64 \ - ${{ env.image_tag }}_arm64 diff --git a/.github/workflows/dockerhub-release-15-8.yml b/.github/workflows/dockerhub-release-15-8.yml deleted file mode 100644 index 11ffd2e48..000000000 --- a/.github/workflows/dockerhub-release-15-8.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Release 15.6 on Dockerhub - -on: - push: - branches: - - develop - - release/* - paths: - - ".github/workflows/dockerhub-release-15-6.yml" - - "common-nix.vars*" - workflow_dispatch: - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - docker_version: ${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/postgres:${{ steps.settings.outputs.postgres-version }} - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' common-nix.vars.pkr.hcl >> $GITHUB_OUTPUT - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' - - build_release_image: - needs: [settings] - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v5 - with: - push: true - build-args: | - ${{ needs.settings.outputs.build_args }} - target: production - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - file: "Dockerfile-158" - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres ${{ matrix.arch }} image failed" - SLACK_FOOTER: "" - - merge_manifest: - needs: [settings, build_release_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres image failed" - SLACK_FOOTER: "" - - publish: - needs: [settings, merge_manifest] - # Call workflow explicitly because events from actions cannot trigger more actions - uses: ./.github/workflows/mirror.yml - with: - version: ${{ needs.settings.outputs.docker_version }} - secrets: inherit diff --git a/.github/workflows/dockerhub-release-aio.yml b/.github/workflows/dockerhub-release-aio.yml deleted file mode 100644 index e6717df9f..000000000 --- a/.github/workflows/dockerhub-release-aio.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: Release AIO image - -on: - push: - branches: - - develop - paths: - - ".github/workflows/dockerhub-release-aio.yml" - - "docker/all-in-one/*" - workflow_run: - workflows: [Release on Dockerhub] - branches: - - develop - types: - - completed - workflow_dispatch: - inputs: - baseDockerVersion: - description: 'Base Docker Version. E.g., 15.1.1.27' - required: false - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - base_docker_version: ${{ steps.base_docker.outputs.base-docker-version }} - docker_version: ${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/postgres:aio-${{ steps.settings.outputs.postgres-version }} - fly_image_tag: supabase-postgres-image:aio-${{ steps.settings.outputs.postgres-version }} - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' common.vars.pkr.hcl >> $GITHUB_OUTPUT - - id: base_docker - run: | - if [[ "${{ inputs.baseDockerVersion }}" != "" ]]; then - echo "base-docker-version=${{ inputs.baseDockerVersion }}" >> $GITHUB_OUTPUT - else - echo "base-docker-version=${{ steps.settings.outputs.postgres-version }}" >> $GITHUB_OUTPUT - fi - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' - - build_image: - needs: settings - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v5 - with: - file: docker/all-in-one/Dockerfile - push: true - build-args: | - postgres_version=${{ needs.settings.outputs.base_docker_version }} - envoy_lds=lds.supabase.yaml - ${{ needs.settings.outputs.build_args }} - target: production - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-aio-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-aio-${{ matrix.arch }} - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres AIO ${{ matrix.arch }} image failed" - SLACK_FOOTER: "" - - merge_manifest: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres image failed" - SLACK_FOOTER: "" - - publish: - needs: [settings, merge_manifest] - # Call workflow explicitly because events from actions cannot trigger more actions - uses: ./.github/workflows/mirror.yml - with: - version: aio-${{ needs.settings.outputs.docker_version }} - secrets: inherit diff --git a/.github/workflows/dockerhub-release-orioledb.yml b/.github/workflows/dockerhub-release-orioledb.yml deleted file mode 100644 index 2c2f05186..000000000 --- a/.github/workflows/dockerhub-release-orioledb.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Release OrioleDB on Dockerhub - -on: - push: - branches: - - develop - paths: - - ".github/workflows/dockerhub-release-orioledb.yml" - - "docker/orioledb/*" - - "common.vars*" - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - docker_version: orioledb-${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/postgres:orioledb-${{ steps.settings.outputs.postgres-version }} - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' common.vars.pkr.hcl >> $GITHUB_OUTPUT - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' - - build_image: - needs: settings - strategy: - fail-fast: false - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v5 - with: - file: docker/orioledb/Dockerfile - push: true - build-args: | - ${{ needs.settings.outputs.build_args }} - target: production - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-orioledb-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-orioledb-${{ matrix.arch }} - - merge_manifest: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 - - publish: - needs: [settings, merge_manifest] - # Call workflow explicitly because events from actions cannot trigger more actions - uses: ./.github/workflows/mirror.yml - with: - version: ${{ needs.settings.outputs.docker_version }} - secrets: inherit diff --git a/.github/workflows/dockerhub-release.yml b/.github/workflows/dockerhub-release.yml deleted file mode 100644 index 7f4be5552..000000000 --- a/.github/workflows/dockerhub-release.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Release on Dockerhub - -on: - push: - branches: - - develop - paths: - - ".github/workflows/dockerhub-release.yml" - - "common.vars*" - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - docker_version: ${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/postgres:${{ steps.settings.outputs.postgres-version }} - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' common.vars.pkr.hcl >> $GITHUB_OUTPUT - - id: args - uses: mikefarah/yq@master - with: - cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' - - - build_image: - needs: settings - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v5 - with: - push: true - build-args: | - ${{ needs.settings.outputs.build_args }} - target: production - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres ${{ matrix.arch }} image failed" - SLACK_FOOTER: "" - - merge_manifest: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres image failed" - SLACK_FOOTER: "" - - publish: - needs: [settings, merge_manifest] - # Call workflow explicitly because events from actions cannot trigger more actions - uses: ./.github/workflows/mirror.yml - with: - version: ${{ needs.settings.outputs.docker_version }} - secrets: inherit diff --git a/.github/workflows/package-plv8.yml b/.github/workflows/package-plv8.yml deleted file mode 100644 index 09b2c4efd..000000000 --- a/.github/workflows/package-plv8.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Package plv8 - -on: - push: - branches: - - develop - paths: - - ".github/workflows/package-plv8.yml" - - "Dockerfile" - workflow_dispatch: - -env: - image: ghcr.io/supabase/plv8 -permissions: - contents: read - packages: write - id-token: write - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - image_tag: ${{ env.image }}:${{ steps.meta.outputs.image_tag }} - steps: - - uses: actions/checkout@v3 - - id: meta - run: | - plv8_release=$(grep -o 'plv8_release=.*' Dockerfile | head -1 | cut -d "=" -f 2) - postgresql_major=$(grep -o 'postgresql_major=.*' Dockerfile | head -1 | cut -d "=" -f 2) - echo "image_tag=${plv8_release}-pg${postgresql_major}" >> $GITHUB_OUTPUT - - build_image: - needs: settings - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - id: build - uses: docker/build-push-action@v5 - with: - push: true - target: plv8-deb - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - no-cache: true - - merge_manifest: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 diff --git a/.github/workflows/test-pg-upgrade.yml b/.github/workflows/test-pg-upgrade.yml deleted file mode 100644 index b90791bc6..000000000 --- a/.github/workflows/test-pg-upgrade.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: Test pg_upgrade - -on: - push: - branches: - - develop - - pcnc/pg_upgrade-test-extensions - workflow_dispatch: - -permissions: - id-token: write - -jobs: - test: - strategy: - matrix: - base_pg_version: - - 15.1.1.60 - - 15.1.1.70 - runs-on: arm-runner - timeout-minutes: 30 - defaults: - run: - working-directory: ./tests/pg_upgrade - env: - PGPORT: 5478 - PGPASSWORD: postgres - PGDATABASE: postgres - PGUSER: supabase_admin - PGHOST: localhost - PG_MAJOR_VERSION: 15 - IS_CI: true - container: pg_upgrade_test - steps: - - uses: actions/checkout@v3 - - - name: Grab release version - id: process_release_version - working-directory: ./ - run: | - VERSION=$(sed -e 's/postgres-version = "\(.*\)"/\1/g' common.vars.pkr.hcl) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - - name: configure aws credentials - staging - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.DEV_AWS_ROLE }} - aws-region: "us-east-1" - - - name: Download pg_upgrade_scripts and binaries - run: | - aws s3 cp s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz scripts/pg_upgrade_scripts.tar.gz - aws s3 cp s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz scripts/pg_upgrade_bin.tar.gz - - - run: docker context create builders - - uses: docker/setup-buildx-action@v2 - with: - endpoint: builders - driver-opts: image=moby/buildkit:v0.11.6 - buildkitd-flags: --debug - - - name: Start Postgres - run: | - docker rm -f "$container" || true - docker run --name "$container" --env-file .env \ - -v "$(pwd)/scripts:/tmp/upgrade" \ - --entrypoint "/tmp/upgrade/entrypoint.sh" -d \ - -p ${PGPORT}:5432 \ - "supabase/postgres:${{ matrix.base_pg_version }}" - - - name: Install psql - run: | - sudo apt update - sudo apt install -y --no-install-recommends postgresql-client - - - name: Install pg_prove - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends perl cpanminus - sudo cpanm -n App::cpanminus - sudo cpanm -n TAP::Parser::SourceHandler::pgTAP - env: - SHELL: /bin/bash - PERL_MM_USE_DEFAULT: 1 - PERL_MM_NONINTERACTIVE: 1 - - - name: Wait for healthy database - run: | - count=0 - while ! docker exec "$container" bash -c "pg_isready"; do - count=$((count + 1)) - if [ $count -ge "$retries" ]; then - echo "Retry $count/$retries exited $exit, no more retries left." - docker logs "$container" - docker rm -f "$container" - exit 1 - fi - done - env: - retries: 20 - - - name: Run migrations - run: | - docker cp ../../migrations/db/migrations "$container:/docker-entrypoint-initdb.d/" - docker exec "$container" bash -c "/docker-entrypoint-initdb.d/migrate.sh > /tmp/migrate.log 2>&1" - - - name: Run initial tests - run: pg_prove "../../migrations/tests/test.sql" - env: - PERL5LIB: /usr/local/lib/perl5 - - - name: Apply pre-upgrade fixtures - run: | - psql -f "./tests/97-enable-extensions.sql" - psql -f "./tests/98-data-fixtures.sql" - psql -f "./tests/99-fixtures.sql" - - - name: Initiate upgrade - run: docker exec "$container" bash -c '/tmp/upgrade/pg_upgrade_scripts/initiate.sh "$PG_MAJOR_VERSION"; exit $?' - - - name: Complete pg_upgrade - run: docker exec pg_upgrade_test bash -c '/tmp/upgrade/pg_upgrade_scripts/complete.sh; exit $?' - - - name: Run post-upgrade tests - run: | - pg_prove tests/01-schema.sql - pg_prove tests/02-data.sql - pg_prove tests/03-settings.sql - - - name: Clean up container - if: ${{ always() }} - continue-on-error: true - run: docker rm -f "$container" || true diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8309c2585..000000000 --- a/Dockerfile +++ /dev/null @@ -1,998 +0,0 @@ -# syntax=docker/dockerfile:1.6 -ARG postgresql_major=15 -ARG postgresql_release=${postgresql_major}.1 - -# Bump default build arg to build a package from source -# Bump vars.yml to specify runtime package version -ARG sfcgal_release=1.3.10 -ARG postgis_release=3.3.2 -ARG pgrouting_release=3.4.1 -ARG pgtap_release=1.2.0 -ARG pg_cron_release=1.6.2 -ARG pgaudit_release=1.7.0 -ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 -ARG pgsql_http_release=1.5.0 -ARG plpgsql_check_release=2.2.5 -ARG pg_safeupdate_release=1.4 -ARG timescaledb_release=2.9.1 -ARG wal2json_release=2_5 -ARG pljava_release=1.6.4 -ARG plv8_release=3.1.5 -ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 -ARG pg_net_release=0.9.2 -ARG rum_release=1.3.13 -ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 -ARG libsodium_release=1.0.18 -ARG pgsodium_release=3.1.6 -ARG pg_graphql_release=1.5.1 -ARG pg_stat_monitor_release=1.1.1 -ARG pg_jsonschema_release=0.1.4 -ARG pg_repack_release=1.4.8 -ARG vault_release=0.2.8 -ARG groonga_release=12.0.8 -ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.1 -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.5.0 -ARG wal_g_release=2.0.1 - -#################### -# Setup Postgres PPA -#################### -FROM ubuntu:focal as ppa -# Redeclare args for use in subsequent stages -ARG postgresql_major -RUN apt-get update && apt-get install -y --no-install-recommends \ - gnupg \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* -# Add Postgres PPA -# In the off-chance that the key in the repository expires, it can be replaced by running the following in the repository's root: -# gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys $NEW_POSTGRESQL_GPG_KEY -# gpg --export --armor $NEW_POSTGRESQL_GPG_KEY > postgresql.gpg.key -COPY postgresql.gpg.key /tmp/postgresql.gpg.key -RUN apt-key add /tmp/postgresql.gpg.key && \ - echo "deb https://apt-archive.postgresql.org/pub/repos/apt focal-pgdg-archive main" > /etc/apt/sources.list.d/pgdg.list - -#################### -# Download pre-built postgres -#################### -FROM ppa as pg -ARG postgresql_release -# Download .deb packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - postgresql-${postgresql_major}=${postgresql_release}-1.pgdg20.04+1 \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -FROM ppa as pg-dev -ARG postgresql_release -# Download .deb packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - postgresql-server-dev-${postgresql_major}=${postgresql_release}-1.pgdg20.04+1 \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# Install postgres -#################### -FROM ubuntu:focal as base -# Redeclare args for use in subsequent stages -ARG TARGETARCH -ARG postgresql_major - -# Install postgres -COPY --from=pg /tmp /tmp -# Ref: https://github.com/docker-library/postgres/blob/master/15/bullseye/Dockerfile#L91 -ENV DEBIAN_FRONTEND=noninteractive -RUN set -ex; \ - export PYTHONDONTWRITEBYTECODE=1; \ - apt-get update; \ - apt-get install -y --no-install-recommends /tmp/postgresql-common_*.deb /tmp/postgresql-client-common_*.deb; \ - sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ - apt-get install -y --no-install-recommends /tmp/*.deb; \ - rm -rf /var/lib/apt/lists/* /tmp/*; \ - find /usr -name '*.pyc' -type f -exec bash -c 'for pyc; do dpkg -S "$pyc" &> /dev/null || rm -vf "$pyc"; done' -- '{}' + - -ENV PATH=$PATH:/usr/lib/postgresql/${postgresql_major}/bin -ENV PGDATA=/var/lib/postgresql/data - -# Make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default -RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C.UTF-8 - -FROM base as builder -# Install build dependencies -COPY --from=pg-dev /tmp /tmp -RUN apt-get update && \ - rm -f /tmp/libssl-dev* && \ - apt-get install -y --no-install-recommends \ - /tmp/*.deb \ - build-essential \ - checkinstall \ - cmake \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -FROM builder as ccache -# Cache large build artifacts -RUN apt-get update && apt-get install -y --no-install-recommends \ - clang \ - ccache \ - && rm -rf /var/lib/apt/lists/* -ENV CCACHE_DIR=/ccache -ENV PATH=/usr/lib/ccache:$PATH -# Used to update ccache -ARG CACHE_EPOCH - -#################### -# 01-postgis.yml -#################### -FROM ccache as sfcgal -# Download and extract -ARG sfcgal_release -ARG sfcgal_release_checksum -ADD --checksum=${sfcgal_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/sfcgal/SFCGAL-v${sfcgal_release}.tar.gz" \ - /tmp/sfcgal.tar.gz -RUN tar -xvf /tmp/sfcgal.tar.gz -C /tmp --one-top-level --strip-components 1 && \ - rm -rf /tmp/sfcgal.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcgal-dev \ - libboost-serialization1.71-dev \ - libmpfr-dev \ - libgmp-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/sfcgal/build -RUN cmake .. -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=yes --fstrans=no --backup=no --pakdir=/tmp --pkgname=sfcgal --pkgversion=${sfcgal_release} --requires=libgmpxx4ldbl,libboost-serialization1.71.0,libmpfr6 --nodoc - -FROM sfcgal as postgis-source -# Download and extract -ARG postgis_release -ARG postgis_release_checksum -ADD --checksum=${postgis_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/postgis-${postgis_release}.tar.gz" \ - /tmp/postgis.tar.gz -RUN tar -xvf /tmp/postgis.tar.gz -C /tmp && \ - rm -rf /tmp/postgis.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - protobuf-c-compiler \ - libgeos-dev \ - libproj-dev \ - libgdal-dev \ - libjson-c-dev \ - libxml2-dev \ - libprotobuf-c-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/postgis-${postgis_release} -RUN ./configure --with-sfcgal -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libgeos-c1v5,libproj15,libjson-c4,libprotobuf-c1,libgdal26 --nodoc - -FROM ppa as postgis -# Latest available is 3.3.2 -ARG postgis_release -# Download pre-built packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - postgresql-${postgresql_major}-postgis-3=${postgis_release}+dfsg-1.pgdg20.04+1 \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# 02-pgrouting.yml -#################### -FROM ccache as pgrouting-source -# Download and extract -ARG pgrouting_release -ARG pgrouting_release_checksum -ADD --checksum=${pgrouting_release_checksum} \ - "https://github.com/pgRouting/pgrouting/releases/download/v${pgrouting_release}/pgrouting-${pgrouting_release}.tar.gz" \ - /tmp/pgrouting.tar.gz -RUN tar -xvf /tmp/pgrouting.tar.gz -C /tmp && \ - rm -rf /tmp/pgrouting.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libboost-all-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgrouting-${pgrouting_release}/build -RUN cmake -DBUILD_HTML=OFF -DBUILD_DOXY=OFF .. -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgname=pgrouting --pkgversion=${pgrouting_release} --nodoc - -FROM ppa as pgrouting -ARG pgrouting_release -# Download pre-built packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - postgresql-${postgresql_major}-pgrouting=${pgrouting_release}-1.pgdg20.04+1 \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# 03-pgtap.yml -#################### -FROM builder as pgtap-source -# Download and extract -ARG pgtap_release -ARG pgtap_release_checksum -ADD --checksum=${pgtap_release_checksum} \ - "https://github.com/theory/pgtap/archive/v${pgtap_release}.tar.gz" \ - /tmp/pgtap.tar.gz -RUN tar -xvf /tmp/pgtap.tar.gz -C /tmp && \ - rm -rf /tmp/pgtap.tar.gz -# Build from source -WORKDIR /tmp/pgtap-${pgtap_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 04-pg_cron.yml -#################### -FROM ccache as pg_cron-source -# Download and extract -ARG pg_cron_release -ARG pg_cron_release_checksum -ADD --checksum=${pg_cron_release_checksum} \ - "https://github.com/citusdata/pg_cron/archive/refs/tags/v${pg_cron_release}.tar.gz" \ - /tmp/pg_cron.tar.gz -RUN tar -xvf /tmp/pg_cron.tar.gz -C /tmp && \ - rm -rf /tmp/pg_cron.tar.gz -# Build from source -WORKDIR /tmp/pg_cron-${pg_cron_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 05-pgaudit.yml -#################### -FROM ccache as pgaudit-source -# Download and extract -ARG pgaudit_release -ARG pgaudit_release_checksum -ADD --checksum=${pgaudit_release_checksum} \ - "https://github.com/pgaudit/pgaudit/archive/refs/tags/${pgaudit_release}.tar.gz" \ - /tmp/pgaudit.tar.gz -RUN tar -xvf /tmp/pgaudit.tar.gz -C /tmp && \ - rm -rf /tmp/pgaudit.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libssl-dev \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgaudit-${pgaudit_release} -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 06-pgjwt.yml -#################### -FROM builder as pgjwt-source -# Download and extract -ARG pgjwt_release -ADD "https://github.com/michelp/pgjwt.git#${pgjwt_release}" \ - /tmp/pgjwt-${pgjwt_release} -# Build from source -WORKDIR /tmp/pgjwt-${pgjwt_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 07-pgsql-http.yml -#################### -FROM ccache as pgsql-http-source -# Download and extract -ARG pgsql_http_release -ARG pgsql_http_release_checksum -ADD --checksum=${pgsql_http_release_checksum} \ - "https://github.com/pramsey/pgsql-http/archive/refs/tags/v${pgsql_http_release}.tar.gz" \ - /tmp/pgsql-http.tar.gz -RUN tar -xvf /tmp/pgsql-http.tar.gz -C /tmp && \ - rm -rf /tmp/pgsql-http.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcurl4-gnutls-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgsql-http-${pgsql_http_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libcurl3-gnutls --nodoc - -#################### -# 08-plpgsql_check.yml -#################### -FROM ccache as plpgsql_check-source -# Download and extract -ARG plpgsql_check_release -ARG plpgsql_check_release_checksum -ADD --checksum=${plpgsql_check_release_checksum} \ - "https://github.com/okbob/plpgsql_check/archive/refs/tags/v${plpgsql_check_release}.tar.gz" \ - /tmp/plpgsql_check.tar.gz -RUN tar -xvf /tmp/plpgsql_check.tar.gz -C /tmp && \ - rm -rf /tmp/plpgsql_check.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libicu-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/plpgsql_check-${plpgsql_check_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 09-pg-safeupdate.yml -#################### -FROM ccache as pg-safeupdate-source -# Download and extract -ARG pg_safeupdate_release -ARG pg_safeupdate_release_checksum -ADD --checksum=${pg_safeupdate_release_checksum} \ - "https://github.com/eradman/pg-safeupdate/archive/refs/tags/${pg_safeupdate_release}.tar.gz" \ - /tmp/pg-safeupdate.tar.gz -RUN tar -xvf /tmp/pg-safeupdate.tar.gz -C /tmp && \ - rm -rf /tmp/pg-safeupdate.tar.gz -# Build from source -WORKDIR /tmp/pg-safeupdate-${pg_safeupdate_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 10-timescaledb.yml -#################### -FROM ccache as timescaledb-source -# Download and extract -ARG timescaledb_release -ARG timescaledb_release_checksum -ADD --checksum=${timescaledb_release_checksum} \ - "https://github.com/timescale/timescaledb/archive/refs/tags/${timescaledb_release}.tar.gz" \ - /tmp/timescaledb.tar.gz -RUN tar -xvf /tmp/timescaledb.tar.gz -C /tmp && \ - rm -rf /tmp/timescaledb.tar.gz -# Build from source -WORKDIR /tmp/timescaledb-${timescaledb_release}/build -RUN cmake -DAPACHE_ONLY=1 .. -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgname=timescaledb --pkgversion=${timescaledb_release} --nodoc - -#################### -# 11-wal2json.yml -#################### -FROM ccache as wal2json-source -# Download and extract -ARG wal2json_release -ARG wal2json_release_checksum -ADD --checksum=${wal2json_release_checksum} \ - "https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_${wal2json_release}.tar.gz" \ - /tmp/wal2json.tar.gz -RUN tar -xvf /tmp/wal2json.tar.gz -C /tmp --one-top-level --strip-components 1 && \ - rm -rf /tmp/wal2json.tar.gz -# Build from source -WORKDIR /tmp/wal2json -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -ENV version=${wal2json_release} -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion="\${version/_/.}" --nodoc - -#################### -# 12-pljava.yml -#################### -FROM builder as pljava-source -# Download and extract -# TODO: revert to using main repo after PG15 support is merged: https://github.com/tada/pljava/pull/413 -ARG pljava_release=master -ARG pljava_release_checksum=sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6 -ADD --checksum=${pljava_release_checksum} \ - "https://github.com/supabase/pljava/archive/refs/heads/${pljava_release}.tar.gz" \ - /tmp/pljava.tar.gz -RUN tar -xvf /tmp/pljava.tar.gz -C /tmp && \ - rm -rf /tmp/pljava.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - maven \ - default-jdk \ - libssl-dev \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pljava-${pljava_release} -RUN mvn -T 1C clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true -# Create debian package -RUN cp pljava-packaging/target/pljava-pg${postgresql_major}.jar /tmp/ - -FROM base as pljava -# Download pre-built packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - default-jdk-headless \ - postgresql-${postgresql_major}-pljava \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# 13-plv8.yml -#################### -FROM ccache as plv8-source -# Download and extract -ARG plv8_release -ARG plv8_release_checksum -ADD --checksum=${plv8_release_checksum} \ - "https://github.com/supabase/plv8/archive/refs/tags/v${plv8_release}.tar.gz" \ - /tmp/plv8.tar.gz -RUN tar -xvf /tmp/plv8.tar.gz -C /tmp && \ - rm -rf /tmp/plv8.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - pkg-config \ - ninja-build \ - git \ - libtinfo5 \ - libstdc++-10-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/plv8-${plv8_release} -ENV DOCKER=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -FROM scratch as plv8-deb -COPY --from=plv8-source /tmp/*.deb /tmp/ - -FROM ghcr.io/supabase/plv8:${plv8_release}-pg${postgresql_major} as plv8 - -#################### -# 14-pg_plan_filter.yml -#################### -FROM ccache as pg_plan_filter-source -# Download and extract -ARG pg_plan_filter_release -ADD "https://github.com/pgexperts/pg_plan_filter.git#${pg_plan_filter_release}" \ - /tmp/pg_plan_filter-${pg_plan_filter_release} -# Build from source -WORKDIR /tmp/pg_plan_filter-${pg_plan_filter_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 15-pg_net.yml -#################### -FROM ccache as pg_net-source -# Download and extract -ARG pg_net_release -ARG pg_net_release_checksum -ADD --checksum=${pg_net_release_checksum} \ - "https://github.com/supabase/pg_net/archive/refs/tags/v${pg_net_release}.tar.gz" \ - /tmp/pg_net.tar.gz -RUN tar -xvf /tmp/pg_net.tar.gz -C /tmp && \ - rm -rf /tmp/pg_net.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcurl4-gnutls-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pg_net-${pg_net_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libcurl3-gnutls --nodoc - -#################### -# 16-rum.yml -#################### -FROM ccache as rum-source -# Download and extract -ARG rum_release -ARG rum_release_checksum -ADD --checksum=${rum_release_checksum} \ - "https://github.com/postgrespro/rum/archive/refs/tags/${rum_release}.tar.gz" \ - /tmp/rum.tar.gz -RUN tar -xvf /tmp/rum.tar.gz -C /tmp && \ - rm -rf /tmp/rum.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - systemtap-sdt-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/rum-${rum_release} -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 17-pg_hashids.yml -#################### -FROM ccache as pg_hashids-source -# Download and extract -ARG pg_hashids_release -ADD "https://github.com/iCyberon/pg_hashids.git#${pg_hashids_release}" \ - /tmp/pg_hashids-${pg_hashids_release} -# Build from source -WORKDIR /tmp/pg_hashids-${pg_hashids_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 18-pgsodium.yml -#################### -FROM ccache as libsodium -# Download and extract -ARG libsodium_release -ARG libsodium_release_checksum -ADD --checksum=${libsodium_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/libsodium/libsodium-${libsodium_release}.tar.gz" \ - /tmp/libsodium.tar.gz -RUN tar -xvf /tmp/libsodium.tar.gz -C /tmp && \ - rm -rf /tmp/libsodium.tar.gz -# Build from source -WORKDIR /tmp/libsodium-${libsodium_release} -RUN ./configure -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -RUN make install - -FROM libsodium as pgsodium-source -# Download and extract -ARG pgsodium_release -ARG pgsodium_release_checksum -ADD --checksum=${pgsodium_release_checksum} \ - "https://github.com/michelp/pgsodium/archive/refs/tags/v${pgsodium_release}.tar.gz" \ - /tmp/pgsodium.tar.gz -RUN tar -xvf /tmp/pgsodium.tar.gz -C /tmp && \ - rm -rf /tmp/pgsodium.tar.gz -# Build from source -WORKDIR /tmp/pgsodium-${pgsodium_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libsodium23 --nodoc - -#################### -# 19-pg_graphql.yml -#################### -FROM base as pg_graphql -# Download package archive -ARG pg_graphql_release -ADD "https://github.com/supabase/pg_graphql/releases/download/v${pg_graphql_release}/pg_graphql-v${pg_graphql_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu.deb" \ - /tmp/pg_graphql.deb - -#################### -# 20-pg_stat_monitor.yml -#################### -FROM ccache as pg_stat_monitor-source -# Download and extract -ARG pg_stat_monitor_release -ARG pg_stat_monitor_release_checksum -ADD --checksum=${pg_stat_monitor_release_checksum} \ - "https://github.com/percona/pg_stat_monitor/archive/refs/tags/${pg_stat_monitor_release}.tar.gz" \ - /tmp/pg_stat_monitor.tar.gz -RUN tar -xvf /tmp/pg_stat_monitor.tar.gz -C /tmp && \ - rm -rf /tmp/pg_stat_monitor.tar.gz -# Build from source -WORKDIR /tmp/pg_stat_monitor-${pg_stat_monitor_release} -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 22-pg_jsonschema.yml -#################### -FROM base as pg_jsonschema -# Download package archive -ARG pg_jsonschema_release -ADD "https://github.com/supabase/pg_jsonschema/releases/download/v${pg_jsonschema_release}/pg_jsonschema-v${pg_jsonschema_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu.deb" \ - /tmp/pg_jsonschema.deb - -#################### -# 23-vault.yml -#################### -FROM builder as vault-source -# Download and extract -ARG vault_release -ARG vault_release_checksum -ADD --checksum=${vault_release_checksum} \ - "https://github.com/supabase/vault/archive/refs/tags/v${vault_release}.tar.gz" \ - /tmp/vault.tar.gz -RUN tar -xvf /tmp/vault.tar.gz -C /tmp && \ - rm -rf /tmp/vault.tar.gz -# Build from source -WORKDIR /tmp/vault-${vault_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 24-pgroonga.yml -#################### -FROM ccache as groonga -# Download and extract -ARG groonga_release -ARG groonga_release_checksum -ADD --checksum=${groonga_release_checksum} \ - "https://packages.groonga.org/source/groonga/groonga-${groonga_release}.tar.gz" \ - /tmp/groonga.tar.gz -RUN tar -xvf /tmp/groonga.tar.gz -C /tmp && \ - rm -rf /tmp/groonga.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - zlib1g-dev \ - liblz4-dev \ - libzstd-dev \ - libmsgpack-dev \ - libzmq3-dev \ - libevent-dev \ - libmecab-dev \ - rapidjson-dev \ - pkg-config \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/groonga-${groonga_release} -RUN ./configure -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=yes --fstrans=no --backup=no --pakdir=/tmp --requires=zlib1g,liblz4-1,libzstd1,libmsgpackc2,libzmq5,libevent-2.1-7,libmecab2 --nodoc - -FROM groonga as pgroonga-source -# Download and extract -ARG pgroonga_release -ARG pgroonga_release_checksum -ADD --checksum=${pgroonga_release_checksum} \ - "https://packages.groonga.org/source/pgroonga/pgroonga-${pgroonga_release}.tar.gz" \ - /tmp/pgroonga.tar.gz -RUN tar -xvf /tmp/pgroonga.tar.gz -C /tmp && \ - rm -rf /tmp/pgroonga.tar.gz -# Build from source -WORKDIR /tmp/pgroonga-${pgroonga_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=mecab-naist-jdic --nodoc - -FROM scratch as pgroonga-deb -COPY --from=pgroonga-source /tmp/*.deb /tmp/ - -FROM base as pgroonga -# Latest available is 3.0.3 -ARG pgroonga_release -# Download pre-built packages -ADD "https://packages.groonga.org/ubuntu/groonga-apt-source-latest-focal.deb" /tmp/source.deb -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - /tmp/source.deb \ - && rm -rf /var/lib/apt/lists/* -RUN rm /tmp/source.deb -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - postgresql-${postgresql_major}-pgdg-pgroonga=${pgroonga_release}-1 \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# 25-wrappers.yml -#################### -FROM base as wrappers -# Download package archive -ARG wrappers_release -ADD "https://github.com/supabase/wrappers/releases/download/v${wrappers_release}/wrappers-v${wrappers_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu.deb" \ - /tmp/wrappers.deb - -#################### -# 26-hypopg.yml -#################### -FROM ccache as hypopg-source -# Download and extract -ARG hypopg_release -ARG hypopg_release_checksum -ADD --checksum=${hypopg_release_checksum} \ - "https://github.com/HypoPG/hypopg/archive/refs/tags/${hypopg_release}.tar.gz" \ - /tmp/hypopg.tar.gz -RUN tar -xvf /tmp/hypopg.tar.gz -C /tmp && \ - rm -rf /tmp/hypopg.tar.gz -# Build from source -WORKDIR /tmp/hypopg-${hypopg_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### - # 27-pg_repack.yml - #################### - FROM ccache as pg_repack-source - ARG pg_repack_release - ARG pg_repack_release_checksum - ADD --checksum=${pg_repack_release_checksum} \ - "https://github.com/reorg/pg_repack/archive/refs/tags/ver_${pg_repack_release}.tar.gz" \ - /tmp/pg_repack.tar.gz - RUN tar -xvf /tmp/pg_repack.tar.gz -C /tmp && \ - rm -rf /tmp/pg_repack.tar.gz - # Install build dependencies - RUN apt-get update && apt-get install -y --no-install-recommends \ - liblz4-dev \ - libz-dev \ - libzstd-dev \ - libreadline-dev \ - && rm -rf /var/lib/apt/lists/* - # Build from source - WORKDIR /tmp/pg_repack-ver_${pg_repack_release} - ENV USE_PGXS=1 - RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) - # Create debian package - RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=${pg_repack_release} --nodoc - -#################### -# 28-pgvector.yml -#################### -FROM ccache as pgvector-source -ARG pgvector_release -ARG pgvector_release_checksum -ADD --checksum=${pgvector_release_checksum} \ - "https://github.com/pgvector/pgvector/archive/refs/tags/v${pgvector_release}.tar.gz" \ - /tmp/pgvector.tar.gz -RUN tar -xvf /tmp/pgvector.tar.gz -C /tmp && \ - rm -rf /tmp/pgvector.tar.gz -# Build from source -WORKDIR /tmp/pgvector-${pgvector_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 29-pg_tle.yml -#################### -FROM ccache as pg_tle-source -ARG pg_tle_release -ARG pg_tle_release_checksum -ADD --checksum=${pg_tle_release_checksum} \ - "https://github.com/aws/pg_tle/archive/refs/tags/v${pg_tle_release}.tar.gz" \ - /tmp/pg_tle.tar.gz -RUN tar -xvf /tmp/pg_tle.tar.gz -C /tmp && \ - rm -rf /tmp/pg_tle.tar.gz -RUN apt-get update && apt-get install -y --no-install-recommends \ - flex \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pg_tle-${pg_tle_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -###################### -# 30-index_advisor.yml -###################### -FROM ccache as index_advisor -ARG index_advisor_release -ARG index_advisor_release_checksum -ADD --checksum=${index_advisor_release_checksum} \ - "https://github.com/olirice/index_advisor/archive/refs/tags/v${index_advisor_release}.tar.gz" \ - /tmp/index_advisor.tar.gz -RUN tar -xvf /tmp/index_advisor.tar.gz -C /tmp && \ - rm -rf /tmp/index_advisor.tar.gz -# Build from source -WORKDIR /tmp/index_advisor-${index_advisor_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# internal/supautils.yml -#################### -FROM base as supautils -# Download package archive -ARG supautils_release -# Define checksums for different architectures -ARG supautils_release_arm64_deb_checksum -ARG supautils_release_amd64_deb_checksum - -RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* - -# Set up a script to download the correct package -RUN echo '#!/bin/sh' > /tmp/download_supautils.sh && \ - echo 'set -e' >> /tmp/download_supautils.sh && \ - echo 'if [ "$TARGETARCH" = "amd64" ]; then' >> /tmp/download_supautils.sh && \ - echo ' CHECKSUM="${supautils_release_amd64_deb_checksum}"' >> /tmp/download_supautils.sh && \ - echo ' ARCH="amd64"' >> /tmp/download_supautils.sh && \ - echo 'elif [ "$TARGETARCH" = "arm64" ]; then' >> /tmp/download_supautils.sh && \ - echo ' CHECKSUM="${supautils_release_arm64_deb_checksum}"' >> /tmp/download_supautils.sh && \ - echo ' ARCH="arm64"' >> /tmp/download_supautils.sh && \ - echo 'else' >> /tmp/download_supautils.sh && \ - echo ' echo "Unsupported architecture: $TARGETARCH" >&2' >> /tmp/download_supautils.sh && \ - echo ' exit 1' >> /tmp/download_supautils.sh && \ - echo 'fi' >> /tmp/download_supautils.sh && \ - echo 'CHECKSUM=$(echo $CHECKSUM | sed "s/^sha256://")' >> /tmp/download_supautils.sh && \ - echo 'curl -fsSL -o /tmp/supautils.deb \\' >> /tmp/download_supautils.sh && \ - echo ' "https://github.com/supabase/supautils/releases/download/v${supautils_release}/supautils-v${supautils_release}-pg${postgresql_major}-$ARCH-linux-gnu.deb"' >> /tmp/download_supautils.sh && \ - echo 'echo "$CHECKSUM /tmp/supautils.deb" | sha256sum -c -' >> /tmp/download_supautils.sh && \ - chmod +x /tmp/download_supautils.sh - -# Run the script to download and verify the package -RUN /tmp/download_supautils.sh && rm /tmp/download_supautils.sh - -#################### -# setup-wal-g.yml -#################### -FROM base as walg -ARG wal_g_release -# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz -RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ - apt-get update && apt-get install -y --no-install-recommends curl && \ - curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${arch}.tar.gz" -o /tmp/wal-g.tar.gz && \ - tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ - rm -rf /tmp/wal-g.tar.gz && \ - mv /tmp/wal-g-pg-ubuntu*20.04-$arch /tmp/wal-g - -#################### -# Collect extension packages -#################### -FROM scratch as extensions -COPY --from=postgis-source /tmp/*.deb /tmp/ -COPY --from=pgrouting-source /tmp/*.deb /tmp/ -COPY --from=pgtap-source /tmp/*.deb /tmp/ -COPY --from=pg_cron-source /tmp/*.deb /tmp/ -COPY --from=pgaudit-source /tmp/*.deb /tmp/ -COPY --from=pgjwt-source /tmp/*.deb /tmp/ -COPY --from=pgsql-http-source /tmp/*.deb /tmp/ -COPY --from=plpgsql_check-source /tmp/*.deb /tmp/ -COPY --from=pg-safeupdate-source /tmp/*.deb /tmp/ -COPY --from=timescaledb-source /tmp/*.deb /tmp/ -COPY --from=wal2json-source /tmp/*.deb /tmp/ -# COPY --from=pljava /tmp/*.deb /tmp/ -COPY --from=plv8 /tmp/*.deb /tmp/ -COPY --from=pg_plan_filter-source /tmp/*.deb /tmp/ -COPY --from=pg_net-source /tmp/*.deb /tmp/ -COPY --from=rum-source /tmp/*.deb /tmp/ -COPY --from=pgsodium-source /tmp/*.deb /tmp/ -COPY --from=pg_hashids-source /tmp/*.deb /tmp/ -COPY --from=pg_graphql /tmp/*.deb /tmp/ -COPY --from=pg_stat_monitor-source /tmp/*.deb /tmp/ -COPY --from=pg_jsonschema /tmp/*.deb /tmp/ -COPY --from=vault-source /tmp/*.deb /tmp/ -COPY --from=pgroonga-source /tmp/*.deb /tmp/ -COPY --from=wrappers /tmp/*.deb /tmp/ -COPY --from=hypopg-source /tmp/*.deb /tmp/ -COPY --from=pg_repack-source /tmp/*.deb /tmp/ -COPY --from=pgvector-source /tmp/*.deb /tmp/ -COPY --from=pg_tle-source /tmp/*.deb /tmp/ -COPY --from=index_advisor /tmp/*.deb /tmp/ -COPY --from=supautils /tmp/*.deb /tmp/ - -#################### -# Download gosu for easy step-down from root -#################### -FROM ubuntu:focal as gosu -ARG TARGETARCH -# Install dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - gnupg \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* -# Download binary -ARG GOSU_VERSION=1.16 -ARG GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4 -ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH \ - /usr/local/bin/gosu -ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH.asc \ - /usr/local/bin/gosu.asc -# Verify checksum -RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY && \ - gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ - gpgconf --kill all && \ - chmod +x /usr/local/bin/gosu - -#################### -# Build final image -#################### -FROM base as production - -# Setup extensions -COPY --from=extensions /tmp /tmp -COPY --from=walg /tmp/wal-g /usr/local/bin/ - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends \ - /tmp/*.deb \ - # Needed for anything using libcurl - # https://github.com/supabase/postgres/issues/573 - ca-certificates \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -# Initialise configs -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf -COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts -COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf -COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh -COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh - -RUN sed -i \ - -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ - -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ - echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ - echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ - useradd --create-home --shell /bin/bash wal-g -G postgres && \ - mkdir -p /etc/postgresql-custom && \ - chown postgres:postgres /etc/postgresql-custom - -# Include schema migrations -COPY migrations/db /docker-entrypoint-initdb.d/ -COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql -COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql - -# Add upstream entrypoint script -COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu -ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ - /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] - -HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost -STOPSIGNAL SIGINT -EXPOSE 5432 - -ENV POSTGRES_HOST=/var/run/postgresql -CMD ["postgres", "-D", "/etc/postgresql"] - -#################### -# Update build cache -#################### -FROM ccache as stats -COPY --from=extensions /tmp/*.deb /dev/null -# Additional packages that are separately built from source -# COPY --from=plv8-deb /tmp/*.deb /dev/null -# Cache mount is only populated by docker build --no-cache -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - ccache -s && \ - cp -r /ccache/* /tmp -FROM scratch as buildcache -COPY --from=stats /tmp / diff --git a/Dockerfile-158 b/Dockerfile-158 deleted file mode 100644 index 52c4e5af3..000000000 --- a/Dockerfile-158 +++ /dev/null @@ -1,221 +0,0 @@ -# syntax=docker/dockerfile:1.6 -ARG postgresql_major=15 -ARG postgresql_release=${postgresql_major}.1 - -# Bump default build arg to build a package from source -# Bump vars.yml to specify runtime package version -ARG sfcgal_release=1.3.10 -ARG postgis_release=3.3.2 -ARG pgrouting_release=3.4.1 -ARG pgtap_release=1.2.0 -ARG pg_cron_release=1.6.2 -ARG pgaudit_release=1.7.0 -ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 -ARG pgsql_http_release=1.5.0 -ARG plpgsql_check_release=2.2.5 -ARG pg_safeupdate_release=1.4 -ARG timescaledb_release=2.9.1 -ARG wal2json_release=2_5 -ARG pljava_release=1.6.4 -ARG plv8_release=3.1.5 -ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 -ARG pg_net_release=0.7.1 -ARG rum_release=1.3.13 -ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 -ARG libsodium_release=1.0.18 -ARG pgsodium_release=3.1.6 -ARG pg_graphql_release=1.5.1 -ARG pg_stat_monitor_release=1.1.1 -ARG pg_jsonschema_release=0.1.4 -ARG pg_repack_release=1.4.8 -ARG vault_release=0.2.8 -ARG groonga_release=12.0.8 -ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.3.0 -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.0 -ARG wal_g_release=2.0.1 - -FROM ubuntu:focal as base - -RUN apt update -y && apt install -y \ - curl \ - gnupg \ - lsb-release \ - software-properties-common \ - wget \ - sudo \ - && apt clean - - -RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres -RUN adduser --system --no-create-home --shell /bin/bash --group wal-g -RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ ---init none \ ---no-confirm \ ---extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ ---extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - -ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" - -COPY . /nixpg - -WORKDIR /nixpg - -RUN nix profile install .#psql_15/bin - - - -WORKDIR / - - -RUN mkdir -p /usr/lib/postgresql/bin \ - /usr/lib/postgresql/share/postgresql \ - /usr/share/postgresql \ - /var/lib/postgresql \ - && chown -R postgres:postgres /usr/lib/postgresql \ - && chown -R postgres:postgres /var/lib/postgresql \ - && chown -R postgres:postgres /usr/share/postgresql - -# Create symbolic links -RUN ln -s /nix/var/nix/profiles/default/bin/* /usr/lib/postgresql/bin/ \ - && ln -s /nix/var/nix/profiles/default/bin/* /usr/bin/ \ - && chown -R postgres:postgres /usr/bin - -# Create symbolic links for PostgreSQL shares -RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/share/postgresql/ -RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ -RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ -RUN chown -R postgres:postgres /usr/share/postgresql/ -# Create symbolic links for contrib directory -RUN mkdir -p /usr/lib/postgresql/share/postgresql/contrib \ - && find /nix/var/nix/profiles/default/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ - && chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/contrib/ - -RUN chown -R postgres:postgres /usr/lib/postgresql - -RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets - - -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - build-essential \ - checkinstall \ - cmake - -ENV PGDATA=/var/lib/postgresql/data - -#################### -# setup-wal-g.yml -#################### -FROM base as walg -ARG wal_g_release -# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz -RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ - apt-get update && apt-get install -y --no-install-recommends curl && \ - curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \ - tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ - rm -rf /tmp/wal-g.tar.gz && \ - mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g - -# #################### -# # Download gosu for easy step-down from root -# #################### -FROM base as gosu -ARG TARGETARCH -# Install dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - gnupg \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* -# Download binary -ARG GOSU_VERSION=1.16 -ARG GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4 -ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH \ - /usr/local/bin/gosu -ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH.asc \ - /usr/local/bin/gosu.asc -# Verify checksum -RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY && \ - gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ - gpgconf --kill all && \ - chmod +x /usr/local/bin/gosu - -# #################### -# # Build final image -# #################### -FROM gosu as production -RUN id postgres || (echo "postgres user does not exist" && exit 1) -# # Setup extensions -COPY --from=walg /tmp/wal-g /usr/local/bin/ - -# # Initialise configs -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf -COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts -COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf -COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh -COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh - -RUN sed -i \ - -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ - -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ - echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ - #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ - echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ - echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ - usermod -aG postgres wal-g && \ - mkdir -p /etc/postgresql-custom && \ - chown postgres:postgres /etc/postgresql-custom - -# # Include schema migrations -COPY migrations/db /docker-entrypoint-initdb.d/ -COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql -COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql - -# # Add upstream entrypoint script -COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu -ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ - /usr/local/bin/ - -RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql - -ENTRYPOINT ["docker-entrypoint.sh"] - -HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost -STOPSIGNAL SIGINT -EXPOSE 5432 - -ENV POSTGRES_HOST=/var/run/postgresql -ENV POSTGRES_USER=supabase_admin -ENV POSTGRES_DB=postgres -RUN apt-get update && apt-get install -y --no-install-recommends \ - locales \ - && rm -rf /var/lib/apt/lists/* && \ - localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ - && localedef -i C -c -f UTF-8 -A /usr/share/locale/locale.alias C.UTF-8 -RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C.UTF-8 -ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive -CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/amazon-arm64.pkr.hcl b/amazon-arm64.pkr.hcl deleted file mode 100644 index 993537297..000000000 --- a/amazon-arm64.pkr.hcl +++ /dev/null @@ -1,278 +0,0 @@ -variable "ami" { - type = string - default = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-*" -} - -variable "profile" { - type = string - default = "${env("AWS_PROFILE")}" -} - -variable "ami_name" { - type = string - default = "supabase-postgres" -} - -variable "ami_regions" { - type = list(string) - default = ["ap-southeast-2"] -} - -variable "ansible_arguments" { - type = string - default = "--skip-tags install-postgrest,install-pgbouncer,install-supabase-internal" -} - -variable "aws_access_key" { - type = string - default = "" -} - -variable "aws_secret_key" { - type = string - default = "" -} - -variable "environment" { - type = string - default = "prod" -} - -variable "region" { - type = string -} - -variable "build-vol" { - type = string - default = "xvdc" -} - -# ccache docker image details -variable "docker_user" { - type = string - default = "" -} - -variable "docker_passwd" { - type = string - default = "" -} - -variable "docker_image" { - type = string - default = "" -} - -variable "docker_image_tag" { - type = string - default = "latest" -} - -locals { - creator = "packer" -} - -variable "postgres-version" { - type = string - default = "" -} - -variable "git-head-version" { - type = string - default = "unknown" -} - -variable "packer-execution-id" { - type = string - default = "unknown" -} - -variable "force-deregister" { - type = bool - default = false -} - -packer { - required_plugins { - amazon = { - source = "github.com/hashicorp/amazon" - version = "~> 1" - } - } -} - -# source block -source "amazon-ebssurrogate" "source" { - profile = "${var.profile}" - #access_key = "${var.aws_access_key}" - #ami_name = "${var.ami_name}-arm64-${formatdate("YYYY-MM-DD-hhmm", timestamp())}" - ami_name = "${var.ami_name}-${var.postgres-version}" - ami_virtualization_type = "hvm" - ami_architecture = "arm64" - ami_regions = "${var.ami_regions}" - instance_type = "c6g.4xlarge" - region = "${var.region}" - #secret_key = "${var.aws_secret_key}" - force_deregister = var.force-deregister - - # Use latest official ubuntu focal ami owned by Canonical. - source_ami_filter { - filters = { - virtualization-type = "hvm" - name = "${var.ami}" - root-device-type = "ebs" - } - owners = [ "099720109477" ] - most_recent = true - } - ena_support = true - launch_block_device_mappings { - device_name = "/dev/xvdf" - delete_on_termination = true - volume_size = 10 - volume_type = "gp3" - } - - launch_block_device_mappings { - device_name = "/dev/xvdh" - delete_on_termination = true - volume_size = 8 - volume_type = "gp3" - } - - launch_block_device_mappings { - device_name = "/dev/${var.build-vol}" - delete_on_termination = true - volume_size = 16 - volume_type = "gp2" - omit_from_artifact = true - } - - run_tags = { - creator = "packer" - appType = "postgres" - packerExecutionId = "${var.packer-execution-id}" - } - run_volume_tags = { - creator = "packer" - appType = "postgres" - } - snapshot_tags = { - creator = "packer" - appType = "postgres" - } - tags = { - creator = "packer" - appType = "postgres" - postgresVersion = "${var.postgres-version}" - sourceSha = "${var.git-head-version}" - } - - communicator = "ssh" - ssh_pty = true - ssh_username = "ubuntu" - ssh_timeout = "5m" - - ami_root_device { - source_device_name = "/dev/xvdf" - device_name = "/dev/xvda" - delete_on_termination = true - volume_size = 10 - volume_type = "gp2" - } - - associate_public_ip_address = true -} - -# a build block invokes sources and runs provisioning steps on them. -build { - sources = ["source.amazon-ebssurrogate.source"] - - provisioner "file" { - source = "ebssurrogate/files/sources-arm64.cfg" - destination = "/tmp/sources.list" - } - - provisioner "file" { - source = "ebssurrogate/files/ebsnvme-id" - destination = "/tmp/ebsnvme-id" - } - - provisioner "file" { - source = "ebssurrogate/files/70-ec2-nvme-devices.rules" - destination = "/tmp/70-ec2-nvme-devices.rules" - } - - provisioner "file" { - source = "ebssurrogate/scripts/chroot-bootstrap.sh" - destination = "/tmp/chroot-bootstrap.sh" - } - - provisioner "file" { - source = "ebssurrogate/files/cloud.cfg" - destination = "/tmp/cloud.cfg" - } - - provisioner "file" { - source = "ebssurrogate/files/vector.timer" - destination = "/tmp/vector.timer" - } - - provisioner "file" { - source = "ebssurrogate/files/apparmor_profiles" - destination = "/tmp" - } - - provisioner "file" { - source = "migrations" - destination = "/tmp" - } - - provisioner "file" { - source = "ebssurrogate/files/unit-tests" - destination = "/tmp" - } - - # Copy ansible playbook - provisioner "shell" { - inline = ["mkdir /tmp/ansible-playbook"] - } - - provisioner "file" { - source = "ansible" - destination = "/tmp/ansible-playbook" - } - - provisioner "file" { - source = "scripts" - destination = "/tmp/ansible-playbook" - } - - provisioner "shell" { - environment_vars = [ - "ARGS=${var.ansible_arguments}", - "DOCKER_USER=${var.docker_user}", - "DOCKER_PASSWD=${var.docker_passwd}", - "DOCKER_IMAGE=${var.docker_image}", - "DOCKER_IMAGE_TAG=${var.docker_image_tag}", - "POSTGRES_SUPABASE_VERSION=${var.postgres-version}" - ] - use_env_var_file = true - script = "ebssurrogate/scripts/surrogate-bootstrap.sh" - execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && {{.Path}}'" - start_retry_timeout = "5m" - skip_clean = true - } - - provisioner "file" { - source = "/tmp/ansible.log" - destination = "/tmp/ansible.log" - direction = "download" - } - - provisioner "file" { - source = "/tmp/pg_binaries.tar.gz" - destination = "/tmp/pg_binaries.tar.gz" - direction = "download" - } -} diff --git a/ansible/tasks/postgres-extensions/01-postgis.yml b/ansible/tasks/postgres-extensions/01-postgis.yml deleted file mode 100644 index 7475a5d95..000000000 --- a/ansible/tasks/postgres-extensions/01-postgis.yml +++ /dev/null @@ -1,102 +0,0 @@ -# postgis -- name: postgis - download & install dependencies - apt: - pkg: - - libgeos-dev - - libproj-dev - - libgdal-dev - - libjson-c-dev - - libxml2-dev - - libboost-all-dev - - libcgal-dev - - libmpfr-dev - - libgmp-dev - - cmake - - libprotobuf-c-dev - - protobuf-c-compiler - update_cache: yes - cache_valid_time: 3600 - install_recommends: no - -- name: postgis - ensure dependencies do not get autoremoved - shell: | - set -e - apt-mark manual libgeos* libproj* libgdal* libjson-c* libxml2* libboost* libcgal* libmpfr* libgmp* - apt-mark auto libgeos*-dev libproj*-dev libgdal*-dev libjson-c*-dev libxml2*-dev libboost*-dev libcgal*-dev libmpfr*-dev libgmp*-dev - - become: yes - args: - executable: /bin/bash - -- name: postgis - download SFCGAL dependency - get_url: - url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/sfcgal/SFCGAL-v{{ sfcgal_release }}.tar.gz" - dest: /tmp/SFCGAL-v{{ sfcgal_release }}.tar.gz - checksum: "{{ sfcgal_release_checksum }}" - timeout: 60 - -- name: postgis - unpack SFCGAL - unarchive: - remote_src: yes - src: /tmp/SFCGAL-v{{ sfcgal_release }}.tar.gz - dest: /tmp - become: yes - -- name: postgis - compile SFCGAL - shell: - cmd: "cmake ." - chdir: /tmp/SFCGAL-v{{ sfcgal_release }} - become: yes - -- name: postgis - build SFCGAL - community.general.make: - target: all - chdir: /tmp/SFCGAL-v{{ sfcgal_release }} - jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: postgis - install SFCGAL - make: - chdir: /tmp/SFCGAL-v{{ sfcgal_release }} - target: install - become: yes - -- name: postgis - download latest release - shell: - cmd: "curl -sf -L https://supabase-public-artifacts-bucket.s3.amazonaws.com/postgis-{{ postgis_release }}.tar.gz -o /tmp/postgis-{{ postgis_release }}.tar.gz" - -- name: postgis - unpack archive - unarchive: - remote_src: yes - src: /tmp/postgis-{{ postgis_release }}.tar.gz - dest: /tmp - become: yes - -- name: postgis - configure - shell: - cmd: "./configure --with-sfcgal" - chdir: /tmp/postgis-{{ postgis_release }} - become: yes - -- name: postgis - build - community.general.make: - target: all - chdir: /tmp/postgis-{{ postgis_release }} - jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: postgis - install - make: - chdir: /tmp/postgis-{{ postgis_release }} - target: install - become: yes - -- name: postgis - SFCGAL cleanup - file: - state: absent - path: /tmp/SFCGAL-v{{ sfcgal_release }} - -- name: postgis - cleanup - file: - state: absent - path: /tmp/postgis-{{ postgis_release }} diff --git a/ansible/tasks/postgres-extensions/02-pgrouting.yml b/ansible/tasks/postgres-extensions/02-pgrouting.yml deleted file mode 100644 index 746870a01..000000000 --- a/ansible/tasks/postgres-extensions/02-pgrouting.yml +++ /dev/null @@ -1,52 +0,0 @@ -# pgRouting -- name: pgRouting - download & install dependencies - apt: - pkg: - - libboost-all-dev - update_cache: yes - cache_valid_time: 3600 - install_recommends: no - -- name: pgRouting - download latest release - get_url: - url: "https://github.com/pgRouting/pgrouting/releases/download/v{{ pgrouting_release }}/pgrouting-{{ pgrouting_release }}.tar.gz" - dest: /tmp/pgrouting-{{ pgrouting_release }}.tar.gz - checksum: "{{ pgrouting_release_checksum }}" - timeout: 60 - -- name: pgRouting - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgrouting-{{ pgrouting_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgRouting - create build directory - file: - path: /tmp/pgrouting-{{ pgrouting_release }}/build - state: directory - become: yes - -- name: pgRouting - compile - shell: - cmd: "cmake -DBUILD_HTML=OFF -DBUILD_DOXY=OFF .." - chdir: /tmp/pgrouting-{{ pgrouting_release }}/build - become: yes - -- name: pgRouting - build - community.general.make: - target: all - chdir: /tmp/pgrouting-{{ pgrouting_release }}/build - jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: pgRouting - install - make: - chdir: /tmp/pgrouting-{{ pgrouting_release }}/build - target: install - become: yes - -- name: pgRouting - cleanup - file: - state: absent - path: /tmp/pgrouting-{{ pgrouting_release }} diff --git a/ansible/tasks/postgres-extensions/03-pgtap.yml b/ansible/tasks/postgres-extensions/03-pgtap.yml deleted file mode 100644 index 9b818b92a..000000000 --- a/ansible/tasks/postgres-extensions/03-pgtap.yml +++ /dev/null @@ -1,25 +0,0 @@ -# pgTAP -- name: pgTAP - download latest release - get_url: - url: "https://github.com/theory/pgtap/archive/v{{ pgtap_release }}.tar.gz" - dest: /tmp/pgtap-{{ pgtap_release }}.tar.gz - checksum: "{{ pgtap_release_checksum }}" - timeout: 60 - -- name: pgTAP - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgtap-{{ pgtap_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgTAP - install - make: - chdir: /tmp/pgtap-{{ pgtap_release }} - target: install - become: yes - -- name: pgTAP - cleanup - file: - state: absent - path: /tmp/pgtap-{{ pgtap_release }} diff --git a/ansible/tasks/postgres-extensions/04-pg_cron.yml b/ansible/tasks/postgres-extensions/04-pg_cron.yml deleted file mode 100644 index d9a11c037..000000000 --- a/ansible/tasks/postgres-extensions/04-pg_cron.yml +++ /dev/null @@ -1,30 +0,0 @@ -# pg_cron -- name: pg_cron - download latest release - get_url: - url: "https://github.com/citusdata/pg_cron/archive/refs/tags/v{{ pg_cron_release }}.tar.gz" - dest: /tmp/pg_cron-{{ pg_cron_release }}.tar.gz - checksum: "{{ pg_cron_release_checksum }}" - timeout: 60 - -- name: pg_cron - unpack archive - unarchive: - remote_src: yes - src: /tmp/pg_cron-{{ pg_cron_release }}.tar.gz - dest: /tmp - become: yes - -- name: pg_cron - build - make: - chdir: /tmp/pg_cron-{{ pg_cron_release }} - become: yes - -- name: pg_cron - install - make: - chdir: /tmp/pg_cron-{{ pg_cron_release }} - target: install - become: yes - -- name: pg_cron - cleanup - file: - state: absent - path: /tmp/pg_cron-{{ pg_cron_release }} diff --git a/ansible/tasks/postgres-extensions/05-pgaudit.yml b/ansible/tasks/postgres-extensions/05-pgaudit.yml deleted file mode 100644 index 5f88c8473..000000000 --- a/ansible/tasks/postgres-extensions/05-pgaudit.yml +++ /dev/null @@ -1,43 +0,0 @@ -# pgAudit -- name: pgAudit - download & install dependencies - apt: - pkg: - - libssl-dev - - libkrb5-dev - update_cache: yes - install_recommends: no - -- name: pgAudit - download latest release - get_url: - url: "https://github.com/pgaudit/pgaudit/archive/refs/tags/{{ pgaudit_release }}.tar.gz" - dest: /tmp/pgaudit-{{ pgaudit_release }}.tar.gz - checksum: "{{ pgaudit_release_checksum }}" - timeout: 60 - -- name: pgAudit - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgaudit-{{ pgaudit_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgAudit - build - make: - chdir: /tmp/pgaudit-{{ pgaudit_release }} - target: check - params: - USE_PGXS: 1 - become: yes - -- name: pgAudit - install - make: - chdir: /tmp/pgaudit-{{ pgaudit_release }} - target: install - params: - USE_PGXS: 1 - become: yes - -- name: pgAudit - cleanup - file: - state: absent - path: /tmp/pgaudit-{{ pgaudit_release }} diff --git a/ansible/tasks/postgres-extensions/06-pgjwt.yml b/ansible/tasks/postgres-extensions/06-pgjwt.yml deleted file mode 100644 index 61890bf43..000000000 --- a/ansible/tasks/postgres-extensions/06-pgjwt.yml +++ /dev/null @@ -1,17 +0,0 @@ -# pgjwt -- name: pgjwt - download from master branch - git: - repo: https://github.com/michelp/pgjwt.git - dest: /tmp/pgjwt - version: "{{ pgjwt_release }}" - -- name: pgjwt - install - make: - chdir: /tmp/pgjwt - target: install - become: yes - -- name: pgjwt - cleanup - file: - state: absent - path: /tmp/pgjwt diff --git a/ansible/tasks/postgres-extensions/07-pgsql-http.yml b/ansible/tasks/postgres-extensions/07-pgsql-http.yml deleted file mode 100644 index 73044d261..000000000 --- a/ansible/tasks/postgres-extensions/07-pgsql-http.yml +++ /dev/null @@ -1,43 +0,0 @@ -# pgsql-http -- name: pgsql-http - libcurl4 package - apt: - pkg: - - libcurl4 - state: absent - -- name: pgsql-http - download & install dependencies - apt: - pkg: - - libcurl4-gnutls-dev - update_cache: yes - install_recommends: no - -- name: pgsql-http - download latest release - get_url: - url: "https://github.com/pramsey/pgsql-http/archive/refs/tags/v{{ pgsql_http_release }}.tar.gz" - dest: /tmp/pgsql_http-{{ pgsql_http_release }}.tar.gz - checksum: "{{ pgsql_http_release_checksum }}" - timeout: 60 - -- name: pgsql-http - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgsql_http-{{ pgsql_http_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgsql-http - build - make: - chdir: /tmp/pgsql-http-{{ pgsql_http_release }} - become: yes - -- name: pgsql-http - install - make: - chdir: /tmp/pgsql-http-{{ pgsql_http_release }} - target: install - become: yes - -- name: pgsql-http - cleanup - file: - state: absent - path: /tmp/pgsql-http-{{ pgsql_http_release }} diff --git a/ansible/tasks/postgres-extensions/08-plpgsql_check.yml b/ansible/tasks/postgres-extensions/08-plpgsql_check.yml deleted file mode 100644 index 75bb041d5..000000000 --- a/ansible/tasks/postgres-extensions/08-plpgsql_check.yml +++ /dev/null @@ -1,38 +0,0 @@ -# plpgsql_check -- name: plpgsql_check - download & install dependencies - apt: - pkg: - - libicu-dev - update_cache: yes - install_recommends: no - -- name: plpgsql_check - download latest release - get_url: - url: "https://github.com/okbob/plpgsql_check/archive/refs/tags/v{{ plpgsql_check_release }}.tar.gz" - dest: /tmp/plpgsql_check-{{ plpgsql_check_release }}.tar.gz - checksum: "{{ plpgsql_check_release_checksum }}" - timeout: 60 - -- name: plpgsql_check - unpack archive - unarchive: - remote_src: yes - src: /tmp/plpgsql_check-{{ plpgsql_check_release }}.tar.gz - dest: /tmp - become: yes - -- name: plpgsql_check - clean - make: - chdir: /tmp/plpgsql_check-{{ plpgsql_check_release }} - target: clean - become: yes - -- name: plpgsql_check - install - make: - chdir: /tmp/plpgsql_check-{{ plpgsql_check_release }} - target: install - become: yes - -- name: plpgsql_check - cleanup - file: - state: absent - path: /tmp/plpgsql_check-{{ plpgsql_check_release }} diff --git a/ansible/tasks/postgres-extensions/09-pg-safeupdate.yml b/ansible/tasks/postgres-extensions/09-pg-safeupdate.yml deleted file mode 100644 index 36ae41cfa..000000000 --- a/ansible/tasks/postgres-extensions/09-pg-safeupdate.yml +++ /dev/null @@ -1,30 +0,0 @@ -# pg-safeupdate -- name: pg-safeupdate - download latest release - get_url: - url: "https://github.com/eradman/pg-safeupdate/archive/refs/tags/{{ pg_safeupdate_release }}.tar.gz" - dest: /tmp/pg_safeupdate-{{ pg_safeupdate_release }}.tar.gz - checksum: "{{ pg_safeupdate_release_checksum }}" - timeout: 60 - -- name: pg-safeupdate - unpack archive - unarchive: - remote_src: yes - src: /tmp/pg_safeupdate-{{ pg_safeupdate_release }}.tar.gz - dest: /tmp - become: yes - -- name: pg-safeupdate - build - make: - chdir: /tmp/pg-safeupdate-{{ pg_safeupdate_release }} - become: yes - -- name: pg-safeupdate - install - make: - chdir: /tmp/pg-safeupdate-{{ pg_safeupdate_release }} - target: install - become: yes - -- name: pg-safeupdate - cleanup - file: - state: absent - path: /tmp/pg-safeupdate-{{ pg_safeupdate_release }} diff --git a/ansible/tasks/postgres-extensions/10-timescaledb.yml b/ansible/tasks/postgres-extensions/10-timescaledb.yml deleted file mode 100644 index cb4b84237..000000000 --- a/ansible/tasks/postgres-extensions/10-timescaledb.yml +++ /dev/null @@ -1,36 +0,0 @@ -# timescaledb -- name: timescaledb - download & install dependencies - apt: - pkg: - - cmake - update_cache: yes - install_recommends: no - -- name: timescaledb - download latest release - git: - repo: https://github.com/timescale/timescaledb.git - dest: /tmp/timescaledb - version: "{{ timescaledb_release }}" - become: yes - -- name: timescaledb - bootstrap - shell: - cmd: "./bootstrap -DAPACHE_ONLY=1" - chdir: /tmp/timescaledb - become: yes - -- name: timescaledb - build - make: - chdir: /tmp/timescaledb/build - become: yes - -- name: timescaledb - install - make: - chdir: /tmp/timescaledb/build - target: install - become: yes - -- name: timescaledb - cleanup - file: - state: absent - path: /tmp/timescaledb diff --git a/ansible/tasks/postgres-extensions/11-wal2json.yml b/ansible/tasks/postgres-extensions/11-wal2json.yml deleted file mode 100644 index c5abde95c..000000000 --- a/ansible/tasks/postgres-extensions/11-wal2json.yml +++ /dev/null @@ -1,17 +0,0 @@ -# wal2json -- name: wal2json - download by commit sha - git: - repo: https://github.com/eulerto/wal2json.git - dest: /tmp/wal2json - version: "wal2json_{{ wal2json_release }}" - -- name: wal2json - install - make: - chdir: /tmp/wal2json - target: install - become: yes - -- name: wal2json - cleanup - file: - state: absent - path: /tmp/wal2json diff --git a/ansible/tasks/postgres-extensions/12-pljava.yml b/ansible/tasks/postgres-extensions/12-pljava.yml deleted file mode 100644 index bd16d1cec..000000000 --- a/ansible/tasks/postgres-extensions/12-pljava.yml +++ /dev/null @@ -1,84 +0,0 @@ -# pljava -- name: pljava - download & install dependencies - apt: - pkg: - - maven - - default-jre - - default-jdk - - libssl-dev - update_cache: yes - install_recommends: no - -#TODO: revert to using main repo after PG15 support is merged: https://github.com/tada/pljava/pull/413 -# - name: pljava - download latest release -# get_url: -# url: https://github.com/tada/pljava/archive/V{{ pljava_release }}.tar.gz -# dest: /tmp/pljava-{{ pljava_release }}.tar.gz -# checksum: "{{ pljava_release_checksum }}" -# timeout: 60 - -# - name: pljava - unpack archive -# unarchive: -# remote_src: yes -# src: /tmp/pljava-{{ pljava_release }}.tar.gz -# dest: /tmp -# become: yes - -- name: pljava - download latest release - become: yes - git: - repo: https://github.com/supabase/pljava.git - dest: /tmp/pljava-{{ pljava_release }} - version: "{{ pljava_release }}" - -- name: pljava - build - become: yes - shell: - cmd: mvn -T 1C clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true - chdir: /tmp/pljava-{{ pljava_release }} - -- name: pljava - install - become: yes - shell: - cmd: java -jar pljava-packaging/target/pljava-pg{{ postgresql_major }}.jar - chdir: /tmp/pljava-{{ pljava_release }} - -- name: pljava - remove build dependencies - apt: - pkg: - - maven - - default-jre - - default-jdk - state: absent - -- name: pljava - install headless jdk - apt: - pkg: - - default-jdk-headless - update_cache: yes - install_recommends: no - -- name: Hold jre package - dpkg_selections: - name: default-jre-headless - selection: hold - when: async_mode - -- name: pljava - set pljava.libjvm_location - become: yes - lineinfile: - path: /etc/postgresql/postgresql.conf - state: present - line: pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-{{ platform }}/lib/server/libjvm.so' - -- name: pljava - remove ~/.m2 directory - become: yes - file: - path: ~/.m2 - state: absent - -- name: pljava - cleanup - become: yes - file: - state: absent - path: /tmp/pljava-{{ pljava_release }} diff --git a/ansible/tasks/postgres-extensions/13-plv8.yml b/ansible/tasks/postgres-extensions/13-plv8.yml deleted file mode 100644 index 9f117355e..000000000 --- a/ansible/tasks/postgres-extensions/13-plv8.yml +++ /dev/null @@ -1,73 +0,0 @@ -# plv8 -- name: plv8 - download & install dependencies - apt: - pkg: - - build-essential - - ca-certificates - - curl - - git-core - - gpp - - cpp - - pkg-config - - apt-transport-https - - cmake - - libc++-dev - - libc++abi-dev - - libc++1 - - libglib2.0-dev - - libtinfo5 - - libc++abi1 - - ninja-build - - python - update_cache: yes - install_recommends: no - -- name: plv8 - download latest release - git: - repo: https://github.com/plv8/plv8.git - dest: /tmp/plv8 - version: "v{{ plv8_release }}" - become: yes - -- name: Create a symbolic link - file: - src: /lib/aarch64-linux-gnu/libc++.so.1 - dest: /lib/aarch64-linux-gnu/libc++.so - state: link - when: platform == "arm64" - ignore_errors: yes # not needed for docker build - -- name: plv8 - enable ccache - become: yes - replace: - path: /tmp/plv8/Makefiles/Makefile.docker - regexp: "^GN_ARGS =" - replace: GN_ARGS = cc_wrapper=\"env CCACHE_SLOPPINESS=time_macros ccache\" - -- name: plv8 - build - make: - chdir: /tmp/plv8 - become: yes - when: not async_mode - -- name: plv8 - install - make: - chdir: /tmp/plv8 - target: install - become: yes - when: not async_mode - -- name: plv8 - cleanup - file: - state: absent - path: /tmp/plv8 - when: not async_mode - -- name: plv8 - build - make: - chdir: /tmp/plv8 - become: yes - async: 2000 - poll: 0 - register: plv8_build - when: async_mode diff --git a/ansible/tasks/postgres-extensions/14-pg_plan_filter.yml b/ansible/tasks/postgres-extensions/14-pg_plan_filter.yml deleted file mode 100644 index 0fa099066..000000000 --- a/ansible/tasks/postgres-extensions/14-pg_plan_filter.yml +++ /dev/null @@ -1,23 +0,0 @@ -# pg_plan_filter -- name: pg_plan_filter - download latest release - git: - repo: https://github.com/pgexperts/pg_plan_filter.git - dest: /tmp/pg_plan_filter - version: "{{ pg_plan_filter_release }}" - become: yes - -- name: pg_plan_filter - build - make: - chdir: /tmp/pg_plan_filter - become: yes - -- name: pg_plan_filter - install - make: - chdir: /tmp/pg_plan_filter - target: install - become: yes - -- name: pg_plan_filter - cleanup - file: - state: absent - path: /tmp/pg_plan_filter diff --git a/ansible/tasks/postgres-extensions/15-pg_net.yml b/ansible/tasks/postgres-extensions/15-pg_net.yml deleted file mode 100644 index 260f38d55..000000000 --- a/ansible/tasks/postgres-extensions/15-pg_net.yml +++ /dev/null @@ -1,37 +0,0 @@ -# pg_net -- name: pg_net - download & install dependencies - apt: - pkg: - - libcurl4-gnutls-dev - update_cache: yes - install_recommends: no - -- name: pg_net - download latest release - get_url: - url: "https://github.com/supabase/pg_net/archive/refs/tags/v{{pg_net_release}}.tar.gz" - dest: /tmp/pg_net-{{ pg_net_release }}.tar.gz - checksum: "{{ pg_net_release_checksum }}" - timeout: 60 - -- name: pg_net - unpack archive - unarchive: - remote_src: yes - src: /tmp/pg_net-{{ pg_net_release }}.tar.gz - dest: /tmp - become: yes - -- name: pg_net - build - make: - chdir: /tmp/pg_net-{{ pg_net_release }} - become: yes - -- name: pg_net - install - make: - chdir: /tmp/pg_net-{{ pg_net_release }} - target: install - become: yes - -- name: pg_net - cleanup - file: - state: absent - path: /tmp/pg_net-{{ pg_net_release }} diff --git a/ansible/tasks/postgres-extensions/16-rum.yml b/ansible/tasks/postgres-extensions/16-rum.yml deleted file mode 100644 index f8cca1600..000000000 --- a/ansible/tasks/postgres-extensions/16-rum.yml +++ /dev/null @@ -1,34 +0,0 @@ -# rum -- name: rum - download latest release - get_url: - url: "https://github.com/postgrespro/rum/archive/refs/tags/{{rum_release}}.tar.gz" - dest: /tmp/rum-{{ rum_release }}.tar.gz - checksum: "{{ rum_release_checksum }}" - timeout: 60 - -- name: rum - unpack archive - unarchive: - remote_src: yes - src: /tmp/rum-{{ rum_release }}.tar.gz - dest: /tmp - become: yes - -- name: rum - build - make: - chdir: /tmp/rum-{{ rum_release }} - params: - USE_PGXS: 1 - become: yes - -- name: rum - install - make: - chdir: /tmp/rum-{{ rum_release }} - target: install - params: - USE_PGXS: 1 - become: yes - -- name: rum - cleanup - file: - state: absent - path: /tmp/rum-{{ rum_release }} diff --git a/ansible/tasks/postgres-extensions/17-pg_hashids.yml b/ansible/tasks/postgres-extensions/17-pg_hashids.yml deleted file mode 100644 index 8bd02917d..000000000 --- a/ansible/tasks/postgres-extensions/17-pg_hashids.yml +++ /dev/null @@ -1,22 +0,0 @@ -# pg_hashids -- name: pg_hashids - download from master branch - git: - repo: https://github.com/iCyberon/pg_hashids.git - dest: /tmp/pg_hashids - version: "{{ pg_hashids_release }}" - -- name: pg_hashids - build - make: - chdir: /tmp/pg_hashids - become: yes - -- name: pg_hashids - install - make: - chdir: /tmp/pg_hashids - target: install - become: yes - -- name: pg_hashids - cleanup - file: - state: absent - path: /tmp/pg_hashids diff --git a/ansible/tasks/postgres-extensions/18-pgsodium.yml b/ansible/tasks/postgres-extensions/18-pgsodium.yml deleted file mode 100644 index ed3c8ee09..000000000 --- a/ansible/tasks/postgres-extensions/18-pgsodium.yml +++ /dev/null @@ -1,80 +0,0 @@ -# libsodium and pgsodium -- name: determine postgres bin directory - shell: pg_config --bindir - register: pg_bindir_output -- set_fact: - pg_bindir: "{{ pg_bindir_output.stdout }}" - -- name: libsodium - download libsodium - get_url: - url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/libsodium/libsodium-{{ libsodium_release }}.tar.gz" - dest: /tmp/libsodium-{{ libsodium_release }}.tar.gz - checksum: "{{ libsodium_release_checksum }}" - timeout: 60 - -- name: libsodium - unpack archive - unarchive: - remote_src: yes - src: /tmp/libsodium-{{ libsodium_release }}.tar.gz - dest: /tmp - become: yes - -- name: libsodium - configure - shell: - cmd: ./configure - chdir: /tmp/libsodium-{{ libsodium_release }} - become: yes - -- name: libsodium - build - make: - chdir: /tmp/libsodium-{{ libsodium_release }} - become: yes - -- name: libsodium - install - make: - chdir: /tmp/libsodium-{{ libsodium_release }} - target: install - become: yes - -- name: pgsodium - download pgsodium - get_url: - url: "https://github.com/michelp/pgsodium/archive/refs/tags/v{{ pgsodium_release }}.tar.gz" - dest: /tmp/pgsodium-{{ pgsodium_release }}.tar.gz - checksum: "{{ pgsodium_release_checksum }}" - timeout: 60 - -- name: pgsodium - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgsodium-{{ pgsodium_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgsodium - build - make: - chdir: /tmp/pgsodium-{{ pgsodium_release }} - become: yes - -- name: pgsodium - install - make: - chdir: /tmp/pgsodium-{{ pgsodium_release }} - target: install - become: yes - -- name: pgsodium - set pgsodium.getkey_script - become: yes - lineinfile: - path: /etc/postgresql/postgresql.conf - state: present - # script is expected to be placed by finalization tasks for different target platforms - line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh' - -- name: libsodium - cleanup - file: - state: absent - path: /tmp/libsodium-{{ libsodium_release }} - -- name: pgsodium - cleanup - file: - state: absent - path: /tmp/pgsodium-{{ pgsodium_release }} diff --git a/ansible/tasks/postgres-extensions/19-pg_graphql.yml b/ansible/tasks/postgres-extensions/19-pg_graphql.yml deleted file mode 100644 index 642becdb6..000000000 --- a/ansible/tasks/postgres-extensions/19-pg_graphql.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: install pg_graphql - ansible.builtin.apt: - deb: "https://github.com/supabase/pg_graphql/releases/download/v{{ pg_graphql_release }}/pg_graphql-v{{ pg_graphql_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb" diff --git a/ansible/tasks/postgres-extensions/20-pg_stat_monitor.yml b/ansible/tasks/postgres-extensions/20-pg_stat_monitor.yml deleted file mode 100644 index bffddefc3..000000000 --- a/ansible/tasks/postgres-extensions/20-pg_stat_monitor.yml +++ /dev/null @@ -1,23 +0,0 @@ -# pg_stat_monitor -- name: pg_stat_monitor - download and install dependencies - git: - repo: https://github.com/percona/pg_stat_monitor.git - dest: /tmp/pg_stat_monitor - version: "{{ pg_stat_monitor_release }}" - become: yes - -- name: pg_stat_monitor build - make: - chdir: /tmp/pg_stat_monitor - params: USE_PGXS=1 - -- name: pg_stat_monitor install - make: - chdir: /tmp/pg_stat_monitor - target: install - params: USE_PGXS=1 - -- name: pg_stat_monitor cleanup - file: - state: absent - path: /tmp/pg_stat_monitor diff --git a/ansible/tasks/postgres-extensions/22-pg_jsonschema.yml b/ansible/tasks/postgres-extensions/22-pg_jsonschema.yml deleted file mode 100644 index fc71ab8ed..000000000 --- a/ansible/tasks/postgres-extensions/22-pg_jsonschema.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: install pg_jsonschema - ansible.builtin.apt: - deb: "https://github.com/supabase/pg_jsonschema/releases/download/v{{ pg_jsonschema_release }}/pg_jsonschema-v{{ pg_jsonschema_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb" diff --git a/ansible/tasks/postgres-extensions/23-vault.yml b/ansible/tasks/postgres-extensions/23-vault.yml deleted file mode 100644 index 1cc76c83a..000000000 --- a/ansible/tasks/postgres-extensions/23-vault.yml +++ /dev/null @@ -1,31 +0,0 @@ -# vault - -- name: vault - download vault - get_url: - url: "https://github.com/supabase/vault/archive/refs/tags/v{{ vault_release }}.tar.gz" - dest: /tmp/vault-{{ vault_release }}.tar.gz - checksum: "{{ vault_release_checksum }}" - timeout: 60 - -- name: vault - unpack archive - unarchive: - remote_src: yes - src: /tmp/vault-{{ vault_release }}.tar.gz - dest: /tmp - become: yes - -- name: vault - build - make: - chdir: /tmp/vault-{{ vault_release }} - become: yes - -- name: vault - install - make: - chdir: /tmp/vault-{{ vault_release }} - target: install - become: yes - -- name: vault - cleanup - file: - state: absent - path: /tmp/vault-{{ vault_release }} diff --git a/ansible/tasks/postgres-extensions/24-pgroonga.yml b/ansible/tasks/postgres-extensions/24-pgroonga.yml deleted file mode 100644 index f8baaa6f9..000000000 --- a/ansible/tasks/postgres-extensions/24-pgroonga.yml +++ /dev/null @@ -1,85 +0,0 @@ -# groonga and pgroonga -- name: groonga - download & install dependencies - apt: - pkg: - - zlib1g-dev - - liblzo2-dev - - libmsgpack-dev - - libzmq3-dev - - libevent-dev - - libmecab-dev - - mecab-naist-jdic - update_cache: yes - install_recommends: no - -- name: groonga - download groonga - get_url: - url: "https://packages.groonga.org/source/groonga/groonga-{{ groonga_release }}.tar.gz" - dest: /tmp/groonga-{{ groonga_release }}.tar.gz - checksum: "{{ groonga_release_checksum }}" - timeout: 60 - -- name: groonga - unpack archive - unarchive: - remote_src: yes - src: /tmp/groonga-{{ groonga_release }}.tar.gz - dest: /tmp - become: yes - -- name: groonga - configure - shell: - cmd: ./configure - chdir: /tmp/groonga-{{ groonga_release }} - become: yes - -- name: groonga - build - community.general.make: - target: all - chdir: /tmp/groonga-{{ groonga_release }} - jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: groonga - install - make: - chdir: /tmp/groonga-{{ groonga_release }} - target: install - become: yes - -- name: pgroonga - download pgroonga - get_url: - url: "https://packages.groonga.org/source/pgroonga/pgroonga-{{ pgroonga_release }}.tar.gz" - dest: /tmp/pgroonga-{{ pgroonga_release }}.tar.gz - checksum: "{{ pgroonga_release_checksum }}" - timeout: 60 - -- name: pgroonga - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgroonga-{{ pgroonga_release }}.tar.gz - dest: /tmp - become: yes - -- name: pgroonga - build - community.general.make: - target: all - chdir: /tmp/pgroonga-{{ pgroonga_release }} - jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: pgroonga - install - make: - chdir: /tmp/pgroonga-{{ pgroonga_release }} - target: install - become: yes - -- name: groonga - cleanup - file: - state: absent - path: /tmp/groonga-{{ groonga_release }} - become: yes - -- name: pgroonga - cleanup - file: - state: absent - path: /tmp/pgroonga-{{ pgroonga_release }} - become: yes diff --git a/ansible/tasks/postgres-extensions/25-wrappers.yml b/ansible/tasks/postgres-extensions/25-wrappers.yml deleted file mode 100644 index 717fa5ce8..000000000 --- a/ansible/tasks/postgres-extensions/25-wrappers.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: install wrappers - ansible.builtin.apt: - deb: "https://github.com/supabase/wrappers/releases/download/v{{ wrappers_release }}/wrappers-v{{ wrappers_release }}-pg{{ postgresql_major }}-{{ platform }}-linux-gnu.deb" diff --git a/ansible/tasks/postgres-extensions/26-hypopg.yml b/ansible/tasks/postgres-extensions/26-hypopg.yml deleted file mode 100644 index 4a9afcf7c..000000000 --- a/ansible/tasks/postgres-extensions/26-hypopg.yml +++ /dev/null @@ -1,17 +0,0 @@ -# hypopg -- name: hypopg - download by commit sha - git: - repo: https://github.com/HypoPG/hypopg.git - dest: /tmp/hypopg - version: "{{ hypopg_release }}" - -- name: hypopg - install - make: - chdir: /tmp/hypopg - target: install - become: yes - -- name: hypopg - cleanup - file: - state: absent - path: /tmp/hypopg diff --git a/ansible/tasks/postgres-extensions/27-pg_repack.yml b/ansible/tasks/postgres-extensions/27-pg_repack.yml deleted file mode 100644 index 81ca80160..000000000 --- a/ansible/tasks/postgres-extensions/27-pg_repack.yml +++ /dev/null @@ -1,38 +0,0 @@ -# pg_repack - - name: pg_repack - download & install dependencies - apt: - pkg: - - liblz4-dev - - libz-dev - - libzstd-dev - - libreadline-dev - update_cache: yes - install_recommends: no - - - name: pg_repack - download latest release - git: - repo: https://github.com/reorg/pg_repack.git - dest: /tmp/pg_repack - version: "ver_{{ pg_repack_release }}" - become: yes - - - name: pg_repack - build - make: - chdir: /tmp/pg_repack - params: - USE_PGXS: 1 - become: yes - - - name: pg_repack - install - make: - chdir: /tmp/pg_repack - target: install - params: - USE_PGXS: 1 - become: yes - - - name: pg_repack - cleanup - file: - state: absent - path: /tmp/pg_repack - diff --git a/ansible/tasks/postgres-extensions/28-pgvector.yml b/ansible/tasks/postgres-extensions/28-pgvector.yml deleted file mode 100644 index a673ab2a2..000000000 --- a/ansible/tasks/postgres-extensions/28-pgvector.yml +++ /dev/null @@ -1,23 +0,0 @@ -# pgvector -- name: pgvector - download latest release - git: - repo: https://github.com/pgvector/pgvector.git - dest: /tmp/pgvector - version: 'v{{ pgvector_release }}' - become: yes - -- name: pgvector - build - make: - chdir: /tmp/pgvector - become: yes - -- name: pgvector - install - make: - chdir: /tmp/pgvector - target: install - become: yes - -- name: pgvector - cleanup - file: - state: absent - path: /tmp/pgvector diff --git a/ansible/tasks/postgres-extensions/29-pg_tle.yml b/ansible/tasks/postgres-extensions/29-pg_tle.yml deleted file mode 100644 index ea0b199e1..000000000 --- a/ansible/tasks/postgres-extensions/29-pg_tle.yml +++ /dev/null @@ -1,12 +0,0 @@ -# pg_tle -- name: pg_tle - download - git: - repo: https://github.com/aws/pg_tle.git - dest: /tmp/pg_tle - version: v{{ pg_tle_release }} - -- name: pg_tle - install - make: - chdir: /tmp/pg_tle - target: install - become: yes diff --git a/ansible/tasks/postgres-extensions/99-finish_async_tasks.yml b/ansible/tasks/postgres-extensions/99-finish_async_tasks.yml deleted file mode 100644 index 2e0609ba0..000000000 --- a/ansible/tasks/postgres-extensions/99-finish_async_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -## Verify plv8 status and complete plv8-install -- name: Check if plv8 is complete - async_status: - jid: "{{ plv8_build.ansible_job_id }}" - register: job_result - until: job_result.finished - delay: 60 - retries: 60 - -- name: plv8 - install - make: - chdir: /tmp/plv8 - target: install - become: yes - -- name: plv8 - cleanup - file: - state: absent - path: /tmp/plv8 diff --git a/ansible/vars.yml b/ansible/vars.yml index 617fa93a9..fc39cb507 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -47,9 +47,6 @@ nginx_release_checksum: sha1:419efb77b80f165666e2ee406ad8ae9b845aba93 wal_g_release: "2.0.1" -sfcgal_release: "1.3.10" -sfcgal_release_checksum: sha256:4e39b3b2adada6254a7bdba6d297bb28e1a9835a9f879b74f37e2dab70203232 - postgres_exporter_release: "0.15.0" postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 @@ -58,100 +55,5 @@ postgres_exporter_release_checksum: adminapi_release: 0.74.0 adminmgr_release: 0.24.1 -# Postgres Extensions -postgis_release: "3.3.2" -postgis_release_checksum: sha256:9a2a219da005a1730a39d1959a1c7cec619b1efb009b65be80ffc25bad299068 - -pgrouting_release: "3.4.1" -pgrouting_release_checksum: sha256:a4e034efee8cf67582b67033d9c3ff714a09d8f5425339624879df50aff3f642 - -pgtap_release: "1.2.0" -pgtap_release_checksum: sha256:9c7c3de67ea41638e14f06da5da57bac6f5bd03fea05c165a0ec862205a5c052 - -pg_cron_release: "1.6.2" -pg_cron_release_checksum: sha256:9f4eb3193733c6fa93a6591406659aac54b82c24a5d91ffaf4ec243f717d94a0 - -pgaudit_release: "1.7.0" -pgaudit_release_checksum: sha256:8f4a73e451c88c567e516e6cba7dc1e23bc91686bb6f1f77f8f3126d428a8bd8 - -pgjwt_release: 9742dab1b2f297ad3811120db7b21451bca2d3c9 - -pgsql_http_release: "1.6.1" - -plpgsql_check_release: "2.2.5" -plpgsql_check_release_checksum: sha256:6c3a3c5faf3f9689425c6db8a6b20bf4cd5e7144a055e29538eae980c7232573 - -pg_safeupdate_release: "1.4" -pg_safeupdate_release_checksum: sha256:ff01d3d444d35924bd3d745c5695696292e2855042da4c30fe728fb3b6648122 - -timescaledb_release: "2.9.1" -timescaledb_release_checksum: sha256:883638f2e79d25ec88ee58f603f3c81c999b6364cb4c799919d363f04089b47b - -wal2json_release: "2_5" -wal2json_release_checksum: sha256:b516653575541cf221b99cf3f8be9b6821f6dbcfc125675c85f35090f824f00e - -supautils_release: "2.6.0" -supautils_release_arm64_deb_checksum: sha256:b83f0777e506e310e33af4dafa8ae130b1b0e2871d6099234b332bfb33a5466f -supautils_release_amd64_deb_checksum: sha256:709d6cf4939031998b9392d435ad113564fb42c4c77e81e5035106840f8a74e0 -supautils_release_tar_checksum: sha256:b1cf964d1c56f45120d4724bfaf258cc7c0caccb30d8bde20bcda088a5990718 - -pljava_release: master -pljava_release_checksum: sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6 - -plv8_release: "3.1.5" -plv8_release_checksum: sha256:2edf9a219844b2b6abae09c0bdb840c5b0d6e3dd418631744c7326c0b107cc10 - -pg_plan_filter_release: 5081a7b5cb890876e67d8e7486b6a64c38c9a492 - -pg_net_release: "0.9.2" -# To obtain the checksum use `wget https://github.com/supabase/pg_net/archive/refs/tags/v0.9.2.tar.gz -q -O- | sha256sum` -pg_net_release_checksum: sha256:268c87c09ccd26e6566d2522cb02ba7918b4cbda37eb5076d2e790bbd994a087 - -rum_release: "1.3.13" -rum_release_checksum: sha256:6ab370532c965568df6210bd844ac6ba649f53055e48243525b0b7e5c4d69a7d - -pg_hashids_release: cd0e1b31d52b394a0df64079406a14a4f7387cd6 - vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" - -libsodium_release: "1.0.18" -libsodium_release_checksum: sha256:6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1 - -pgsodium_release: "3.1.8" -pgsodium_release_checksum: sha256:4d027aeee5163f3f33740d269938a120d1593a41c3701c920d2a1de80aa97486 - -pg_graphql_release: "1.5.7" - -pg_jsonschema_release: "0.2.0" - -pg_stat_monitor_release: "1.1.1" -pg_stat_monitor_release_checksum: sha256:1756a02d5a6dd66b892d15920257c69a17a67d48d3d4e2f189b681b83001ec2a - -vault_release: "0.2.9" -vault_release_checksum: sha256:1e813216395c59bb94c92be47ce8b70ba19ccc0efbcdb1fb14ed6d34a42c6cdb - -groonga_release: "13.0.1" -groonga_release_checksum: sha256:1c2d1a6981c1ad3f02a11aff202b15ba30cb1c6147f1fa9195b519a2b728f8ba - -pgroonga_release: "3.0.7" -pgroonga_release_checksum: sha256:885ff3878cc30e9030e5fc56d561bc8b66df3ede1562c9d802bc0ea04fe5c203 - -wrappers_release: "0.4.4" - -hypopg_release: "1.4.1" -hypopg_release_checksum: sha256:9afe6357fd389d8d33fad81703038ce520b09275ec00153c6c89282bcdedd6bc - -pg_repack_release: "1.5.0" -pg_repack_release_checksum: sha256:9a14d6a95bfa29f856aa10538238622c1f351d38eb350b196c06720a878ccc52 - -pgvector_release: "0.8.0" -pgvector_release_checksum: sha256:867a2c328d4928a5a9d6f052cd3bc78c7d60228a9b914ad32aa3db88e9de27b0 - -pg_tle_release: "1.3.2" -pg_tle_release_checksum: sha256:d04f72d88b21b954656609743560684ac42645b64a36c800d4d2f84d1f180de1 - -index_advisor_release: "0.2.0" -index_advisor_checksum: sha256:2d3642012a9185cda51f1e82ba43d64a81b24a2655a3ac3afdcbbd95d46a1a27 - -pg_backtrace_release: "1.1" diff --git a/common.vars.pkr.hcl b/common.vars.pkr.hcl deleted file mode 100644 index 871647b06..000000000 --- a/common.vars.pkr.hcl +++ /dev/null @@ -1 +0,0 @@ -postgres-version = "15.1.1.95" diff --git a/digitalOcean.json b/digitalOcean.json deleted file mode 100644 index 36396fc29..000000000 --- a/digitalOcean.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "variables": { - "do_token": "", - "image_name": "ubuntu-20-04-x64", - "region": "sgp1", - "snapshot_regions": "sgp1", - "snapshot_name": "supabase-postgres-13.3.0", - "ansible_arguments": "--skip-tags,update-only,--skip-tags,aws-only,-e,supabase_internal='false'" - }, - "builders": [ - { - "type": "digitalocean", - "api_token": "{{user `do_token`}}", - "image": "{{user `image_name`}}", - "region": "{{user `region`}}", - "snapshot_regions": "{{user `snapshot_regions`}}", - "size": "s-1vcpu-1gb", - "ssh_username": "root", - "snapshot_name": "{{user `snapshot_name`}}" - } - ], - "provisioners": [ - { - "type": "shell", - "inline": [ - "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done" - ] - }, - { - "type": "ansible", - "user": "root", - "playbook_file": "ansible/playbook.yml", - "extra_arguments": "{{user `ansible_arguments`}}" - }, - { - "type": "shell", - "scripts": [ - "scripts/01-postgres_check.sh", - "scripts/90-cleanup.sh", - "scripts/91-log_cleanup.sh", - "scripts/99-img_check.sh" - ] - } - ] -} diff --git a/docker/all-in-one/Dockerfile b/docker/all-in-one/Dockerfile deleted file mode 100644 index ec0c51637..000000000 --- a/docker/all-in-one/Dockerfile +++ /dev/null @@ -1,317 +0,0 @@ -ARG postgres_version=15.1.1.49 - -ARG pgbouncer_release=1.18.0 -ARG postgrest_release=10.1.2 -ARG gotrue_release=2.130.0 -ARG adminapi_release=0.64.1 -ARG adminmgr_release=0.22.1 -ARG vector_release=0.22.3 -ARG postgres_exporter_release=0.15.0 -ARG envoy_release=1.28.0 - -# Update `gateway-28` in the URL below if upgrading above v2.8.x. -ARG kong_release=2.8.1 - -FROM supabase/postgres:${postgres_version} as base -ARG TARGETARCH -ARG postgresql_major - -FROM base as builder -# Install build dependencies -RUN apt-get update && apt-get install -y \ - postgresql-server-dev-${postgresql_major} \ - build-essential \ - checkinstall \ - pkg-config \ - cmake \ - && rm -rf /var/lib/apt/lists/* - -#################### -# Install pgbouncer -#################### -FROM builder as pgbouncer-source -# Download and extract -ARG pgbouncer_release -ADD "https://www.pgbouncer.org/downloads/files/${pgbouncer_release}/pgbouncer-${pgbouncer_release}.tar.gz" /tmp/pgbouncer.tar.gz -RUN tar -xvf /tmp/pgbouncer.tar.gz -C /tmp && \ - rm -rf /tmp/pgbouncer.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y \ - libevent-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgbouncer-${pgbouncer_release} -RUN ./configure --prefix=/usr/local -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libevent-2.1-7 --nodoc - -FROM base as pgbouncer -# Download pre-built packages -RUN apt-get update && apt-get install -y --no-install-recommends --download-only \ - pgbouncer \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# Install PostgREST -#################### -FROM postgrest/postgrest:v${postgrest_release} as pgrst - -#################### -# Install GoTrue -#################### -FROM supabase/gotrue:v${gotrue_release} as gotrue - -#################### -# Install Envoy -#################### -FROM envoyproxy/envoy:v${envoy_release} as envoy - -#################### -# Install Kong -#################### -FROM base as kong -ARG kong_release -ADD "https://packages.konghq.com/public/gateway-28/deb/ubuntu/pool/focal/main/k/ko/kong_${kong_release}/kong_${kong_release}_${TARGETARCH}.deb" \ - /tmp/kong.deb - -#################### -# Install admin api -#################### -FROM base as adminapi -ARG adminapi_release -ADD "https://supabase-public-artifacts-bucket.s3.amazonaws.com/supabase-admin-api/v${adminapi_release}/supabase-admin-api_${adminapi_release}_linux_${TARGETARCH}.tar.gz" /tmp/supabase-admin-api.tar.gz -RUN tar -xvf /tmp/supabase-admin-api.tar.gz -C /tmp && \ - rm -rf /tmp/supabase-admin-api.tar.gz - -#################### -# Install admin mgr -#################### -FROM base as adminmgr -ARG adminmgr_release -ADD "https://supabase-public-artifacts-bucket.s3.amazonaws.com/admin-mgr/v${adminmgr_release}/admin-mgr_${adminmgr_release}_linux_${TARGETARCH}.tar.gz" /tmp/admin-mgr.tar.gz -RUN tar -xvf /tmp/admin-mgr.tar.gz -C /tmp && \ - rm -rf /tmp/admin-mgr.tar.gz - -#################### -# Install Prometheus Exporter -#################### -FROM base as exporter -ARG postgres_exporter_release -ADD "https://github.com/prometheus-community/postgres_exporter/releases/download/v${postgres_exporter_release}/postgres_exporter-${postgres_exporter_release}.linux-${TARGETARCH}.tar.gz" /tmp/postgres_exporter.tar.gz -RUN tar -xvf /tmp/postgres_exporter.tar.gz -C /tmp --strip-components 1 && \ - rm -rf /tmp/postgres_exporter.tar.gz - -#################### -# Install vector -#################### -FROM base as vector -ARG vector_release -ADD "https://packages.timber.io/vector/${vector_release}/vector_${vector_release}-1_${TARGETARCH}.deb" /tmp/vector.deb - -#################### -# Install supervisord -#################### -FROM base as supervisor -# Download pre-built packages -RUN apt-get update -y && apt-get install -y --no-install-recommends --download-only \ - supervisor \ - && rm -rf /var/lib/apt/lists/* -RUN mv /var/cache/apt/archives/*.deb /tmp/ - -#################### -# Create the final image for production -#################### -FROM base as production - -# Copy dependencies from previous build stages -COPY --from=pgbouncer /tmp/*.deb /tmp/ -COPY --from=vector /tmp/*.deb /tmp/ -COPY --from=kong /tmp/*.deb /tmp/ -COPY --from=supervisor /tmp/*.deb /tmp/ - -# Install runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - /tmp/*.deb \ - # For health check - curl \ - # For parsing init payload - jq \ - # Security tools - fail2ban \ - # sudo - sudo \ - vim-tiny \ - less \ - libnuma1 \ - logrotate \ - dumb-init \ - # pg_egress_collect deps - tcpdump libio-async-perl \ - && rm -rf /var/lib/apt/lists/* /tmp/* \ - && mkdir -p /dist \ - && mkdir -p /data/opt && chmod go+rwx /data/opt - -#################### -# Install salt -#################### -ENV DEBIAN_FRONTEND=noninteractive -ENV SALT_VERSION=3006 - -# Install one-dir salt -RUN cat < /etc/apt/preferences.d/salt-pin-1001 -Package: salt-* -Pin: version ${SALT_VERSION}.* -Pin-Priority: 1001 -EOF - -RUN mkdir /etc/apt/keyrings \ - && curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring.pgp https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public \ - && curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources > /etc/apt/sources.list.d/salt.sources \ - && apt-get clean && apt-get update && apt-get install -y salt-minion - -ADD docker/all-in-one/etc/salt/minion /etc/salt/minion - - -# Copy single binary dependencies -COPY --from=pgrst /bin/postgrest /dist/ -COPY --from=gotrue /usr/local/bin/auth /dist/gotrue -COPY --from=gotrue /usr/local/etc/auth /opt/gotrue/ -COPY --from=envoy /usr/local/bin/envoy /dist/ -COPY --from=adminapi /tmp/supabase-admin-api /dist/ -COPY --chown=root:root --from=adminmgr /tmp/admin-mgr /dist/ -COPY --from=exporter /tmp/postgres_exporter /opt/postgres_exporter/ -COPY docker/all-in-one/opt/postgres_exporter /opt/postgres_exporter/ - -# Configuring dangling symlinks for binaries -RUN ln -s /data/opt/supabase-admin-api /opt/supabase-admin-api \ - && ln -s /data/opt/postgrest /opt/postgrest \ - && ln -s /data/opt/gotrue /opt/gotrue/gotrue \ - && ln -s /data/opt/admin-mgr /usr/bin/admin-mgr - -# Scripts for adminapi -COPY ansible/files/admin_api_scripts /root -COPY --chown=adminapi:adminapi docker/all-in-one/etc/adminapi /etc/adminapi -COPY --chmod=644 docker/all-in-one/etc/sudoers.d /etc/sudoers.d/ - -# Script for pg_egress_collect -COPY --chown=adminapi:adminapi docker/all-in-one/opt/pg_egress_collect /opt/pg_egress_collect - -# Customizations for pgbouncer -COPY docker/all-in-one/etc/pgbouncer /etc/pgbouncer -COPY docker/all-in-one/etc/pgbouncer-custom /etc/pgbouncer-custom -COPY docker/all-in-one/etc/tmpfiles.d /etc/tmpfiles.d - -# Customizations for postgres -COPY --chown=postgres:postgres docker/all-in-one/etc/postgresql/pg_hba.conf /etc/postgresql/ -COPY --chown=postgres:postgres docker/all-in-one/etc/postgresql/logging.conf /etc/postgresql/ -COPY --chown=postgres:postgres docker/all-in-one/etc/postgresql-custom /etc/postgresql-custom -COPY --chown=postgres:postgres docker/all-in-one/etc/postgresql.schema.sql /etc/postgresql.schema.sql - -# Customizations for postgres_exporter -COPY --chown=postgres:postgres docker/all-in-one/opt/postgres_exporter/queries.yml /opt/postgres_exporter/queries.yml - -# Customizations for fail2ban -COPY docker/all-in-one/etc/fail2ban/filter.d /etc/fail2ban/filter.d/ -COPY docker/all-in-one/etc/fail2ban/jail.d /etc/fail2ban/jail.d/ - -# Customizations for postgrest -COPY --chown=postgrest:postgrest docker/all-in-one/etc/postgrest/bootstrap.sh /etc/postgrest/bootstrap.sh -COPY --chown=postgrest:postgrest docker/all-in-one/etc/postgrest/base.conf /etc/postgrest/base.conf -COPY --chown=postgrest:postgrest docker/all-in-one/etc/postgrest/generated.conf /etc/postgrest/generated.conf - -# Customizations for logrotate -COPY docker/all-in-one/etc/logrotate.d/walg.conf /etc/logrotate.d/walg.conf -COPY docker/all-in-one/etc/logrotate.d/postgresql.conf /etc/logrotate.d/postgresql.conf - -# Customizations for gotrue -COPY docker/all-in-one/etc/gotrue.env /etc/gotrue.env - -# Customizations for envoy -ARG envoy_release -ARG envoy_lds="lds.yaml" -ADD --chmod=755 --chown=envoy:envoy "https://raw.githubusercontent.com/envoyproxy/envoy/v${envoy_release}/restarter/hot-restarter.py" /opt/envoy-hot-restarter.py -COPY --chmod=775 --chown=envoy:envoy ansible/files/envoy_config/ /etc/envoy/ -COPY --chmod=755 --chown=envoy:envoy ansible/files/start-envoy.sh /opt/ -RUN mv /etc/envoy/${envoy_lds} /etc/envoy/lds.yaml -RUN rm -f /etc/envoy/lds.supabase.yaml - -# Customizations for kong -COPY docker/all-in-one/etc/kong/kong.conf /etc/kong/kong.conf -COPY docker/all-in-one/etc/kong/kong.yml /etc/kong/kong.yml - -# Customizations for vector -COPY --chown=vector:vector docker/all-in-one/etc/vector/vector.yaml /etc/vector/vector.yaml - -# Customizations for supervisor -COPY docker/all-in-one/etc/supervisor /etc/supervisor - -# Customizations for supa-shutdown -COPY --chown=adminapi:adminapi docker/all-in-one/etc/supa-shutdown /etc/supa-shutdown -COPY docker/all-in-one/configure-shim.sh /usr/local/bin/configure-shim.sh - -# Configure service ports -ENV PGRST_SERVER_PORT=3000 -ENV PGRST_ADMIN_SERVER_PORT=3001 -EXPOSE ${PGRST_SERVER_PORT} - -ENV GOTRUE_SITE_URL=http://localhost:${PGRST_SERVER_PORT} -ENV GOTRUE_API_PORT=9999 -EXPOSE ${GOTRUE_API_PORT} - -ENV ENVOY_HTTP_PORT=8000 -ENV ENVOY_HTTPS_PORT=8443 - -ENV KONG_HTTP_PORT=8000 -ENV KONG_HTTPS_PORT=8443 - -ENV HTTP_PORT=${ENVOY_HTTP_PORT:-KONG_HTTP_PORT} -ENV HTTP_PORT=${ENVOY_HTTPS_PORT:-KONG_HTTPS_PORT} -EXPOSE ${HTTP_PORT} ${HTTPS_PORT} - -ENV ADMIN_API_CERT_DIR=/etc/ssl/adminapi -ENV ADMIN_API_PORT=8085 -EXPOSE ${ADMIN_API_PORT} - -ENV PGBOUNCER_PORT=6543 -EXPOSE ${PGBOUNCER_PORT} - -ENV PGEXPORTER_PORT=9187 -EXPOSE ${PGEXPORTER_PORT} - -ENV VECTOR_API_PORT=9001 - -# Create system users -RUN useradd --create-home --shell /bin/bash postgrest && \ - useradd --create-home --shell /bin/bash gotrue && \ - useradd --create-home --shell /bin/bash envoy && \ - useradd --create-home --shell /bin/bash pgbouncer -G postgres,ssl-cert && \ - useradd --create-home --shell /bin/bash adminapi -G root,envoy,kong,pgbouncer,postgres,postgrest,wal-g && \ - usermod --append --shell /bin/bash -G postgres vector -RUN mkdir -p /etc/wal-g && \ - chown -R adminapi:adminapi /etc/wal-g && \ - chmod g+w /etc/wal-g -RUN mkdir -p /var/log/wal-g \ - && chown -R postgres:postgres /var/log/wal-g \ - && chmod +x /dist/admin-mgr \ - && chmod ug+s /dist/admin-mgr \ - && touch /etc/wal-g/config.json \ - && chown adminapi:adminapi /etc/wal-g/config.json \ - && echo '{"WALG_S3_PREFIX": "s3://foo/bar/"}' > /etc/wal-g/config.json -RUN chown -R adminapi:adminapi /etc/adminapi -RUN sed -i "s;#include = '/etc/postgresql-custom/generated-optimizations.conf';include = '/etc/postgresql-custom/generated-optimizations.conf';" /etc/postgresql/postgresql.conf - -# Add healthcheck and entrypoint scripts -COPY docker/all-in-one/healthcheck.sh /usr/local/bin/ -HEALTHCHECK --interval=3s --timeout=2s --start-period=4s --retries=10 CMD [ "healthcheck.sh" ] - -COPY docker/all-in-one/init /init -COPY docker/all-in-one/entrypoint.sh /usr/local/bin/ -COPY docker/all-in-one/postgres-entrypoint.sh /usr/local/bin/ -COPY docker/all-in-one/shutdown.sh /usr/local/bin/supa-shutdown.sh -COPY docker/all-in-one/run-logrotate.sh /usr/local/bin/run-logrotate.sh - -ENTRYPOINT [ "/usr/bin/dumb-init" ] - -CMD [ "entrypoint.sh"] diff --git a/docker/all-in-one/README.md b/docker/all-in-one/README.md deleted file mode 100644 index 72e120009..000000000 --- a/docker/all-in-one/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Supabase All-in-One - -All Supabase backend services bundled in a single Docker image for quick local testing and edge deployment. - -## Build - -```bash -# cwd: repo root -docker build -f docker/all-in-one/Dockerfile -t supabase/all-in-one . -``` - -## Run - -```bash -docker run --rm -it \ - -e POSTGRES_PASSWORD=postgres \ - -e JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long \ - -e ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE \ - -e SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q \ - -e ADMIN_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic3VwYWJhc2VfYWRtaW4iLCJpc3MiOiJzdXBhYmFzZS1kZW1vIiwiaWF0IjoxNjQxNzY5MjAwLCJleHAiOjE3OTk1MzU2MDB9.Y9mSNVuTw2TdfryoaqM5wySvwQemGGWfSe9ixcklVfM \ - -e DATA_VOLUME_MOUNTPOINT=/data \ - -e MACHINE_TYPE=shared_cpu_1x_512m \ - -p 5432:5432 \ - -p 8000:8000 \ - supabase/all-in-one -``` - -Use bind mount to start from an existing physical backup: `-v $(pwd)/data:/var/lib/postgresql/data` - -Alternatively, the container may be initialised using a payload tarball. - -```bash -docker run --rm \ - -e POSTGRES_PASSWORD=postgres \ - -e INIT_PAYLOAD_PRESIGNED_URL= \ - -p 5432:5432 \ - -p 8000:8000 \ - -it supabase/all-in-one -``` - -## Test - -```bash -curl -H "apikey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE" \ - localhost:8000/rest/v1/ | jq -``` - -## TODO - -- [x] optimise admin config -- [x] propagate shutdown signals -- [x] add http health checks -- [x] generate dynamic JWT -- [ ] ufw / nftables -- [x] log rotation -- [x] egress metrics -- [x] vector -- [ ] apparmor -- [x] wal-g diff --git a/docker/all-in-one/configure-shim.sh b/docker/all-in-one/configure-shim.sh deleted file mode 100755 index f42f1557a..000000000 --- a/docker/all-in-one/configure-shim.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -INITIAL_BINARY_PATH=$1 -SYMLINK_PATH=$2 - -SYMLINK_TARGET=$(readlink -m "$SYMLINK_PATH") - -if [ ! -f "$SYMLINK_TARGET" ]; then - cp "$INITIAL_BINARY_PATH" "$SYMLINK_TARGET" - - PERMS=$(stat -c "%a" "$INITIAL_BINARY_PATH") - chmod "$PERMS" "$SYMLINK_TARGET" - - OWNER_GROUP=$(stat -c "%u:%g" "$INITIAL_BINARY_PATH") - chown "$OWNER_GROUP" "$SYMLINK_TARGET" -fi diff --git a/docker/all-in-one/entrypoint.sh b/docker/all-in-one/entrypoint.sh deleted file mode 100755 index 0aff0b1ec..000000000 --- a/docker/all-in-one/entrypoint.sh +++ /dev/null @@ -1,366 +0,0 @@ -#!/bin/bash -set -eou pipefail - -START_TIME=$(date +%s%N) - -PG_CONF=/etc/postgresql/postgresql.conf -SUPERVISOR_CONF=/etc/supervisor/supervisord.conf - -export DATA_VOLUME_MOUNTPOINT=${DATA_VOLUME_MOUNTPOINT:-/data} -export CONFIGURED_FLAG_PATH=${CONFIGURED_FLAG_PATH:-$DATA_VOLUME_MOUNTPOINT/machine.configured} - -export MAX_IDLE_TIME_MINUTES=${MAX_IDLE_TIME_MINUTES:-5} - -function calculate_duration { - local start_time=$1 - local end_time=$2 - - local duration=$((end_time - start_time)) - local milliseconds=$((duration / 1000000)) - - echo "$milliseconds" -} - -# Ref: https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746 -function retry { - # Pass 0 for unlimited retries - local retries=$1 - shift - - local start=$EPOCHSECONDS - local count=0 - until "$@"; do - exit=$? - # Reset count if service has been running for more than 2 minutes - local elapsed=$((EPOCHSECONDS - start)) - if [ $elapsed -gt 120 ]; then - count=0 - fi - # Exponential backoff up to n tries - local wait=$((2 ** count)) - count=$((count + 1)) - if [ $count -ge "$retries" ] && [ "$retries" -gt 0 ]; then - echo "Retry $count/$retries exited $exit, no more retries left." - return $exit - fi - echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." - sleep $wait - start=$EPOCHSECONDS - done - return 0 -} - -function configure_services { - # Start services after migrations are run - for file in /init/configure-*.sh; do - retry 0 "$file" - done -} - -function enable_swap { - fallocate -l 1G /mnt/swapfile - chmod 600 /mnt/swapfile - mkswap /mnt/swapfile - swapon /mnt/swapfile -} - -function push_lsn_checkpoint_file { - if [ "${PLATFORM_DEPLOYMENT:-}" != "true" ]; then - echo "Skipping push of LSN checkpoint file" - return - fi - - /usr/bin/admin-mgr lsn-checkpoint-push --immediately || echo "Failed to push LSN checkpoint" -} - -function graceful_shutdown { - echo "$(date): Received SIGINT. Shutting down." - - # Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation - # This is to ensure that the WAL file is shipped, just in case - sleep 0.2 - push_lsn_checkpoint_file -} - -function enable_autoshutdown { - sed -i "s/autostart=.*/autostart=true/" /etc/supervisor/base-services/supa-shutdown.conf -} - -function enable_lsn_checkpoint_push { - sed -i "s/autostart=.*/autostart=true/" /etc/supervisor/base-services/lsn-checkpoint-push.conf - sed -i "s/autorestart=.*/autorestart=true/" /etc/supervisor/base-services/lsn-checkpoint-push.conf -} - -function disable_fail2ban { - sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/fail2ban.conf - sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/fail2ban.conf -} - -function setup_postgres { - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgresql.schema.sql - mv /etc/postgresql.schema.sql /docker-entrypoint-initdb.d/migrations/99-schema.sql - - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgresql-custom/pgsodium_root.key - sed -i "/# Automatically generated optimizations/i # Supabase Platform Defaults\ninclude = '/etc/postgresql-custom/platform-defaults.conf'\n" $PG_CONF - - # TODO (darora): walg enablement is temporarily performed here until changes from https://github.com/supabase/postgres/pull/639 get picked up - # other things will still be needed in the future (auth_delay config) - sed -i \ - -e "s|#include = '/etc/postgresql-custom/custom-overrides.conf'|include = '/etc/postgresql-custom/custom-overrides.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" \ - -e "s|shared_preload_libraries = '\(.*\)'|shared_preload_libraries = '\1, auth_delay'|" \ - -e "/# Automatically generated optimizations/i auth_delay.milliseconds = '3000'" \ - "${PG_CONF}" - - # Setup ssl certs - mkdir -p /etc/ssl/certs/postgres - tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/ssl/certs/postgres/ --strip-components 2 ./ssl/server.crt - tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/ssl/certs/postgres/ --strip-components 2 ./ssl/ca.crt - tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/ssl/private/ --strip-components 2 ./ssl/server.key - # tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/ssl/certs/postgres/ ./ssl/server-intermediate.srl - - PGSSLROOTCERT=/etc/ssl/certs/postgres/ca.crt - PGSSLCERT=/etc/ssl/certs/postgres/server.crt - PGSSLKEY=/etc/ssl/private/server.key - chown root:postgres $PGSSLROOTCERT $PGSSLKEY $PGSSLCERT - chmod 640 $PGSSLROOTCERT $PGSSLKEY $PGSSLCERT - - # Change ssl back to on in postgres.conf - sed -i -e "s|ssl = off|ssl = on|g" \ - -e "s|ssl_ca_file = ''|ssl_ca_file = '$PGSSLROOTCERT'|g" \ - -e "s|ssl_cert_file = ''|ssl_cert_file = '$PGSSLCERT'|g" \ - -e "s|ssl_key_file = ''|ssl_key_file = '$PGSSLKEY'|g" \ - $PG_CONF - - if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - mkdir -p "${DATA_VOLUME_MOUNTPOINT}/opt" - /usr/local/bin/configure-shim.sh /dist/supabase-admin-api /opt/supabase-admin-api - /opt/supabase-admin-api optimize db --destination-config-file-path /etc/postgresql-custom/generated-optimizations.conf - - # Preserve postgresql configs across restarts - POSTGRESQL_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/postgresql-custom" - - mkdir -p "${POSTGRESQL_CUSTOM_DIR}" - - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom postgresql config from /etc/postgresql-custom to ${POSTGRESQL_CUSTOM_DIR}" - cp -R "/etc/postgresql-custom/." "${POSTGRESQL_CUSTOM_DIR}/" - fi - - rm -rf "/etc/postgresql-custom" - ln -s "${POSTGRESQL_CUSTOM_DIR}" "/etc/postgresql-custom" - chown -R postgres:postgres "/etc/postgresql-custom" - chown -R postgres:postgres "${POSTGRESQL_CUSTOM_DIR}" - chmod g+rx "${POSTGRESQL_CUSTOM_DIR}" - - # Preserve wal-g configs across restarts - WALG_CONF_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/wal-g" - mkdir -p "${WALG_CONF_DIR}" - - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom wal-g config from /etc/wal-g to ${WALG_CONF_DIR}" - cp -R "/etc/wal-g/." "${WALG_CONF_DIR}/" - fi - - rm -rf "/etc/wal-g" - ln -s "${WALG_CONF_DIR}" "/etc/wal-g" - chown -R adminapi:adminapi "/etc/wal-g" - chown -R adminapi:adminapi "${WALG_CONF_DIR}" - chmod g+rx "/etc/wal-g" - chmod g+rx "${WALG_CONF_DIR}" - fi - DURATION=$(calculate_duration "$START_TIME" "$(date +%s%N)") - echo "E: Execution time to setting up postgresql: $DURATION milliseconds" -} - -function setup_credentials { - # Load credentials from init json - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./tmp/init.json - export ANON_KEY=${ANON_KEY:-$(jq -r '.["anon_key"]' /tmp/init.json)} - export SERVICE_ROLE_KEY=${SERVICE_ROLE_KEY:-$(jq -r '.["service_key"]' /tmp/init.json)} - export ADMIN_API_KEY=${ADMIN_API_KEY:-$(jq -r '.["supabase_admin_key"]' /tmp/init.json)} - export JWT_SECRET=${JWT_SECRET:-$(jq -r '.["jwt_secret"]' /tmp/init.json)} - DURATION=$(calculate_duration "$START_TIME" "$(date +%s%N)") - echo "E: Execution time to setting up credentials: $DURATION milliseconds" -} - -function report_health { - if [ -z "${REPORTING_TOKEN:-}" ]; then - echo "Skipped health reporting: missing REPORTING_TOKEN" - exit 0 - fi - if [ -d "$ADMIN_API_CERT_DIR" ]; then - retry 10 curl -sSkf "https://localhost:$ADMIN_API_PORT/health-reporter/send" -X POST -H "apikey: $ADMIN_API_KEY" - else - retry 10 curl -sSf "http://localhost:$ADMIN_API_PORT/health-reporter/send" -X POST -H "apikey: $ADMIN_API_KEY" - fi -} - -function run_prelaunch_hooks { - if [ -f "/etc/postgresql-custom/supautils.conf" ]; then - sed -i -e 's/dblink, //' "/etc/postgresql-custom/supautils.conf" - fi -} - -function start_supervisor { - # Start health reporting - report_health & - - # Start supervisord - /usr/bin/supervisord -c $SUPERVISOR_CONF -} - -DELEGATED_ARCHIVE_PATH=/data/delegated-init.tar.gz -DELEGATED_ENTRY_PATH=/data/delegated-entry.sh - -function fetch_and_execute_delegated_payload { - curl -s --time-cond $DELEGATED_ARCHIVE_PATH -o $DELEGATED_ARCHIVE_PATH "$DELEGATED_INIT_LOCATION" - - if [ ! -f $DELEGATED_ARCHIVE_PATH ]; then - echo "No delegated payload found, bailing" - return - fi - - # only extract a valid archive - if tar -tzf "$DELEGATED_ARCHIVE_PATH" &>/dev/null; then - TAR_MTIME_EPOCH=$(tar -tvzf "$DELEGATED_ARCHIVE_PATH" delegated-entry.sh | awk '{print $4, $5}' | xargs -I {} date -d {} +%s) - - if [ -f $DELEGATED_ENTRY_PATH ]; then - FILE_MTIME_EPOCH=$(stat -c %Y "$DELEGATED_ENTRY_PATH") - - if [ "$TAR_MTIME_EPOCH" -gt "$FILE_MTIME_EPOCH" ]; then - tar -xvzf "$DELEGATED_ARCHIVE_PATH" -C /data - else - echo "TAR archive is not newer, skipping extraction" - fi - else - tar -xvzf "$DELEGATED_ARCHIVE_PATH" -C /data - fi - else - echo "Invalid TAR archive" - return - fi - - # Run our delegated entry script here - if [ -f "$DELEGATED_ENTRY_PATH" ]; then - chmod +x $DELEGATED_ENTRY_PATH - bash -c "$DELEGATED_ENTRY_PATH $START_TIME" - fi -} - -# Increase max number of open connections -ulimit -n 65536 - -# Update pgsodium root key -if [ "${PGSODIUM_ROOT_KEY:-}" ]; then - echo "${PGSODIUM_ROOT_KEY}" >/etc/postgresql-custom/pgsodium_root.key -fi - -# Update pgdata directory -if [ "${PGDATA_REAL:-}" ]; then - mkdir -p "${PGDATA_REAL}" - chown -R postgres:postgres "${PGDATA_REAL}" - chmod -R g+rx "${PGDATA_REAL}" -fi - -if [ "${PGDATA:-}" ]; then - if [ "${PGDATA_REAL:-}" ]; then - mkdir -p "$(dirname "${PGDATA}")" - rm -rf "${PGDATA}" - ln -s "${PGDATA_REAL}" "${PGDATA}" - chmod -R g+rx "${PGDATA}" - else - mkdir -p "$PGDATA" - chown postgres:postgres "$PGDATA" - fi - sed -i "s|data_directory = '.*'|data_directory = '$PGDATA'|g" $PG_CONF -fi - -# Download and extract init payload from s3 -export INIT_PAYLOAD_PATH=${INIT_PAYLOAD_PATH:-/tmp/payload.tar.gz} - -if [ "${INIT_PAYLOAD_PRESIGNED_URL:-}" ]; then - curl -fsSL "$INIT_PAYLOAD_PRESIGNED_URL" -o "/tmp/payload.tar.gz" || true - if [ -f "/tmp/payload.tar.gz" ] && [ "/tmp/payload.tar.gz" != "$INIT_PAYLOAD_PATH" ]; then - mv "/tmp/payload.tar.gz" "$INIT_PAYLOAD_PATH" - fi -fi - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - BASE_LOGS_FOLDER="${DATA_VOLUME_MOUNTPOINT}/logs" - - for folder in "postgresql" "services" "wal-g"; do - mkdir -p "${BASE_LOGS_FOLDER}/${folder}" - rm -rf "/var/log/${folder}" - ln -s "${BASE_LOGS_FOLDER}/${folder}" "/var/log/${folder}" - done - - chown -R postgres:postgres "${BASE_LOGS_FOLDER}" - - mkdir -p "${DATA_VOLUME_MOUNTPOINT}/etc/logrotate" -fi - -# Process init payload -if [ -f "$INIT_PAYLOAD_PATH" ]; then - setup_credentials - setup_postgres -else - echo "Skipped extracting init payload: $INIT_PAYLOAD_PATH does not exist" -fi - -mkdir -p /var/log/services - -SUPERVISOR_CONF=/etc/supervisor/supervisord.conf -find /etc/supervisor/ -type d -exec chmod 0770 {} + -find /etc/supervisor/ -type f -exec chmod 0660 {} + - -# Start services in the background -if [ "${POSTGRES_ONLY:-}" == "true" ]; then - sed -i "s| - postgrest| # - postgrest|g" /etc/adminapi/adminapi.yaml - sed -i "s|files = services/\*.conf base-services/\*.conf|files = base-services/\*.conf|g" $SUPERVISOR_CONF - /init/configure-adminapi.sh -else - sed -i "s| # - postgrest| - postgrest|g" /etc/adminapi/adminapi.yaml - sed -i "s|files = base-services/\*.conf|files = services/\*.conf base-services/\*.conf|g" $SUPERVISOR_CONF - configure_services -fi - -if [ "${AUTOSHUTDOWN_ENABLED:-}" == "true" ]; then - enable_autoshutdown -fi - -if [ "${ENVOY_ENABLED:-}" == "true" ]; then - sed -i "s/autostart=.*/autostart=true/" /etc/supervisor/services/envoy.conf - sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/kong.conf - sed -i "s/kong/envoy/" /etc/supervisor/services/group.conf -fi - -if [ "${FAIL2BAN_DISABLED:-}" == "true" ]; then - disable_fail2ban -fi - -if [ "${GOTRUE_DISABLED:-}" == "true" ]; then - sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/gotrue.conf - sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/gotrue.conf -fi - -if [ "${PLATFORM_DEPLOYMENT:-}" == "true" ]; then - if [ "${SWAP_DISABLED:-}" != "true" ]; then - enable_swap - fi - enable_lsn_checkpoint_push - - trap graceful_shutdown SIGINT -fi - -touch "$CONFIGURED_FLAG_PATH" -run_prelaunch_hooks - -if [ -n "${DELEGATED_INIT_LOCATION:-}" ]; then - fetch_and_execute_delegated_payload -else - DURATION=$(calculate_duration "$START_TIME" "$(date +%s%N)") - echo "E: Execution time to starting supervisor: $DURATION milliseconds" - start_supervisor - push_lsn_checkpoint_file -fi diff --git a/docker/all-in-one/etc/adminapi/adminapi.yaml b/docker/all-in-one/etc/adminapi/adminapi.yaml deleted file mode 100644 index 7784fd7d4..000000000 --- a/docker/all-in-one/etc/adminapi/adminapi.yaml +++ /dev/null @@ -1,83 +0,0 @@ -port: 8085 -host: 0.0.0.0 -ref: {{ .ProjectRef }} -jwt_secret: {{ .JwtSecret }} -metric_collectors: - - filesystem - - meminfo - - netdev - - loadavg - - cpu - - diskstats - - vmstat -node_exporter_additional_args: - - "--collector.filesystem.ignored-mount-points=^/(boot|sys|dev|run).*" - - "--collector.netdev.device-exclude=lo" -# cert_path: /etc/ssl/adminapi/server.crt -# key_path: /etc/ssl/adminapi/server.key -upstream_metrics_refresh_duration: 60s -pgbouncer_endpoints: - - "postgres://pgbouncer:{{ .PgbouncerPassword }}@localhost:6543/pgbouncer" -fail2ban_socket: /var/run/fail2ban/fail2ban.sock -upstream_metrics_sources: - - name: system - url: "https://localhost:8085/metrics" - labels_to_attach: - - name: supabase_project_ref - value: {{ .ProjectRef }} - - name: service_type - value: db - skip_tls_verify: true - - name: postgresql - url: "http://localhost:9187/metrics" - labels_to_attach: - - name: supabase_project_ref - value: {{ .ProjectRef }} - - name: service_type - value: postgresql - - name: gotrue - url: "http://localhost:9122/metrics" - labels_to_attach: - - name: supabase_project_ref - value: {{ .ProjectRef }} - - name: service_type - value: gotrue - - name: postgrest - url: "http://localhost:3001/metrics" - labels_to_attach: - - name: supabase_project_ref - value: {{ .ProjectRef }} - - name: service_type - value: postgrest -monitoring: - disk_usage: - enabled: true -upgrades_config: - region: us-east-1 - s3_bucket_name: supabase-internal-artifacts-prod-bucket - common_prefix: upgrades - destination_dir: /tmp -firewall: - enabled: true - internal_ports: - - 9187 - - 8085 - - 9122 - privileged_ports: - - 22 - privileged_ports_allowlist: - - 0.0.0.0/0 - filtered_ports: - - 5432 - - 6543 - unfiltered_ports: - - 80 - - 443 - managed_rules_file: /etc/nftables/supabase_managed.conf -pg_egress_collect_path: /tmp/pg_egress_collect.txt -health_reporting: - api_url: {{ .SupabaseUrl }} - project_token: {{ .ReportingToken }} - check_services: - # - postgres - # - postgrest diff --git a/docker/all-in-one/etc/fail2ban/filter.d/pgbouncer.conf b/docker/all-in-one/etc/fail2ban/filter.d/pgbouncer.conf deleted file mode 100644 index b2d59c1b3..000000000 --- a/docker/all-in-one/etc/fail2ban/filter.d/pgbouncer.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Definition] -failregex = ^.+@:.+error: password authentication failed$ diff --git a/docker/all-in-one/etc/fail2ban/filter.d/postgresql.conf b/docker/all-in-one/etc/fail2ban/filter.d/postgresql.conf deleted file mode 100644 index 4c708069d..000000000 --- a/docker/all-in-one/etc/fail2ban/filter.d/postgresql.conf +++ /dev/null @@ -1,8 +0,0 @@ -[Definition] -failregex = ^.*,.*,.*,.*,":.*password authentication failed for user.*$ -ignoreregex = ^.*,.*,.*,.*,"127\.0\.0\.1.*password authentication failed for user.*$ - ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_admin".*$ - ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_auth_admin".*$ - ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_storage_admin".*$ - ^.*,.*,.*,.*,":.*password authentication failed for user ""authenticator".*$ - ^.*,.*,.*,.*,":.*password authentication failed for user ""pgbouncer".*$ diff --git a/docker/all-in-one/etc/fail2ban/jail.d/jail.local b/docker/all-in-one/etc/fail2ban/jail.d/jail.local deleted file mode 100644 index 44e8210f1..000000000 --- a/docker/all-in-one/etc/fail2ban/jail.d/jail.local +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] - -banaction = nftables-multiport -banaction_allports = nftables-allports diff --git a/docker/all-in-one/etc/fail2ban/jail.d/pgbouncer.conf b/docker/all-in-one/etc/fail2ban/jail.d/pgbouncer.conf deleted file mode 100644 index c8b3c49c5..000000000 --- a/docker/all-in-one/etc/fail2ban/jail.d/pgbouncer.conf +++ /dev/null @@ -1,7 +0,0 @@ -[pgbouncer] -enabled = true -port = 6543 -protocol = tcp -filter = pgbouncer -logpath = /var/log/services/pgbouncer.log -maxretry = 3 diff --git a/docker/all-in-one/etc/fail2ban/jail.d/postgresql.conf b/docker/all-in-one/etc/fail2ban/jail.d/postgresql.conf deleted file mode 100644 index 0ec1819d6..000000000 --- a/docker/all-in-one/etc/fail2ban/jail.d/postgresql.conf +++ /dev/null @@ -1,8 +0,0 @@ -[postgresql] -enabled = true -port = 5432 -protocol = tcp -filter = postgresql -logpath = /var/log/postgresql/auth-failures.csv -maxretry = 3 -ignoreip = 192.168.0.0/16 172.17.1.0/20 diff --git a/docker/all-in-one/etc/fail2ban/jail.d/sshd.local b/docker/all-in-one/etc/fail2ban/jail.d/sshd.local deleted file mode 100644 index 703373833..000000000 --- a/docker/all-in-one/etc/fail2ban/jail.d/sshd.local +++ /dev/null @@ -1,3 +0,0 @@ -[sshd] - -enabled = false diff --git a/docker/all-in-one/etc/gotrue.env b/docker/all-in-one/etc/gotrue.env deleted file mode 100644 index eb1e1a3c6..000000000 --- a/docker/all-in-one/etc/gotrue.env +++ /dev/null @@ -1,9 +0,0 @@ -API_EXTERNAL_URL=api_external_url -GOTRUE_API_HOST=gotrue_api_host -GOTRUE_SITE_URL=gotrue_site_url -GOTRUE_DB_DRIVER=postgres -GOTRUE_DB_DATABASE_URL=postgres://supabase_auth_admin@localhost/postgres?sslmode=disable -GOTRUE_DB_MIGRATIONS_PATH=/opt/gotrue/migrations -GOTRUE_JWT_ADMIN_ROLES=supabase_admin,service_role -GOTRUE_JWT_AUD=authenticated -GOTRUE_JWT_SECRET=gotrue_jwt_secret diff --git a/docker/all-in-one/etc/kong/kong.conf b/docker/all-in-one/etc/kong/kong.conf deleted file mode 100644 index 47789021b..000000000 --- a/docker/all-in-one/etc/kong/kong.conf +++ /dev/null @@ -1,37 +0,0 @@ -database = off -declarative_config = /etc/kong/kong.yml - -# plugins defined in the dockerfile -plugins = request-transformer,cors,key-auth,basic-auth,http-log,ip-restriction,rate-limiting - -admin_listen = off -proxy_listen = 0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16834, [::]:80 reuseport backlog=16384, [::]:443 http2 ssl reuseport backlog=16348 - -nginx_http_log_format = custom_log '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $request_length' -nginx_http_client_body_buffer_size = 512k -proxy_access_log = off -dns_stale_ttl = 60 -nginx_proxy_proxy_max_temp_file_size = 0 -nginx_proxy_proxy_buffer_size = 128k -nginx_proxy_proxy_buffers = 4 256k -nginx_proxy_proxy_busy_buffers_size = 256k -nginx_proxy_proxy_read_timeout = 120s -nginx_proxy_proxy_ssl_verify = off -nginx_http_gzip=on -nginx_http_gzip_comp_level=6 -nginx_http_gzip_min_length=256 -nginx_http_gzip_proxied=any -nginx_http_gzip_vary=on -nginx_http_gzip_types=text/plain application/xml application/openapi+json application/json - -# the upstream requests will be timed out after 60s idle anyway -# this ensures that we're not unnecessarily cycling them -upstream_keepalive_max_requests = 0 -# the pool size can be (and ought to be) scaled up on larger instances -upstream_keepalive_pool_size = 500 - -nginx_events_use = epoll -# can be tuned to be higher on larger boxes (4096 is totally fine) -nginx_events_worker_connections = 1024 -anonymous_reports = off -headers = latency_tokens diff --git a/docker/all-in-one/etc/kong/kong.yml b/docker/all-in-one/etc/kong/kong.yml deleted file mode 100644 index 9952f9861..000000000 --- a/docker/all-in-one/etc/kong/kong.yml +++ /dev/null @@ -1,94 +0,0 @@ -# ############################################################################################## -# Updating this file also requires a corresponding update in worker/src/lib/config-utils/kong.ts -# ############################################################################################## -_format_version: '1.1' -services: - - { - name: auth-v1-open, - url: 'http://localhost:9999/verify', - routes: [{ name: auth-v1-open, strip_path: true, paths: [/auth/v1/verify] }], - plugins: [{ name: cors }], - } - - { - name: auth-v1-open-callback, - url: 'http://localhost:9999/callback', - routes: [{ name: auth-v1-open-callback, strip_path: true, paths: [/auth/v1/callback] }], - plugins: [{ name: cors }], - } - - { - name: auth-v1-open-authorize, - url: 'http://localhost:9999/authorize', - routes: [{ name: auth-v1-open-authorize, strip_path: true, paths: [/auth/v1/authorize] }], - plugins: [{ name: cors }], - } - - { - name: auth-v1-open-saml, - url: 'http://localhost:9999/sso/saml/', - routes: [{ name: auth-v1-open-saml, strip_path: true, paths: [/auth/v1/sso/saml/] }], - plugins: [{ name: cors }], - } - - { - name: auth-v1-open-well-known, - url: 'http://localhost:9999/.well-known/', - routes: [{ name: auth-v1-open-well-known, strip_path: true, paths: [/auth/v1/.well-known/] }], - plugins: [{ name: cors }], - } - - { - name: auth-v1, - url: 'http://localhost:9999/', - routes: [{ name: auth-v1, strip_path: true, paths: [/auth/v1/] }], - plugins: [{ name: cors }, { name: key-auth, config: { hide_credentials: false } }], - } - - { - name: rest-v1-admin, - url: 'http://localhost:3001/', - routes: [{ name: rest-admin-v1, strip_path: true, paths: [/rest-admin/v1/] }], - plugins: [{ name: cors }, { name: key-auth, config: { hide_credentials: true } }], - } - - { - name: rest-v1, - url: 'http://localhost:3000/', - routes: [{ name: rest-v1, strip_path: true, paths: [/rest/v1/] }], - plugins: [{ name: cors }, { name: key-auth, config: { hide_credentials: true } }], - } - - { - name: graphql-v1, - url: 'http://localhost:3000/rpc/graphql', - routes: [{ name: graphql-v1, strip_path: true, paths: [/graphql/v1] }], - plugins: - [ - { name: cors }, - { name: key-auth, config: { hide_credentials: true } }, - { - name: request-transformer, - config: { add: { headers: [Content-Profile:graphql_public] } }, - }, - ], - } - - { - name: admin-v1, - url: 'https://localhost:8085/', - routes: [{ name: admin-v1, strip_path: true, paths: [/admin/v1/] }], - plugins: [{ name: cors }, { name: key-auth, config: { hide_credentials: false } }], - } - - { - name: admin-v1-user-routes, - url: 'https://localhost:8085/privileged', - routes: [{ name: admin-v1-user-routes, strip_path: true, paths: [/customer/v1/privileged] }], - plugins: [{ name: cors }, { name: basic-auth, config: { hide_credentials: false } }], - } - - { - name: admin-v1-metrics, - url: 'https://localhost:8085/metrics/aggregated', - routes: [{ name: admin-v1-metrics, strip_path: true, paths: [/supabase-internal/metrics] }], - plugins: [{ name: cors }, { name: ip-restriction, config: { allow: [10.0.0.0/8] } }], - } -consumers: - - { username: anon-key, keyauth_credentials: [{ key: anon_key }] } - - { username: service_role-key, keyauth_credentials: [{ key: service_key }] } - - { username: supabase-admin-key, keyauth_credentials: [{ key: supabase_admin_key }] } -basicauth_credentials: - - consumer: service_role-key - username: 'service_role' - password: service_key -plugins: [] diff --git a/docker/all-in-one/etc/logrotate.d/postgresql.conf b/docker/all-in-one/etc/logrotate.d/postgresql.conf deleted file mode 100644 index 6e2b8828a..000000000 --- a/docker/all-in-one/etc/logrotate.d/postgresql.conf +++ /dev/null @@ -1,11 +0,0 @@ -/var/log/postgresql/postgresql.csv { - size 50M - rotate 4 - compress - delaycompress - notifempty - missingok - postrotate - sudo -u postgres /usr/lib/postgresql/15/bin/pg_ctl -D /var/lib/postgresql/data logrotate - endscript -} diff --git a/docker/all-in-one/etc/logrotate.d/walg.conf b/docker/all-in-one/etc/logrotate.d/walg.conf deleted file mode 100644 index 49eeb59eb..000000000 --- a/docker/all-in-one/etc/logrotate.d/walg.conf +++ /dev/null @@ -1,9 +0,0 @@ -/var/log/wal-g/*.log { - size 50M - rotate 3 - copytruncate - delaycompress - compress - notifempty - missingok -} diff --git a/docker/all-in-one/etc/pgbouncer-custom/custom-overrides.ini b/docker/all-in-one/etc/pgbouncer-custom/custom-overrides.ini deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/pgbouncer-custom/generated-optimizations.ini b/docker/all-in-one/etc/pgbouncer-custom/generated-optimizations.ini deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/pgbouncer-custom/ssl-config.ini b/docker/all-in-one/etc/pgbouncer-custom/ssl-config.ini deleted file mode 100644 index 69a802500..000000000 --- a/docker/all-in-one/etc/pgbouncer-custom/ssl-config.ini +++ /dev/null @@ -1,4 +0,0 @@ -client_tls_sslmode = allow -client_tls_ca_file = /etc/ssl/certs/postgres/ca.crt -client_tls_key_file = /etc/ssl/private/server.key -client_tls_cert_file = /etc/ssl/certs/postgres/server.crt diff --git a/docker/all-in-one/etc/pgbouncer/pgbouncer.ini b/docker/all-in-one/etc/pgbouncer/pgbouncer.ini deleted file mode 100644 index 5a36ac197..000000000 --- a/docker/all-in-one/etc/pgbouncer/pgbouncer.ini +++ /dev/null @@ -1,363 +0,0 @@ -;;; -;;; PgBouncer configuration file -;;; - -;; database name = connect string -;; -;; connect string params: -;; dbname= host= port= user= password= auth_user= -;; client_encoding= datestyle= timezone= -;; pool_size= reserve_pool= max_db_connections= -;; pool_mode= connect_query= application_name= -[databases] -* = host=localhost auth_user=pgbouncer - -;; foodb over Unix socket -;foodb = - -;; redirect bardb to bazdb on localhost -;bardb = host=localhost dbname=bazdb - -;; access to dest database will go with single user -;forcedb = host=localhost port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1' - -;; use custom pool sizes -;nondefaultdb = pool_size=50 reserve_pool=10 - -;; use auth_user with auth_query if user not present in auth_file -;; auth_user must exist in auth_file -; foodb = auth_user=bar - -;; fallback connect string -;* = host=testserver - -;; User-specific configuration -[users] - -;user1 = pool_mode=transaction max_user_connections=10 - -;; Configuration section -[pgbouncer] - -;;; -;;; Administrative settings -;;; - -pidfile = /var/run/pgbouncer/pgbouncer.pid - -;;; -;;; Where to wait for clients -;;; - -;; IP address or * which means all IPs -listen_addr = * -listen_port = 6543 - -;; Unix socket is also used for -R. -;; On Debian it should be /var/run/postgresql -unix_socket_dir = /tmp -;unix_socket_mode = 0777 -;unix_socket_group = - -;;; -;;; TLS settings for accepting clients -;;; - -;; disable, allow, require, verify-ca, verify-full -;client_tls_sslmode = disable - -;; Path to file that contains trusted CA certs -;client_tls_ca_file = - -;; Private key and cert to present to clients. -;; Required for accepting TLS connections from clients. -;client_tls_key_file = -;client_tls_cert_file = - -;; fast, normal, secure, legacy, -;client_tls_ciphers = fast - -;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3 -;client_tls_protocols = secure - -;; none, auto, legacy -;client_tls_dheparams = auto - -;; none, auto, -;client_tls_ecdhcurve = auto - -;;; -;;; TLS settings for connecting to backend databases -;;; - -;; disable, allow, require, verify-ca, verify-full -;server_tls_sslmode = disable - -;; Path to that contains trusted CA certs -;server_tls_ca_file = - -;; Private key and cert to present to backend. -;; Needed only if backend server require client cert. -;server_tls_key_file = -;server_tls_cert_file = - -;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3 -;server_tls_protocols = secure - -;; fast, normal, secure, legacy, -;server_tls_ciphers = fast - -;;; -;;; Authentication settings -;;; - -;; any, trust, plain, md5, cert, hba, pam -auth_type = scram-sha-256 -auth_file = /etc/pgbouncer/userlist.txt - -;; Path to HBA-style auth config -;auth_hba_file = - -;; Query to use to fetch password from database. Result -;; must have 2 columns - username and password hash. -auth_query = SELECT * FROM pgbouncer.get_auth($1) - -;;; -;;; Users allowed into database 'pgbouncer' -;;; - -;; comma-separated list of users who are allowed to change settings -admin_users = pgbouncer - -;; comma-separated list of users who are just allowed to use SHOW command -stats_users = pgbouncer - -;;; -;;; Pooler personality questions -;;; - -;; When server connection is released back to pool: -;; session - after client disconnects (default) -;; transaction - after transaction finishes -;; statement - after statement finishes -pool_mode = transaction - -;; Query for cleaning connection immediately after releasing from -;; client. No need to put ROLLBACK here, pgbouncer does not reuse -;; connections where transaction is left open. -;server_reset_query = DISCARD ALL - -;; Whether server_reset_query should run in all pooling modes. If it -;; is off, server_reset_query is used only for session-pooling. -;server_reset_query_always = 0 - -;; Comma-separated list of parameters to ignore when given in startup -;; packet. Newer JDBC versions require the extra_float_digits here. -ignore_startup_parameters = extra_float_digits - -;; When taking idle server into use, this query is run first. -;server_check_query = select 1 - -;; If server was used more recently that this many seconds ago, -; skip the check query. Value 0 may or may not run in immediately. -;server_check_delay = 30 - -;; Close servers in session pooling mode after a RECONNECT, RELOAD, -;; etc. when they are idle instead of at the end of the session. -;server_fast_close = 0 - -;; Use as application_name on server. -;application_name_add_host = 0 - -;; Period for updating aggregated stats. -;stats_period = 60 - -;;; -;;; Connection limits -;;; - -;; Total number of clients that can connect -;max_client_conn = 100 - -;; Default pool size. 20 is good number when transaction pooling -;; is in use, in session pooling it needs to be the number of -;; max clients you want to handle at any moment -default_pool_size = 15 - -;; Minimum number of server connections to keep in pool. -;min_pool_size = 0 - -; how many additional connection to allow in case of trouble -;reserve_pool_size = 0 - -;; If a clients needs to wait more than this many seconds, use reserve -;; pool. -;reserve_pool_timeout = 5 - -;; Maximum number of server connections for a database -;max_db_connections = 0 - -;; Maximum number of server connections for a user -;max_user_connections = 0 - -;; If off, then server connections are reused in LIFO manner -;server_round_robin = 0 - -;;; -;;; Logging -;;; - -;; Syslog settings -;syslog = 0 -;syslog_facility = daemon -;syslog_ident = pgbouncer - -;; log if client connects or server connection is made -;log_connections = 1 - -;; log if and why connection was closed -;log_disconnections = 1 - -;; log error messages pooler sends to clients -;log_pooler_errors = 1 - -;; write aggregated stats into log -;log_stats = 1 - -;; Logging verbosity. Same as -v switch on command line. -;verbose = 0 - -;;; -;;; Timeouts -;;; - -;; Close server connection if its been connected longer. -;server_lifetime = 3600 - -;; Close server connection if its not been used in this time. Allows -;; to clean unnecessary connections from pool after peak. -;server_idle_timeout = 600 - -;; Cancel connection attempt if server does not answer takes longer. -;server_connect_timeout = 15 - -;; If server login failed (server_connect_timeout or auth failure) -;; then wait this many second. -;server_login_retry = 15 - -;; Dangerous. Server connection is closed if query does not return in -;; this time. Should be used to survive network problems, _not_ as -;; statement_timeout. (default: 0) -;query_timeout = 0 - -;; Dangerous. Client connection is closed if the query is not -;; assigned to a server in this time. Should be used to limit the -;; number of queued queries in case of a database or network -;; failure. (default: 120) -;query_wait_timeout = 120 - -;; Dangerous. Client connection is closed if no activity in this -;; time. Should be used to survive network problems. (default: 0) -;client_idle_timeout = 0 - -;; Disconnect clients who have not managed to log in after connecting -;; in this many seconds. -;client_login_timeout = 60 - -;; Clean automatically created database entries (via "*") if they stay -;; unused in this many seconds. -; autodb_idle_timeout = 3600 - -;; Close connections which are in "IDLE in transaction" state longer -;; than this many seconds. -;idle_transaction_timeout = 0 - -;; How long SUSPEND/-R waits for buffer flush before closing -;; connection. -;suspend_timeout = 10 - -;;; -;;; Low-level tuning options -;;; - -;; buffer for streaming packets -;pkt_buf = 4096 - -;; man 2 listen -;listen_backlog = 128 - -;; Max number pkt_buf to process in one event loop. -;sbuf_loopcnt = 5 - -;; Maximum PostgreSQL protocol packet size. -;max_packet_size = 2147483647 - -;; Set SO_REUSEPORT socket option -;so_reuseport = 0 - -;; networking options, for info: man 7 tcp - -;; Linux: Notify program about new connection only if there is also -;; data received. (Seconds to wait.) On Linux the default is 45, on -;; other OS'es 0. -;tcp_defer_accept = 0 - -;; In-kernel buffer size (Linux default: 4096) -;tcp_socket_buffer = 0 - -;; whether tcp keepalive should be turned on (0/1) -;tcp_keepalive = 1 - -;; The following options are Linux-specific. They also require -;; tcp_keepalive=1. - -;; Count of keepalive packets -;tcp_keepcnt = 0 - -;; How long the connection can be idle before sending keepalive -;; packets -;tcp_keepidle = 0 - -;; The time between individual keepalive probes -;tcp_keepintvl = 0 - -;; How long may transmitted data remain unacknowledged before TCP -;; connection is closed (in milliseconds) -;tcp_user_timeout = 0 - -;; DNS lookup caching time -;dns_max_ttl = 15 - -;; DNS zone SOA lookup period -;dns_zone_check_period = 0 - -;; DNS negative result caching time -;dns_nxdomain_ttl = 15 - -;; Custom resolv.conf file, to set custom DNS servers or other options -;; (default: empty = use OS settings) -;resolv_conf = /etc/pgbouncer/resolv.conf - -;;; -;;; Random stuff -;;; - -;; Hackish security feature. Helps against SQL injection: when PQexec -;; is disabled, multi-statement cannot be made. -;disable_pqexec = 0 - -;; Config file to use for next RELOAD/SIGHUP -;; By default contains config file from command line. -;conffile - -;; Windows service name to register as. job_name is alias for -;; service_name, used by some Skytools scripts. -;service_name = pgbouncer -;job_name = pgbouncer - -;; Read additional config from other file -;%include /etc/pgbouncer/pgbouncer-other.ini - -%include /etc/pgbouncer-custom/generated-optimizations.ini -%include /etc/pgbouncer-custom/custom-overrides.ini -# %include /etc/pgbouncer-custom/ssl-config.ini diff --git a/docker/all-in-one/etc/pgbouncer/userlist.txt b/docker/all-in-one/etc/pgbouncer/userlist.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/postgresql-custom/custom-overrides.conf b/docker/all-in-one/etc/postgresql-custom/custom-overrides.conf deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/postgresql-custom/generated-optimizations.conf b/docker/all-in-one/etc/postgresql-custom/generated-optimizations.conf deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf b/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf deleted file mode 100644 index 51d34a13a..000000000 --- a/docker/all-in-one/etc/postgresql-custom/postgresql-platform-defaults.conf +++ /dev/null @@ -1,7 +0,0 @@ -# these get imported _after_ the user specified overrides -row_security = on -wal_level = logical -log_connections = on -statement_timeout = 120000 -jit = off -pgaudit.log = 'ddl' diff --git a/docker/all-in-one/etc/postgresql.schema.sql b/docker/all-in-one/etc/postgresql.schema.sql deleted file mode 100644 index 475b09bb9..000000000 --- a/docker/all-in-one/etc/postgresql.schema.sql +++ /dev/null @@ -1,16 +0,0 @@ -\set admin_pass `echo "${SUPABASE_ADMIN_PASSWORD:-$POSTGRES_PASSWORD}"` -\set pgrst_pass `echo "${AUTHENTICATOR_PASSWORD:-$POSTGRES_PASSWORD}"` -\set pgbouncer_pass `echo "${PGBOUNCER_PASSWORD:-$POSTGRES_PASSWORD}"` -\set auth_pass `echo "${SUPABASE_AUTH_ADMIN_PASSWORD:-$POSTGRES_PASSWORD}"` -\set storage_pass `echo "${SUPABASE_STORAGE_ADMIN_PASSWORD:-$POSTGRES_PASSWORD}"` -\set replication_pass `echo "${SUPABASE_REPLICATION_ADMIN_PASSWORD:-$POSTGRES_PASSWORD}"` -\set read_only_pass `echo "${SUPABASE_READ_ONLY_USER_PASSWORD:-$POSTGRES_PASSWORD}"` - -ALTER USER supabase_admin WITH PASSWORD :'admin_pass'; -ALTER USER authenticator WITH PASSWORD :'pgrst_pass'; -ALTER USER pgbouncer WITH PASSWORD :'pgbouncer_pass'; -ALTER USER supabase_auth_admin WITH PASSWORD :'auth_pass'; -ALTER USER supabase_storage_admin WITH PASSWORD :'storage_pass'; -ALTER USER supabase_replication_admin WITH PASSWORD :'replication_pass'; -ALTER ROLE supabase_read_only_user WITH PASSWORD :'read_only_pass'; -ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions; diff --git a/docker/all-in-one/etc/postgresql/logging.conf b/docker/all-in-one/etc/postgresql/logging.conf deleted file mode 100644 index b8d64da51..000000000 --- a/docker/all-in-one/etc/postgresql/logging.conf +++ /dev/null @@ -1,33 +0,0 @@ -# - Where to Log - - -log_destination = 'csvlog' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -logging_collector = on # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -log_directory = '/var/log/postgresql' # directory where log files are written, - # can be absolute or relative to PGDATA -log_filename = 'postgresql.log' # log file name pattern, - # can include strftime() escapes -log_file_mode = 0640 # creation mode for log files, - # begin with 0 to use octal notation -log_rotation_age = 0 # Automatic rotation of logfiles will - # happen after that time. 0 disables. -log_rotation_size = 0 # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. -#log_truncate_on_rotation = off # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. diff --git a/docker/all-in-one/etc/postgresql/pg_hba.conf b/docker/all-in-one/etc/postgresql/pg_hba.conf deleted file mode 100755 index 9cafd4146..000000000 --- a/docker/all-in-one/etc/postgresql/pg_hba.conf +++ /dev/null @@ -1,94 +0,0 @@ -# PostgreSQL Client Authentication Configuration File -# =================================================== -# -# Refer to the "Client Authentication" section in the PostgreSQL -# documentation for a complete description of this file. A short -# synopsis follows. -# -# This file controls: which hosts are allowed to connect, how clients -# are authenticated, which PostgreSQL user names they can use, which -# databases they can access. Records take one of these forms: -# -# local DATABASE USER METHOD [OPTIONS] -# host DATABASE USER ADDRESS METHOD [OPTIONS] -# hostssl DATABASE USER ADDRESS METHOD [OPTIONS] -# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] -# hostgssenc DATABASE USER ADDRESS METHOD [OPTIONS] -# hostnogssenc DATABASE USER ADDRESS METHOD [OPTIONS] -# -# (The uppercase items must be replaced by actual values.) -# -# The first field is the connection type: "local" is a Unix-domain -# socket, "host" is either a plain or SSL-encrypted TCP/IP socket, -# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a -# non-SSL TCP/IP socket. Similarly, "hostgssenc" uses a -# GSSAPI-encrypted TCP/IP socket, while "hostnogssenc" uses a -# non-GSSAPI socket. -# -# DATABASE can be "all", "sameuser", "samerole", "replication", a -# database name, or a comma-separated list thereof. The "all" -# keyword does not match "replication". Access to replication -# must be enabled in a separate record (see example below). -# -# USER can be "all", a user name, a group name prefixed with "+", or a -# comma-separated list thereof. In both the DATABASE and USER fields -# you can also write a file name prefixed with "@" to include names -# from a separate file. -# -# ADDRESS specifies the set of hosts the record matches. It can be a -# host name, or it is made up of an IP address and a CIDR mask that is -# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that -# specifies the number of significant bits in the mask. A host name -# that starts with a dot (.) matches a suffix of the actual host name. -# Alternatively, you can write an IP address and netmask in separate -# columns to specify the set of hosts. Instead of a CIDR-address, you -# can write "samehost" to match any of the server's own IP addresses, -# or "samenet" to match any address in any subnet that the server is -# directly connected to. -# -# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256", -# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert". -# Note that "password" sends passwords in clear text; "md5" or -# "scram-sha-256" are preferred since they send encrypted passwords. -# -# OPTIONS are a set of options for the authentication in the format -# NAME=VALUE. The available options depend on the different -# authentication methods -- refer to the "Client Authentication" -# section in the documentation for a list of which options are -# available for which authentication methods. -# -# Database and user names containing spaces, commas, quotes and other -# special characters must be quoted. Quoting one of the keywords -# "all", "sameuser", "samerole" or "replication" makes the name lose -# its special character, and just match a database or username with -# that name. -# -# This file is read on server startup and when the server receives a -# SIGHUP signal. If you edit the file on a running system, you have to -# SIGHUP the server for the changes to take effect, run "pg_ctl reload", -# or execute "SELECT pg_reload_conf()". -# -# Put your actual configuration here -# ---------------------------------- -# -# If you want to allow non-local connections, you need to add more -# "host" records. In that case you will also need to make PostgreSQL -# listen on a non-local interface via the listen_addresses -# configuration parameter, or via the -i or -h command line switches. - -# TYPE DATABASE USER ADDRESS METHOD - -# trust local connections -local all supabase_admin scram-sha-256 -local all all peer map=supabase_map -host all all 127.0.0.1/32 trust -host all all ::1/128 trust - -# IPv4 external connections -host all all 10.0.0.0/8 scram-sha-256 -host all all 172.16.0.0/12 scram-sha-256 -host all all 192.168.0.0/16 scram-sha-256 -host all all 0.0.0.0/0 scram-sha-256 - -# IPv6 external connections -host all all ::0/0 scram-sha-256 diff --git a/docker/all-in-one/etc/postgrest/base.conf b/docker/all-in-one/etc/postgrest/base.conf deleted file mode 100644 index e5120ede6..000000000 --- a/docker/all-in-one/etc/postgrest/base.conf +++ /dev/null @@ -1,7 +0,0 @@ -server-port="pgrst_server_port" -admin-server-port="pgrst_admin_server_port" -db-schema="pgrst_db_schemas" -db-extra-search-path="pgrst_db_extra_search_path" -db-anon-role="pgrst_db_anon_role" -jwt-secret="pgrst_jwt_secret" -db-uri="postgres://authenticator@localhost:5432/postgres?application_name=postgrest" diff --git a/docker/all-in-one/etc/postgrest/bootstrap.sh b/docker/all-in-one/etc/postgrest/bootstrap.sh deleted file mode 100755 index 9ac21d201..000000000 --- a/docker/all-in-one/etc/postgrest/bootstrap.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env bash -set -euo pipefail -set -x - -cd "$(dirname "$0")" -cat $@ > merged.conf - -/opt/postgrest merged.conf diff --git a/docker/all-in-one/etc/postgrest/generated.conf b/docker/all-in-one/etc/postgrest/generated.conf deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/all-in-one/etc/salt/minion b/docker/all-in-one/etc/salt/minion deleted file mode 100644 index 29d840696..000000000 --- a/docker/all-in-one/etc/salt/minion +++ /dev/null @@ -1,71 +0,0 @@ -# Minions can connect to multiple masters simultaneously (all masters -# are "hot"), or can be configured to failover if a master becomes -# unavailable. Multiple hot masters are configured by setting this -# value to "str". Failover masters can be requested by setting -# to "failover". MAKE SURE TO SET master_alive_interval if you are -# using failover. -# Setting master_type to 'disable' lets you have a running minion (with engines and -# beacons) without a master connection -master_type: disable - -# The minion can locally cache the return data from jobs sent to it, this -# can be a good way to keep track of jobs the minion has executed -# (on the minion side). By default this feature is disabled, to enable, set -# cache_jobs to True. -cache_jobs: True - -# The minion can take a while to start up when lspci and/or dmidecode is used -# to populate the grains for the minion. Set this to False if you do not need -# GPU hardware grains for your minion. -enable_gpu_grains: False - -# Backup files that are replaced by file.managed and file.recurse under -# 'cachedir'/file_backup relative to their original location and appended -# with a timestamp. The only valid setting is "minion". Disabled by default. -# -# Alternatively this can be specified for each file in state files: -# /etc/ssh/sshd_config: -# file.managed: -# - source: salt://ssh/sshd_config -# - backup: minion -# -backup_mode: minion - -##### File Directory Settings ##### -########################################## -# The Salt Minion can redirect all file server operations to a local directory, -# this allows for the same state tree that is on the master to be used if -# copied completely onto the minion. This is a literal copy of the settings on -# the master but used to reference a local directory on the minion. - -# Set the file client. The client defaults to looking on the master server for -# files, but can be directed to look at the local file directory setting -# defined below by setting it to "local". Setting a local file_client runs the -# minion in masterless mode. -file_client: local - -# The file directory works on environments passed to the minion, each environment -# can have multiple root directories, the subdirectories in the multiple file -# roots cannot match, otherwise the downloaded files will not be able to be -# reliably ensured. A base environment is required to house the top file. -# Example: -# file_roots: -# base: -# - /srv/salt/ -# dev: -# - /srv/salt/dev/services -# - /srv/salt/dev/states -# prod: -# - /srv/salt/prod/services -# - /srv/salt/prod/states -# -file_roots: - base: - - /data/salt/state - -# The Salt pillar is searched for locally if file_client is set to local. If -# this is the case, and pillar data is defined, then the pillar_roots need to -# also be configured on the minion: -pillar_roots: - base: - - /data/salt/pillar diff --git a/docker/all-in-one/etc/sudoers.d/adminapi b/docker/all-in-one/etc/sudoers.d/adminapi deleted file mode 100644 index eeff5fb9c..000000000 --- a/docker/all-in-one/etc/sudoers.d/adminapi +++ /dev/null @@ -1,27 +0,0 @@ -Cmnd_Alias ENVOY = /usr/bin/supervisorctl start services\:envoy, /usr/bin/supervisorctl stop services\:envoy, /usr/bin/supervisorctl restart services\:envoy, /usr/bin/supervisorctl status services\:envoy -Cmnd_Alias KONG = /usr/bin/supervisorctl start services\:kong, /usr/bin/supervisorctl stop services\:kong, /usr/bin/supervisorctl restart services\:kong, /usr/bin/supervisorctl status services\:kong -Cmnd_Alias POSTGREST = /usr/bin/supervisorctl start services\:postgrest, /usr/bin/supervisorctl stop services\:postgrest, /usr/bin/supervisorctl restart services\:postgrest, /usr/bin/supervisorctl status services\:postgrest -Cmnd_Alias GOTRUE = /usr/bin/supervisorctl start services\:gotrue, /usr/bin/supervisorctl stop services\:gotrue, /usr/bin/supervisorctl restart services\:gotrue, /usr/bin/supervisorctl status services\:gotrue -Cmnd_Alias PGBOUNCER = /usr/bin/supervisorctl start pgbouncer, /usr/bin/supervisorctl stop pgbouncer, /usr/bin/supervisorctl restart pgbouncer, /usr/bin/supervisorctl status pgbouncer - -%adminapi ALL= NOPASSWD: /root/grow_fs.sh -%adminapi ALL= NOPASSWD: /root/manage_readonly_mode.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/prepare.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/initiate.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/complete.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/check.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/common.sh -%adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/pgsodium_getkey.sh -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl reread -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl update -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl restart postgresql -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl status postgresql -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl restart adminapi -%adminapi ALL= NOPASSWD: /usr/bin/supervisorctl restart services\:* -%adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf -%adminapi ALL= NOPASSWD: /usr/bin/admin-mgr -%adminapi ALL= NOPASSWD: ENVOY -%adminapi ALL= NOPASSWD: KONG -%adminapi ALL= NOPASSWD: POSTGREST -%adminapi ALL= NOPASSWD: GOTRUE -%adminapi ALL= NOPASSWD: PGBOUNCER diff --git a/docker/all-in-one/etc/supa-shutdown/shutdown.conf b/docker/all-in-one/etc/supa-shutdown/shutdown.conf deleted file mode 100644 index 384b9357f..000000000 --- a/docker/all-in-one/etc/supa-shutdown/shutdown.conf +++ /dev/null @@ -1 +0,0 @@ -SHUTDOWN_IDLE_TIME_MINUTES= diff --git a/docker/all-in-one/etc/supervisor/base-services/adminapi.conf b/docker/all-in-one/etc/supervisor/base-services/adminapi.conf deleted file mode 100644 index 66b591f80..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/adminapi.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:adminapi] -command=/opt/supabase-admin-api -user=adminapi -autorestart=true -autostart=true -startretries=1000 -stdout_logfile=/var/log/services/adminapi.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=50 diff --git a/docker/all-in-one/etc/supervisor/base-services/logrotate.conf b/docker/all-in-one/etc/supervisor/base-services/logrotate.conf deleted file mode 100644 index a1ccea647..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/logrotate.conf +++ /dev/null @@ -1,11 +0,0 @@ -[program:logrotate] -command=/usr/local/bin/run-logrotate.sh -autostart=true -autorestart=true -user=root -startretries=1000 -stdout_logfile=/var/log/services/logrotate.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=50 -environment=DATA_VOLUME_MOUNTPOINT="%(ENV_DATA_VOLUME_MOUNTPOINT)s" diff --git a/docker/all-in-one/etc/supervisor/base-services/lsn-checkpoint-push.conf b/docker/all-in-one/etc/supervisor/base-services/lsn-checkpoint-push.conf deleted file mode 100644 index 36abcf867..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/lsn-checkpoint-push.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:lsn-checkpoint-push] -command=/usr/bin/admin-mgr lsn-checkpoint-push --watch -user=root -autorestart=false -autostart=false -startretries=1000 -stdout_logfile=/var/log/services/lsn-push.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=50 diff --git a/docker/all-in-one/etc/supervisor/base-services/pg_egress_collect.conf b/docker/all-in-one/etc/supervisor/base-services/pg_egress_collect.conf deleted file mode 100644 index d340a9c93..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/pg_egress_collect.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:pg_egress_collect] -command=/bin/bash -c "tcpdump -s 128 -Q out -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl /opt/pg_egress_collect/pg_egress_collect.pl" -user=root -autorestart=true -autostart=true -startretries=1000 -stdout_logfile=/var/log/services/pg_egress_collect.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=50 diff --git a/docker/all-in-one/etc/supervisor/base-services/postgresql.conf b/docker/all-in-one/etc/supervisor/base-services/postgresql.conf deleted file mode 100644 index b9dbe0228..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/postgresql.conf +++ /dev/null @@ -1,13 +0,0 @@ -[program:postgresql] -command=/usr/local/bin/postgres-entrypoint.sh postgres -D /etc/postgresql -user=postgres -stopsignal=INT -autorestart=true -autostart=true -startretries=1000 -priority=1 -# Inherit env vars from https://github.com/supabase/postgres/blob/develop/Dockerfile#L800 -environment=POSTGRES_PASSWORD="%(ENV_POSTGRES_PASSWORD)s",POSTGRES_HOST="%(ENV_POSTGRES_HOST)s",HOME="/var/lib/postgresql" -stdout_logfile=/var/log/postgresql/init.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/etc/supervisor/base-services/supa-shutdown.conf b/docker/all-in-one/etc/supervisor/base-services/supa-shutdown.conf deleted file mode 100644 index 06b24a7b5..000000000 --- a/docker/all-in-one/etc/supervisor/base-services/supa-shutdown.conf +++ /dev/null @@ -1,11 +0,0 @@ -[program:supa-shutdown] -command=/usr/local/bin/supa-shutdown.sh -user=root -autorestart=true -autostart=false -startretries=1000 -stdout_logfile=/var/log/services/supa-shutdown.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=50 -environment=MAX_IDLE_TIME_MINUTES="%(ENV_MAX_IDLE_TIME_MINUTES)s" diff --git a/docker/all-in-one/etc/supervisor/services/envoy.conf b/docker/all-in-one/etc/supervisor/services/envoy.conf deleted file mode 100644 index 2b33807a6..000000000 --- a/docker/all-in-one/etc/supervisor/services/envoy.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:envoy] -command=/opt/envoy-hot-restarter.py /opt/start-envoy.sh -user=envoy -autorestart=true -autostart=false -stopasgroup=true -startretries=1000 -stdout_logfile=/var/log/services/envoy.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/etc/supervisor/services/exporter.conf b/docker/all-in-one/etc/supervisor/services/exporter.conf deleted file mode 100644 index 36979588f..000000000 --- a/docker/all-in-one/etc/supervisor/services/exporter.conf +++ /dev/null @@ -1,11 +0,0 @@ -[program:exporter] -command=/opt/postgres_exporter/postgres_exporter --disable-settings-metrics --extend.query-path=/opt/postgres_exporter/queries.yml --disable-default-metrics --no-collector.locks --no-collector.replication --no-collector.replication_slot --no-collector.stat_bgwriter --no-collector.stat_database --no-collector.stat_user_tables --no-collector.statio_user_tables --no-collector.wal -user=root -autorestart=true -autostart=true -startretries=1000 -environment=DATA_SOURCE_NAME="host=localhost dbname=postgres sslmode=disable user=supabase_admin pg_stat_statements.track=none application_name=postgres_exporter" -stdout_logfile=/var/log/services/exporter.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=150 diff --git a/docker/all-in-one/etc/supervisor/services/fail2ban.conf b/docker/all-in-one/etc/supervisor/services/fail2ban.conf deleted file mode 100644 index 8000386dc..000000000 --- a/docker/all-in-one/etc/supervisor/services/fail2ban.conf +++ /dev/null @@ -1,9 +0,0 @@ -[program:fail2ban] -command=/usr/bin/fail2ban-client -f start -user=root -autorestart=true -autostart=true -stdout_logfile=/var/log/services/fail2ban.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=200 diff --git a/docker/all-in-one/etc/supervisor/services/gotrue.conf b/docker/all-in-one/etc/supervisor/services/gotrue.conf deleted file mode 100644 index 679057ee8..000000000 --- a/docker/all-in-one/etc/supervisor/services/gotrue.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:gotrue] -directory=/opt/gotrue -command=/opt/gotrue/gotrue --config /etc/gotrue.env -user=gotrue -startretries=1000 -autorestart=true -autostart=true -stdout_logfile=/var/log/services/gotrue.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/etc/supervisor/services/group.conf b/docker/all-in-one/etc/supervisor/services/group.conf deleted file mode 100644 index ef6673d59..000000000 --- a/docker/all-in-one/etc/supervisor/services/group.conf +++ /dev/null @@ -1,3 +0,0 @@ -[group:services] -programs=gotrue,kong,postgrest -priority=100 diff --git a/docker/all-in-one/etc/supervisor/services/kong.conf b/docker/all-in-one/etc/supervisor/services/kong.conf deleted file mode 100644 index 04f5219a8..000000000 --- a/docker/all-in-one/etc/supervisor/services/kong.conf +++ /dev/null @@ -1,11 +0,0 @@ -[program:kong] -command=/init/start-kong.sh -user=kong -autorestart=true -autostart=true -stopasgroup=true -startretries=1000 -environment=KONG_NGINX_DAEMON="off" -stdout_logfile=/var/log/services/kong.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/etc/supervisor/services/pgbouncer.conf b/docker/all-in-one/etc/supervisor/services/pgbouncer.conf deleted file mode 100644 index 6926c34bc..000000000 --- a/docker/all-in-one/etc/supervisor/services/pgbouncer.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:pgbouncer] -command=/usr/sbin/pgbouncer /etc/pgbouncer/pgbouncer.ini -user=pgbouncer -stopsignal=INT -autorestart=false -autostart=false -stdout_logfile=/var/log/services/pgbouncer.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=150 diff --git a/docker/all-in-one/etc/supervisor/services/postgrest.conf b/docker/all-in-one/etc/supervisor/services/postgrest.conf deleted file mode 100644 index ad43b5208..000000000 --- a/docker/all-in-one/etc/supervisor/services/postgrest.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:postgrest] -command=/etc/postgrest/bootstrap.sh /etc/postgrest/generated.conf /etc/postgrest/base.conf -user=postgrest -autorestart=true -autostart=true -stopasgroup=true -startretries=1000 -stdout_logfile=/var/log/services/postgrest.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/etc/supervisor/supervisord.conf b/docker/all-in-one/etc/supervisor/supervisord.conf deleted file mode 100644 index d64f40f71..000000000 --- a/docker/all-in-one/etc/supervisor/supervisord.conf +++ /dev/null @@ -1,170 +0,0 @@ -; Sample supervisor config file. -; -; For more information on the config file, please see: -; http://supervisord.org/configuration.html -; -; Notes: -; - Shell expansion ("~" or "$HOME") is not supported. Environment -; variables can be expanded using this syntax: "%(ENV_HOME)s". -; - Quotes around values are not supported, except in the case of -; the environment= options as shown below. -; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". -; - Command will be truncated if it looks like a config file comment, e.g. -; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ". -; -; Warning: -; Paths throughout this example file use /tmp because it is available on most -; systems. You will likely need to change these to locations more appropriate -; for your system. Some systems periodically delete older files in /tmp. -; Notably, if the socket file defined in the [unix_http_server] section below -; is deleted, supervisorctl will be unable to connect to supervisord. - -[unix_http_server] -file=/tmp/supervisor.sock ; the path to the socket file -chmod=0760 ; socket file mode (default 0700) -chown=root:root ; socket file uid:gid owner -;username=user ; default is no username (open server) -;password=123 ; default is no password (open server) - -; Security Warning: -; The inet HTTP server is not enabled by default. The inet HTTP server is -; enabled by uncommenting the [inet_http_server] section below. The inet -; HTTP server is intended for use within a trusted environment only. It -; should only be bound to localhost or only accessible from within an -; isolated, trusted network. The inet HTTP server does not support any -; form of encryption. The inet HTTP server does not use authentication -; by default (see the username= and password= options to add authentication). -; Never expose the inet HTTP server to the public internet. - -;[inet_http_server] ; inet (TCP) server disabled by default -;port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface -;username=user ; default is no username (open server) -;password=123 ; default is no password (open server) - -[supervisord] -logfile=/tmp/supervisord.log ; main log file; default $CWD/supervisord.log -logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB -logfile_backups=10 ; # of main logfile backups; 0 means none, default 10 -loglevel=info ; log level; default info; others: debug,warn,trace -pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid -nodaemon=true ; start in foreground if true; default false -silent=false ; no logs to stdout if true; default false -minfds=1024 ; min. avail startup file descriptors; default 1024 -minprocs=200 ; min. avail process descriptors;default 200 -user=root ; setuid to this UNIX account at startup; recommended if root -;umask=022 ; process file creation umask; default 022 -;identifier=supervisor ; supervisord identifier, default is 'supervisor' -;directory=/tmp ; default is not to cd during start -;nocleanup=true ; don't clean up tempfiles at start; default false -;childlogdir=/tmp ; 'AUTO' child log dir, default $TEMP -;environment=KEY="value" ; key value pairs to add to environment -;strip_ansi=false ; strip ansi escape codes in logs; def. false - -; The rpcinterface:supervisor section must remain in the config file for -; RPC (supervisorctl/web interface) to work. Additional interfaces may be -; added by defining them in separate [rpcinterface:x] sections. - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -; The supervisorctl section configures how supervisorctl will connect to -; supervisord. configure it match the settings in either the unix_http_server -; or inet_http_server section. - -[supervisorctl] -serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket -;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket -;username=chris ; should be same as in [*_http_server] if set -;password=123 ; should be same as in [*_http_server] if set -;prompt=mysupervisor ; cmd line prompt (default "supervisor") -;history_file=~/.sc_history ; use readline history if available - -; The sample program section below shows all possible program subsection values. -; Create one or more 'real' program: sections to be able to control them under -; supervisor. - -;[program:theprogramname] -;command=/bin/cat ; the program (relative uses PATH, can take args) -;process_name=%(program_name)s ; process_name expr (default %(program_name)s) -;numprocs=1 ; number of processes copies to start (def 1) -;directory=/tmp ; directory to cwd to before exec (def no cwd) -;umask=022 ; umask for process (default None) -;priority=999 ; the relative start priority (default 999) -;autostart=true ; start at supervisord start (default: true) -;startsecs=1 ; # of secs prog must stay up to be running (def. 1) -;startretries=3 ; max # of serial start failures when starting (default 3) -;autorestart=unexpected ; when to restart if exited after running (def: unexpected) -;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) -;stopsignal=QUIT ; signal used to kill process (default TERM) -;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) -;stopasgroup=false ; send stop signal to the UNIX process group (default false) -;killasgroup=false ; SIGKILL the UNIX process group (def false) -;user=chrism ; setuid to this UNIX account to run the program -;redirect_stderr=true ; redirect proc stderr to stdout (default false) -;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO -;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) -;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) -;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) -;stdout_events_enabled=false ; emit events on stdout writes (default false) -;stdout_syslog=false ; send stdout to syslog with process name (default false) -;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO -;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) -;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) -;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) -;stderr_events_enabled=false ; emit events on stderr writes (default false) -;stderr_syslog=false ; send stderr to syslog with process name (default false) -;environment=A="1",B="2" ; process environment additions (def no adds) -;serverurl=AUTO ; override serverurl computation (childutils) - -; The sample eventlistener section below shows all possible eventlistener -; subsection values. Create one or more 'real' eventlistener: sections to be -; able to handle event notifications sent by supervisord. - -;[eventlistener:theeventlistenername] -;command=/bin/eventlistener ; the program (relative uses PATH, can take args) -;process_name=%(program_name)s ; process_name expr (default %(program_name)s) -;numprocs=1 ; number of processes copies to start (def 1) -;events=EVENT ; event notif. types to subscribe to (req'd) -;buffer_size=10 ; event buffer queue size (default 10) -;directory=/tmp ; directory to cwd to before exec (def no cwd) -;umask=022 ; umask for process (default None) -;priority=-1 ; the relative start priority (default -1) -;autostart=true ; start at supervisord start (default: true) -;startsecs=1 ; # of secs prog must stay up to be running (def. 1) -;startretries=3 ; max # of serial start failures when starting (default 3) -;autorestart=unexpected ; autorestart if exited after running (def: unexpected) -;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) -;stopsignal=QUIT ; signal used to kill process (default TERM) -;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) -;stopasgroup=false ; send stop signal to the UNIX process group (default false) -;killasgroup=false ; SIGKILL the UNIX process group (def false) -;user=chrism ; setuid to this UNIX account to run the program -;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners -;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO -;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) -;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) -;stdout_events_enabled=false ; emit events on stdout writes (default false) -;stdout_syslog=false ; send stdout to syslog with process name (default false) -;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO -;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) -;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) -;stderr_events_enabled=false ; emit events on stderr writes (default false) -;stderr_syslog=false ; send stderr to syslog with process name (default false) -;environment=A="1",B="2" ; process environment additions -;serverurl=AUTO ; override serverurl computation (childutils) - -; The sample group section below shows all possible group values. Create one -; or more 'real' group: sections to create "heterogeneous" process groups. - -;[group:thegroupname] -;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions -;priority=999 ; the relative start priority (default 999) - -; The [include] section can just contain the "files" setting. This -; setting can list multiple files (separated by whitespace or -; newlines). It can also contain wildcards. The filenames are -; interpreted as relative to this file. Included files *cannot* -; include files themselves. - -[include] -files = base-services/*.conf diff --git a/docker/all-in-one/etc/tmpfiles.d/pgbouncer.conf b/docker/all-in-one/etc/tmpfiles.d/pgbouncer.conf deleted file mode 100644 index d5d2cd49d..000000000 --- a/docker/all-in-one/etc/tmpfiles.d/pgbouncer.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Directory for PostgreSQL sockets, lockfiles and stats tempfiles -d /run/pgbouncer 2775 pgbouncer postgres - - \ No newline at end of file diff --git a/docker/all-in-one/etc/vector/vector.yaml b/docker/all-in-one/etc/vector/vector.yaml deleted file mode 100644 index 8bcf867b8..000000000 --- a/docker/all-in-one/etc/vector/vector.yaml +++ /dev/null @@ -1,306 +0,0 @@ -data_dir: /var/lib/vector -sources: - gotrue_log: - type: file - include: - - /var/log/services/gotrue.log - - postgrest_log: - type: file - include: - - /var/log/services/postgrest.log - - pgbouncer_log: - type: file - include: - - /var/log/services/pgbouncer.log - - pitr_log: - type: file - include: - - /var/log/wal-g/pitr.log - read_from: end - - postgres_log: - type: file - include: - - /var/log/postgresql/postgres*.csv - read_from: end - multiline: - start_pattern: '^20[0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]{3} UTC,"' - mode: halt_before - condition_pattern: '^20[0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]{3} UTC,"' - timeout_ms: 500 - -transforms: - csv_parse: - type: remap - inputs: - - postgres_log - source: |- - csv_data = parse_csv!(.message) - .metadata.parsed.timestamp = csv_data[0] - .metadata.parsed.user_name = csv_data[1] - .metadata.parsed.database_name = csv_data[2] - .metadata.parsed.process_id = to_int(csv_data[3]) ?? null - .metadata.parsed.connection_from = csv_data[4] - .metadata.parsed.session_id = csv_data[5] - .metadata.parsed.session_line_num = to_int(csv_data[6]) ?? null - .metadata.parsed.command_tag = csv_data[7] - .metadata.parsed.session_start_time = csv_data[8] - .metadata.parsed.virtual_transaction_id = csv_data[9] - .metadata.parsed.transaction_id = to_int(csv_data[10]) ?? null - .metadata.parsed.error_severity = csv_data[11] - .metadata.parsed.sql_state_code = csv_data[12] - .metadata.parsed.message = csv_data[13] - .metadata.parsed.detail = csv_data[14] - .metadata.parsed.hint = csv_data[15] - .metadata.parsed.internal_query = csv_data[16] - .metadata.parsed.internal_query_pos = to_int(csv_data[17]) ?? null - .metadata.parsed.context = csv_data[18] - .metadata.parsed.query = csv_data[19] - .metadata.parsed.query_pos = to_int(csv_data[20]) ?? null - .metadata.parsed.location = csv_data[21] - .metadata.parsed.application_name = csv_data[22] - .metadata.parsed.backend_type = csv_data[23] - .metadata.parsed.leader_pid = to_int(csv_data[24]) ?? null - .metadata.parsed.query_id = to_int(csv_data[25]) ?? null - - z_ts = replace!(.metadata.parsed.timestamp, " UTC", "Z") - iso8601_ts = replace(z_ts, " ", "T") - - .timestamp = iso8601_ts - - # Sends original csv log line duplicating data. Used for QA. - # .metadata.parsed_from = .message - - .message = del(.metadata.parsed.message) - .metadata.host = del(.host) - del(.file) - del(.source_type) - - drop_metrics: - type: filter - inputs: - - csv_parse - condition: > - .metadata.parsed.application_name != "postgres_exporter" && .metadata.parsed.application_name != "realtime_rls" && !contains!(.message, "disconnection: session time") - - add_project_ref: - type: add_fields - inputs: - - drop_metrics - fields: - project: {{ .ProjectRef }} - - auth_failures: - type: filter - inputs: - - postgres_log - condition: >- - contains!(.message, "password authentication failed for user") - - filter_pgbouncer_stats: - type: filter - inputs: - - pgbouncer_log - condition: >- - !starts_with!(.message, "stats:") && !starts_with!(.message, "kernel file descriptor limit") && !contains!(.message, "FIXME") - - filter_postgrest_stats: - type: filter - inputs: - - postgrest_log - condition: >- - !starts_with!(.message, "+") && !starts_with!(.message, "INFO:") && !contains!(.message, "Admin server listening") - - gotrue_to_object: - inputs: - - gotrue_log - type: remap - source: |2- - .project = "{{ .ProjectRef }}" - - .parsed, err = parse_json(.message) - if err == null { - .metadata = .parsed - .metadata.msg = .parsed.msg - .timestamp = del(.metadata.time) - } - del(.parsed) - .metadata.host = del(.host) - - del(.source_type) - del(.PRIORITY) - del(.SYSLOG_FACILITY) - del(.SYSLOG_IDENTIFIER) - del(._BOOT_ID) - del(._CAP_EFFECTIVE) - del(._CMDLINE) - del(._COMM) - del(._EXE) - del(._GID) - del(._MACHINE_ID) - del(._PID) - del(._SELINUX_CONTEXT) - del(._STREAM_ID) - del(._SYSTEMD_CGROUP) - del(._SYSTEMD_INVOCATION_ID) - del(._SYSTEMD_SLICE) - del(._SYSTEMD_UNIT) - del(._TRANSPORT) - del(._UID) - del(.__MONOTONIC_TIMESTAMP) - del(.__REALTIME_TIMESTAMP) - - postgrest_to_object: - inputs: - - filter_postgrest_stats - type: remap - source: |2- - .project = "{{ .ProjectRef }}" - - # removes timestamp embedded in log since Vector already sends it - .message = replace!(.message, r'^\d+/\w+/\d+:\d+:\d+:\d+\s\+\d+:\s', "") - .metadata.host = del(.host) - del(.source_type) - del(.PRIORITY) - del(.SYSLOG_FACILITY) - del(.SYSLOG_IDENTIFIER) - del(._BOOT_ID) - del(._CAP_EFFECTIVE) - del(._CMDLINE) - del(._COMM) - del(._EXE) - del(._GID) - del(._MACHINE_ID) - del(._PID) - del(._SELINUX_CONTEXT) - del(._STREAM_ID) - del(._SYSTEMD_CGROUP) - del(._SYSTEMD_INVOCATION_ID) - del(._SYSTEMD_SLICE) - del(._SYSTEMD_UNIT) - del(._TRANSPORT) - del(._UID) - del(.__MONOTONIC_TIMESTAMP) - del(.__REALTIME_TIMESTAMP) - - pgbouncer_to_object: - inputs: - - filter_pgbouncer_stats - type: remap - source: |2- - .project = "{{ .ProjectRef }}" - .metadata.host = del(.host) - del(.source_type) - del(.PRIORITY) - del(.SYSLOG_IDENTIFIER) - del(._BOOT_ID) - del(._CAP_EFFECTIVE) - del(._CMDLINE) - del(._COMM) - del(._EXE) - del(._GID) - del(._MACHINE_ID) - del(._PID) - del(._SELINUX_CONTEXT) - del(._SOURCE_REALTIME_TIMESTAMP) - del(._SYSTEMD_CGROUP) - del(._SYSTEMD_INVOCATION_ID) - del(._SYSTEMD_SLICE) - del(._SYSTEMD_UNIT) - del(._TRANSPORT) - del(._UID) - del(.__MONOTONIC_TIMESTAMP) - del(.__REALTIME_TIMESTAMP) - - pitr_to_object: - inputs: - - pitr_log - type: remap - source: |2- - .project = "{{ .ProjectRef }}" - - .parsed, err = parse_key_value(.message) - if err == null { - .metadata = .parsed - .metadata.host = del(.host) - .message = del(.metadata.msg) - .timestamp = del(.metadata.time) - } - - del(.parsed) - del(.source_type) - del(.file) - - filter_pitr_error: - inputs: - - pitr_to_object - type: filter - condition: > - .metadata.level != "info" - -sinks: - http_gotrue: - type: "http" - inputs: - - gotrue_to_object - encoding: - codec: "json" - method: "post" - compression: none - request: - retry_max_duration_secs: 10 - uri: "https://{{ .LogflareHost }}/logs?api_key={{ .ApiKey }}&source={{ .GotrueSource }}" - - http_postgrest: - type: http - inputs: - - postgrest_to_object - encoding: - codec: "json" - method: "post" - compression: none - request: - retry_max_duration_secs: 10 - uri: "https://{{ .LogflareHost }}/logs?api_key={{ .ApiKey }}&source={{ .PostgrestSource }}" - - http_pgbouncer: - type: http - inputs: - - pgbouncer_to_object - encoding: - codec: json - compression: none - uri: "https://{{ .LogflareHost }}/logs?api_key={{ .ApiKey }}&source={{ .PgbouncerSource }}" - - http_pitr_error: - type: http - inputs: - - filter_pitr_error - encoding: - codec: json - compression: none - uri: "https://{{ .LogflareHost }}/logs?api_key={{ .ApiKey }}&source={{ .PitrErrorsSource }}" - - http_postgres: - type: http - inputs: - - add_project_ref - encoding: - codec: "json" - method: "post" - compression: none - request: - retry_max_duration_secs: 10 - uri: "https://{{ .LogflareHost }}/logs?api_key={{ .ApiKey }}&source={{ .DbSource }}" - - file_postgres: - type: file - inputs: - - auth_failures - encoding: - codec: text - path: >- - /var/log/postgresql/auth-failures.csv diff --git a/docker/all-in-one/healthcheck.sh b/docker/all-in-one/healthcheck.sh deleted file mode 100755 index 0b5c9607d..000000000 --- a/docker/all-in-one/healthcheck.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -eou pipefail - -# database up -pg_isready -U postgres -h localhost -p 5432 - -if [ -f "/tmp/init.json" ]; then - ADMIN_API_KEY=${ADMIN_API_KEY:-$(jq -r '.["supabase_admin_key"]' /tmp/init.json)} -fi - -# adminapi up -if [ -d "$ADMIN_API_CERT_DIR" ]; then - curl -sSkf "https://localhost:$ADMIN_API_PORT/health" -H "apikey: $ADMIN_API_KEY" -else - curl -sSf "http://localhost:$ADMIN_API_PORT/health" -H "apikey: $ADMIN_API_KEY" -fi - -if [ "${POSTGRES_ONLY:-}" ]; then - exit 0 -fi - -# postgrest up -curl -sSfI "http://localhost:$PGRST_ADMIN_SERVER_PORT/ready" - -# gotrue up -curl -sSf "http://localhost:$GOTRUE_API_PORT/health" - -if [ "${ENVOY_ENABLED:-}" == "true" ]; then - # envoy up - curl -sSfI "http://localhost:$ENVOY_HTTP_PORT/health" -else - # kong up - kong health -fi - -# fail2ban up -fail2ban-client status - -# prometheus exporter up -curl -sSfI "http://localhost:$PGEXPORTER_PORT/metrics" - -# vector is up (if starting logflare) -# TODO: make this non-conditional once we set up local logflare for testinfra -if [ -n "${LOGFLARE_API_KEY:-}" ]; then - curl -sSfI "http://localhost:$VECTOR_API_PORT/health" -fi diff --git a/docker/all-in-one/init/configure-admin-mgr.sh b/docker/all-in-one/init/configure-admin-mgr.sh deleted file mode 100755 index 98ebf6c17..000000000 --- a/docker/all-in-one/init/configure-admin-mgr.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -eou pipefail - -touch "/var/log/wal-g/pitr.log" -chown postgres:postgres "/var/log/wal-g/pitr.log" -chmod 0666 "/var/log/wal-g/pitr.log" - -/usr/local/bin/configure-shim.sh /dist/admin-mgr /usr/bin/admin-mgr diff --git a/docker/all-in-one/init/configure-adminapi.sh b/docker/all-in-one/init/configure-adminapi.sh deleted file mode 100755 index e56e5ee0c..000000000 --- a/docker/all-in-one/init/configure-adminapi.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -set -eou pipefail - -ADMIN_API_CONF=/etc/adminapi/adminapi.yaml -touch /var/log/services/adminapi.log - -ADMINAPI_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/adminapi" - -/usr/local/bin/configure-shim.sh /dist/supabase-admin-api /opt/supabase-admin-api - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init adminapi payload" - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/adminapi/adminapi.yaml - chown adminapi:adminapi ./etc/adminapi/adminapi.yaml - - mkdir -p $ADMIN_API_CERT_DIR - tar -xzvf "$INIT_PAYLOAD_PATH" -C $ADMIN_API_CERT_DIR --strip-components 2 ./ssl/server.crt - tar -xzvf "$INIT_PAYLOAD_PATH" -C $ADMIN_API_CERT_DIR --strip-components 2 ./ssl/server.key - chown -R adminapi:root $ADMIN_API_CERT_DIR - chmod 700 -R $ADMIN_API_CERT_DIR -else - PROJECT_REF=${PROJECT_REF:-default} - PGBOUNCER_PASSWORD=${PGBOUNCER_PASSWORD:-$POSTGRES_PASSWORD} - SUPABASE_URL=${SUPABASE_URL:-https://api.supabase.io/system} - REPORTING_TOKEN=${REPORTING_TOKEN:-token} - - sed -i "s|{{ .JwtSecret }}|$JWT_SECRET|g" $ADMIN_API_CONF - sed -i "s|{{ .PgbouncerPassword }}|$PGBOUNCER_PASSWORD|g" $ADMIN_API_CONF - sed -i "s|{{ .ProjectRef }}|$PROJECT_REF|g" $ADMIN_API_CONF - sed -i "s|{{ .SupabaseUrl }}|$SUPABASE_URL|g" $ADMIN_API_CONF - sed -i "s|{{ .ReportingToken }}|$REPORTING_TOKEN|g" $ADMIN_API_CONF -fi - -# Allow adminapi to write to /etc and manage Postgres configs -chmod g+w /etc -chmod -R 0775 /etc/postgresql -chmod -R 0775 /etc/postgresql-custom -chmod -R 0775 /etc/pgbouncer-custom - -# Update api port -sed -i "s|^port: .*$|port: ${ADMIN_API_PORT:-8085}|g" $ADMIN_API_CONF - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - mkdir -p "${ADMINAPI_CUSTOM_DIR}" - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom adminapi config from /etc/adminapi to ${ADMINAPI_CUSTOM_DIR}" - cp -R "/etc/adminapi/." "${ADMINAPI_CUSTOM_DIR}/" - fi - - rm -rf "/etc/adminapi" - ln -s "${ADMINAPI_CUSTOM_DIR}" "/etc/adminapi" - chown -R adminapi:adminapi "/etc/adminapi" - - chown -R adminapi:adminapi "${ADMINAPI_CUSTOM_DIR}" - chmod g+wrx "${ADMINAPI_CUSTOM_DIR}" -fi diff --git a/docker/all-in-one/init/configure-autoshutdown.sh b/docker/all-in-one/init/configure-autoshutdown.sh deleted file mode 100755 index 66343e518..000000000 --- a/docker/all-in-one/init/configure-autoshutdown.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eou pipefail - -mkdir -p /etc/supa-shutdown - -AUTOSHUTDOWN_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/supa-shutdown" -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - mkdir -p "${AUTOSHUTDOWN_CUSTOM_DIR}" - - AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH="${AUTOSHUTDOWN_CUSTOM_DIR}/shutdown.conf" - if [ ! -f "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" ]; then - echo "Copying existing custom shutdown config from /etc/supa-shutdown to ${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" - cp "/etc/supa-shutdown/shutdown.conf" "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" - fi - - rm -f "/etc/supa-shutdown/shutdown.conf" - ln -s "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" "/etc/supa-shutdown/shutdown.conf" - chmod g+wrx "${AUTOSHUTDOWN_CUSTOM_DIR}" - chown -R adminapi:adminapi "/etc/supa-shutdown/shutdown.conf" - chown -R adminapi:adminapi "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" -fi diff --git a/docker/all-in-one/init/configure-envoy.sh b/docker/all-in-one/init/configure-envoy.sh deleted file mode 100755 index 4d3382f8a..000000000 --- a/docker/all-in-one/init/configure-envoy.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -eou pipefail - -if [[ "${ENVOY_ENABLED:-}" != "true" ]]; then - exit -fi - -ENVOY_CDS_CONF=/etc/envoy/cds.yaml -ENVOY_LDS_CONF=/etc/envoy/lds.yaml -touch /var/log/services/envoy.log - -/usr/local/bin/configure-shim.sh /dist/envoy /opt/envoy - -if [[ -n "${DATA_VOLUME_MOUNTPOINT}" ]]; then - ENVOY_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/envoy" - mkdir -p "${ENVOY_CUSTOM_DIR}" - if [[ ! -f "${CONFIGURED_FLAG_PATH}" ]]; then - echo "Copying existing custom envoy config from /etc/envoy/ to ${ENVOY_CUSTOM_DIR}" - cp -R "/etc/envoy/." "${ENVOY_CUSTOM_DIR}/" - fi - - rm -rf "/etc/envoy" - ln -s "${ENVOY_CUSTOM_DIR}" "/etc/envoy" - chown -R envoy:envoy "/etc/envoy" - chmod -R g+w "/etc/envoy" - - chown -R envoy:envoy "${ENVOY_CUSTOM_DIR}" - chmod -R g+w "${ENVOY_CUSTOM_DIR}" - chmod g+rx "${ENVOY_CUSTOM_DIR}" -fi - -if [[ -f "${INIT_PAYLOAD_PATH:-}" ]]; then - echo "init envoy payload" - tar -xzvhf "${INIT_PAYLOAD_PATH}" -C / ./etc/envoy/ - chown -HR envoy:envoy /etc/envoy - chmod -HR g+w /etc/envoy -fi - -# Inject project specific configuration -# "c2VydmljZV9yb2xlOnNlcnZpY2Vfa2V5" is base64-encoded "service_role:service_key". -sed -i -e "s|anon_key|${ANON_KEY}|g" \ - -e "s|service_key|${SERVICE_ROLE_KEY}|g" \ - -e "s|supabase_admin_key|${ADMIN_API_KEY}|g" \ - -e "s|c2VydmljZV9yb2xlOnNlcnZpY2Vfa2V5|$(echo -n "service_role:${SERVICE_ROLE_KEY}" | base64 --wrap 0)|g" \ - "${ENVOY_LDS_CONF}" - -# Update Envoy ports -sed -i "s|port_value: 80$|port_value: ${ENVOY_HTTP_PORT}|g" "${ENVOY_LDS_CONF}" -sed -i "s|port_value: 443$|port_value: ${ENVOY_HTTPS_PORT}|g" "${ENVOY_LDS_CONF}" -sed -i "s|port_value: 3000$|port_value: ${PGRST_SERVER_PORT}|g" "${ENVOY_CDS_CONF}" -sed -i "s|port_value: 3001$|port_value: ${PGRST_ADMIN_SERVER_PORT}|g" "${ENVOY_CDS_CONF}" -sed -i "s|port_value: 8085$|port_value: ${ADMIN_API_PORT}|g" "${ENVOY_CDS_CONF}" -sed -i "s|port_value: 9999$|port_value: ${GOTRUE_API_PORT}|g" "${ENVOY_CDS_CONF}" diff --git a/docker/all-in-one/init/configure-exporter.sh b/docker/all-in-one/init/configure-exporter.sh deleted file mode 100755 index 93498c4e6..000000000 --- a/docker/all-in-one/init/configure-exporter.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -eou pipefail - -touch /var/log/services/exporter.log - diff --git a/docker/all-in-one/init/configure-fail2ban.sh b/docker/all-in-one/init/configure-fail2ban.sh deleted file mode 100755 index 39b0a27a6..000000000 --- a/docker/all-in-one/init/configure-fail2ban.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -eou pipefail - -mkdir -p /var/run/fail2ban -touch /var/log/services/fail2ban.log -touch /var/log/postgresql/auth-failures.csv diff --git a/docker/all-in-one/init/configure-gotrue.sh b/docker/all-in-one/init/configure-gotrue.sh deleted file mode 100755 index 5fe4ad25e..000000000 --- a/docker/all-in-one/init/configure-gotrue.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -eou pipefail - -touch /var/log/services/gotrue.log - -GOTRUE_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/gotrue" -GOTRUE_CUSTOM_CONFIG_FILE_PATH="${DATA_VOLUME_MOUNTPOINT}/etc/gotrue/gotrue.env" - -/usr/local/bin/configure-shim.sh /dist/gotrue /opt/gotrue/gotrue - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - mkdir -p "${GOTRUE_CUSTOM_DIR}" - chmod g+wrx "${GOTRUE_CUSTOM_DIR}" - chown adminapi:adminapi "${GOTRUE_CUSTOM_DIR}" - - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing GoTrue config from /etc/gotrue.env to ${GOTRUE_CUSTOM_CONFIG_FILE_PATH}" - cp "/etc/gotrue.env" "${GOTRUE_CUSTOM_CONFIG_FILE_PATH}" - fi - - rm -f "/etc/gotrue.env" - ln -s "${GOTRUE_CUSTOM_CONFIG_FILE_PATH}" "/etc/gotrue.env" - chown -R adminapi:adminapi "/etc/gotrue.env" - - chown -R adminapi:adminapi "${GOTRUE_CUSTOM_CONFIG_FILE_PATH}" - chmod g+rx "${GOTRUE_CUSTOM_CONFIG_FILE_PATH}" -fi - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "init gotrue payload" - tar -h --overwrite -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/gotrue.env - chown -R adminapi:adminapi /etc/gotrue.env - fi -else - sed -i "s|api_external_url|${API_EXTERNAL_URL:-http://localhost}|g" /etc/gotrue.env - sed -i "s|gotrue_api_host|${GOTRUE_API_HOST:-0.0.0.0}|g" /etc/gotrue.env - sed -i "s|gotrue_site_url|$GOTRUE_SITE_URL|g" /etc/gotrue.env - sed -i "s|gotrue_jwt_secret|$JWT_SECRET|g" /etc/gotrue.env -fi diff --git a/docker/all-in-one/init/configure-kong.sh b/docker/all-in-one/init/configure-kong.sh deleted file mode 100755 index 110525d44..000000000 --- a/docker/all-in-one/init/configure-kong.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -eou pipefail - -KONG_CONF=/etc/kong/kong.yml -KONG_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/kong" - -touch /var/log/services/kong.log - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init kong payload" - # Setup ssl termination - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/kong/ - chown -R adminapi:adminapi ./etc/kong/kong.yml - chown -R adminapi:adminapi ./etc/kong/*pem - echo "ssl_cipher_suite = intermediate" >> /etc/kong/kong.conf - echo "ssl_cert = /etc/kong/fullChain.pem" >> /etc/kong/kong.conf - echo "ssl_cert_key = /etc/kong/privKey.pem" >> /etc/kong/kong.conf -else - # Default gateway config - export KONG_DNS_ORDER=LAST,A,CNAME - export KONG_PROXY_ERROR_LOG=syslog:server=unix:/dev/log - export KONG_ADMIN_ERROR_LOG=syslog:server=unix:/dev/log -fi - -# Inject project specific configuration -sed -i -e "s|anon_key|$ANON_KEY|g" \ - -e "s|service_key|$SERVICE_ROLE_KEY|g" \ - -e "s|supabase_admin_key|$ADMIN_API_KEY|g" \ - $KONG_CONF - -# Update kong ports -sed -i "s|:80 |:$KONG_HTTP_PORT |g" /etc/kong/kong.conf -sed -i "s|:443 |:$KONG_HTTPS_PORT |g" /etc/kong/kong.conf - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - mkdir -p "${KONG_CUSTOM_DIR}" - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom kong config from /etc/kong/kong.yml to ${KONG_CUSTOM_DIR}" - cp /etc/kong/kong.yml "${KONG_CUSTOM_DIR}/kong.yml" - fi - - rm -rf "/etc/kong/kong.yml" - ln -s "${KONG_CUSTOM_DIR}/kong.yml" "/etc/kong/kong.yml" - chown -R adminapi:adminapi "/etc/kong/kong.yml" - - chown -R adminapi:adminapi "${KONG_CUSTOM_DIR}" - chmod g+wrx "${KONG_CUSTOM_DIR}" -fi \ No newline at end of file diff --git a/docker/all-in-one/init/configure-pg_egress_collect.sh b/docker/all-in-one/init/configure-pg_egress_collect.sh deleted file mode 100755 index 17051aba9..000000000 --- a/docker/all-in-one/init/configure-pg_egress_collect.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -eou pipefail - -PG_EGRESS_COLLECT_FILE=/tmp/pg_egress_collect.txt - -if [ "${DATA_VOLUME_MOUNTPOINT:-}" != "" ]; then - if [ ! -L $PG_EGRESS_COLLECT_FILE ]; then - if [ -f $PG_EGRESS_COLLECT_FILE ]; then - rm -f $PG_EGRESS_COLLECT_FILE - fi - touch "${DATA_VOLUME_MOUNTPOINT}/pg_egress_collect.txt" - ln -s "${DATA_VOLUME_MOUNTPOINT}/pg_egress_collect.txt" $PG_EGRESS_COLLECT_FILE - fi -fi diff --git a/docker/all-in-one/init/configure-pgbouncer.sh b/docker/all-in-one/init/configure-pgbouncer.sh deleted file mode 100755 index c9c8062e6..000000000 --- a/docker/all-in-one/init/configure-pgbouncer.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -eou pipefail - -touch /var/log/services/pgbouncer.log - -mkdir -p /var/run/pgbouncer -chown pgbouncer:postgres /var/run/pgbouncer - -PGBOUNCER_CONF=/etc/pgbouncer/pgbouncer.ini - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init pgbouncer payload" - sed -i -E "s|^# (%include /etc/pgbouncer-custom/ssl-config.ini)$|\1|g" $PGBOUNCER_CONF - - tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/pgbouncer/ --strip-components 3 ./etc/pgbouncer/userlist.txt - chown -R pgbouncer:pgbouncer /etc/pgbouncer/userlist.txt -fi - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - /opt/supabase-admin-api optimize pgbouncer --destination-config-file-path /etc/pgbouncer-custom/generated-optimizations.ini - - # Preserve pgbouncer configs across restarts - PGBOUNCER_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/pgbouncer" - PGBOUNCER_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/pgbouncer-custom" - - mkdir -p "${PGBOUNCER_DIR}" - mkdir -p "${PGBOUNCER_CUSTOM_DIR}" - - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom pgbouncer config from /etc/pgbouncer-custom to ${PGBOUNCER_CUSTOM_DIR}" - cp -R "/etc/pgbouncer-custom/." "${PGBOUNCER_CUSTOM_DIR}/" - cp -R "/etc/pgbouncer/." "${PGBOUNCER_DIR}/" - fi - - rm -rf "/etc/pgbouncer-custom" - ln -s "${PGBOUNCER_CUSTOM_DIR}" "/etc/pgbouncer-custom" - chown -R pgbouncer:pgbouncer "/etc/pgbouncer-custom" - chown -R pgbouncer:pgbouncer "${PGBOUNCER_CUSTOM_DIR}" - chmod -R g+wrx "${PGBOUNCER_CUSTOM_DIR}" - - rm -rf "/etc/pgbouncer" - ln -s "${PGBOUNCER_DIR}" "/etc/pgbouncer" - chown -R pgbouncer:pgbouncer "/etc/pgbouncer" - chown -R pgbouncer:pgbouncer "${PGBOUNCER_DIR}" - chmod -R g+wrx "${PGBOUNCER_DIR}" -fi diff --git a/docker/all-in-one/init/configure-postgrest.sh b/docker/all-in-one/init/configure-postgrest.sh deleted file mode 100755 index 20f5a9902..000000000 --- a/docker/all-in-one/init/configure-postgrest.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -set -eou pipefail - -touch /var/log/services/postgrest.log - -# Default in-database config -sed -i "s|pgrst_server_port|${PGRST_SERVER_PORT:-3000}|g" /etc/postgrest/base.conf -sed -i "s|pgrst_admin_server_port|${PGRST_ADMIN_SERVER_PORT:-3001}|g" /etc/postgrest/base.conf -sed -i "s|pgrst_db_schemas|${PGRST_DB_SCHEMAS:-public,storage,graphql_public}|g" /etc/postgrest/base.conf -sed -i "s|pgrst_db_extra_search_path|${PGRST_DB_SCHEMAS:-public,extensions}|g" /etc/postgrest/base.conf -sed -i "s|pgrst_db_anon_role|${PGRST_DB_ANON_ROLE:-anon}|g" /etc/postgrest/base.conf -sed -i "s|pgrst_jwt_secret|$JWT_SECRET|g" /etc/postgrest/base.conf - -/usr/local/bin/configure-shim.sh /dist/postgrest /opt/postgrest - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init postgrest payload" - tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgrest/base.conf - chown -R postgrest:postgrest /etc/postgrest -fi - -if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then - POSTGREST_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/postgrest" - mkdir -p "${POSTGREST_CUSTOM_DIR}" - if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then - echo "Copying existing custom PostgREST config from /etc/postgrest/ to ${POSTGREST_CUSTOM_DIR}" - cp -R "/etc/postgrest/." "${POSTGREST_CUSTOM_DIR}/" - fi - - rm -rf "/etc/postgrest" - ln -s "${POSTGREST_CUSTOM_DIR}" "/etc/postgrest" - chown -R postgrest:postgrest "/etc/postgrest" - - chown -R postgrest:postgrest "${POSTGREST_CUSTOM_DIR}" - chmod g+wrx "${POSTGREST_CUSTOM_DIR}" -fi - -PGRST_CONF=/etc/postgrest/generated.conf - -/opt/supabase-admin-api optimize postgrest --destination-config-file-path $PGRST_CONF -cat /etc/postgrest/base.conf >> $PGRST_CONF diff --git a/docker/all-in-one/init/configure-vector.sh b/docker/all-in-one/init/configure-vector.sh deleted file mode 100755 index 9177a0f94..000000000 --- a/docker/all-in-one/init/configure-vector.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -set -eou pipefail - -VECTOR_CONF=/etc/vector/vector.yaml -touch /var/log/services/vector.log - -if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init vector payload" - tar -xzvf "$INIT_PAYLOAD_PATH" -C /etc/vector/ --strip-components 2 ./tmp/init.json - PROJECT_REF=$(jq -r '.["project_ref"]' /etc/vector/init.json) - LOGFLARE_DB_SOURCE=$(jq -r '.["logflare_db_source"]' /etc/vector/init.json) - LOGFLARE_GOTRUE_SOURCE=$(jq -r '.["logflare_gotrue_source"]' /etc/vector/init.json) - LOGFLARE_POSTGREST_SOURCE=$(jq -r '.["logflare_postgrest_source"]' /etc/vector/init.json) - LOGFLARE_PGBOUNCER_SOURCE=$(jq -r '.["logflare_pgbouncer_source"]' /etc/vector/init.json) - LOGFLARE_PITR_ERRORS_SOURCE=$(jq -r '.["logflare_pitr_errors_source"]' /etc/vector/init.json) - LOGFLARE_API_KEY=$(jq -r '.["logflare_api_key"]' /etc/vector/init.json) -fi - -# Exit early if not starting logflare -if [ -z "${LOGFLARE_API_KEY:-}" ]; then - echo "Skipped starting vector: missing LOGFLARE_API_KEY" - exit 0 -fi - -# Add vector to support both base-services and services config -cat < /etc/supervisor/services/vector.conf - -[program:vector] -command=/usr/bin/vector --config-yaml /etc/vector/vector.yaml -user=root -autorestart=true -stdout_logfile=/var/log/services/vector.log -redirect_stderr=true -stdout_logfile_maxbytes=10MB -priority=250 - -EOF - -VECTOR_API_PORT=${VECTOR_API_PORT:-9001} -PROJECT_REF=${PROJECT_REF:-default} -LOGFLARE_HOST=${LOGFLARE_HOST:-api.logflare.app} -LOGFLARE_DB_SOURCE=${LOGFLARE_DB_SOURCE:-postgres.logs} -LOGFLARE_GOTRUE_SOURCE=${LOGFLARE_GOTRUE_SOURCE:-gotrue.logs.prod} -LOGFLARE_POSTGREST_SOURCE=${LOGFLARE_POSTGREST_SOURCE:-postgREST.logs.prod} -LOGFLARE_PGBOUNCER_SOURCE=${LOGFLARE_PGBOUNCER_SOURCE:-pgbouncer.logs.prod} -LOGFLARE_PITR_ERRORS_SOURCE=${LOGFLARE_PITR_ERRORS_SOURCE:-pitr_errors.logs.prod} - -sed -i "s|{{ .ApiPort }}|$VECTOR_API_PORT|g" $VECTOR_CONF -sed -i "s|{{ .ProjectRef }}|$PROJECT_REF|g" $VECTOR_CONF -sed -i "s|{{ .LogflareHost }}|$LOGFLARE_HOST|g" $VECTOR_CONF -sed -i "s|{{ .ApiKey }}|$LOGFLARE_API_KEY|g" $VECTOR_CONF -sed -i "s|{{ .DbSource }}|$LOGFLARE_DB_SOURCE|g" $VECTOR_CONF -sed -i "s|{{ .GotrueSource }}|$LOGFLARE_GOTRUE_SOURCE|g" $VECTOR_CONF -sed -i "s|{{ .PostgrestSource }}|$LOGFLARE_POSTGREST_SOURCE|g" $VECTOR_CONF -sed -i "s|{{ .PgbouncerSource }}|$LOGFLARE_PGBOUNCER_SOURCE|g" $VECTOR_CONF -sed -i "s|{{ .PitrErrorsSource }}|$LOGFLARE_PITR_ERRORS_SOURCE|g" $VECTOR_CONF diff --git a/docker/all-in-one/init/start-kong.sh b/docker/all-in-one/init/start-kong.sh deleted file mode 100755 index 7418d26c4..000000000 --- a/docker/all-in-one/init/start-kong.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -eou pipefail - -# In the event of a restart, properly stop any running kong instances first -# Confirmed by running /usr/local/bin/kong health -trap '/usr/local/bin/kong quit' EXIT -/usr/local/bin/kong start diff --git a/docker/all-in-one/opt/pg_egress_collect/pg_egress_collect.pl b/docker/all-in-one/opt/pg_egress_collect/pg_egress_collect.pl deleted file mode 100644 index 2acc98aa6..000000000 --- a/docker/all-in-one/opt/pg_egress_collect/pg_egress_collect.pl +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env perl - -# This script receive tcpdump output through STDIN and does: -# -# 1. extract outgoing TCP packet length on the 1st non-loopback device port 5432 and 6543 -# 2. sum the length up to one minute -# 3. save the total length to file (default is /tmp/pg_egress_collect.txt) per minute -# -# Usage: -# -# tcpdump -s 128 -Q out -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl pg_egress_collect.pl -o /tmp/output.txt -# - -use POSIX; -use List::Util qw(sum); -use Getopt::Long 'HelpMessage'; -use IO::Async::Loop; -use IO::Async::Stream; -use IO::Async::Timer::Periodic; - -use strict; -use warnings; - -# total captured packets lenth in a time frame -my $captured_len = 0; - -# extract tcp packet length captured by tcpdump -# -# Sample input lines: -# -# 1674013833.940253 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60) -# 10.112.101.122.5432 > 220.235.16.223.62599: Flags [S.], cksum 0x5de3 (incorrect -> 0x63da), seq 2314200657, ack 2071735457, win 62643, options [mss 8961,sackOK,TS val 3358598837 ecr 1277499190,nop,wscale 7], length 0 -# 1674013833.989257 IP (tos 0x0, ttl 64, id 24975, offset 0, flags [DF], proto TCP (6), length 52) -# 10.112.101.122.5432 > 220.235.16.223.62599: Flags [.], cksum 0x5ddb (incorrect -> 0xa25b), seq 1, ack 9, win 490, options [nop,nop,TS val 3358598885 ecr 1277499232], length 0 -sub extract_packet_length { - my ($line) = @_; - - #print("debug: >> " . $line); - - if ($line =~ /^\s+\d+\.\d+\.\d+\.\d+\..*, length (\d+)$/) { - # extract tcp packet length and add it up - my $len = $1; - $captured_len += $len; - } -} - -# write total length to file -sub write_file { - my ($output) = @_; - - my $now = strftime "%F %T", localtime time; - print "[$now] write captured len $captured_len to $output\n"; - - open(my $fh, "+>", $output) or die "Could not open file '$output' $!"; - print $fh "$captured_len"; - close($fh) or die "Could not write file '$output' $!"; -} - -# main -sub main { - # get arguments - GetOptions( - "interval:i" => \(my $interval = 60), - "output:s" => \(my $output = "/tmp/pg_egress_collect.txt"), - "help" => sub { HelpMessage(0) }, - ) or HelpMessage(1); - - my $loop = IO::Async::Loop->new; - - # tcpdump extractor - my $extractor = IO::Async::Stream->new_for_stdin( - on_read => sub { - my ($self, $buffref, $eof) = @_; - - while($$buffref =~ s/^(.*\n)//) { - my $line = $1; - extract_packet_length($line); - } - - return 0; - }, - ); - - # schedule file writer per minute - my $writer = IO::Async::Timer::Periodic->new( - interval => $interval, - on_tick => sub { - write_file($output); - - # reset total captured length - $captured_len = 0; - }, - ); - $writer->start; - - print "pg_egress_collect started, egress data will be saved to $output at interval $interval seconds.\n"; - - $loop->add($extractor); - $loop->add($writer); - $loop->run; -} - -main(); - -__END__ - -=head1 NAME - -pg_egress_collect.pl - collect egress from tcpdump output, extract TCP packet length, aggregate in specified interval and write to output file. - -=head1 SYNOPSIS - -pg_egress_collect.pl [-i interval] [-o output] - -Options: - - -i, --interval interval - output file write interval, in seconds, default is 60 seconds - - -o, --output output - output file path, default is /tmp/pg_egress_collect.txt - - -h, --help - print this help message - -=cut diff --git a/docker/all-in-one/opt/postgres_exporter/queries.yml b/docker/all-in-one/opt/postgres_exporter/queries.yml deleted file mode 100644 index 45b9058eb..000000000 --- a/docker/all-in-one/opt/postgres_exporter/queries.yml +++ /dev/null @@ -1,345 +0,0 @@ -set_timeout: - master: true - cache_seconds: 5 - query: "set statement_timeout to '20s'" - -pg_database: - master: true - cache_seconds: 60 - query: "SELECT SUM(pg_database_size(pg_database.datname)) / (1024 * 1024) as size_mb FROM pg_database" - metrics: - - size_mb: - usage: "GAUGE" - description: "Disk space used by the database" - -pg_stat_bgwriter: - master: true - cache_seconds: 60 - query: | - select checkpoints_timed as checkpoints_timed_total, - checkpoints_req as checkpoints_req_total, - checkpoint_write_time as checkpoint_write_time_total, - checkpoint_sync_time as checkpoint_sync_time_total, - buffers_checkpoint as buffers_checkpoint_total, - buffers_clean as buffers_clean_total, - maxwritten_clean as maxwritten_clean_total, - buffers_backend as buffers_backend_total, - buffers_backend_fsync as buffers_backend_fsync_total, - buffers_alloc as buffers_alloc_total, - stats_reset - from pg_stat_bgwriter - metrics: - - checkpoints_timed_total: - usage: "COUNTER" - description: "Scheduled checkpoints performed" - - checkpoints_req_total: - usage: "COUNTER" - description: "Requested checkpoints performed" - - checkpoint_write_time_total: - usage: "COUNTER" - description: "Time spent writing checkpoint files to disk" - - checkpoint_sync_time_total: - usage: "COUNTER" - description: "Time spent synchronizing checkpoint files to disk" - - buffers_checkpoint_total: - usage: "COUNTER" - description: "Buffers written during checkpoints" - - buffers_clean_total: - usage: "COUNTER" - description: "Buffers written by bg writter" - - maxwritten_clean_total: - usage: "COUNTER" - description: "Number of times bg writer stopped a cleaning scan because it had written too many buffers" - - buffers_backend_total: - usage: "COUNTER" - description: "Buffers written directly by a backend" - - buffers_backend_fsync_total: - usage: "COUNTER" - description: "fsync calls executed by a backend directly" - - buffers_alloc_total: - usage: "COUNTER" - description: "Buffers allocated" - - stats_reset: - usage: "COUNTER" - description: "Most recent stat reset time" - -pg_stat_database: - master: true - cache_seconds: 60 - query: | - SELECT sum(numbackends) as num_backends, - sum(xact_commit) as xact_commit_total, - sum(xact_rollback) as xact_rollback_total, - sum(blks_read) as blks_read_total, - sum(blks_hit) as blks_hit_total, - sum(tup_returned) as tup_returned_total, - sum(tup_fetched) as tup_fetched_total, - sum(tup_inserted) as tup_inserted_total, - sum(tup_updated) as tup_updated_total, - sum(tup_deleted) as tup_deleted_total, - sum(conflicts) as conflicts_total, - sum(temp_files) as temp_files_total, - sum(temp_bytes) as temp_bytes_total, - sum(deadlocks) as deadlocks_total, - max(stats_reset) as most_recent_reset - FROM pg_stat_database - metrics: - - num_backends: - usage: "GAUGE" - description: "The number of active backends" - - xact_commit_total: - usage: "COUNTER" - description: "Transactions committed" - - xact_rollback_total: - usage: "COUNTER" - description: "Transactions rolled back" - - blks_read_total: - usage: "COUNTER" - description: "Number of disk blocks read" - - blks_hit_total: - usage: "COUNTER" - description: "Disk blocks found in buffer cache" - - tup_returned_total: - usage: "COUNTER" - description: "Rows returned by queries" - - tup_fetched_total: - usage: "COUNTER" - description: "Rows fetched by queries" - - tup_inserted_total: - usage: "COUNTER" - description: "Rows inserted" - - tup_updated_total: - usage: "COUNTER" - description: "Rows updated" - - tup_deleted_total: - usage: "COUNTER" - description: "Rows deleted" - - conflicts_total: - usage: "COUNTER" - description: "Queries canceled due to conflicts with recovery" - - temp_files_total: - usage: "COUNTER" - description: "Temp files created by queries" - - temp_bytes_total: - usage: "COUNTER" - description: "Temp data written by queries" - - deadlocks_total: - usage: "COUNTER" - description: "Deadlocks detected" - - most_recent_reset: - usage: "COUNTER" - description: "The most recent time one of the databases had its statistics reset" - -pg_stat_database_conflicts: - master: true - cache_seconds: 60 - query: | - SELECT sum(confl_tablespace) as confl_tablespace_total, - sum(confl_lock) as confl_lock_total, - sum(confl_snapshot) as confl_snapshot_total, - sum(confl_bufferpin) as confl_bufferpin_total, - sum(confl_deadlock) as confl_deadlock_total - from pg_stat_database_conflicts - metrics: - - confl_tablespace_total: - usage: "COUNTER" - description: "Queries cancelled due to dropped tablespaces" - - confl_lock_total: - usage: "COUNTER" - description: "Queries cancelled due to lock timeouts" - - confl_snapshot_total: - usage: "COUNTER" - description: "Queries cancelled due to old snapshots" - - confl_bufferpin_total: - usage: "COUNTER" - description: "Queries cancelled due to pinned buffers" - - confl_deadlock_total: - usage: "COUNTER" - description: "Queries cancelled due to deadlocks" - -pg_stat_statements: - master: true - cache_seconds: 60 - query: "SELECT sum(calls) as total_queries, sum(total_exec_time / 1000) as total_time_seconds FROM extensions.pg_stat_statements t1 JOIN pg_database t3 ON (t1.dbid=t3.oid)" - metrics: - - total_queries: - usage: "COUNTER" - description: "Number of times executed" - - total_time_seconds: - usage: "COUNTER" - description: "Total time spent, in seconds" - -pg_ls_archive_statusdir: - master: true - cache_seconds: 60 - query: "select count(*) as wal_pending_count from pg_ls_archive_statusdir() where name like '%.ready'" - metrics: - - wal_pending_count: - usage: "COUNTER" - description: "Number of not yet archived WAL files" - -auth_users: - master: true - cache_seconds: 21600 # 6 hours - query: "select count(id) as user_count from auth.users" - metrics: - - user_count: - usage: "GAUGE" - description: "Number of users in the project db" - -realtime: - master: true - cache_seconds: 60 - query: "select count(1) as postgres_changes_total_subscriptions, count(distinct subscription_id) as postgres_changes_client_subscriptions from realtime.subscription" - metrics: - - postgres_changes_total_subscriptions: - usage: "GAUGE" - description: "Total subscription records listening for Postgres changes" - - postgres_changes_client_subscriptions: - usage: "GAUGE" - description: "Client subscriptions listening for Postgres changes" - -replication: - master: true - cache_seconds: 60 - query: "SELECT slot_name, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS realtime_lag_bytes, active AS realtime_slot_status FROM pg_replication_slots WHERE slot_name LIKE ANY (ARRAY['realtime', 'realtime_rls', 'supabase_realtime_replication_slot%'])" - metrics: - - realtime_slot_name: - usage: "LABEL" - description: "Replication Slot Name for Realtime" - - realtime_lag_bytes: - usage: "GAUGE" - description: "Replication Lag for Realtime" - - realtime_slot_status: - usage: "GAUGE" - description: "Replication Slot Active Status" - -replication_slots: - master: true - cache_seconds: 60 - query: "SELECT max(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) AS max_lag_bytes FROM pg_replication_slots" - metrics: - - max_lag_bytes: - usage: "GAUGE" - description: "Max Replication Lag" - -storage: - master: true - cache_seconds: 60 - query: "select sum(size) / (1024 * 1024) as storage_size_mb from storage.get_size_by_bucket()" - metrics: - - storage_size_mb: - usage: "GAUGE" - description: "The total size used for all storage buckets, in mb" - -supabase_usage_metrics: - # pg_stat_statements collects metrics from all databases on the cluster, so querying just the master db should be sufficient - master: true - cache_seconds: 60 - query: | - select sum(calls) as user_queries_total - from extensions.pg_stat_statements - where query <> 'SELECT version()' - and query <> 'BEGIN ISOLATION LEVEL READ COMMITTED READ ONLY' - and query <> 'COMMIT' - and query <> 'SET client_encoding = ''UTF8''' - and query <> 'SET client_min_messages TO WARNING' - and query <> 'LISTEN "ddl_command_end"' - and query <> 'LISTEN "pgrst"' - and query <> 'SELECT * FROM migrations ORDER BY id' - and query <> 'SELECT COUNT(*) = $1 FROM pg_publication WHERE pubname = $2' - and query <> 'SELECT COUNT(*) >= $1 FROM pg_replication_slots WHERE slot_name = $2' - and query <> 'SELECT EXISTS (SELECT schema_migrations.* FROM schema_migrations AS schema_migrations WHERE version = $1)' - and query <> 'SELECT current_setting($1)::integer, current_setting($2)' - and query <> 'SELECT pg_advisory_unlock($1)' - and query <> 'SELECT pg_try_advisory_lock($1)' - and query <> 'SELECT slot_name, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) FROM pg_replication_slots' - and query <> 'SELECT typname::text, oid::int4, typarray::int4 FROM pg_type WHERE typname IN ($1,$2) ORDER BY typname' - and query <> 'select * from schema_migrations' - and query <> 'set local schema ''''' - and query <> 'SELECT SUM(pg_database_size(pg_database.datname)) / ($1 * $2) as size_mb FROM pg_database' - and query not like 'select set_config(%' - and query not like '%LATERAL (SELECT * FROM pg_namespace WHERE pg_namespace.oid = other.relnamespace) AS ns2%' - and query not like '%LEFT JOIN (pg_collation co JOIN pg_namespace nco ON co.collnamespace = nco.oid)%' - and query not like '%LEFT JOIN pg_description as d ON d.objoid = p.oid%' - and query not like '%LEFT JOIN pg_description as d on d.objoid = c.oid%' - and query not like '%-- CTE to replace information_schema.key_column_usage to remove owner limit%' - and query not like '%join pg_namespace sch on sch.oid = tbl.relnamespace%' - and query not like '%select setdatabase, unnest(setconfig) as setting from pg_catalog.pg_db_role_setting%' - and lower(trim(regexp_replace(regexp_replace(query, E'\n', ' ', 'g'), E'\\s+', ' ', 'g'))) not in - ('with rows as ( select id from net.http_request_queue order by id limit $1 ) delete from net.http_request_queue q using rows where q.id = rows.id returning q.id, q.method, q.url, timeout_milliseconds, array(select key || $2 || value from jsonb_each_text(q.headers)), q.body', - 'with rows as ( select ctid from net._http_response where created < now() - $1 order by created limit $2 ) delete from net._http_response r using rows where r.ctid = rows.ctid', - -- version of query above before https://github.com/supabase/pg_net/commit/eaa721e11761da07d01fc04b5114c90cd7973b83 - 'with rows as ( select ctid from net._http_response where created < $1 - $2 order by created limit $3 ) delete from net._http_response r using rows where r.ctid = rows.ctid', - 'select exists ( select $2 from pg_catalog.pg_class c where c.relname = $1 and c.relkind = $3 )', - 'select description from pg_namespace n left join pg_description d on d.objoid = n.oid where n.nspname = $1', - 'select concat(schemaname, $1, tablename, $2, policyname) as policy from pg_policies order by 1 desc', - 'select concat(table_schema, $1, table_name) as table from information_schema.tables where table_schema not like $2 and table_schema <> $3 order by 1 desc', - 'select concat(conrelid::regclass, $1, conname) as fk from pg_constraint where contype = $2 order by 1 desc', - 'select datname from pg_database where datallowconn = $1 order by oid asc', - 'select count(*) > $1 as pgsodium_enabled from pg_extension where extname = $2', - 'select count(*) > $1 as keys_created from pgsodium.key') - and query <> 'insert into schema_migrations (version) values ($1)' - -- temporarily included for older versions of pg_net - and query not like 'SELECT%FROM net.http_request_queue%' - and query not like 'DELETE FROM net.http_request_queue%' - and query not like '%source: project usage%' - and query not like 'select name, setting from pg_settings where name in ($1, $2)%' - and userid not in (select oid from pg_roles where rolname in ('authenticator', 'pgbouncer', 'supabase_admin', 'supabase_storage_admin')) - metrics: - - user_queries_total: - usage: "COUNTER" - description: "The total number of user queries executed" - -pg_settings: - master: true - cache-seconds: 30 - query: "SELECT COUNT(*) as default_transaction_read_only FROM pg_settings WHERE name = 'default_transaction_read_only' AND setting = 'on';" - metrics: - - default_transaction_read_only: - usage: "GAUGE" - description: "Default transaction mode set to read only" - -pg_status: - master: true - cache-seconds: 60 - query: "SELECT CASE WHEN pg_is_in_recovery() = false THEN 0 ELSE 1 END as in_recovery" - metrics: - - in_recovery: - usage: "GAUGE" - description: "Database in recovery" - -# specific to read replicas -# for primary databases, all columns will always return a value of 0 -# --- -# for checking replication lag (physical_replication_lag_seconds) -# we firstly check if the replica is connected to its primary -# and if last WAL received is equivalent to last WAL replayed -# if so return 0 -# otherwise calculate replication lag as per usual -physical_replication_lag: - master: true - cache-seconds: 60 - query: | - select - case - when (select count(*) from pg_stat_wal_receiver) = 1 and pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() - then 0 - else coalesce(extract(epoch from now() - pg_last_xact_replay_timestamp()),0) - end as physical_replication_lag_seconds, - case - when pg_is_in_recovery() - then case when pg_is_wal_replay_paused() = false then 0 else 1 end - else 0 - end as is_wal_replay_paused, - (select count(*) from pg_stat_wal_receiver) as is_connected_to_primary - metrics: - - physical_replication_lag_seconds: - usage: "GAUGE" - description: "Physical replication lag in seconds" - - is_wal_replay_paused: - usage: "GAUGE" - description: "Check if WAL replay has been paused" - - is_connected_to_primary: - usage: "GAUGE" - description: "Monitor connection to the primary database" diff --git a/docker/all-in-one/postgres-entrypoint.sh b/docker/all-in-one/postgres-entrypoint.sh deleted file mode 100755 index 52bff7847..000000000 --- a/docker/all-in-one/postgres-entrypoint.sh +++ /dev/null @@ -1,358 +0,0 @@ -#!/usr/bin/env bash - -# Downloaded from https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh -# Changes needed to make adminapi able to read the recovery.signal file: -# -44: chmod 00700 "$PGDATA" || : -# +44: chmod 00750 "$PGDATA" || : -# -# We're already including the original file in the base postgres Docker image. - -set -Eeo pipefail - -# usage: file_env VAR [DEFAULT] -# ie: file_env 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - printf >&2 'error: both %s and %s are set (but are exclusive)\n' "$var" "$fileVar" - exit 1 - fi - local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - export "$var"="$val" - unset "$fileVar" -} - -# check to see if this file is being run or sourced from another script -_is_sourced() { - # https://unix.stackexchange.com/a/215279 - [ "${#FUNCNAME[@]}" -ge 2 ] \ - && [ "${FUNCNAME[0]}" = '_is_sourced' ] \ - && [ "${FUNCNAME[1]}" = 'source' ] -} - -# used to create initial postgres directories and if run as root, ensure ownership to the "postgres" user -docker_create_db_directories() { - local user; user="$(id -u)" - - mkdir -p "$PGDATA" - # ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory) - chmod 00750 "$PGDATA" || : - - # ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289 - mkdir -p /var/run/postgresql || : - chmod 03775 /var/run/postgresql || : - - # Create the transaction log directory before initdb is run so the directory is owned by the correct user - if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then - mkdir -p "$POSTGRES_INITDB_WALDIR" - if [ "$user" = '0' ]; then - find "$POSTGRES_INITDB_WALDIR" \! -user postgres -exec chown postgres '{}' + - fi - chmod 700 "$POSTGRES_INITDB_WALDIR" - fi - - # allow the container to be started with `--user` - if [ "$user" = '0' ]; then - find "$PGDATA" \! -user postgres -exec chown postgres '{}' + - find /var/run/postgresql \! -user postgres -exec chown postgres '{}' + - fi -} - -# initialize empty PGDATA directory with new database via 'initdb' -# arguments to `initdb` can be passed via POSTGRES_INITDB_ARGS or as arguments to this function -# `initdb` automatically creates the "postgres", "template0", and "template1" dbnames -# this is also where the database user is created, specified by `POSTGRES_USER` env -docker_init_database_dir() { - # "initdb" is particular about the current user existing in "/etc/passwd", so we use "nss_wrapper" to fake that if necessary - # see https://github.com/docker-library/postgres/pull/253, https://github.com/docker-library/postgres/issues/359, https://cwrap.org/nss_wrapper.html - local uid; uid="$(id -u)" - if ! getent passwd "$uid" &> /dev/null; then - # see if we can find a suitable "libnss_wrapper.so" (https://salsa.debian.org/sssd-team/nss-wrapper/-/commit/b9925a653a54e24d09d9b498a2d913729f7abb15) - local wrapper - for wrapper in {/usr,}/lib{/*,}/libnss_wrapper.so; do - if [ -s "$wrapper" ]; then - NSS_WRAPPER_PASSWD="$(mktemp)" - NSS_WRAPPER_GROUP="$(mktemp)" - export LD_PRELOAD="$wrapper" NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP - local gid; gid="$(id -g)" - printf 'postgres:x:%s:%s:PostgreSQL:%s:/bin/false\n' "$uid" "$gid" "$PGDATA" > "$NSS_WRAPPER_PASSWD" - printf 'postgres:x:%s:\n' "$gid" > "$NSS_WRAPPER_GROUP" - break - fi - done - fi - - if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then - set -- --waldir "$POSTGRES_INITDB_WALDIR" "$@" - fi - - # --pwfile refuses to handle a properly-empty file (hence the "\n"): https://github.com/docker-library/postgres/issues/1025 - eval 'initdb --username="$POSTGRES_USER" --pwfile=<(printf "%s\n" "$POSTGRES_PASSWORD") '"$POSTGRES_INITDB_ARGS"' "$@"' - - # unset/cleanup "nss_wrapper" bits - if [[ "${LD_PRELOAD:-}" == */libnss_wrapper.so ]]; then - rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP" - unset LD_PRELOAD NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP - fi -} - -# print large warning if POSTGRES_PASSWORD is long -# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust' -# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust' -# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ] -docker_verify_minimum_env() { - # check password first so we can output the warning before postgres - # messes it up - if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then - cat >&2 <<-'EOWARN' - - WARNING: The supplied POSTGRES_PASSWORD is 100+ characters. - - This will not work if used via PGPASSWORD with "psql". - - https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412) - https://github.com/docker-library/postgres/issues/507 - - EOWARN - fi - if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then - # The - option suppresses leading tabs but *not* spaces. :) - cat >&2 <<-'EOE' - Error: Database is uninitialized and superuser password is not specified. - You must specify POSTGRES_PASSWORD to a non-empty value for the - superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run". - - You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all - connections without a password. This is *not* recommended. - - See PostgreSQL documentation about "trust": - https://www.postgresql.org/docs/current/auth-trust.html - EOE - exit 1 - fi - if [ 'trust' = "$POSTGRES_HOST_AUTH_METHOD" ]; then - cat >&2 <<-'EOWARN' - ******************************************************************************** - WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow - anyone with access to the Postgres port to access your database without - a password, even if POSTGRES_PASSWORD is set. See PostgreSQL - documentation about "trust": - https://www.postgresql.org/docs/current/auth-trust.html - In Docker's default configuration, this is effectively any other - container on the same system. - - It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace - it with "-e POSTGRES_PASSWORD=password" instead to set a password in - "docker run". - ******************************************************************************** - EOWARN - fi -} - -# usage: docker_process_init_files [file [file [...]]] -# ie: docker_process_init_files /always-initdb.d/* -# process initializer files, based on file extensions and permissions -docker_process_init_files() { - # psql here for backwards compatibility "${psql[@]}" - psql=( docker_process_sql ) - - printf '\n' - local f - for f; do - case "$f" in - *.sh) - # https://github.com/docker-library/postgres/issues/450#issuecomment-393167936 - # https://github.com/docker-library/postgres/pull/452 - if [ -x "$f" ]; then - printf '%s: running %s\n' "$0" "$f" - "$f" - else - printf '%s: sourcing %s\n' "$0" "$f" - . "$f" - fi - ;; - *.sql) printf '%s: running %s\n' "$0" "$f"; docker_process_sql -f "$f"; printf '\n' ;; - *.sql.gz) printf '%s: running %s\n' "$0" "$f"; gunzip -c "$f" | docker_process_sql; printf '\n' ;; - *.sql.xz) printf '%s: running %s\n' "$0" "$f"; xzcat "$f" | docker_process_sql; printf '\n' ;; - *.sql.zst) printf '%s: running %s\n' "$0" "$f"; zstd -dc "$f" | docker_process_sql; printf '\n' ;; - *) printf '%s: ignoring %s\n' "$0" "$f" ;; - esac - printf '\n' - done -} - -# Execute sql script, passed via stdin (or -f flag of pqsl) -# usage: docker_process_sql [psql-cli-args] -# ie: docker_process_sql --dbname=mydb <<<'INSERT ...' -# ie: docker_process_sql -f my-file.sql -# ie: docker_process_sql > "$PGDATA/pg_hba.conf" -} - -# start socket-only postgresql server for setting up or running scripts -# all arguments will be passed along as arguments to `postgres` (via pg_ctl) -docker_temp_server_start() { - if [ "$1" = 'postgres' ]; then - shift - fi - - # internal start of server in order to allow setup using psql client - # does not listen on external TCP/IP and waits until start finishes - set -- "$@" -c listen_addresses='' -p "${PGPORT:-5432}" - - PGUSER="${PGUSER:-$POSTGRES_USER}" \ - pg_ctl -D "$PGDATA" \ - -o "$(printf '%q ' "$@")" \ - -w start -} - -# stop postgresql server after done setting up user and running scripts -docker_temp_server_stop() { - PGUSER="${PGUSER:-postgres}" \ - pg_ctl -D "$PGDATA" -m fast -w stop -} - -# check arguments for an option that would cause postgres to stop -# return true if there is one -_pg_want_help() { - local arg - for arg; do - case "$arg" in - # postgres --help | grep 'then exit' - # leaving out -C on purpose since it always fails and is unhelpful: - # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory - -'?'|--help|--describe-config|-V|--version) - return 0 - ;; - esac - done - return 1 -} - -_main() { - # if first arg looks like a flag, assume we want to run postgres server - if [ "${1:0:1}" = '-' ]; then - set -- postgres "$@" - fi - - if [ "$1" = 'postgres' ] && ! _pg_want_help "$@"; then - docker_setup_env - # setup data directories and permissions (when run as root) - docker_create_db_directories - if [ "$(id -u)" = '0' ]; then - # then restart script as postgres user - exec gosu postgres "$BASH_SOURCE" "$@" - fi - - # only run initialization on an empty data directory - if [ -z "$DATABASE_ALREADY_EXISTS" ]; then - docker_verify_minimum_env - - # check dir permissions to reduce likelihood of half-initialized database - ls /docker-entrypoint-initdb.d/ > /dev/null - - docker_init_database_dir - pg_setup_hba_conf "$@" - - # PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless - # e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGS - export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" - docker_temp_server_start "$@" - - docker_setup_db - docker_process_init_files /docker-entrypoint-initdb.d/* - - docker_temp_server_stop - unset PGPASSWORD - - cat <<-'EOM' - - PostgreSQL init process complete; ready for start up. - - EOM - else - cat <<-'EOM' - - PostgreSQL Database directory appears to contain a database; Skipping initialization - - EOM - fi - fi - - exec "$@" -} - -if ! _is_sourced; then - _main "$@" -fi diff --git a/docker/all-in-one/run-logrotate.sh b/docker/all-in-one/run-logrotate.sh deleted file mode 100755 index 40805f855..000000000 --- a/docker/all-in-one/run-logrotate.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -eou pipefail - -while true; do - sleep 1800 - /usr/sbin/logrotate /etc/logrotate.conf --state "${DATA_VOLUME_MOUNTPOINT}/etc/logrotate/logrotate.state" --verbose -done diff --git a/docker/all-in-one/shutdown.sh b/docker/all-in-one/shutdown.sh deleted file mode 100755 index 9f5beb250..000000000 --- a/docker/all-in-one/shutdown.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# This script provides a method of shutting down the machine/container when the database has been idle -# for a certain amount of time (configurable via the MAX_IDLE_TIME_MINUTES env var) -# -# It checks for any active (non-idle) connections and for any connections which have been idle for more than MAX_IDLE_TIME_MINUTES. -# If there are no active connections and no idle connections, it then checks if the last disconnection event happened more than MAX_IDLE_TIME_MINUTES ago. -# -# If all of these conditions are met, then Postgres is shut down, allowing it to wrap up any pending transactions (such as WAL shippipng) and gracefully exit. -# To terminate the machine/container, a SIGTERM signal is sent to the top-level process (supervisord) which will then shut down all other processes and exit. - -DEFAULT_MAX_IDLE_TIME_MINUTES=${MAX_IDLE_TIME_MINUTES:-5} -CONFIG_FILE_PATH=${CONFIG_FILE_PATH:-/etc/supa-shutdown/shutdown.conf} - -run_sql() { - psql -h localhost -U supabase_admin -d postgres "$@" -} - -check_activity() { - pg_isready -h localhost > /dev/null 2>&1 || (echo "Postgres is not ready yet" && exit 1) - - QUERY=$(cat </dev/null || echo 0) - NOW=$(date +%s) - TIME_SINCE_LAST_DISCONNECT="$((NOW - LAST_DISCONNECT_TIME))" - - if [ $TIME_SINCE_LAST_DISCONNECT -gt "$((MAX_IDLE_TIME_MINUTES * 60))" ]; then - echo "$(date): No active connections for $MAX_IDLE_TIME_MINUTES minutes. Shutting down." - - supervisorctl stop postgresql - - # Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation - # This is to ensure that the WAL file is shipped, just in case - sleep 1 - - /usr/bin/admin-mgr lsn-checkpoint-push --immediately || echo "Failed to push LSN checkpoint" - - kill -s TERM "$(supervisorctl pid)" - fi -} - -# Wait for Postgres to be up -until pg_isready -h localhost > /dev/null 2>&1; - do sleep 3 -done - -# Enable logging of disconnections so the script can check when the last disconnection happened -run_sql -c "ALTER SYSTEM SET log_disconnections = 'on';" -run_sql -c "SELECT pg_reload_conf();" - -sleep $((DEFAULT_MAX_IDLE_TIME_MINUTES * 60)) -while true; do - if [ -f "$CONFIG_FILE_PATH" ]; then - source "$CONFIG_FILE_PATH" - - if [ -z "$SHUTDOWN_IDLE_TIME_MINUTES" ]; then - MAX_IDLE_TIME_MINUTES="$DEFAULT_MAX_IDLE_TIME_MINUTES" - else - MAX_IDLE_TIME_MINUTES="$SHUTDOWN_IDLE_TIME_MINUTES" - fi - else - MAX_IDLE_TIME_MINUTES="$DEFAULT_MAX_IDLE_TIME_MINUTES" - fi - - if [ "$MAX_IDLE_TIME_MINUTES" -gt 0 ] && [ "$MAX_IDLE_TIME_MINUTES" -lt 50000000 ]; then - check_activity - fi - - sleep 30 -done diff --git a/docker/cache/.gitkeep b/docker/cache/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/orioledb/Dockerfile b/docker/orioledb/Dockerfile deleted file mode 100644 index 7adb7d74a..000000000 --- a/docker/orioledb/Dockerfile +++ /dev/null @@ -1,1059 +0,0 @@ -# syntax=docker/dockerfile:1.6 -ARG postgresql_major=15 -ARG postgresql_release=${postgresql_major}.1 - -# Bump default build arg to build a package from source -# Bump vars.yml to specify runtime package version -ARG sfcgal_release=1.3.10 -ARG postgis_release=3.3.2 -ARG pgrouting_release=3.4.1 -ARG pgtap_release=1.2.0 -ARG pg_cron_release=1.6.2 -ARG pgaudit_release=1.7.0 -ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 -ARG pgsql_http_release=1.5.0 -ARG plpgsql_check_release=2.2.5 -ARG pg_safeupdate_release=1.4 -ARG timescaledb_release=2.9.1 -ARG wal2json_release=2_5 -ARG pljava_release=1.6.4 -ARG plv8_release=3.1.5 -ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 -ARG pg_net_release=0.9.2 -ARG rum_release=1.3.13 -ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 -ARG libsodium_release=1.0.18 -ARG pgsodium_release=3.1.6 -ARG pg_graphql_release=1.5.1 -ARG pg_stat_monitor_release=1.1.1 -ARG pg_jsonschema_release=0.2.0 -ARG pg_repack_release=1.4.8 -ARG vault_release=0.2.8 -ARG groonga_release=12.0.8 -ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.2.0 -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.5.0 -ARG wal_g_release=2.0.1 - -#################### -# Install postgres -#################### -FROM orioledb/orioledb:latest-pg${postgresql_major}-ubuntu as base -# Redeclare args for use in subsequent stages -ARG TARGETARCH -ARG postgresql_major - -ENV PATH=$PATH:/usr/lib/postgresql/${postgresql_major}/bin -ENV PGDATA=/var/lib/postgresql/data - -# Make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default -# RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C - -FROM base as builder -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - checkinstall \ - cmake \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -FROM builder as ccache -# Cache large build artifacts -RUN apt-get update && apt-get install -y --no-install-recommends \ - clang \ - ccache \ - && rm -rf /var/lib/apt/lists/* -ENV CCACHE_DIR=/ccache -ENV PATH=/usr/lib/ccache:$PATH -# Used to update ccache -ARG CACHE_EPOCH - -FROM builder as rust-toolchain -ENV PATH=/root/.cargo/bin:$PATH -RUN apt-get update && apt-get install -y --no-install-recommends curl pkg-config && \ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable && \ - rustup --version && \ - rustc --version && \ - cargo --version - -RUN cargo install cargo-pgrx --version 0.10.2 --locked -RUN cargo pgrx init --pg${postgresql_major} $(which pg_config) - -#################### -# 01-postgis.yml -#################### -FROM ccache as sfcgal -# Download and extract -ARG sfcgal_release -ARG sfcgal_release_checksum -ADD --checksum=${sfcgal_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/sfcgal/SFCGAL-v${sfcgal_release}.tar.gz" \ - /tmp/sfcgal.tar.gz -RUN tar -xvf /tmp/sfcgal.tar.gz -C /tmp --one-top-level --strip-components 1 && \ - rm -rf /tmp/sfcgal.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcgal-dev \ - libboost-serialization1.71-dev \ - libmpfr-dev \ - libgmp-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/sfcgal/build -RUN cmake .. -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=yes --fstrans=no --backup=no --pakdir=/tmp --pkgname=sfcgal --pkgversion=${sfcgal_release} --requires=libgmpxx4ldbl,libboost-serialization1.71.0,libmpfr6 --nodoc - -FROM sfcgal as postgis-source -# Download and extract -ARG postgis_release -ARG postgis_release_checksum -ADD --checksum=${postgis_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/postgis-${postgis_release}.tar.gz" \ - /tmp/postgis.tar.gz -RUN tar -xvf /tmp/postgis.tar.gz -C /tmp && \ - rm -rf /tmp/postgis.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - protobuf-c-compiler \ - libgeos-dev \ - libproj-dev \ - libgdal-dev \ - libjson-c-dev \ - libxml2-dev \ - libprotobuf-c-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/postgis-${postgis_release} -RUN ./configure --with-sfcgal -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libgeos-c1v5,libproj15,libjson-c4,libprotobuf-c1,libgdal26 --nodoc - -#################### -# 02-pgrouting.yml -#################### -FROM ccache as pgrouting-source -# Download and extract -ARG pgrouting_release -ARG pgrouting_release_checksum -ADD --checksum=${pgrouting_release_checksum} \ - "https://github.com/pgRouting/pgrouting/releases/download/v${pgrouting_release}/pgrouting-${pgrouting_release}.tar.gz" \ - /tmp/pgrouting.tar.gz -RUN tar -xvf /tmp/pgrouting.tar.gz -C /tmp && \ - rm -rf /tmp/pgrouting.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libboost-all-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgrouting-${pgrouting_release}/build -RUN cmake -DBUILD_HTML=OFF -DBUILD_DOXY=OFF .. -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgname=pgrouting --pkgversion=${pgrouting_release} --nodoc - -#################### -# 03-pgtap.yml -#################### -FROM builder as pgtap-source -# Download and extract -ARG pgtap_release -ARG pgtap_release_checksum -ADD --checksum=${pgtap_release_checksum} \ - "https://github.com/theory/pgtap/archive/v${pgtap_release}.tar.gz" \ - /tmp/pgtap.tar.gz -RUN tar -xvf /tmp/pgtap.tar.gz -C /tmp && \ - rm -rf /tmp/pgtap.tar.gz -# Build from source -WORKDIR /tmp/pgtap-${pgtap_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 04-pg_cron.yml -#################### -FROM ccache as pg_cron-source -# Download and extract -ARG pg_cron_release -ARG pg_cron_release_checksum -ADD --checksum=${pg_cron_release_checksum} \ - "https://github.com/citusdata/pg_cron/archive/refs/tags/v${pg_cron_release}.tar.gz" \ - /tmp/pg_cron.tar.gz -RUN tar -xvf /tmp/pg_cron.tar.gz -C /tmp && \ - rm -rf /tmp/pg_cron.tar.gz -# Build from source -WORKDIR /tmp/pg_cron-${pg_cron_release} -# error: redefinition of typedef 'snapshot_hook_type' is a C11 feature [-Werror,-Wtypedef-redefinition] -RUN sed -i -e "s|-std=c99|-std=c11|g" Makefile -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 05-pgaudit.yml -#################### -FROM ccache as pgaudit-source -# Download and extract -ARG pgaudit_release -ARG pgaudit_release_checksum -ADD --checksum=${pgaudit_release_checksum} \ - "https://github.com/pgaudit/pgaudit/archive/refs/tags/${pgaudit_release}.tar.gz" \ - /tmp/pgaudit.tar.gz -RUN tar -xvf /tmp/pgaudit.tar.gz -C /tmp && \ - rm -rf /tmp/pgaudit.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libssl-dev \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgaudit-${pgaudit_release} -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 06-pgjwt.yml -#################### -FROM builder as pgjwt-source -# Download and extract -ARG pgjwt_release -ADD "https://github.com/michelp/pgjwt.git#${pgjwt_release}" \ - /tmp/pgjwt-${pgjwt_release} -# Build from source -WORKDIR /tmp/pgjwt-${pgjwt_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 07-pgsql-http.yml -#################### -FROM ccache as pgsql-http-source -# Download and extract -ARG pgsql_http_release -ARG pgsql_http_release_checksum -ADD --checksum=${pgsql_http_release_checksum} \ - "https://github.com/pramsey/pgsql-http/archive/refs/tags/v${pgsql_http_release}.tar.gz" \ - /tmp/pgsql-http.tar.gz -RUN tar -xvf /tmp/pgsql-http.tar.gz -C /tmp && \ - rm -rf /tmp/pgsql-http.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcurl4-gnutls-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pgsql-http-${pgsql_http_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libcurl3-gnutls --nodoc - -#################### -# 08-plpgsql_check.yml -#################### -FROM ccache as plpgsql_check-source -# Download and extract -ARG plpgsql_check_release -ARG plpgsql_check_release_checksum -ADD --checksum=${plpgsql_check_release_checksum} \ - "https://github.com/okbob/plpgsql_check/archive/refs/tags/v${plpgsql_check_release}.tar.gz" \ - /tmp/plpgsql_check.tar.gz -RUN tar -xvf /tmp/plpgsql_check.tar.gz -C /tmp && \ - rm -rf /tmp/plpgsql_check.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libicu-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/plpgsql_check-${plpgsql_check_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 09-pg-safeupdate.yml -#################### -FROM ccache as pg-safeupdate-source -# Download and extract -ARG pg_safeupdate_release -ARG pg_safeupdate_release_checksum -ADD --checksum=${pg_safeupdate_release_checksum} \ - "https://github.com/eradman/pg-safeupdate/archive/refs/tags/${pg_safeupdate_release}.tar.gz" \ - /tmp/pg-safeupdate.tar.gz -RUN tar -xvf /tmp/pg-safeupdate.tar.gz -C /tmp && \ - rm -rf /tmp/pg-safeupdate.tar.gz -# Build from source -WORKDIR /tmp/pg-safeupdate-${pg_safeupdate_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 10-timescaledb.yml -#################### -FROM ccache as timescaledb-source -# Download and extract -ARG timescaledb_release -ARG timescaledb_release_checksum -ADD --checksum=${timescaledb_release_checksum} \ - "https://github.com/timescale/timescaledb/archive/refs/tags/${timescaledb_release}.tar.gz" \ - /tmp/timescaledb.tar.gz -RUN tar -xvf /tmp/timescaledb.tar.gz -C /tmp && \ - rm -rf /tmp/timescaledb.tar.gz -# Build from source -WORKDIR /tmp/timescaledb-${timescaledb_release}/build -RUN cmake -DAPACHE_ONLY=1 .. -# error: too few arguments to function ‘table_tuple_update’ -# error: too few arguments to function ‘table_tuple_delete’ -RUN sed -i \ - -e "1981s|);|, NULL);|g" \ - -e "2567s|);|, NULL);|g" \ - ../src/nodes/hypertable_modify.c -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgname=timescaledb --pkgversion=${timescaledb_release} --nodoc - -#################### -# 11-wal2json.yml -#################### -FROM ccache as wal2json-source -# Download and extract -ARG wal2json_release -ARG wal2json_release_checksum -ADD --checksum=${wal2json_release_checksum} \ - "https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_${wal2json_release}.tar.gz" \ - /tmp/wal2json.tar.gz -RUN tar -xvf /tmp/wal2json.tar.gz -C /tmp --one-top-level --strip-components 1 && \ - rm -rf /tmp/wal2json.tar.gz -# Build from source -WORKDIR /tmp/wal2json -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -ENV version=${wal2json_release} -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion="\${version/_/.}" --nodoc - -#################### -# 12-pljava.yml -#################### -FROM builder as pljava-source -# Download and extract -# TODO: revert to using main repo after PG15 support is merged: https://github.com/tada/pljava/pull/413 -ARG pljava_release=master -ARG pljava_release_checksum=sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6 -ADD --checksum=${pljava_release_checksum} \ - "https://github.com/supabase/pljava/archive/refs/heads/${pljava_release}.tar.gz" \ - /tmp/pljava.tar.gz -RUN tar -xvf /tmp/pljava.tar.gz -C /tmp && \ - rm -rf /tmp/pljava.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - maven \ - default-jdk \ - libssl-dev \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pljava-${pljava_release} -RUN mvn -T 1C clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true -# Create debian package -RUN cp pljava-packaging/target/pljava-pg${postgresql_major}.jar /tmp/ - -#################### -# 13-plv8.yml -#################### -FROM ccache as plv8-source -# Download and extract -ARG plv8_release -ARG plv8_release_checksum -ADD --checksum=${plv8_release_checksum} \ - "https://github.com/plv8/plv8/archive/refs/tags/v${plv8_release}.tar.gz" \ - /tmp/plv8.tar.gz -RUN tar -xvf /tmp/plv8.tar.gz -C /tmp && \ - rm -rf /tmp/plv8.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - pkg-config \ - ninja-build \ - git \ - libtinfo5 \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/plv8-${plv8_release} -ENV DOCKER=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -FROM scratch as plv8-deb -COPY --from=plv8-source /tmp/*.deb /tmp/ - -FROM ghcr.io/supabase/plv8:${plv8_release}-pg${postgresql_major} as plv8 - -#################### -# 14-pg_plan_filter.yml -#################### -FROM ccache as pg_plan_filter-source -# Download and extract -ARG pg_plan_filter_release -ADD "https://github.com/pgexperts/pg_plan_filter.git#${pg_plan_filter_release}" \ - /tmp/pg_plan_filter-${pg_plan_filter_release} -# Build from source -WORKDIR /tmp/pg_plan_filter-${pg_plan_filter_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 15-pg_net.yml -#################### -FROM ccache as pg_net-source -# Download and extract -ARG pg_net_release -ARG pg_net_release_checksum -ADD --checksum=${pg_net_release_checksum} \ - "https://github.com/supabase/pg_net/archive/refs/tags/v${pg_net_release}.tar.gz" \ - /tmp/pg_net.tar.gz -RUN tar -xvf /tmp/pg_net.tar.gz -C /tmp && \ - rm -rf /tmp/pg_net.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libcurl4-gnutls-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pg_net-${pg_net_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libcurl3-gnutls --nodoc - -#################### -# 16-rum.yml -#################### -FROM ccache as rum-source -# Download and extract -ARG rum_release -ARG rum_release_checksum -ADD --checksum=${rum_release_checksum} \ - "https://github.com/postgrespro/rum/archive/refs/tags/${rum_release}.tar.gz" \ - /tmp/rum.tar.gz -RUN tar -xvf /tmp/rum.tar.gz -C /tmp && \ - rm -rf /tmp/rum.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - systemtap-sdt-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/rum-${rum_release} -RUN sed -i \ - # error: typedef redefinition with different types ('struct SortTuple' vs 'struct SortTuple') - -e "183s|^|// |g" \ - -e "184s|^|// |g" \ - -e "185s|^|// |g" \ - -e "186s|^|// |g" \ - -e "187s|^|// |g" \ - -e "188s|^|// |g" \ - -e "189s|^|// |g" \ - # error: static declaration of 'tuplesort_begin_common' follows non-static declaration - -e "621s|static ||g" \ - # error: static declaration of 'tuplesort_begin_common' follows non-static declaration - -e "846s|static ||g" \ - # error: static declaration of 'tuplesort_gettuple_common' follows non-static declaration - -e "2308s|static ||g" \ - src/tuplesort15.c -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 17-pg_hashids.yml -#################### -FROM ccache as pg_hashids-source -# Download and extract -ARG pg_hashids_release -ADD "https://github.com/iCyberon/pg_hashids.git#${pg_hashids_release}" \ - /tmp/pg_hashids-${pg_hashids_release} -# Build from source -WORKDIR /tmp/pg_hashids-${pg_hashids_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=1 --nodoc - -#################### -# 18-pgsodium.yml -#################### -FROM ccache as libsodium -# Download and extract -ARG libsodium_release -ARG libsodium_release_checksum -ADD --checksum=${libsodium_release_checksum} \ - "https://supabase-public-artifacts-bucket.s3.amazonaws.com/libsodium/libsodium-${libsodium_release}.tar.gz" \ - /tmp/libsodium.tar.gz -RUN tar -xvf /tmp/libsodium.tar.gz -C /tmp && \ - rm -rf /tmp/libsodium.tar.gz -# Build from source -WORKDIR /tmp/libsodium-${libsodium_release} -RUN ./configure -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -RUN make install - -FROM libsodium as pgsodium-source -# Download and extract -ARG pgsodium_release -ARG pgsodium_release_checksum -ADD --checksum=${pgsodium_release_checksum} \ - "https://github.com/michelp/pgsodium/archive/refs/tags/v${pgsodium_release}.tar.gz" \ - /tmp/pgsodium.tar.gz -RUN tar -xvf /tmp/pgsodium.tar.gz -C /tmp && \ - rm -rf /tmp/pgsodium.tar.gz -# Build from source -WORKDIR /tmp/pgsodium-${pgsodium_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=libsodium23 --nodoc - -#################### -# 19-pg_graphql.yml -#################### -FROM rust-toolchain as pg_graphql-source -# Download and extract -ARG pg_graphql_release -ARG pg_graphql_release_checksum -ADD --checksum=${pg_graphql_release_checksum} \ - "https://github.com/supabase/pg_graphql/archive/refs/tags/v${pg_graphql_release}.tar.gz" \ - /tmp/pg_graphql.tar.gz -RUN tar -xvf /tmp/pg_graphql.tar.gz -C /tmp && \ - rm -rf /tmp/pg_graphql.tar.gz -WORKDIR /tmp/pg_graphql-${pg_graphql_release} -RUN cargo pgrx package --no-default-features --features pg${postgresql_major} - -# Create installable package -RUN mkdir archive -RUN cp target/release/pg_graphql-pg${postgresql_major}/usr/local/share/postgresql/extension/pg_graphql* archive -RUN cp target/release/pg_graphql-pg${postgresql_major}/usr/local/lib/postgresql/pg_graphql.so archive - -# name of the package directory before packaging -ENV package_dir=pg_graphql-v${pg_graphql_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu - -## Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/lib/postgresql/lib -RUN mkdir -p ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.so ${package_dir}/usr/lib/postgresql/lib -RUN cp archive/*.control ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.sql ${package_dir}/var/lib/postgresql/extension - -# symlinks to Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/local/lib/postgresql -WORKDIR ${package_dir}/usr/local/lib/postgresql -RUN cp -s ../../../lib/postgresql/lib/*.so . -WORKDIR ../../../../.. - -RUN mkdir -p ${package_dir}/usr/local/share/postgresql/extension -WORKDIR ${package_dir}/usr/local/share/postgresql/extension -RUN cp -s ../../../../../var/lib/postgresql/extension/pg_graphql.control . -RUN cp -s ../../../../../var/lib/postgresql/extension/pg_graphql*.sql . -WORKDIR ../../../../../.. - -RUN mkdir -p ${package_dir}/DEBIAN -RUN touch ${package_dir}/DEBIAN/control -RUN echo 'Package: pg-graphql' >> ${package_dir}/DEBIAN/control -RUN echo 'Version:' ${pg_graphql_release} >> ${package_dir}/DEBIAN/control -RUN echo "Architecture: ${TARGETARCH}" >> ${package_dir}/DEBIAN/control -RUN echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control -RUN echo 'Description: A PostgreSQL extension' >> ${package_dir}/DEBIAN/control - -# Create deb package -RUN chown -R root:root ${package_dir} -RUN chmod -R 00755 ${package_dir} -RUN dpkg-deb --build --root-owner-group ${package_dir} -RUN cp ./*.deb /tmp/pg_graphql.deb - -#################### -# 20-pg_stat_monitor.yml -#################### -FROM ccache as pg_stat_monitor-source -# Download and extract -ARG pg_stat_monitor_release -ARG pg_stat_monitor_release_checksum -ADD --checksum=${pg_stat_monitor_release_checksum} \ - "https://github.com/percona/pg_stat_monitor/archive/refs/tags/${pg_stat_monitor_release}.tar.gz" \ - /tmp/pg_stat_monitor.tar.gz -RUN tar -xvf /tmp/pg_stat_monitor.tar.gz -C /tmp && \ - rm -rf /tmp/pg_stat_monitor.tar.gz -# Build from source -WORKDIR /tmp/pg_stat_monitor-${pg_stat_monitor_release} -ENV USE_PGXS=1 -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 22-pg_jsonschema.yml -#################### -FROM rust-toolchain as pg_jsonschema-source -# Download and extract -ARG pg_jsonschema_release -ARG pg_jsonschema_release_checksum -ADD --checksum=${pg_jsonschema_release_checksum} \ - "https://github.com/supabase/pg_jsonschema/archive/refs/tags/v${pg_jsonschema_release}.tar.gz" \ - /tmp/pg_jsonschema.tar.gz -RUN tar -xvf /tmp/pg_jsonschema.tar.gz -C /tmp && \ - rm -rf /tmp/pg_jsonschema.tar.gz -WORKDIR /tmp/pg_jsonschema-${pg_jsonschema_release} -RUN cargo pgrx package --no-default-features --features pg${postgresql_major} - -# Create installable package -RUN mkdir archive -RUN cp target/release/pg_jsonschema-pg${postgresql_major}/usr/local/share/postgresql/extension/pg_jsonschema* archive -RUN cp target/release/pg_jsonschema-pg${postgresql_major}/usr/local/lib/postgresql/pg_jsonschema.so archive - -# name of the package directory before packaging -ENV package_dir=pg_jsonschema-v${pg_jsonschema_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu - -## Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/lib/postgresql/lib -RUN mkdir -p ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.so ${package_dir}/usr/lib/postgresql/lib -RUN cp archive/*.control ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.sql ${package_dir}/var/lib/postgresql/extension - -# symlinks to Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/local/lib/postgresql -WORKDIR ${package_dir}/usr/local/lib/postgresql -RUN cp -s ../../../lib/postgresql/lib/*.so . -WORKDIR ../../../../.. - -RUN mkdir -p ${package_dir}/usr/local/share/postgresql/extension -WORKDIR ${package_dir}/usr/local/share/postgresql/extension - -RUN cp -s ../../../../../var/lib/postgresql/extension/pg_jsonschema.control . -RUN cp -s ../../../../../var/lib/postgresql/extension/pg_jsonschema*.sql . -WORKDIR ../../../../../.. - -RUN mkdir -p ${package_dir}/DEBIAN -RUN touch ${package_dir}/DEBIAN/control -RUN echo 'Package: pg-jsonschema' >> ${package_dir}/DEBIAN/control -RUN echo 'Version:' ${pg_jsonschema_release} >> ${package_dir}/DEBIAN/control -RUN echo "Architecture: ${TARGETARCH}" >> ${package_dir}/DEBIAN/control -RUN echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control -RUN echo 'Description: A PostgreSQL extension' >> ${package_dir}/DEBIAN/control - -# Create deb package -RUN chown -R root:root ${package_dir} -RUN chmod -R 00755 ${package_dir} -RUN dpkg-deb --build --root-owner-group ${package_dir} -RUN cp ./*.deb /tmp/pg_jsonschema.deb - -#################### -# 23-vault.yml -#################### -FROM builder as vault-source -# Download and extract -ARG vault_release -ARG vault_release_checksum -ADD --checksum=${vault_release_checksum} \ - "https://github.com/supabase/vault/archive/refs/tags/v${vault_release}.tar.gz" \ - /tmp/vault.tar.gz -RUN tar -xvf /tmp/vault.tar.gz -C /tmp && \ - rm -rf /tmp/vault.tar.gz -# Build from source -WORKDIR /tmp/vault-${vault_release} -RUN make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 24-pgroonga.yml -#################### -FROM ccache as groonga -# Download and extract -ARG groonga_release -ARG groonga_release_checksum -ADD --checksum=${groonga_release_checksum} \ - "https://packages.groonga.org/source/groonga/groonga-${groonga_release}.tar.gz" \ - /tmp/groonga.tar.gz -RUN tar -xvf /tmp/groonga.tar.gz -C /tmp && \ - rm -rf /tmp/groonga.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - zlib1g-dev \ - liblz4-dev \ - libzstd-dev \ - libmsgpack-dev \ - libzmq3-dev \ - libevent-dev \ - libmecab-dev \ - rapidjson-dev \ - pkg-config \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/groonga-${groonga_release} -RUN ./configure -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=yes --fstrans=no --backup=no --pakdir=/tmp --requires=zlib1g,liblz4-1,libzstd1,libmsgpackc2,libzmq5,libevent-2.1-7,libmecab2 --nodoc - -FROM groonga as pgroonga-source -# Download and extract -ARG pgroonga_release -ARG pgroonga_release_checksum -ADD --checksum=${pgroonga_release_checksum} \ - "https://packages.groonga.org/source/pgroonga/pgroonga-${pgroonga_release}.tar.gz" \ - /tmp/pgroonga.tar.gz -RUN tar -xvf /tmp/pgroonga.tar.gz -C /tmp && \ - rm -rf /tmp/pgroonga.tar.gz -# Build from source -WORKDIR /tmp/pgroonga-${pgroonga_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --requires=mecab-naist-jdic --nodoc - -FROM scratch as pgroonga-deb -COPY --from=pgroonga-source /tmp/*.deb /tmp/ - -#################### -# 25-wrappers.yml -#################### -FROM rust-toolchain as wrappers-source -# Required by wrappers 0.2.0 -RUN cargo install cargo-pgrx --version 0.11.0 --locked -RUN cargo pgrx init --pg${postgresql_major} $(which pg_config) -# Download and extract -ARG wrappers_release -ARG wrappers_release_checksum -ADD --checksum=${wrappers_release_checksum} \ - "https://github.com/supabase/wrappers/archive/refs/tags/v${wrappers_release}.tar.gz" \ - /tmp/wrappers.tar.gz -RUN tar -xvf /tmp/wrappers.tar.gz -C /tmp && \ - rm -rf /tmp/wrappers.tar.gz -WORKDIR /tmp/wrappers-${wrappers_release}/wrappers -RUN cargo pgrx package --no-default-features --features pg${postgresql_major},all_fdws - -ENV extension_dir=target/release/wrappers-pg${postgresql_major}/usr/local/share/postgresql/extension - -# copy schema file to version update sql files -# Note: some version numbers may be skipped -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.6--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.7--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.8--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.9--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.10--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.11--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.14--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.15--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.16--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.17--${wrappers_release}.sql -RUN cp ${extension_dir}/wrappers--${wrappers_release}.sql ${extension_dir}/wrappers--0.1.18--${wrappers_release}.sql - -# Create installable package -RUN mkdir archive -RUN cp target/release/wrappers-pg${postgresql_major}/usr/local/share/postgresql/extension/wrappers* archive -RUN cp target/release/wrappers-pg${postgresql_major}/usr/local/lib/postgresql/wrappers-${wrappers_release}.so archive - -# name of the package directory before packaging -ENV package_dir=wrappers-v${wrappers_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu - -## Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/lib/postgresql/lib -RUN mkdir -p ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.so ${package_dir}/usr/lib/postgresql/lib -RUN cp archive/*.control ${package_dir}/var/lib/postgresql/extension -RUN cp archive/*.sql ${package_dir}/var/lib/postgresql/extension - -# symlinks to Copy files into directory structure -RUN mkdir -p ${package_dir}/usr/local/lib/postgresql -WORKDIR ${package_dir}/usr/local/lib/postgresql -RUN cp -s ../../../lib/postgresql/lib/*.so . -WORKDIR ../../../../.. - -RUN mkdir -p ${package_dir}/usr/local/share/postgresql/extension -WORKDIR ${package_dir}/usr/local/share/postgresql/extension - -RUN cp -s ../../../../../var/lib/postgresql/extension/wrappers.control . -RUN cp -s ../../../../../var/lib/postgresql/extension/wrappers*.sql . -WORKDIR ../../../../../.. - -RUN mkdir -p ${package_dir}/DEBIAN -RUN touch ${package_dir}/DEBIAN/control -RUN echo 'Package: wrappers' >> ${package_dir}/DEBIAN/control -RUN echo 'Version:' ${wrappers_release} >> ${package_dir}/DEBIAN/control -RUN echo "Architecture: ${TARGETARCH}" >> ${package_dir}/DEBIAN/control -RUN echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control -RUN echo 'Description: A PostgreSQL extension' >> ${package_dir}/DEBIAN/control - -# Create deb package -RUN chown -R root:root ${package_dir} -RUN chmod -R 00755 ${package_dir} -RUN dpkg-deb --build --root-owner-group ${package_dir} -RUN cp ./*.deb /tmp/wrappers.deb - -#################### -# 26-hypopg.yml -#################### -FROM ccache as hypopg-source -# Download and extract -ARG hypopg_release -ARG hypopg_release_checksum -ADD --checksum=${hypopg_release_checksum} \ - "https://github.com/HypoPG/hypopg/archive/refs/tags/${hypopg_release}.tar.gz" \ - /tmp/hypopg.tar.gz -RUN tar -xvf /tmp/hypopg.tar.gz -C /tmp && \ - rm -rf /tmp/hypopg.tar.gz -# Build from source -WORKDIR /tmp/hypopg-${hypopg_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### - # 27-pg_repack.yml - #################### - FROM ccache as pg_repack-source - ARG pg_repack_release - ARG pg_repack_release_checksum - ADD --checksum=${pg_repack_release_checksum} \ - "https://github.com/reorg/pg_repack/archive/refs/tags/ver_${pg_repack_release}.tar.gz" \ - /tmp/pg_repack.tar.gz - RUN tar -xvf /tmp/pg_repack.tar.gz -C /tmp && \ - rm -rf /tmp/pg_repack.tar.gz - # Install build dependencies - RUN apt-get update && apt-get install -y --no-install-recommends \ - liblz4-dev \ - libz-dev \ - libzstd-dev \ - libreadline-dev \ - && rm -rf /var/lib/apt/lists/* - # Build from source - WORKDIR /tmp/pg_repack-ver_${pg_repack_release} - ENV USE_PGXS=1 - RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) - # Create debian package - RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgversion=${pg_repack_release} --nodoc - -#################### -# 28-pgvector.yml -#################### -FROM ccache as pgvector-source -ARG pgvector_release -ARG pgvector_release_checksum -ADD --checksum=${pgvector_release_checksum} \ - "https://github.com/pgvector/pgvector/archive/refs/tags/v${pgvector_release}.tar.gz" \ - /tmp/pgvector.tar.gz -RUN tar -xvf /tmp/pgvector.tar.gz -C /tmp && \ - rm -rf /tmp/pgvector.tar.gz -# Build from source -WORKDIR /tmp/pgvector-${pgvector_release} -# error: the clang compiler does not support '-march=native' -RUN sed -i -e "s|-march=native||g" Makefile -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# 29-pg_tle.yml -#################### -FROM ccache as pg_tle-source -ARG pg_tle_release -ARG pg_tle_release_checksum -ADD --checksum=${pg_tle_release_checksum} \ - "https://github.com/aws/pg_tle/archive/refs/tags/v${pg_tle_release}.tar.gz" \ - /tmp/pg_tle.tar.gz -RUN tar -xvf /tmp/pg_tle.tar.gz -C /tmp && \ - rm -rf /tmp/pg_tle.tar.gz -RUN apt-get update && apt-get install -y --no-install-recommends \ - flex \ - libkrb5-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/pg_tle-${pg_tle_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -###################### -# 30-index_advisor.yml -###################### -FROM ccache as index_advisor -ARG index_advisor_release -ARG index_advisor_release_checksum -ADD --checksum=${index_advisor_release_checksum} \ - "https://github.com/olirice/index_advisor/archive/refs/tags/v${index_advisor_release}.tar.gz" \ - /tmp/index_advisor.tar.gz -RUN tar -xvf /tmp/index_advisor.tar.gz -C /tmp && \ - rm -rf /tmp/index_advisor.tar.gz -# Build from source -WORKDIR /tmp/index_advisor-${index_advisor_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# internal/supautils.yml -#################### -FROM ccache as supautils-source -ARG supautils_release -ARG supautils_release_tar_checksum -ADD --checksum=${supautils_release_tar_checksum} \ - "https://github.com/supabase/supautils/archive/refs/tags/v${supautils_release}.tar.gz" \ - /tmp/supautils.tar.gz -RUN tar -xvf /tmp/supautils.tar.gz -C /tmp && \ - rm -rf /tmp/supautils.tar.gz -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - libicu-dev \ - && rm -rf /var/lib/apt/lists/* -# Build from source -WORKDIR /tmp/supautils-${supautils_release} -RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccache \ - make -j$(nproc) -# Create debian package -RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc - -#################### -# setup-wal-g.yml -#################### -FROM base as walg -ARG wal_g_release -# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz -RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ - apt-get update && apt-get install -y --no-install-recommends curl && \ - curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${arch}.tar.gz" -o /tmp/wal-g.tar.gz && \ - tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ - rm -rf /tmp/wal-g.tar.gz && \ - mv /tmp/wal-g-pg-ubuntu*20.04-$arch /tmp/wal-g - -#################### -# Collect extension packages -#################### -FROM scratch as extensions -COPY --from=postgis-source /tmp/*.deb /tmp/ -COPY --from=pgrouting-source /tmp/*.deb /tmp/ -COPY --from=pgtap-source /tmp/*.deb /tmp/ -COPY --from=pg_cron-source /tmp/*.deb /tmp/ -COPY --from=pgaudit-source /tmp/*.deb /tmp/ -COPY --from=pgjwt-source /tmp/*.deb /tmp/ -COPY --from=pgsql-http-source /tmp/*.deb /tmp/ -COPY --from=plpgsql_check-source /tmp/*.deb /tmp/ -COPY --from=pg-safeupdate-source /tmp/*.deb /tmp/ -COPY --from=timescaledb-source /tmp/*.deb /tmp/ -COPY --from=wal2json-source /tmp/*.deb /tmp/ -# COPY --from=pljava /tmp/*.deb /tmp/ -COPY --from=plv8 /tmp/*.deb /tmp/ -COPY --from=pg_plan_filter-source /tmp/*.deb /tmp/ -COPY --from=pg_net-source /tmp/*.deb /tmp/ -COPY --from=rum-source /tmp/*.deb /tmp/ -COPY --from=pgsodium-source /tmp/*.deb /tmp/ -COPY --from=pg_hashids-source /tmp/*.deb /tmp/ -COPY --from=pg_graphql-source /tmp/*.deb /tmp/ -COPY --from=pg_stat_monitor-source /tmp/*.deb /tmp/ -COPY --from=pg_jsonschema-source /tmp/*.deb /tmp/ -COPY --from=vault-source /tmp/*.deb /tmp/ -COPY --from=pgroonga-source /tmp/*.deb /tmp/ -COPY --from=wrappers-source /tmp/*.deb /tmp/ -COPY --from=hypopg-source /tmp/*.deb /tmp/ -COPY --from=pg_repack-source /tmp/*.deb /tmp/ -COPY --from=pgvector-source /tmp/*.deb /tmp/ -COPY --from=pg_tle-source /tmp/*.deb /tmp/ -COPY --from=index_advisor /tmp/*.deb /tmp/ -COPY --from=supautils-source /tmp/*.deb /tmp/ - -#################### -# Build final image -#################### -FROM base as production - -# Setup extensions -COPY --from=extensions /tmp /tmp -COPY --from=walg /tmp/wal-g /usr/local/bin/ - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends \ - /tmp/*.deb \ - # Needed for anything using libcurl - # https://github.com/supabase/postgres/issues/573 - ca-certificates \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -# Initialise configs -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf -COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts -COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf -COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh -COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh - -RUN sed -i \ - -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ - -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|shared_preload_libraries = '\(.*\)'|shared_preload_libraries = '\1, orioledb'|g" \ - -e "s|#max_wal_size = 1GB|max_wal_size = 8GB|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ - echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ - echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ - echo "orioledb.main_buffers = 1GB" >> /etc/postgresql/postgresql.conf && \ - echo "orioledb.undo_buffers = 256MB" >> /etc/postgresql/postgresql.conf && \ - useradd --create-home --shell /bin/bash wal-g -G postgres && \ - mkdir -p /etc/postgresql-custom && \ - chown postgres:postgres /etc/postgresql-custom - -# Include schema migrations -COPY migrations/db /docker-entrypoint-initdb.d/ -COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql -COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql - -# Patch upstream entrypoint script -RUN sed -i \ - -e "s|su-exec|gosu|g" \ - -e "s|PGHOST= PGHOSTADDR=|PGHOST=\$POSTGRES_HOST|g" \ - /usr/local/bin/docker-entrypoint.sh && \ - mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/orioledb-entrypoint.sh - -COPY docker/orioledb/entrypoint.sh /usr/local/bin/docker-entrypoint.sh - -HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost -STOPSIGNAL SIGINT -EXPOSE 5432 - -ENV POSTGRES_HOST=/var/run/postgresql -CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/docker/orioledb/entrypoint.sh b/docker/orioledb/entrypoint.sh deleted file mode 100755 index b9a460b7d..000000000 --- a/docker/orioledb/entrypoint.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -eou pipefail - -PG_CONF=/etc/postgresql/postgresql.conf - -if [ "${S3_ENABLED:-}" == "true" ]; then - echo "Enabling OrioleDB S3 Backend..." - - echo " -archive_mode = on -archive_library = 'orioledb' -max_worker_processes = 50 # should fit orioledb.s3_num_workers as long as other workers -orioledb.s3_num_workers = 20 # should be enough for comfortable work -orioledb.s3_mode = true -orioledb.s3_host = '$S3_HOST' # replace with your bucket URL, accelerated buckets are recommended -orioledb.s3_region = '$S3_REGION' # replace with your S3 region -orioledb.s3_accesskey = '$S3_ACCESS_KEY' # replace with your S3 key -orioledb.s3_secretkey = '$S3_SECRET_KEY' # replace with your S3 secret key -" >> "$PG_CONF" -else - echo "Disabling OrioleDB S3 Backend..." - - sed -i \ - -e "/^archive_mode = on/d" \ - -e "/^archive_library = 'orioledb'/d" \ - -e "/^max_worker_processes = 50/d" \ - -e "/^orioledb.s3_num_workers = /d" \ - -e "/^orioledb.s3_mode = /d" \ - -e "/^orioledb.s3_host = /d" \ - -e "/^orioledb.s3_region = /d" \ - -e "/^orioledb.s3_accesskey = /d" \ - -e "/^orioledb.s3_secretkey = /d" \ - "$PG_CONF" -fi - -orioledb-entrypoint.sh "$@" diff --git a/ebssurrogate/scripts/chroot-bootstrap.sh b/ebssurrogate/scripts/chroot-bootstrap.sh deleted file mode 100755 index 4b7ceaf8d..000000000 --- a/ebssurrogate/scripts/chroot-bootstrap.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/env bash -# -# This script runs inside chrooted environment. It installs grub and its -# Configuration file. -# - -set -o errexit -set -o pipefail -set -o xtrace - -export DEBIAN_FRONTEND=noninteractive - -export APT_OPTIONS="-oAPT::Install-Recommends=false \ - -oAPT::Install-Suggests=false \ - -oAcquire::Languages=none" - -if [ $(dpkg --print-architecture) = "amd64" ]; -then - ARCH="amd64"; -else - ARCH="arm64"; -fi - - - -function update_install_packages { - source /etc/os-release - - # Update APT with new sources - cat /etc/apt/sources.list - apt-get $APT_OPTIONS update && apt-get $APT_OPTIONS --yes dist-upgrade - - # Do not configure grub during package install - if [ "${ARCH}" = "amd64" ]; then - echo 'grub-pc grub-pc/install_devices_empty select true' | debconf-set-selections - echo 'grub-pc grub-pc/install_devices select' | debconf-set-selections - # Install various packages needed for a booting system - apt-get install -y \ - linux-aws \ - grub-pc \ - e2fsprogs - else - apt-get install -y e2fsprogs - fi - # Install standard packages - apt-get install -y \ - sudo \ - wget \ - cloud-init \ - acpid \ - ec2-hibinit-agent \ - ec2-instance-connect \ - hibagent \ - ncurses-term \ - ssh-import-id \ - - # apt upgrade - apt-get upgrade -y - - # Install OpenSSH and other packages - sudo add-apt-repository universe - apt-get update - apt-get install -y --no-install-recommends \ - openssh-server \ - git \ - ufw \ - cron \ - logrotate \ - fail2ban \ - locales \ - at \ - less \ - python3-systemd - - if [ "${ARCH}" = "arm64" ]; then - apt-get $APT_OPTIONS --yes install linux-aws initramfs-tools dosfstools - fi -} - -function setup_locale { -cat << EOF >> /etc/locale.gen -en_US.UTF-8 UTF-8 -EOF - -cat << EOF > /etc/default/locale -LANG="C.UTF-8" -LC_CTYPE="C.UTF-8" -EOF - localedef -i en_US -f UTF-8 en_US.UTF-8 -} - -function install_packages_for_build { - apt-get install -y --no-install-recommends linux-libc-dev \ - acl \ - magic-wormhole sysstat \ - build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libsystemd-dev libpq-dev libxml2-utils uuid-dev xsltproc ssl-cert \ - gcc-10 g++-10 \ - libgeos-dev libproj-dev libgdal-dev libjson-c-dev libboost-all-dev libcgal-dev libmpfr-dev libgmp-dev cmake \ - libkrb5-dev \ - maven default-jre default-jdk \ - curl gpp apt-transport-https cmake libc++-dev libc++abi-dev libc++1 libglib2.0-dev libtinfo5 libc++abi1 ninja-build python \ - liblzo2-dev - - source /etc/os-release - - apt-get install -y --no-install-recommends llvm-11-dev clang-11 - # Mark llvm as manual to prevent auto removal - apt-mark manual libllvm11:arm64 -} - -function setup_apparmor { - apt-get install -y apparmor apparmor-utils auditd - - # Copy apparmor profiles - cp -rv /tmp/apparmor_profiles/* /etc/apparmor.d/ -} - -function setup_grub_conf_arm64 { -cat << EOF > /etc/default/grub -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_TIMEOUT_STYLE="hidden" -GRUB_DISTRIBUTOR="Supabase postgresql" -GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty1 console=ttyS0 ipv6.disable=0" -EOF -} - -# Install GRUB -function install_configure_grub { - if [ "${ARCH}" = "arm64" ]; then - apt-get $APT_OPTIONS --yes install cloud-guest-utils fdisk grub-efi-arm64 efibootmgr - setup_grub_conf_arm64 - rm -rf /etc/grub.d/30_os-prober - sleep 1 - fi - grub-install /dev/xvdf && update-grub -} - -# skip fsck for first boot -function disable_fsck { - touch /fastboot -} - -# Don't request hostname during boot but set hostname -function setup_hostname { - sed -i 's/gethostname()/ubuntu /g' /etc/dhcp/dhclient.conf - sed -i 's/host-name,//g' /etc/dhcp/dhclient.conf - echo "ubuntu" > /etc/hostname - chmod 644 /etc/hostname -} - -# Set options for the default interface -function setup_eth0_interface { -cat << EOF > /etc/netplan/eth0.yaml -network: - version: 2 - ethernets: - eth0: - dhcp4: true -EOF -} - -function disable_sshd_passwd_auth { - sed -i -E -e 's/^#?\s*PasswordAuthentication\s+(yes|no)\s*$/PasswordAuthentication no/g' \ - -e 's/^#?\s*ChallengeResponseAuthentication\s+(yes|no)\s*$/ChallengeResponseAuthentication no/g' \ - /etc/ssh/sshd_config -} - -function create_admin_account { - groupadd admin -} - -#Set default target as multi-user -function set_default_target { - rm -f /etc/systemd/system/default.target - ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target -} - -# Setup ccache -function setup_ccache { - apt-get install ccache -y - mkdir -p /tmp/ccache - export PATH=/usr/lib/ccache:$PATH - echo "PATH=$PATH" >> /etc/environment -} - -# Clear apt caches -function cleanup_cache { - apt-get clean -} - -update_install_packages -setup_locale -#install_packages_for_build -install_configure_grub -setup_apparmor -setup_hostname -create_admin_account -set_default_target -setup_eth0_interface -disable_sshd_passwd_auth -disable_fsck -#setup_ccache -cleanup_cache diff --git a/ebssurrogate/scripts/surrogate-bootstrap.sh b/ebssurrogate/scripts/surrogate-bootstrap.sh deleted file mode 100755 index 54eb98fb5..000000000 --- a/ebssurrogate/scripts/surrogate-bootstrap.sh +++ /dev/null @@ -1,324 +0,0 @@ -#!/usr/bin/env bash -# -# This script creates filesystem and setups up chrooted -# enviroment for further processing. It also runs -# ansible playbook and finally does system cleanup. -# -# Adapted from: https://github.com/jen20/packer-ubuntu-zfs - -set -o errexit -set -o pipefail -set -o xtrace - -if [ $(dpkg --print-architecture) = "amd64" ]; -then - ARCH="amd64"; -else - ARCH="arm64"; -fi - -function waitfor_boot_finished { - export DEBIAN_FRONTEND=noninteractive - - echo "args: ${ARGS}" - # Wait for cloudinit on the surrogate to complete before making progress - while [[ ! -f /var/lib/cloud/instance/boot-finished ]]; do - echo 'Waiting for cloud-init...' - sleep 1 - done -} - -function install_packages { - # Setup Ansible on host VM - apt-get update && sudo apt-get install software-properties-common -y - add-apt-repository --yes --update ppa:ansible/ansible && sudo apt-get install ansible -y - ansible-galaxy collection install community.general - - # Update apt and install required packages - apt-get update - apt-get install -y \ - gdisk \ - e2fsprogs \ - debootstrap \ - nvme-cli -} - -# Partition the new root EBS volume -function create_partition_table { - - if [ "${ARCH}" = "arm64" ]; then - parted --script /dev/xvdf \ - mklabel gpt \ - mkpart UEFI 1MiB 100MiB \ - mkpart ROOT 100MiB 100% - set 1 esp on \ - set 1 boot on - parted --script /dev/xvdf print - else - sgdisk -Zg -n1:0:4095 -t1:EF02 -c1:GRUB -n2:0:0 -t2:8300 -c2:EXT4 /dev/xvdf - fi - - sleep 2 -} - -function device_partition_mappings { - # NVMe EBS launch device mappings (symlinks): /dev/nvme*n* to /dev/xvd* - declare -A blkdev_mappings - for blkdev in $(nvme list | awk '/^\/dev/ { print $1 }'); do # /dev/nvme*n* - # Mapping info from disk headers - header=$(nvme id-ctrl --raw-binary "${blkdev}" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g' | sed 's!/dev/!!') - mapping="/dev/${header%%[0-9]}" # normalize sda1 => sda - - # Create /dev/xvd* device symlink - if [[ ! -z "$mapping" ]] && [[ -b "${blkdev}" ]] && [[ ! -L "${mapping}" ]]; then - ln -s "$blkdev" "$mapping" - - blkdev_mappings["$blkdev"]="$mapping" - fi - done - - create_partition_table - - # NVMe EBS launch device partition mappings (symlinks): /dev/nvme*n*p* to /dev/xvd*[0-9]+ - declare -A partdev_mappings - for blkdev in "${!blkdev_mappings[@]}"; do # /dev/nvme*n* - mapping="${blkdev_mappings[$blkdev]}" - - # Create /dev/xvd*[0-9]+ partition device symlink - for partdev in "${blkdev}"p*; do - partnum=${partdev##*p} - if [[ ! -L "${mapping}${partnum}" ]]; then - ln -s "${blkdev}p${partnum}" "${mapping}${partnum}" - - partdev_mappings["${blkdev}p${partnum}"]="${mapping}${partnum}" - fi - done - done -} - - -#Download and install latest e2fsprogs for fast_commit feature,if required. -function format_and_mount_rootfs { - mkfs.ext4 -m0.1 /dev/xvdf2 - - mount -o noatime,nodiratime /dev/xvdf2 /mnt - if [ "${ARCH}" = "arm64" ]; then - mkfs.fat -F32 /dev/xvdf1 - mkdir -p /mnt/boot/efi - sleep 2 - mount /dev/xvdf1 /mnt/boot/efi - fi - - mkfs.ext4 /dev/xvdh - mkdir -p /mnt/data - mount -o defaults,discard /dev/xvdh /mnt/data -} - -function create_swapfile { - fallocate -l 1G /mnt/swapfile - chmod 600 /mnt/swapfile - mkswap /mnt/swapfile -} - -function format_build_partition { - mkfs.ext4 -O ^has_journal /dev/xvdc -} -function pull_docker { - apt-get install -y docker.io - docker run -itd --name ccachedata "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}" sh - docker exec -itd ccachedata mkdir -p /build/ccache -} - -# Create fstab -function create_fstab { - FMT="%-42s %-11s %-5s %-17s %-5s %s" -cat > "/mnt/etc/fstab" << EOF -$(printf "${FMT}" "# DEVICE UUID" "MOUNTPOINT" "TYPE" "OPTIONS" "DUMP" "FSCK") -$(findmnt -no SOURCE /mnt | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/", "ext4", "defaults,discard", "0", "1" ) }') -$(findmnt -no SOURCE /mnt/boot/efi | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/boot/efi", "vfat", "umask=0077", "0", "1" ) }') -$(findmnt -no SOURCE /mnt/data | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/data", "ext4", "defaults,discard", "0", "2" ) }') -$(printf "$FMT" "/swapfile" "none" "swap" "sw" "0" "0") -EOF - unset FMT -} - -function setup_chroot_environment { - UBUNTU_VERSION=$(lsb_release -cs) # 'focal' for Ubuntu 20.04 - - # Bootstrap Ubuntu into /mnt - debootstrap --arch ${ARCH} --variant=minbase "$UBUNTU_VERSION" /mnt - - # Update ec2-region - REGION=$(curl --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -E 's|[a-z]+$||g') - sed -i "s/REGION/${REGION}/g" /tmp/sources.list - cp /tmp/sources.list /mnt/etc/apt/sources.list - - if [ "${ARCH}" = "arm64" ]; then - create_fstab - fi - - # Create mount points and mount the filesystem - mkdir -p /mnt/{dev,proc,sys} - mount --rbind /dev /mnt/dev - mount --rbind /proc /mnt/proc - mount --rbind /sys /mnt/sys - - # Create build mount point and mount - mkdir -p /mnt/tmp - mount /dev/xvdc /mnt/tmp - chmod 777 /mnt/tmp - - # Copy apparmor profiles - chmod 644 /tmp/apparmor_profiles/* - cp -r /tmp/apparmor_profiles /mnt/tmp/ - - # Copy migrations - cp -r /tmp/migrations /mnt/tmp/ - - # Copy unit tests - cp -r /tmp/unit-tests /mnt/tmp/ - - # Copy the bootstrap script into place and execute inside chroot - cp /tmp/chroot-bootstrap.sh /mnt/tmp/chroot-bootstrap.sh - chroot /mnt /tmp/chroot-bootstrap.sh - rm -f /mnt/tmp/chroot-bootstrap.sh - echo "${POSTGRES_SUPABASE_VERSION}" > /mnt/root/supabase-release - - # Copy the nvme identification script into /sbin inside the chroot - mkdir -p /mnt/sbin - cp /tmp/ebsnvme-id /mnt/sbin/ebsnvme-id - chmod +x /mnt/sbin/ebsnvme-id - - # Copy the udev rules for identifying nvme devices into the chroot - mkdir -p /mnt/etc/udev/rules.d - cp /tmp/70-ec2-nvme-devices.rules \ - /mnt/etc/udev/rules.d/70-ec2-nvme-devices.rules - - #Copy custom cloud-init - rm -f /mnt/etc/cloud/cloud.cfg - cp /tmp/cloud.cfg /mnt/etc/cloud/cloud.cfg - - sleep 2 -} - -function download_ccache { - docker cp ccachedata:/build/ccache/. /mnt/tmp/ccache -} - -function execute_playbook { - -tee /etc/ansible/ansible.cfg <= 14 THEN - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql extension is not enabled.' - ) - ) - ); - ELSE - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' - ) - ) - ); - END IF; - END; - $$; - END IF; - - END; -$_$; - - --- --- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: - --- - -COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; - - --- --- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - --- - -CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) - LANGUAGE plpgsql SECURITY DEFINER - AS $$ -BEGIN - RAISE WARNING 'PgBouncer auth request: %', p_usename; - - RETURN QUERY - SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow - WHERE usename = p_usename; -END; -$$; - - --- --- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - --- - -CREATE FUNCTION storage.extension(name text) RETURNS text - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -_filename text; -BEGIN - select string_to_array(name, '/') into _parts; - select _parts[array_length(_parts,1)] into _filename; - -- @todo return the last part instead of 2 - return split_part(_filename, '.', 2); -END -$$; - - --- --- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: - --- - -CREATE FUNCTION storage.filename(name text) RETURNS text - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -BEGIN - select string_to_array(name, '/') into _parts; - return _parts[array_length(_parts,1)]; -END -$$; - - --- --- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: - --- - -CREATE FUNCTION storage.foldername(name text) RETURNS text[] - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -BEGIN - select string_to_array(name, '/') into _parts; - return _parts[1:array_length(_parts,1)-1]; -END -$$; - - --- --- Name: search(text, text, integer, integer, integer); Type: FUNCTION; Schema: storage; Owner: - --- - -CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) - LANGUAGE plpgsql - AS $$ -DECLARE -_bucketId text; -BEGIN - -- will be replaced by migrations when server starts - -- saving space for cloud-init -END -$$; - - --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - -SET default_tablespace = ''; - -SET default_table_access_method = heap; - --- --- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - --- - -CREATE TABLE auth.audit_log_entries ( - instance_id uuid, - id uuid NOT NULL, - payload json, - created_at timestamp with time zone -); - - --- --- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: - --- - -COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; - - --- --- Name: instances; Type: TABLE; Schema: auth; Owner: - --- - -CREATE TABLE auth.instances ( - id uuid NOT NULL, - uuid uuid, - raw_base_config text, - created_at timestamp with time zone, - updated_at timestamp with time zone -); - - --- --- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: - --- - -COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; - - --- --- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: - --- - -CREATE TABLE auth.refresh_tokens ( - instance_id uuid, - id bigint NOT NULL, - token character varying(255), - user_id character varying(255), - revoked boolean, - created_at timestamp with time zone, - updated_at timestamp with time zone -); - - --- --- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: - --- - -COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; - - --- --- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: - --- - -CREATE SEQUENCE auth.refresh_tokens_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: - --- - -ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; - - --- --- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: - --- - -CREATE TABLE auth.schema_migrations ( - version character varying(255) NOT NULL -); - - --- --- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: - --- - -COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; - - --- --- Name: users; Type: TABLE; Schema: auth; Owner: - --- - -CREATE TABLE auth.users ( - instance_id uuid, - id uuid NOT NULL, - aud character varying(255), - role character varying(255), - email character varying(255), - encrypted_password character varying(255), - confirmed_at timestamp with time zone, - invited_at timestamp with time zone, - confirmation_token character varying(255), - confirmation_sent_at timestamp with time zone, - recovery_token character varying(255), - recovery_sent_at timestamp with time zone, - email_change_token character varying(255), - email_change character varying(255), - email_change_sent_at timestamp with time zone, - last_sign_in_at timestamp with time zone, - raw_app_meta_data jsonb, - raw_user_meta_data jsonb, - is_super_admin boolean, - created_at timestamp with time zone, - updated_at timestamp with time zone -); - - --- --- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: - --- - -COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; - - --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.schema_migrations ( - version character varying(128) NOT NULL -); - - --- --- Name: buckets; Type: TABLE; Schema: storage; Owner: - --- - -CREATE TABLE storage.buckets ( - id text NOT NULL, - name text NOT NULL, - owner uuid, - created_at timestamp with time zone DEFAULT now(), - updated_at timestamp with time zone DEFAULT now() -); - - --- --- Name: migrations; Type: TABLE; Schema: storage; Owner: - --- - -CREATE TABLE storage.migrations ( - id integer NOT NULL, - name character varying(100) NOT NULL, - hash character varying(40) NOT NULL, - executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP -); - - --- --- Name: objects; Type: TABLE; Schema: storage; Owner: - --- - -CREATE TABLE storage.objects ( - id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, - bucket_id text, - name text, - owner uuid, - created_at timestamp with time zone DEFAULT now(), - updated_at timestamp with time zone DEFAULT now(), - last_accessed_at timestamp with time zone DEFAULT now(), - metadata jsonb -); - - --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT id, - name, - description, - secret, - CASE - WHEN (secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) - END - END AS decrypted_secret, - key_id, - nonce, - created_at, - updated_at - FROM vault.secrets; - - --- --- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); - - --- --- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.audit_log_entries - ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); - - --- --- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.instances - ADD CONSTRAINT instances_pkey PRIMARY KEY (id); - - --- --- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.refresh_tokens - ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); - - --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - --- --- Name: users users_email_key; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.users - ADD CONSTRAINT users_email_key UNIQUE (email); - - --- --- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: - --- - -ALTER TABLE ONLY auth.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - --- --- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.buckets - ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); - - --- --- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.migrations - ADD CONSTRAINT migrations_name_key UNIQUE (name); - - --- --- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.migrations - ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); - - --- --- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT objects_pkey PRIMARY KEY (id); - - --- --- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); - - --- --- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); - - --- --- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); - - --- --- Name: refresh_tokens_token_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); - - --- --- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); - - --- --- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: - --- - -CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); - - --- --- Name: bname; Type: INDEX; Schema: storage; Owner: - --- - -CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); - - --- --- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: - --- - -CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); - - --- --- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: - --- - -CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); - - --- --- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.buckets - ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); - - --- --- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); - - --- --- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); - - --- --- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: - --- - -ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; - --- --- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: - --- - -CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); - - --- --- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop - WHEN TAG IN ('DROP EXTENSION') - EXECUTE FUNCTION extensions.set_graphql_placeholder(); - - --- --- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end - WHEN TAG IN ('CREATE EXTENSION') - EXECUTE FUNCTION extensions.grant_pg_cron_access(); - - --- --- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end - WHEN TAG IN ('CREATE FUNCTION') - EXECUTE FUNCTION extensions.grant_pg_graphql_access(); - - --- --- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end - WHEN TAG IN ('CREATE EXTENSION') - EXECUTE FUNCTION extensions.grant_pg_net_access(); - - --- --- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end - EXECUTE FUNCTION extensions.pgrst_ddl_watch(); - - --- --- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: - --- - -CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop - EXECUTE FUNCTION extensions.pgrst_drop_watch(); - - --- --- PostgreSQL database dump complete --- - - --- --- Dbmate schema migrations --- - diff --git a/testinfra/test_all_in_one.py b/testinfra/test_all_in_one.py deleted file mode 100644 index 2763c5160..000000000 --- a/testinfra/test_all_in_one.py +++ /dev/null @@ -1,135 +0,0 @@ -from docker.models.containers import Container -from os import path -from time import sleep -from typing import cast -import docker -import pytest -import requests -import subprocess -import testinfra - -all_in_one_image_tag = "supabase/all-in-one:testinfra" -all_in_one_envs = { - "POSTGRES_PASSWORD": "postgres", - "JWT_SECRET": "super-secret-jwt-token-with-at-least-32-characters-long", - "ANON_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlLWRlbW8iLCJpYXQiOjE2NDE3NjkyMDAsImV4cCI6MTc5OTUzNTYwMH0.F_rDxRTPE8OU83L_CNgEGXfmirMXmMMugT29Cvc8ygQ", - "SERVICE_ROLE_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UtZGVtbyIsImlhdCI6MTY0MTc2OTIwMCwiZXhwIjoxNzk5NTM1NjAwfQ.5z-pJI1qwZg1LE5yavGLqum65WOnnaaI5eZ3V00pLww", - "ADMIN_API_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic3VwYWJhc2VfYWRtaW4iLCJpc3MiOiJzdXBhYmFzZS1kZW1vIiwiaWF0IjoxNjQxNzY5MjAwLCJleHAiOjE3OTk1MzU2MDB9.Y9mSNVuTw2TdfryoaqM5wySvwQemGGWfSe9ixcklVfM", - "DATA_VOLUME_MOUNTPOINT": "/data", - "MACHINE_TYPE": "shared_cpu_1x_512m", - "PLATFORM_DEPLOYMENT": "true", - "SWAP_DISABLED": "true", - "AUTOSHUTDOWN_ENABLED": "true", - "ENV_MAX_IDLE_TIME_MINUTES": "60", - "PGDATA": "/var/lib/postgresql/data", - "PGDATA_REAL": "/data/pgdata", -} - -# TODO: spin up local Logflare for Vector tests. - - -# scope='session' uses the same container for all the tests; -# scope='function' uses a new container per test function. -@pytest.fixture(scope="session") -def host(): - # We build the image with the Docker CLI in path instead of using docker-py - # (official Docker SDK for Python) because the latter doesn't use BuildKit, - # so things like `ARG TARGETARCH` don't work: - # - https://github.com/docker/docker-py/issues/2230 - # - https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope - subprocess.check_call( - [ - "docker", - "buildx", - "build", - "--file", - path.join(path.dirname(__file__), "../docker/all-in-one/Dockerfile"), - "--load", - "--tag", - all_in_one_image_tag, - path.join(path.dirname(__file__), ".."), - ] - ) - - docker_client = docker.from_env() - container = cast( - Container, - docker_client.containers.run( - all_in_one_image_tag, - detach=True, - environment=all_in_one_envs, - ports={ - "5432/tcp": 5432, - "8000/tcp": 8000, - }, - ), - ) - - def get_health(container: Container) -> str: - inspect_results = docker_client.api.inspect_container(container.name) - return inspect_results["State"]["Health"]["Status"] - - attempts = 0 - - # containers might appear healthy but crash during bootstrap - sleep(3) - - while True: - health = get_health(container) - if health == "healthy": - break - if attempts > 60 or health == "exited": - # print container logs for debugging - print(container.logs().decode("utf-8")) - - # write logs to file to be displayed in GHA output - with open("testinfra-aio-container-logs.log", "w") as f: - f.write(container.logs().decode("utf-8")) - - raise TimeoutError("Container failed to become healthy.") - attempts += 1 - sleep(1) - - # return a testinfra connection to the container - yield testinfra.get_host("docker://" + cast(str, container.name)) - - # at the end of the test suite, destroy the container - container.remove(v=True, force=True) - - -@pytest.mark.parametrize("service_name", [ - 'adminapi', - 'lsn-checkpoint-push', - 'pg_egress_collect', - 'postgresql', - 'logrotate', - 'supa-shutdown', - 'services:kong', - 'services:postgrest', - 'services:gotrue', -]) -def test_service_is_running(host, service_name): - assert host.supervisor(service_name).is_running - - -def test_postgrest_responds_to_requests(): - res = requests.get( - "http://localhost:8000/rest/v1/", - headers={ - "apikey": all_in_one_envs["ANON_KEY"], - "authorization": f"Bearer {all_in_one_envs['ANON_KEY']}", - }, - ) - assert res.ok - - -def test_postgrest_can_connect_to_db(): - res = requests.get( - "http://localhost:8000/rest/v1/buckets", - headers={ - "apikey": all_in_one_envs["SERVICE_ROLE_KEY"], - "authorization": f"Bearer {all_in_one_envs['SERVICE_ROLE_KEY']}", - "accept-profile": "storage", - }, - ) - assert res.ok diff --git a/testinfra/test_ami.py b/testinfra/test_ami.py deleted file mode 100644 index 403641dac..000000000 --- a/testinfra/test_ami.py +++ /dev/null @@ -1,443 +0,0 @@ -import base64 -import boto3 -import gzip -import logging -import os -import pytest -import requests -import socket -import testinfra -from ec2instanceconnectcli.EC2InstanceConnectLogger import EC2InstanceConnectLogger -from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey -from time import sleep - -# if GITHUB_RUN_ID is not set, use a default value that includes the user and hostname -RUN_ID = os.environ.get("GITHUB_RUN_ID", "unknown-ci-run-" + os.environ.get("USER", "unknown-user") + '@' + socket.gethostname()) - -postgresql_schema_sql_content = """ -ALTER DATABASE postgres SET "app.settings.jwt_secret" TO 'my_jwt_secret_which_is_not_so_secret'; -ALTER DATABASE postgres SET "app.settings.jwt_exp" TO 3600; - -ALTER USER supabase_admin WITH PASSWORD 'postgres'; -ALTER USER postgres WITH PASSWORD 'postgres'; -ALTER USER authenticator WITH PASSWORD 'postgres'; -ALTER USER pgbouncer WITH PASSWORD 'postgres'; -ALTER USER supabase_auth_admin WITH PASSWORD 'postgres'; -ALTER USER supabase_storage_admin WITH PASSWORD 'postgres'; -ALTER USER supabase_replication_admin WITH PASSWORD 'postgres'; -ALTER ROLE supabase_read_only_user WITH PASSWORD 'postgres'; -ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions; -""" -realtime_env_content = "" -adminapi_yaml_content = """ -port: 8085 -host: 0.0.0.0 -ref: aaaaaaaaaaaaaaaaaaaa -jwt_secret: my_jwt_secret_which_is_not_so_secret -metric_collectors: - - filesystem - - meminfo - - netdev - - loadavg - - cpu - - diskstats - - vmstat -node_exporter_additional_args: - - '--collector.filesystem.ignored-mount-points=^/(boot|sys|dev|run).*' - - '--collector.netdev.device-exclude=lo' -cert_path: /etc/ssl/adminapi/server.crt -key_path: /etc/ssl/adminapi/server.key -upstream_metrics_refresh_duration: 60s -pgbouncer_endpoints: - - 'postgres://pgbouncer:postgres@localhost:6543/pgbouncer' -fail2ban_socket: /var/run/fail2ban/fail2ban.sock -upstream_metrics_sources: - - - name: system - url: 'https://localhost:8085/metrics' - labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: db}] - skip_tls_verify: true - - - name: postgresql - url: 'http://localhost:9187/metrics' - labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: postgresql}] - - - name: gotrue - url: 'http://localhost:9122/metrics' - labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: gotrue}] - - - name: postgrest - url: 'http://localhost:3001/metrics' - labels_to_attach: [{name: supabase_project_ref, value: aaaaaaaaaaaaaaaaaaaa}, {name: service_type, value: postgrest}] -monitoring: - disk_usage: - enabled: true -firewall: - enabled: true - internal_ports: - - 9187 - - 8085 - - 9122 - privileged_ports: - - 22 - privileged_ports_allowlist: - - 0.0.0.0/0 - filtered_ports: - - 5432 - - 6543 - unfiltered_ports: - - 80 - - 443 - managed_rules_file: /etc/nftables/supabase_managed.conf -pg_egress_collect_path: /tmp/pg_egress_collect.txt -aws_config: - creds: - enabled: false - check_frequency: 1h - refresh_buffer_duration: 6h -""" -pgsodium_root_key_content = ( - "0000000000000000000000000000000000000000000000000000000000000000" -) -postgrest_base_conf_content = """ -db-uri = "postgres://authenticator:postgres@localhost:5432/postgres?application_name=postgrest" -db-schema = "public, storage, graphql_public" -db-anon-role = "anon" -jwt-secret = "my_jwt_secret_which_is_not_so_secret" -role-claim-key = ".role" -openapi-mode = "ignore-privileges" -db-use-legacy-gucs = true -admin-server-port = 3001 -server-host = "*6" -db-pool-acquisition-timeout = 10 -max-rows = 1000 -db-extra-search-path = "public, extensions" -""" -gotrue_env_content = """ -API_EXTERNAL_URL=http://localhost -GOTRUE_API_HOST=0.0.0.0 -GOTRUE_SITE_URL= -GOTRUE_DB_DRIVER=postgres -GOTRUE_DB_DATABASE_URL=postgres://supabase_auth_admin@localhost/postgres?sslmode=disable -GOTRUE_JWT_ADMIN_ROLES=supabase_admin,service_role -GOTRUE_JWT_AUD=authenticated -GOTRUE_JWT_SECRET=my_jwt_secret_which_is_not_so_secret -""" -walg_config_json_content = """ -{ - "AWS_REGION": "ap-southeast-1", - "WALG_S3_PREFIX": "", - "PGDATABASE": "postgres", - "PGUSER": "supabase_admin", - "PGPORT": 5432, - "WALG_DELTA_MAX_STEPS": 6, - "WALG_COMPRESSION_METHOD": "lz4" -} -""" -anon_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTYyMjQ5NjYsImV4cCI6MjAxMTgwMDk2Nn0.QW95aRPA-4QuLzuvaIeeoFKlJP9J2hvAIpJ3WJ6G5zo" -service_role_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5NjIyNDk2NiwiZXhwIjoyMDExODAwOTY2fQ.Om7yqv15gC3mLGitBmvFRB3M4IsLsX9fXzTQnFM7lu0" -supabase_admin_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicm9sZSI6InN1cGFiYXNlX2FkbWluIiwiaWF0IjoxNjk2MjI0OTY2LCJleHAiOjIwMTE4MDA5NjZ9.jrD3j2rBWiIx0vhVZzd1CXFv7qkAP392nBMadvXxk1c" -init_json_content = f""" -{{ - "jwt_secret": "my_jwt_secret_which_is_not_so_secret", - "project_ref": "aaaaaaaaaaaaaaaaaaaa", - "logflare_api_key": "", - "logflare_pitr_errors_source": "", - "logflare_postgrest_source": "", - "logflare_pgbouncer_source": "", - "logflare_db_source": "", - "logflare_gotrue_source": "", - "anon_key": "{anon_key}", - "service_key": "{service_role_key}", - "supabase_admin_key": "{supabase_admin_key}", - "common_name": "db.aaaaaaaaaaaaaaaaaaaa.supabase.red", - "region": "ap-southeast-1", - "init_database_only": false -}} -""" - -logger = logging.getLogger("ami-tests") -handler = logging.StreamHandler() -formatter = logging.Formatter( - '%(asctime)s %(name)-12s %(levelname)-8s %(message)s') -handler.setFormatter(formatter) -logger.addHandler(handler) -logger.setLevel(logging.DEBUG) - -# scope='session' uses the same container for all the tests; -# scope='function' uses a new container per test function. -@pytest.fixture(scope="session") -def host(): - ec2 = boto3.resource("ec2", region_name="ap-southeast-1") - images = list( - ec2.images.filter( - Filters=[{"Name": "name", "Values": ["supabase-postgres-ci-ami-test"]}] - ) - ) - assert len(images) == 1 - image = images[0] - - def gzip_then_base64_encode(s: str) -> str: - return base64.b64encode(gzip.compress(s.encode())).decode() - - instance = list( - ec2.create_instances( - BlockDeviceMappings=[ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeSize": 8, # gb - "Encrypted": True, - "DeleteOnTermination": True, - "VolumeType": "gp3", - }, - }, - ], - MetadataOptions={ - "HttpTokens": "required", - "HttpEndpoint": "enabled", - }, - IamInstanceProfile={"Name": "pg-ap-southeast-1"}, - InstanceType="t4g.micro", - MinCount=1, - MaxCount=1, - ImageId=image.id, - NetworkInterfaces=[ - { - "DeviceIndex": 0, - "AssociatePublicIpAddress": True, - "Groups": ["sg-0a883ca614ebfbae0", "sg-014d326be5a1627dc"], - } - ], - UserData=f"""#cloud-config -hostname: db-aaaaaaaaaaaaaaaaaaaa -write_files: - - {{path: /etc/postgresql.schema.sql, content: {gzip_then_base64_encode(postgresql_schema_sql_content)}, permissions: '0600', encoding: gz+b64}} - - {{path: /etc/realtime.env, content: {gzip_then_base64_encode(realtime_env_content)}, permissions: '0664', encoding: gz+b64}} - - {{path: /etc/adminapi/adminapi.yaml, content: {gzip_then_base64_encode(adminapi_yaml_content)}, permissions: '0600', owner: 'adminapi:root', encoding: gz+b64}} - - {{path: /etc/postgresql-custom/pgsodium_root.key, content: {gzip_then_base64_encode(pgsodium_root_key_content)}, permissions: '0600', owner: 'postgres:postgres', encoding: gz+b64}} - - {{path: /etc/postgrest/base.conf, content: {gzip_then_base64_encode(postgrest_base_conf_content)}, permissions: '0664', encoding: gz+b64}} - - {{path: /etc/gotrue.env, content: {gzip_then_base64_encode(gotrue_env_content)}, permissions: '0664', encoding: gz+b64}} - - {{path: /etc/wal-g/config.json, content: {gzip_then_base64_encode(walg_config_json_content)}, permissions: '0664', owner: 'wal-g:wal-g', encoding: gz+b64}} - - {{path: /tmp/init.json, content: {gzip_then_base64_encode(init_json_content)}, permissions: '0600', encoding: gz+b64}} -runcmd: - - 'sudo echo \"pgbouncer\" \"postgres\" >> /etc/pgbouncer/userlist.txt' - - 'cd /tmp && aws s3 cp --region ap-southeast-1 s3://init-scripts-staging/project/init.sh .' - - 'bash init.sh "staging"' - - 'rm -rf /tmp/*' -""", - TagSpecifications=[ - { - "ResourceType": "instance", - "Tags": [ - {"Key": "Name", "Value": "ci-ami-test"}, - {"Key": "creator", "Value": "testinfra-ci"}, - {"Key": "testinfra-run-id", "Value": RUN_ID} - ], - } - ], - ) - )[0] - instance.wait_until_running() - - ec2logger = EC2InstanceConnectLogger(debug=False) - temp_key = EC2InstanceConnectKey(ec2logger.get_logger()) - ec2ic = boto3.client("ec2-instance-connect", region_name="ap-southeast-1") - response = ec2ic.send_ssh_public_key( - InstanceId=instance.id, - InstanceOSUser="ubuntu", - SSHPublicKey=temp_key.get_pub_key(), - ) - assert response["Success"] - - # instance doesn't have public ip yet - while not instance.public_ip_address: - logger.warning("waiting for ip to be available") - sleep(5) - instance.reload() - - while True: - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if sock.connect_ex((instance.public_ip_address, 22)) == 0: - break - else: - logger.warning("waiting for ssh to be available") - sleep(10) - - host = testinfra.get_host( - # paramiko is an ssh backend - f"paramiko://ubuntu@{instance.public_ip_address}?timeout=60", - ssh_identity_file=temp_key.get_priv_key_file(), - ) - - def is_healthy(host) -> bool: - cmd = host.run("pg_isready -U postgres") - if cmd.failed is True: - logger.warning("pg not ready") - return False - - cmd = host.run(f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'") - if cmd.failed is True: - logger.warning("adminapi not ready") - return False - - cmd = host.run("curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready") - if cmd.failed is True: - logger.warning("postgrest not ready") - return False - - cmd = host.run("curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health") - if cmd.failed is True: - logger.warning("gotrue not ready") - return False - - # TODO(thebengeu): switch to checking Envoy once it's the default. - cmd = host.run("sudo kong health") - if cmd.failed is True: - logger.warning("kong not ready") - return False - - cmd = host.run("sudo fail2ban-client status") - if cmd.failed is True: - logger.warning("fail2ban not ready") - return False - - return True - - while True: - if is_healthy(host): - break - sleep(1) - - # return a testinfra connection to the instance - yield host - - # at the end of the test suite, destroy the instance - instance.terminate() - - -def test_postgrest_is_running(host): - postgrest = host.service("postgrest") - assert postgrest.is_running - - -def test_postgrest_responds_to_requests(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/", - headers={ - "apikey": anon_key, - "authorization": f"Bearer {anon_key}", - }, - ) - assert res.ok - - -def test_postgrest_can_connect_to_db(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "apikey": service_role_key, - "authorization": f"Bearer {service_role_key}", - "accept-profile": "storage", - }, - ) - assert res.ok - - -# There would be an error if the `apikey` query parameter isn't removed, -# since PostgREST treats query parameters as conditions. -# -# Worth testing since remove_apikey_query_parameters uses regexp instead -# of parsed query parameters. -def test_postgrest_starting_apikey_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "apikey": service_role_key, - "id": "eq.absent", - "name": "eq.absent", - }, - ) - assert res.ok - - -def test_postgrest_middle_apikey_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "id": "eq.absent", - "apikey": service_role_key, - "name": "eq.absent", - }, - ) - assert res.ok - - -def test_postgrest_ending_apikey_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "id": "eq.absent", - "name": "eq.absent", - "apikey": service_role_key, - }, - ) - assert res.ok - -# There would be an error if the empty key query parameter isn't removed, -# since PostgREST treats empty key query parameters as malformed input. -# -# Worth testing since remove_apikey_and_empty_key_query_parameters uses regexp instead -# of parsed query parameters. -def test_postgrest_starting_empty_key_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "": "empty_key", - "id": "eq.absent", - "apikey": service_role_key, - }, - ) - assert res.ok - - -def test_postgrest_middle_empty_key_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "apikey": service_role_key, - "": "empty_key", - "id": "eq.absent", - }, - ) - assert res.ok - - -def test_postgrest_ending_empty_key_query_parameter_is_removed(host): - res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", - headers={ - "accept-profile": "storage", - }, - params={ - "id": "eq.absent", - "apikey": service_role_key, - "": "empty_key", - }, - ) - assert res.ok From d39d27401a9d40c182ad4ee014883a9d9ab58a12 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 3 Feb 2025 15:20:33 -0500 Subject: [PATCH 099/271] chore: update ci.yml to reflect where data is now stored --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59993411c..510de7be6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,11 +11,37 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3 + - name: Load postgres_release values + id: load_postgres_release + uses: mikefarah/yq@master + with: + args: eval '.postgres_release' ansible/vars.yml + # The output will be available as steps.load_postgres_release.outputs.stdout + - name: Run checks - # Update `ami-release.yaml` too if changing constraints. run: | - SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl) - if [[ -n $SUFFIX ]] ; then - echo "We no longer allow merging RC versions to develop." - exit 1 - fi + POSTGRES_RELEASES="${{ steps.load_postgres_release.outputs.stdout }}" + + # Iterate through each release + for release in $(echo "$POSTGRES_RELEASES" | yq eval 'keys | .[]' -); do + VERSION=$(echo "$POSTGRES_RELEASES" | yq eval ".\"$release\"" -) + if [[ "$release" == "postgresorioledb-17" ]]; then + # Check for suffix after -orioledb + if [[ "$VERSION" =~ -orioledb(.*) ]]; then + SUFFIX="${BASH_REMATCH[1]}" + if [[ -n "$SUFFIX" ]]; then + echo "We no longer allow merging versions with suffixes after -orioledb." + exit 1 + fi + fi + else + # Check for suffix after version digits + if [[ "$VERSION" =~ ([0-9]+\.[0-9]+\.[0-9]+)(.*) ]]; then + SUFFIX="${BASH_REMATCH[2]}" + if [[ -n "$SUFFIX" ]]; then + echo "We no longer allow merging versions with suffixes after version $VERSION." + exit 1 + fi + fi + fi + done From 3cbe23cd5fe947ac0983831bd5fce96a71702540 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 4 Feb 2025 07:49:50 -0500 Subject: [PATCH 100/271] chore: wip upgrade pgroonga to latest (#1418) * chore: wip upgrade pgroonga to latest * chore: strings for staging tests of image * chore: staging version * chore: bump staging vrsion * chore: GRN_PLUGINS_DIR env var * chore: make sure nix available * chore: no longer need sudo * chore: bump version * chore: bump upload artifact action --- .../workflows/dockerhub-release-matrix.yml | 2 +- ...ublish-nix-pgupgrade-bin-flake-version.yml | 4 +++- .../pg_upgrade_scripts/initiate.sh | 4 ++-- ansible/vars.yml | 4 ++-- nix/ext/pgroonga.nix | 4 ++-- nix/tests/expected/z_15_ext_interface.out | 23 ++++++++++++++++++- nix/tests/expected/z_17_ext_interface.out | 23 ++++++++++++++++++- nix/tools/run-client.sh.in | 10 +++++++- 8 files changed, 63 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index 378d61725..d42285cb7 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -157,7 +157,7 @@ jobs: run: | echo "${{ steps.output_version.outputs.result }}" >> results.txt # Append results - name: Upload Results Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: merge_results-${{ matrix.version }} path: results.txt diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index 47bbc274d..09e1663ce 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -37,11 +37,13 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then VERSION=${{ inputs.postgresVersion }} diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 88518766b..4e11f2d52 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -419,7 +419,7 @@ EOF if [ "$IS_NIX_BASED_SYSTEM" = "true" ]; then UPGRADE_COMMAND=". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $UPGRADE_COMMAND" fi - LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres echo "10. Stopping postgres; running pg_upgrade" # Extra work to ensure postgres is actually stopped @@ -435,7 +435,7 @@ EOF CI_stop_postgres fi - LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres # copying custom configurations echo "11. Copying custom configurations" diff --git a/ansible/vars.yml b/ansible/vars.yml index fc39cb507..9671ec2aa 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.030-orioledb" - postgres15: "15.8.1.034" + postgresorioledb-17: "17.0.1.31-orioledb" + postgres15: "15.8.1.035" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/pgroonga.nix b/nix/ext/pgroonga.nix index c7fe90bb1..7ebe84960 100644 --- a/nix/ext/pgroonga.nix +++ b/nix/ext/pgroonga.nix @@ -4,10 +4,10 @@ let in stdenv.mkDerivation rec { pname = "pgroonga"; - version = "3.0.7"; + version = "3.2.5"; src = fetchurl { url = "https://packages.groonga.org/source/${pname}/${pname}-${version}.tar.gz"; - sha256 = "sha256-iF/zh4zDDpAw5fxW1WG8i2bfPt4VYsnYArwOoE/lwgM="; + sha256 = "sha256-GM9EOQty72hdE4Ecq8jpDudhZLiH3pP9ODLxs8DXcSY="; }; nativeBuildInputs = [ pkg-config makeWrapper ]; diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 7f53984f3..9914fa3b9 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1420,13 +1420,20 @@ order by pgroonga | public | pgroonga_command | groongacommand text | text pgroonga | public | pgroonga_command | groongacommand text, arguments text[] | text pgroonga | public | pgroonga_command_escape_value | value text | text + pgroonga | public | pgroonga_condition | query text, weights integer[], scorers text[], schema_name text, index_name text, column_name text, fuzzy_max_distance_ratio real | pgroonga_condition pgroonga | public | pgroonga_contain_varchar_array | character varying[], character varying | boolean pgroonga | public | pgroonga_equal_query_text_array | targets text[], query text | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_query_varchar_array | targets character varying[], query text | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_text | target text, other text | boolean pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_escape | value bigint | text pgroonga | public | pgroonga_escape | value double precision | text pgroonga | public | pgroonga_escape | value text, special_characters text | text @@ -1446,6 +1453,8 @@ order by pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text pgroonga | public | pgroonga_is_writable | | boolean + pgroonga | public | pgroonga_list_broken_indexes | | SETOF text + pgroonga | public | pgroonga_list_lagged_indexes | | SETOF text pgroonga | public | pgroonga_match_in_text | text, text[] | boolean pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean @@ -1467,11 +1476,14 @@ order by pgroonga | public | pgroonga_match_text | text, text | boolean pgroonga | public | pgroonga_match_text_array | text[], text | boolean pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_array_condition_with_scorers | target text[], condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_match_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_normalize | target text | text pgroonga | public | pgroonga_normalize | target text, normalizername text | text @@ -1490,10 +1502,14 @@ order by pgroonga | public | pgroonga_prefix_rk_varchar_array | character varying[], character varying | boolean pgroonga | public | pgroonga_prefix_text | text, text | boolean pgroonga | public | pgroonga_prefix_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_text_array_condition | text[], pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_prefix_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_array_condition | character varying[], pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_condition | boolean pgroonga | public | pgroonga_query_escape | query text | text pgroonga | public | pgroonga_query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text pgroonga | public | pgroonga_query_extract_keywords | query text, index_name text | text[] @@ -1503,16 +1519,21 @@ order by pgroonga | public | pgroonga_query_jsonb | jsonb, text | boolean pgroonga | public | pgroonga_query_text | text, text | boolean pgroonga | public | pgroonga_query_text_array | text[], text | boolean + pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_text_array_condition_with_scorers | targets text[], condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_query_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_regexp_in_text | text, text[] | boolean pgroonga | public | pgroonga_regexp_in_varchar | character varying, character varying[] | boolean pgroonga | public | pgroonga_regexp_text | text, text | boolean + pgroonga | public | pgroonga_regexp_text_array | targets text[], pattern text | boolean + pgroonga | public | pgroonga_regexp_text_array_condition | targets text[], pattern pgroonga_condition | boolean pgroonga | public | pgroonga_regexp_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_result_to_jsonb_objects | result jsonb | jsonb pgroonga | public | pgroonga_result_to_recordset | result jsonb | SETOF record @@ -5205,7 +5226,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5034 rows) +(5055 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 7e2dc5fd2..37f417f81 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1441,12 +1441,19 @@ order by pgroonga | public | pgroonga_command | groongacommand text | text pgroonga | public | pgroonga_command | groongacommand text, arguments text[] | text pgroonga | public | pgroonga_command_escape_value | value text | text + pgroonga | public | pgroonga_condition | query text, weights integer[], scorers text[], schema_name text, index_name text, column_name text, fuzzy_max_distance_ratio real | pgroonga_condition pgroonga | public | pgroonga_contain_varchar_array | character varying[], character varying | boolean pgroonga | public | pgroonga_equal_query_text_array | targets text[], query text | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_query_varchar_array | targets character varying[], query text | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_text | target text, other text | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_escape | value bigint | text pgroonga | public | pgroonga_escape | value boolean | text @@ -1467,6 +1474,8 @@ order by pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text pgroonga | public | pgroonga_is_writable | | boolean + pgroonga | public | pgroonga_list_broken_indexes | | SETOF text + pgroonga | public | pgroonga_list_lagged_indexes | | SETOF text pgroonga | public | pgroonga_match_in_text | text, text[] | boolean pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean @@ -1487,11 +1496,14 @@ order by pgroonga | public | pgroonga_match_term | target text[], term text | boolean pgroonga | public | pgroonga_match_text | text, text | boolean pgroonga | public | pgroonga_match_text_array | text[], text | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_match_text_array_condition_with_scorers | target text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_match_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_match_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_match_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_normalize | target text | text @@ -1511,9 +1523,13 @@ order by pgroonga | public | pgroonga_prefix_rk_varchar_array | character varying[], character varying | boolean pgroonga | public | pgroonga_prefix_text | text, text | boolean pgroonga | public | pgroonga_prefix_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_text_array_condition | text[], pgroonga_condition | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_prefix_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_prefix_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_array_condition | character varying[], pgroonga_condition | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_escape | query text | text pgroonga | public | pgroonga_query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text @@ -1524,16 +1540,21 @@ order by pgroonga | public | pgroonga_query_jsonb | jsonb, text | boolean pgroonga | public | pgroonga_query_text | text, text | boolean pgroonga | public | pgroonga_query_text_array | text[], text | boolean + pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_text_array_condition_with_scorers | targets text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_query_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_regexp_in_text | text, text[] | boolean pgroonga | public | pgroonga_regexp_in_varchar | character varying, character varying[] | boolean pgroonga | public | pgroonga_regexp_text | text, text | boolean + pgroonga | public | pgroonga_regexp_text_array | targets text[], pattern text | boolean + pgroonga | public | pgroonga_regexp_text_array_condition | targets text[], pattern pgroonga_condition | boolean pgroonga | public | pgroonga_regexp_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_result_to_jsonb_objects | result jsonb | jsonb pgroonga | public | pgroonga_result_to_recordset | result jsonb | SETOF record @@ -4885,7 +4906,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4726 rows) +(4747 rows) /* diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 125e365bd..ef81d58c1 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -64,6 +64,15 @@ while [[ "$#" -gt 0 ]]; do exit 1 fi ;; + -p|--port) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + PORTNO="$2" + shift 2 + else + echo "Error: --port requires an argument" + exit 1 + fi + ;; -h|--help) print_help exit 0 @@ -106,7 +115,6 @@ export PATH=$BINDIR/bin:$PATH export POSTGRES_DB=postgres export POSTGRES_HOST=localhost -PORTNO="${2:-@PGSQL_DEFAULT_PORT@}" PGSQL_SUPERUSER=@PGSQL_SUPERUSER@ MIGRATIONS_DIR=@MIGRATIONS_DIR@ POSTGRESQL_SCHEMA_SQL=@POSTGRESQL_SCHEMA_SQL@ From 2f54d6bf0c4449ac9cdccad53c66e354e7f3d88a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 4 Feb 2025 08:08:09 -0500 Subject: [PATCH 101/271] chore: bump to v4 to fix deprecation failure --- .github/workflows/dockerhub-release-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index d42285cb7..72116abd1 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -195,7 +195,7 @@ jobs: $"versions=$versions_str" | save --append $env.GITHUB_ENV ' - name: Download Results Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: pattern: merge_results-* - name: Combine Results From e8522fad0af38da3f7b57792d558e0c141bfad37 Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Sun, 2 Feb 2025 12:44:29 -0500 Subject: [PATCH 102/271] feat: allow all auto_explain parameters to be user customizable Configures supautils to allow access to all auto_explain params --- ansible/files/postgresql_config/supautils.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 1970bc16f..1edd4abe4 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -9,6 +9,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' -supautils.privileged_role_allowed_configs = 'auto_explain.log_min_duration, auto_explain.log_nested_statements, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' +supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' From 93e983ca9471e52447d0c8e97fb0f9e5b63b22b0 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 5 Feb 2025 14:48:23 +0800 Subject: [PATCH 103/271] feat: log ddl by default --- .gitignore | 1 + ansible/files/postgresql_config/postgresql.conf.j2 | 2 +- ansible/vars.yml | 4 ++-- ...250205060043_disable_log_statement_on_internal_roles.sql | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 migrations/db/migrations/20250205060043_disable_log_statement_on_internal_roles.sql diff --git a/.gitignore b/.gitignore index 45464e3f0..45e3e6e71 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ result* .vscode/ db +!migrations/db diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index 1604d94f9..6d2df6074 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -540,7 +540,7 @@ log_line_prefix = '%h %m [%p] %q%u@%d ' # special values: #log_parameter_max_length_on_error = 0 # when logging an error, limit logged # bind-parameter values to N bytes; # -1 means print in full, 0 disables -log_statement = 'none' # none, ddl, mod, all +log_statement = 'ddl' # none, ddl, mod, all #log_replication_commands = off #log_temp_files = -1 # log temporary files equal or larger # than the specified size in kilobytes; diff --git a/ansible/vars.yml b/ansible/vars.yml index 9671ec2aa..95bc674d2 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.31-orioledb" - postgres15: "15.8.1.035" + postgresorioledb-17: "17.0.1.032-orioledb" + postgres15: "15.8.1.036" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250205060043_disable_log_statement_on_internal_roles.sql b/migrations/db/migrations/20250205060043_disable_log_statement_on_internal_roles.sql new file mode 100644 index 000000000..822a7587e --- /dev/null +++ b/migrations/db/migrations/20250205060043_disable_log_statement_on_internal_roles.sql @@ -0,0 +1,6 @@ +-- migrate:up +alter role supabase_admin set log_statement = none; +alter role supabase_auth_admin set log_statement = none; +alter role supabase_storage_admin set log_statement = none; + +-- migrate:down From ba21d04e8e3f875f059394863e8f9620142d855a Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 6 Feb 2025 15:18:26 +0800 Subject: [PATCH 104/271] chore: only gitignore schema.sql --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 45e3e6e71..005d3ece6 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,4 @@ result* .idea/ .vscode/ -db -!migrations/db +db/schema.sql From 4de4563f0469f532771dcf86eb9a51acf3a665c4 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 7 Feb 2025 11:04:38 +0800 Subject: [PATCH 105/271] feat: Build and publish a QEMU image artifact (#1430) Co-authored-by: angelico --- .github/workflows/ami-release-nix.yml | 1 + .github/workflows/qemu-image-build.yml | 185 +++++++++++++ Dockerfile-kubernetes | 9 + Makefile | 20 ++ amazon-arm64-nix.pkr.hcl | 2 +- ansible/files/permission_check.py | 301 +++++++++++---------- ansible/playbook.yml | 10 +- ansible/tasks/setup-fail2ban.yml | 9 +- ansible/tasks/setup-postgres.yml | 22 +- ansible/tasks/stage2-setup-postgres.yml | 63 ++--- ansible/vars.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 146 ++++++++++ http/.gitkeep | 0 meta-data | 2 + nix/ext/wrappers/default.nix | 2 +- qemu-arm64-nix.pkr.hcl | 142 ++++++++++ qemu_artifact.md | 50 ++++ scripts/90-cleanup-qemu.sh | 65 +++++ user-data-cloudimg | 16 ++ 19 files changed, 840 insertions(+), 207 deletions(-) create mode 100644 .github/workflows/qemu-image-build.yml create mode 100644 Dockerfile-kubernetes create mode 100644 Makefile create mode 100755 ebssurrogate/scripts/qemu-bootstrap-nix.sh create mode 100644 http/.gitkeep create mode 100644 meta-data create mode 100644 qemu-arm64-nix.pkr.hcl create mode 100644 qemu_artifact.md create mode 100644 scripts/90-cleanup-qemu.sh create mode 100644 user-data-cloudimg diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 3242a4e1d..10c419fb1 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -78,6 +78,7 @@ jobs: run: | packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} + # why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined? packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml new file mode 100644 index 000000000..464ee01fe --- /dev/null +++ b/.github/workflows/qemu-image-build.yml @@ -0,0 +1,185 @@ +name: Build QEMU image + +on: + push: + branches: + - develop + - release/* + paths: + - '.github/workflows/qemu-image-build.yml' + - 'qemu-arm64-nix.pkr.hcl' + - 'common-nix.vars.pkr.hcl' + - 'ansible/vars.yml' + workflow_dispatch: + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL versions - only builds pg15 atm + id: set-versions + run: | + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[0]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT + + build: + needs: prepare + strategy: + matrix: + postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} + runs-on: arm-native-runner + timeout-minutes: 150 + permissions: + contents: write + packages: write + id-token: write + + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Run checks if triggered manually + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + if [[ -z $SUFFIX ]] ; then + echo "Version must include non-numeric characters if built manually." + exit 1 + fi + + - name: enable KVM support + run: | + sudo chown runner /dev/kvm + sudo chmod 666 /dev/kvm + + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + + - name: Generate common-nix.vars.pkr.hcl + run: | + curl -L https://github.com/mikefarah/yq/releases/download/v4.45.1/yq_linux_arm64 -o yq && chmod +x yq + PG_VERSION=$(./yq '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl + echo 'postgres-major-version = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl + # Ensure there's a newline at the end of the file + echo "" >> common-nix.vars.pkr.hcl + + # TODO (darora): not quite sure why I'm having to uninstall and re-install these deps, but the build fails w/o this + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get remove -y qemu-efi-aarch64 cloud-image-utils qemu-system-arm qemu-utils + sudo apt-get install -y qemu-efi-aarch64 cloud-image-utils qemu-system-arm qemu-utils + + - name: Build QEMU artifact + run: | + make init + GIT_SHA=${{github.sha}} + export PACKER_LOG=1 + packer build -var "git_sha=${GIT_SHA}" -var-file="common-nix.vars.pkr.hcl" qemu-arm64-nix.pkr.hcl + + - name: Grab release version + id: process_release_version + run: | + VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + echo "version=$VERSION" >> $GITHUB_OUTPUT + + # - name: Create nix flake revision tarball + # run: | + # GIT_SHA=${{github.sha}} + # MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} + + # mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" + # echo "$GIT_SHA" >> "/tmp/pg_upgrade_bin/${MAJOR_VERSION}/nix_flake_version" + # tar -czf "/tmp/pg_binaries.tar.gz" -C "/tmp/pg_upgrade_bin" . + + - name: configure aws credentials - staging + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + aws-region: "us-east-1" + + - name: Login to Amazon ECR Public + id: login-ecr-public + uses: aws-actions/amazon-ecr-login@v2 + with: + registry-type: public + + - name: Build, tag, and push docker image to Amazon ECR Public + env: + REGISTRY: public.ecr.aws/w9p6e7k7 + REGISTRY_ALIAS: supabase + REPOSITORY: postgres-vm-image + IMAGE_TAG: ${{ steps.process_release_version.outputs.version }} + run: | + docker build -f Dockerfile-kubernetes -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG . + docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG + + # - name: Upload software manifest to s3 staging + # run: | + # cd ansible + # ansible-playbook -i localhost \ + # -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ + # -e "internal_artifacts_bucket=${{ secrets.ARTIFACTS_BUCKET }}" \ + # -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ + # manifest-playbook.yml + + # - name: Upload nix flake revision to s3 staging + # run: | + # aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + + # - name: configure aws credentials - prod + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: ${{ secrets.PROD_AWS_ROLE }} + # aws-region: "us-east-1" + + # - name: Upload software manifest to s3 prod + # run: | + # cd ansible + # ansible-playbook -i localhost \ + # -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ + # -e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \ + # -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ + # manifest-playbook.yml + + # - name: Upload nix flake revision to s3 prod + # run: | + # aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + + # - name: Create release + # uses: softprops/action-gh-release@v1 + # with: + # name: ${{ steps.process_release_version.outputs.version }} + # tag_name: ${{ steps.process_release_version.outputs.version }} + # target_commitish: ${{github.sha}} + + # - name: Slack Notification on Failure + # if: ${{ failure() }} + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + # SLACK_USERNAME: 'gha-failures-notifier' + # SLACK_COLOR: 'danger' + # SLACK_MESSAGE: 'Building Postgres AMI failed' + # SLACK_FOOTER: '' + + - name: Cleanup resources after build + if: ${{ always() }} + run: | + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + + - name: Cleanup resources on build cancellation + if: ${{ cancelled() }} + run: | + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids diff --git a/Dockerfile-kubernetes b/Dockerfile-kubernetes new file mode 100644 index 000000000..716e72b42 --- /dev/null +++ b/Dockerfile-kubernetes @@ -0,0 +1,9 @@ +FROM alpine:3.21 + +ADD ./output-cloudimg/packer-cloudimg /disk/focal.qcow2 + +RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf +# dev stuff +# RUN apk add --no-cache iproute2 + +CMD exec /bin/sh -c "trap : TERM INT; sleep 9999999999d & wait" diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..5bef8a430 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +UPSTREAM_NIX_GIT_SHA := $(shell git rev-parse HEAD) +GIT_SHA := $(shell git describe --tags --always --dirty) + +init: qemu-arm64-nix.pkr.hcl + packer init qemu-arm64-nix.pkr.hcl + +output-cloudimg/packer-cloudimg: ansible qemu-arm64-nix.pkr.hcl + packer build -var "git_sha=$(UPSTREAM_NIX_GIT_SHA)" qemu-arm64-nix.pkr.hcl + +disk/focal-raw.img: output-cloudimg/packer-cloudimg + mkdir -p disk + sudo qemu-img convert -O raw output-cloudimg/packer-cloudimg disk/focal-raw.img + +alpine-image: output-cloudimg/packer-cloudimg + sudo nerdctl build . -t supabase-postgres-test:$(GIT_SHA) -f ./Dockerfile-kubernetes + +clean: + rm -rf output-cloudimg + +.PHONY: alpine-image init clean diff --git a/amazon-arm64-nix.pkr.hcl b/amazon-arm64-nix.pkr.hcl index 118196473..ec427ff9f 100644 --- a/amazon-arm64-nix.pkr.hcl +++ b/amazon-arm64-nix.pkr.hcl @@ -264,7 +264,7 @@ build { ] use_env_var_file = true script = "ebssurrogate/scripts/surrogate-bootstrap-nix.sh" - execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && {{.Path}}'" + execute_command = "sudo -S sh -c '. {{.EnvVarFile}} && cd /tmp/ansible-playbook && {{.Path}}'" start_retry_timeout = "5m" skip_clean = true } diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index 724acb10a..5bf421018 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -1,155 +1,110 @@ import subprocess import json import sys +import argparse + # Expected groups for each user expected_results = { "postgres": [ {"groupname": "postgres", "username": "postgres"}, - {"groupname": "ssl-cert", "username": "postgres"} + {"groupname": "ssl-cert", "username": "postgres"}, ], "ubuntu": [ - {"groupname":"ubuntu","username":"ubuntu"}, - {"groupname":"adm","username":"ubuntu"}, - {"groupname":"dialout","username":"ubuntu"}, - {"groupname":"cdrom","username":"ubuntu"}, - {"groupname":"floppy","username":"ubuntu"}, - {"groupname":"sudo","username":"ubuntu"}, - {"groupname":"audio","username":"ubuntu"}, - {"groupname":"dip","username":"ubuntu"}, - {"groupname":"video","username":"ubuntu"}, - {"groupname":"plugdev","username":"ubuntu"}, - {"groupname":"lxd","username":"ubuntu"}, - {"groupname":"netdev","username":"ubuntu"} - ], - "root": [ - {"groupname":"root","username":"root"} - ], - "daemon": [ - {"groupname":"daemon","username":"daemon"} - ], - "bin": [ - {"groupname":"bin","username":"bin"} - ], - "sys": [ - {"groupname":"sys","username":"sys"} - ], - "sync": [ - {"groupname":"nogroup","username":"sync"} - ], - "games": [ - {"groupname":"games","username":"games"} - ], - "man": [ - {"groupname":"man","username":"man"} - ], - "lp": [ - {"groupname":"lp","username":"lp"} - ], - "mail": [ - {"groupname":"mail","username":"mail"} - ], - "news": [ - {"groupname":"news","username":"news"} - ], - "uucp": [ - {"groupname":"uucp","username":"uucp"} - ], - "proxy": [ - {"groupname":"proxy","username":"proxy"} - ], - "www-data": [ - {"groupname":"www-data","username":"www-data"} - ], - "backup": [ - {"groupname":"backup","username":"backup"} - ], - "list": [ - {"groupname":"list","username":"list"} - ], - "irc": [ - {"groupname":"irc","username":"irc"} - ], - "gnats": [ - {"groupname":"gnats","username":"gnats"} - ], - "nobody": [ - {"groupname":"nogroup","username":"nobody"} - ], + {"groupname": "adm", "username": "ubuntu"}, + {"groupname": "audio", "username": "ubuntu"}, + {"groupname": "cdrom", "username": "ubuntu"}, + {"groupname": "dialout", "username": "ubuntu"}, + {"groupname": "dip", "username": "ubuntu"}, + {"groupname": "floppy", "username": "ubuntu"}, + {"groupname": "lxd", "username": "ubuntu"}, + {"groupname": "netdev", "username": "ubuntu"}, + {"groupname": "plugdev", "username": "ubuntu"}, + {"groupname": "sudo", "username": "ubuntu"}, + {"groupname": "ubuntu", "username": "ubuntu"}, + {"groupname": "video", "username": "ubuntu"}, + ], + "root": [{"groupname": "root", "username": "root"}], + "daemon": [{"groupname": "daemon", "username": "daemon"}], + "bin": [{"groupname": "bin", "username": "bin"}], + "sys": [{"groupname": "sys", "username": "sys"}], + "sync": [{"groupname": "nogroup", "username": "sync"}], + "games": [{"groupname": "games", "username": "games"}], + "man": [{"groupname": "man", "username": "man"}], + "lp": [{"groupname": "lp", "username": "lp"}], + "mail": [{"groupname": "mail", "username": "mail"}], + "news": [{"groupname": "news", "username": "news"}], + "uucp": [{"groupname": "uucp", "username": "uucp"}], + "proxy": [{"groupname": "proxy", "username": "proxy"}], + "www-data": [{"groupname": "www-data", "username": "www-data"}], + "backup": [{"groupname": "backup", "username": "backup"}], + "list": [{"groupname": "list", "username": "list"}], + "irc": [{"groupname": "irc", "username": "irc"}], + "gnats": [{"groupname": "gnats", "username": "gnats"}], + "nobody": [{"groupname": "nogroup", "username": "nobody"}], "systemd-network": [ - {"groupname":"systemd-network","username":"systemd-network"} + {"groupname": "systemd-network", "username": "systemd-network"} ], "systemd-resolve": [ - {"groupname":"systemd-resolve","username":"systemd-resolve"} + {"groupname": "systemd-resolve", "username": "systemd-resolve"} ], "systemd-timesync": [ - {"groupname":"systemd-timesync","username":"systemd-timesync"} - ], - "messagebus": [ - {"groupname":"messagebus","username":"messagebus"} + {"groupname": "systemd-timesync", "username": "systemd-timesync"} ], + "messagebus": [{"groupname": "messagebus", "username": "messagebus"}], "ec2-instance-connect": [ - {"groupname":"nogroup","username":"ec2-instance-connect"} - ], - "sshd": [ - {"groupname":"nogroup","username":"sshd"} + {"groupname": "nogroup", "username": "ec2-instance-connect"} ], + "sshd": [{"groupname": "nogroup", "username": "sshd"}], "wal-g": [ - {"groupname":"wal-g","username":"wal-g"}, - {"groupname":"postgres","username":"wal-g"} + {"groupname": "postgres", "username": "wal-g"}, + {"groupname": "wal-g", "username": "wal-g"}, ], "pgbouncer": [ - {"groupname":"pgbouncer","username":"pgbouncer"}, - {"groupname":"ssl-cert","username":"pgbouncer"}, - {"groupname":"postgres","username":"pgbouncer"} - ], - "gotrue": [ - {"groupname":"gotrue","username":"gotrue"} - ], - "envoy": [ - {"groupname":"envoy","username":"envoy"} - ], - "kong": [ - {"groupname":"kong","username":"kong"} - ], - "nginx": [ - {"groupname":"nginx","username":"nginx"} - ], + {"groupname": "pgbouncer", "username": "pgbouncer"}, + {"groupname": "postgres", "username": "pgbouncer"}, + {"groupname": "ssl-cert", "username": "pgbouncer"}, + ], + "gotrue": [{"groupname": "gotrue", "username": "gotrue"}], + "envoy": [{"groupname": "envoy", "username": "envoy"}], + "kong": [{"groupname": "kong", "username": "kong"}], + "nginx": [{"groupname": "nginx", "username": "nginx"}], "vector": [ - {"groupname":"vector","username":"vector"}, - {"groupname":"adm","username":"vector"}, - {"groupname":"systemd-journal","username":"vector"}, - {"groupname":"postgres","username":"vector"} + {"groupname": "adm", "username": "vector"}, + {"groupname": "postgres", "username": "vector"}, + {"groupname": "systemd-journal", "username": "vector"}, + {"groupname": "vector", "username": "vector"}, ], "adminapi": [ - {"groupname":"adminapi","username":"adminapi"}, - {"groupname":"root","username":"adminapi"}, - {"groupname":"systemd-journal","username":"adminapi"}, - {"groupname":"admin","username":"adminapi"}, - {"groupname":"postgres","username":"adminapi"}, - {"groupname":"pgbouncer","username":"adminapi"}, - {"groupname":"wal-g","username":"adminapi"}, - {"groupname":"postgrest","username":"adminapi"}, - {"groupname":"envoy","username":"adminapi"}, - {"groupname":"kong","username":"adminapi"}, - {"groupname":"vector","username":"adminapi"} - ], - "postgrest": [ - {"groupname":"postgrest","username":"postgrest"} - ], - "tcpdump": [ - {"groupname":"tcpdump","username":"tcpdump"} - ], + {"groupname": "admin", "username": "adminapi"}, + {"groupname": "adminapi", "username": "adminapi"}, + {"groupname": "envoy", "username": "adminapi"}, + {"groupname": "kong", "username": "adminapi"}, + {"groupname": "pgbouncer", "username": "adminapi"}, + {"groupname": "postgres", "username": "adminapi"}, + {"groupname": "postgrest", "username": "adminapi"}, + {"groupname": "root", "username": "adminapi"}, + {"groupname": "systemd-journal", "username": "adminapi"}, + {"groupname": "vector", "username": "adminapi"}, + {"groupname": "wal-g", "username": "adminapi"}, + ], + "postgrest": [{"groupname": "postgrest", "username": "postgrest"}], + "tcpdump": [{"groupname": "tcpdump", "username": "tcpdump"}], "systemd-coredump": [ - {"groupname":"systemd-coredump","username":"systemd-coredump"} - ] + {"groupname": "systemd-coredump", "username": "systemd-coredump"} + ], } + + # This program depends on osquery being installed on the system # Function to run osquery def run_osquery(query): - process = subprocess.Popen(['osqueryi', '--json', query], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + process = subprocess.Popen( + ["osqueryi", "--json", query], stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) output, error = process.communicate() - return output.decode('utf-8') + return output.decode("utf-8") + def parse_json(json_str): try: @@ -158,6 +113,7 @@ def parse_json(json_str): print("Error decoding JSON:", e) sys.exit(1) + def compare_results(username, query_result): expected_result = expected_results.get(username) if expected_result is None: @@ -167,38 +123,101 @@ def compare_results(username, query_result): if query_result == expected_result: print(f"The query result for user '{username}' matches the expected result.") else: - print(f"The query result for user '{username}' does not match the expected result.") + print( + f"The query result for user '{username}' does not match the expected result." + ) print("Expected:", expected_result) print("Got:", query_result) sys.exit(1) + def check_nixbld_users(): query = """ - SELECT u.username, g.groupname - FROM users u - JOIN user_groups ug ON u.uid = ug.uid - JOIN groups g ON ug.gid = g.gid + SELECT u.username, g.groupname + FROM users u + JOIN user_groups ug ON u.uid = ug.uid + JOIN groups g ON ug.gid = g.gid WHERE u.username LIKE 'nixbld%'; """ query_result = run_osquery(query) parsed_result = parse_json(query_result) - + for user in parsed_result: - if user['groupname'] != 'nixbld': - print(f"User '{user['username']}' is in group '{user['groupname']}' instead of 'nixbld'.") + if user["groupname"] != "nixbld": + print( + f"User '{user['username']}' is in group '{user['groupname']}' instead of 'nixbld'." + ) sys.exit(1) - + print("All nixbld users are in the 'nixbld' group.") -# Define usernames for which you want to compare results -usernames = ["postgres", "ubuntu", "root", "daemon", "bin", "sys", "sync", "games","man","lp","mail","news","uucp","proxy","www-data","backup","list","irc","gnats","nobody","systemd-network","systemd-resolve","systemd-timesync","messagebus","ec2-instance-connect","sshd","wal-g","pgbouncer","gotrue","envoy","kong","nginx","vector","adminapi","postgrest","tcpdump","systemd-coredump"] -# Iterate over usernames, run the query, and compare results -for username in usernames: - query = f"SELECT u.username, g.groupname FROM users u JOIN user_groups ug ON u.uid = ug.uid JOIN groups g ON ug.gid = g.gid WHERE u.username = '{username}';" - query_result = run_osquery(query) - parsed_result = parse_json(query_result) - compare_results(username, parsed_result) +def main(): + parser = argparse.ArgumentParser( + prog="Supabase Postgres Artifact Permissions Checker", + description="Checks the Postgres Artifact for the appropriate users and group memberships", + ) + parser.add_argument( + "-q", + "--qemu", + action="store_true", + help="Whether we are checking a QEMU artifact", + ) + args = parser.parse_args() + qemu_artifact = args.qemu or False + + # Define usernames for which you want to compare results + usernames = [ + "postgres", + "ubuntu", + "root", + "daemon", + "bin", + "sys", + "sync", + "games", + "man", + "lp", + "mail", + "news", + "uucp", + "proxy", + "www-data", + "backup", + "list", + "irc", + "gnats", + "nobody", + "systemd-network", + "systemd-resolve", + "systemd-timesync", + "messagebus", + "sshd", + "wal-g", + "pgbouncer", + "gotrue", + "envoy", + "kong", + "nginx", + "vector", + "adminapi", + "postgrest", + "tcpdump", + "systemd-coredump", + ] + if not qemu_artifact: + usernames.append("ec2-instance-connect") + + # Iterate over usernames, run the query, and compare results + for username in usernames: + query = f"SELECT u.username, g.groupname FROM users u JOIN user_groups ug ON u.uid = ug.uid JOIN groups g ON ug.gid = g.gid WHERE u.username = '{username}' ORDER BY g.groupname;" + query_result = run_osquery(query) + parsed_result = parse_json(query_result) + compare_results(username, parsed_result) + + # Check if all nixbld users are in the nixbld group + check_nixbld_users() + -# Check if all nixbld users are in the nixbld group -check_nixbld_users() +if __name__ == "__main__": + main() diff --git a/ansible/playbook.yml b/ansible/playbook.yml index a6bea19e9..5c5f8da3a 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -142,6 +142,7 @@ import_tasks: tasks/setup-fail2ban.yml when: debpkg_mode or nixpkg_mode + # Install EC2 instance connect # Only for AWS images - name: install EC2 instance connect @@ -151,6 +152,7 @@ - ec2-instance-connect tags: - aws-only + when: qemu_mode is undefined # Install this at the end to prevent it from kicking in during the apt process, causing conflicts - name: Install security tools @@ -196,6 +198,12 @@ - collect-binaries when: debpkg_mode + - name: Install osquery from nixpkgs binary cache + become: yes + shell: | + apt autoremove -y --purge snapd + when: stage2_nix + - name: Install osquery from nixpkgs binary cache become: yes shell: | @@ -205,7 +213,7 @@ - name: Run osquery permission checks become: yes shell: | - sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && /usr/bin/python3 /tmp/ansible-playbook/ansible/files/permission_check.py" + sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && /usr/bin/python3 /tmp/ansible-playbook/ansible/files/permission_check.py {{ '--qemu' if qemu_mode is defined else '' }}" when: stage2_nix - name: Remove osquery diff --git a/ansible/tasks/setup-fail2ban.yml b/ansible/tasks/setup-fail2ban.yml index 1f6065d32..7d9088d46 100644 --- a/ansible/tasks/setup-fail2ban.yml +++ b/ansible/tasks/setup-fail2ban.yml @@ -65,16 +65,9 @@ - install-supabase-internal when: debpkg_mode or nixpkg_mode -# Restart -- name: fail2ban - restart - systemd: - name: fail2ban - state: restarted - when: debpkg_mode or nixpkg_mode - - name: fail2ban - disable service systemd: name: fail2ban enabled: no daemon_reload: yes - when: debpkg_mode or nixpkg_mode \ No newline at end of file + when: debpkg_mode or nixpkg_mode diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 188a364b8..a45b7a502 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -204,6 +204,14 @@ ansible_command_timeout: 60 when: debpkg_mode +- name: Make sure .bashrc exists + file: + path: /var/lib/postgresql/.bashrc + state: touch + owner: postgres + group: postgres + when: nixpkg_mode + - name: Check psql_version and modify supautils.conf and postgresql.conf if necessary block: - name: Check if psql_version is psql_orioledb @@ -260,6 +268,13 @@ dest: /etc/systemd/system/database-optimizations.service when: debpkg_mode or stage2_nix +- name: initialize pg required state + become: yes + shell: | + mkdir -p /run/postgresql + chown -R postgres:postgres /run/postgresql + when: stage2_nix and qemu_mode is defined + - name: Restart Postgres Database without Systemd become: yes become_user: postgres @@ -283,13 +298,6 @@ daemon_reload: yes when: debpkg_mode or stage2_nix -- name: Make sure .bashrc exists - file: - path: /var/lib/postgresql/.bashrc - state: touch - owner: postgres - group: postgres - when: nixpkg_mode - name: Add LOCALE_ARCHIVE to .bashrc lineinfile: diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index facc1e54d..d2877e239 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -164,7 +164,7 @@ - name: import pgsodium_getkey script template: - src: /tmp/ansible-playbook/ansible/files/pgsodium_getkey_readonly.sh.j2 + src: files/pgsodium_getkey_readonly.sh.j2 dest: "/usr/lib/postgresql/bin/pgsodium_getkey.sh" owner: postgres group: postgres @@ -172,12 +172,11 @@ when: stage2_nix - name: Create symbolic links from /var/lib/postgresql/.nix-profile/bin to /usr/lib/postgresql/bin - file: - src: "{{ item }}" - dest: "/usr/lib/postgresql/bin/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/bin/*" + shell: >- + find /var/lib/postgresql/.nix-profile/bin/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "{{ item }}/$(basename $0)"' {} \; + loop: + - /usr/lib/postgresql/bin + - /usr/bin become: yes when: stage2_nix @@ -194,23 +193,9 @@ when: pg_config_stat.stat.exists and not pg_config_stat.stat.islnk and stage2_nix become: yes -- name: Create symbolic links from /var/lib/postgresql/.nix-profile/bin to /usr/bin - file: - src: "{{ item }}" - dest: "/usr/bin/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/bin/*" - become: yes - when: stage2_nix - - name: Ensure postgres user has ownership of symlink - file: - path: "/usr/bin/{{ item | basename }}" - owner: postgres - group: postgres - with_fileglob: - - "/var/lib/postgresql/.nix-profile/bin/*" + shell: >- + find /var/lib/postgresql/.nix-profile/bin/ -maxdepth 1 -type f,l -exec chown postgres:postgres "/usr/bin/$(basename {})" \; become: yes when: stage2_nix @@ -225,22 +210,14 @@ # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql to /usr/lib/postgresql/share/postgresql - file: - src: "{{ item }}" - dest: "/usr/lib/postgresql/share/postgresql/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/share/postgresql/*" + shell: >- + find /var/lib/postgresql/.nix-profile/share/postgresql/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "/usr/lib/postgresql/share/postgresql/$(basename $0)"' {} \; become: yes when: stage2_nix - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/extension to /usr/lib/postgresql/share/postgresql/extension - file: - src: "{{ item }}" - dest: "/usr/lib/postgresql/share/postgresql/extension/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/share/postgresql/extension/*" + shell: >- + find /var/lib/postgresql/.nix-profile/share/postgresql/extension/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "/usr/lib/postgresql/share/postgresql/extension/$(basename $0)"' {} \; become: yes when: stage2_nix @@ -266,22 +243,14 @@ when: stage2_nix and not is_psql_oriole - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets - file: - src: "{{ item }}" - dest: "/usr/lib/postgresql/share/postgresql/timezonesets/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/share/postgresql/timezonesets/*" + shell: >- + find /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "/usr/lib/postgresql/share/postgresql/timezonesets/$(basename $0)"' {} \; become: yes when: stage2_nix - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/tsearch_data to /usr/lib/postgresql/share/postgresql/tsearch_data - file: - src: "{{ item }}" - dest: "/usr/lib/postgresql/share/postgresql/tsearch_data/{{ item | basename }}" - state: link - with_fileglob: - - "/var/lib/postgresql/.nix-profile/share/postgresql/tsearch_data/*" + shell: >- + find /var/lib/postgresql/.nix-profile/share/postgresql/tsearch_data/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "/usr/lib/postgresql/share/postgresql/tsearch_data/$(basename $0)"' {} \; become: yes when: stage2_nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 95bc674d2..40c2e2788 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -25,7 +25,7 @@ postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 gotrue_release: 2.169.0 gotrue_release_checksum: sha1:1419b94683aac7ddc30355408b8e8b79e61146c4 -aws_cli_release: "2.2.7" +aws_cli_release: "2.23.11" salt_minion_version: 3007 diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh new file mode 100755 index 000000000..61606c81e --- /dev/null +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -0,0 +1,146 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o xtrace + +if [ $(dpkg --print-architecture) = "amd64" ]; then + ARCH="amd64" +else + ARCH="arm64" +fi + +function waitfor_boot_finished { + export DEBIAN_FRONTEND=noninteractive + + echo "args: ${ARGS}" + # Wait for cloudinit on the surrogate to complete before making progress + while [[ ! -f /var/lib/cloud/instance/boot-finished ]]; do + echo 'Waiting for cloud-init...' + sleep 1 + done +} + +function install_packages { + apt-get update && sudo apt-get install software-properties-common e2fsprogs -y + add-apt-repository --yes --update ppa:ansible/ansible && sudo apt-get install ansible -y + ansible-galaxy collection install community.general +} + +function execute_playbook { + + tee /etc/ansible/ansible.cfg </dev/null +LOCALE_ARCHIVE=/usr/lib/locale/locale-archive +LANG="en_US.UTF-8" +LANGUAGE="en_US.UTF-8" +LC_ALL="en_US.UTF-8" +LC_CTYPE="en_US.UTF-8" +EOF +} + +function setup_locale { + cat <>/etc/locale.gen +en_US.UTF-8 UTF-8 +EOF + + cat </etc/default/locale +LANG="C.UTF-8" +LC_CTYPE="C.UTF-8" +EOF + locale-gen en_US.UTF-8 +} + +sed -i 's/- hosts: all/- hosts: localhost/' ansible/playbook.yml + +waitfor_boot_finished +install_packages +setup_postgesql_env +setup_locale +execute_playbook + +#################### +# stage 2 things +#################### + +function install_nix() { + sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ + --extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \ + --extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root + . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh + +} + +function execute_stage2_playbook { + sudo tee /etc/ansible/ansible.cfg < /root/.bash_history +unset HISTFILE +find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; +rm -rf /var/log/*.gz /var/log/*.[0-9] /var/log/*-???????? +rm -rf /var/lib/cloud/instances/* +rm -f /root/.ssh/authorized_keys /etc/ssh/*key* +touch /etc/ssh/revoked_keys +chmod 600 /etc/ssh/revoked_keys + +cat /dev/null > /var/log/lastlog +cat /dev/null > /var/log/wtmp diff --git a/user-data-cloudimg b/user-data-cloudimg new file mode 100644 index 000000000..9a74d237a --- /dev/null +++ b/user-data-cloudimg @@ -0,0 +1,16 @@ +#cloud-config +users: + - name: root + lock_passwd: false + ssh_redirect_user: true + hashed_passwd: "$6$canonical.$0zWaW71A9ke9ASsaOcFTdQ2tx1gSmLxMPrsH0rF0Yb.2AEKNPV1lrF94n6YuPJmnUy2K2/JSDtxuiBDey6Lpa/" + - name: ubuntu + lock_passwd: false + hashed_passwd: "$6$canonical.$0zWaW71A9ke9ASsaOcFTdQ2tx1gSmLxMPrsH0rF0Yb.2AEKNPV1lrF94n6YuPJmnUy2K2/JSDtxuiBDey6Lpa/" + ssh_redired_user: false + sudo: "ALL=(ALL) NOPASSWD:ALL" + shell: /usr/bin/bash + groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] +ssh_pwauth: True +disable_root: false +preserve_hostname: true From 9b50c8ef56afac6a34dd1a506f9a07a453dfcc38 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 7 Feb 2025 09:19:17 -0500 Subject: [PATCH 106/271] Sam/pgroonga release (#1436) * feat: updated pgroonga to 3.2.5 * chore: bumping version of action * chore: suffix for release testing * chore: bump versions after success in release testing --- .github/workflows/ami-release-nix.yml | 2 +- ansible/vars.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 10c419fb1..1d57ea23b 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -144,7 +144,7 @@ jobs: aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz - name: Create release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: ${{ steps.process_release_version.outputs.version }} tag_name: ${{ steps.process_release_version.outputs.version }} diff --git a/ansible/vars.yml b/ansible/vars.yml index 40c2e2788..5161c9d11 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.032-orioledb" - postgres15: "15.8.1.036" + postgresorioledb-17: "17.0.1.033-orioledb" + postgres15: "15.8.1.037" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 871305032a5e3230e4b191ebad107ab91b556e68 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 7 Feb 2025 19:00:56 -0500 Subject: [PATCH 107/271] chore: increase files limit for Postgres (#1429) --- ansible/files/postgresql_config/postgresql.service.j2 | 2 +- ansible/vars.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.service.j2 b/ansible/files/postgresql_config/postgresql.service.j2 index 8e5318cba..c056ac433 100644 --- a/ansible/files/postgresql_config/postgresql.service.j2 +++ b/ansible/files/postgresql_config/postgresql.service.j2 @@ -20,6 +20,6 @@ Restart=always RestartSec=5 OOMScoreAdjust=-1000 EnvironmentFile=-/etc/environment.d/postgresql.env - +LimitNOFILE=16384 [Install] WantedBy=multi-user.target diff --git a/ansible/vars.yml b/ansible/vars.yml index 5161c9d11..0f9b8a328 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.033-orioledb" - postgres15: "15.8.1.037" + postgresorioledb-17: "17.0.1.31-orioledb-ulimit-2" + postgres15: "15.8.1.035-ulimit-2" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 3cd81a22eff53d743188668a4ac735228a72d4e0 Mon Sep 17 00:00:00 2001 From: samrose Date: Sat, 8 Feb 2025 21:27:10 -0500 Subject: [PATCH 108/271] chore: a new release version to cover ulimit -n change for postgres (#1438) --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 0f9b8a328..fe8ec2d35 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.31-orioledb-ulimit-2" - postgres15: "15.8.1.035-ulimit-2" + postgresorioledb-17: "17.0.1.34-orioledb" + postgres15: "15.8.1.038" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 45e80ac037cce9bfcd1c5a494c2b619a0cb975aa Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 10 Feb 2025 16:06:57 -0500 Subject: [PATCH 109/271] =?UTF-8?q?chore:=20create=20a=20workflow=5Fdispat?= =?UTF-8?q?ch=20only=20method=20with=20input,=20for=20docker=20=E2=80=A6?= =?UTF-8?q?=20(#1440)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: create a workflow_dispatch only method with input, for docker release * chore: move file to correct dir --- .github/workflows/manual-docker-release.yml | 250 ++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 .github/workflows/manual-docker-release.yml diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml new file mode 100644 index 000000000..b9b66b305 --- /dev/null +++ b/.github/workflows/manual-docker-release.yml @@ -0,0 +1,250 @@ +name: Manual Docker Artifacts Release + +on: + workflow_dispatch: + inputs: + postgresVersion: + description: 'Optional. Postgres version to publish against, i.e. 15.1.1.78' + required: false + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} + steps: + - uses: DeterminateSystems/nix-installer-action@main + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Generate build matrix + id: set-matrix + run: | + nix run nixpkgs#nushell -- -c 'let versions = (open ansible/vars.yml | get postgres_major) + let matrix = ($versions | each { |ver| + let version = ($ver | str trim) + let dockerfile = $"Dockerfile-($version)" + if ($dockerfile | path exists) { + { + version: $version, + dockerfile: $dockerfile + } + } else { + null + } + } | compact) + + let matrix_config = { + include: $matrix + } + + $"matrix_config=($matrix_config | to json -r)" | save --append $env.GITHUB_OUTPUT' + build: + needs: prepare + strategy: + matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }} + runs-on: ubuntu-latest + outputs: + build_args: ${{ steps.args.outputs.result }} + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV + + - id: args + run: | + nix run nixpkgs#nushell -- -c ' + open ansible/vars.yml + | items { |key value| {name: $key, item: $value} } + | where { |it| ($it.item | describe) == "string" } + | each { |it| $"($it.name)=($it.item)" } + | str join "\n" + | save --append $env.GITHUB_OUTPUT + ' + build_release_image: + needs: [prepare, build] + strategy: + matrix: + postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} + arch: [amd64, arm64] + runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} + timeout-minutes: 180 + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - run: docker context create builders + - uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get image tag + id: image + run: | + if [[ "${{ matrix.arch }}" == "arm64" ]]; then + pg_version=$(sudo nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.postgres.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + let base_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim) + let final_version = if "${{ inputs.postgresVersion }}" != "" { + "${{ inputs.postgresVersion }}" + } else { + $base_version + } + $final_version | str trim + ') + echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT + else + pg_version=$(nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.postgres.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + let base_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim) + let final_version = if "${{ inputs.postgresVersion }}" != "" { + "${{ inputs.postgresVersion }}" + } else { + $base_version + } + $final_version | str trim + ') + echo "pg_version=supabase/postgres:$pg_version" >> $GITHUB_OUTPUT + fi + - id: build + uses: docker/build-push-action@v5 + with: + push: true + build-args: | + ${{ needs.build.outputs.build_args }} + target: production + tags: ${{ steps.image.outputs.pg_version }}_${{ matrix.arch }} + platforms: linux/${{ matrix.arch }} + cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + file: ${{ matrix.postgres.dockerfile }} + merge_manifest: + needs: [prepare, build, build_release_image] + strategy: + matrix: + include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get image tag + id: get_version + run: | + nix run nixpkgs#nushell -- -c ' + let version = "${{ matrix.version }}" + let release_key = if ($version | str contains "orioledb") { + $"postgresorioledb-17" + } else { + $"postgres($version)" + } + let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim) + $"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT + ' + - name: Output version + id: output_version + run: | + echo "result=${{ steps.get_version.outputs.pg_version }}" >> $GITHUB_OUTPUT + - name: Collect versions + id: collect_versions + run: | + echo "${{ steps.output_version.outputs.result }}" >> results.txt # Append results + - name: Upload Results Artifact + uses: actions/upload-artifact@v4 + with: + name: merge_results-${{ matrix.version }} + path: results.txt + if-no-files-found: warn + - name: Merge multi-arch manifests + run: | + docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \ + ${{ steps.get_version.outputs.pg_version }}_amd64 \ + ${{ steps.get_version.outputs.pg_version }}_arm64 + combine_results: + needs: [prepare, merge_manifest] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + + - name: Debug Input from Prepare + run: | + echo "Raw matrix_config output:" + echo "${{ needs.prepare.outputs.matrix_config }}" + - name: Get Versions from Matrix Config + id: get_versions + run: | + nix run nixpkgs#nushell -- -c ' + # Parse the matrix configuration directly + let matrix_config = (${{ toJson(needs.prepare.outputs.matrix_config) }} | from json) + + # Get versions directly from include array + let versions = ($matrix_config.include | get version) + + echo "Versions: $versions" + + # Convert the versions to a comma-separated string + let versions_str = ($versions | str join ",") + $"versions=$versions_str" | save --append $env.GITHUB_ENV + ' + - name: Download Results Artifacts + uses: actions/download-artifact@v4 + with: + pattern: merge_results-* + - name: Combine Results + id: combine + run: | + nix run nixpkgs#nushell -- -c ' + # Get all results files and process them in one go + let files = (ls **/results.txt | get name) + echo $"Found files: ($files)" + + let matrix = { + include: ( + $files + | each { |file| open $file } # Open each file + | each { |content| $content | lines } # Split into lines + | flatten # Flatten the nested lists + | where { |line| $line != "" } # Filter empty lines + | each { |line| + # Extract just the version part after the last colon + let version = ($line | parse "supabase/postgres:{version}" | get version.0) + {version: $version} + } + ) + } + + let json_output = ($matrix | to json -r) # -r for raw output + echo $"Debug output: ($json_output)" + + $"matrix=($json_output)" | save --append $env.GITHUB_OUTPUT + ' + - name: Debug Combined Results + run: | + echo "Combined Results: '${{ steps.combine.outputs.matrix }}'" + outputs: + matrix: ${{ steps.combine.outputs.matrix }} + publish: + needs: combine_results + strategy: + matrix: ${{ fromJson(needs.combine_results.outputs.matrix) }} + uses: ./.github/workflows/mirror.yml + with: + version: ${{ inputs.postgresVersion != '' && inputs.postgresVersion || matrix.version }} + secrets: inherit From 7207d7af7dfe10f8d3271f4a8749d0fc45eea107 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 5 Feb 2025 13:48:55 +0800 Subject: [PATCH 110/271] feat: vault sans pgsodium --- .../pg_upgrade_scripts/complete.sh | 37 +++++++++++++++++ .../supabase_vault/after-create.sql | 3 ++ ansible/files/sodium_extension.sql | 6 --- ansible/vars.yml | 4 +- .../files/unit-tests/unit-test-01.sql | 10 +---- ...221207154255_create_pgsodium_and_vault.sql | 40 ------------------- .../20221207154255_create_vault.sql | 17 ++++++++ ...0529180330_alter_api_roles_for_inherit.sql | 2 - migrations/tests/database/privs.sql | 4 -- nix/ext/vault.nix | 13 +++--- nix/tests/postgresql.conf.in | 2 +- nix/tools/run-server.sh.in | 2 + 12 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql delete mode 100644 ansible/files/sodium_extension.sql delete mode 100644 migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql create mode 100644 migrations/db/migrations/20221207154255_create_vault.sql diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 515c490f6..c2367116d 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -150,6 +150,43 @@ EOF run_sql -c "$PATCH_PGMQ_QUERY" run_sql -c "update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';" + + # Patch to handle upgrading to pgsodium-less Vault + REENCRYPT_VAULT_SECRETS_QUERY=$(cat < Date: Wed, 5 Feb 2025 10:55:58 -0500 Subject: [PATCH 111/271] chore: this substitution no longer needed --- flake.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/flake.nix b/flake.nix index c0ecc45f0..154352e25 100644 --- a/flake.nix +++ b/flake.nix @@ -670,8 +670,6 @@ export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins PGTAP_CLUSTER=$(mktemp -d) initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" - substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ - --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf From 9b2c570134a980ec08e83a20b604472ae8c4fde1 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 12:56:07 -0500 Subject: [PATCH 112/271] fix: nix flake check --- .../postgresql_config/postgresql.conf.j2 | 2 +- flake.nix | 79 +++++++++++-------- nix/tests/expected/z_15_ext_interface.out | 16 +++- nix/tests/expected/z_17_ext_interface.out | 16 +++- nix/tests/postgresql.conf.in | 1 + 5 files changed, 75 insertions(+), 39 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index 6d2df6074..5d4237068 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -688,7 +688,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, supabase_vault' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use # - Other Defaults - diff --git a/flake.nix b/flake.nix index 154352e25..8bbd79525 100644 --- a/flake.nix +++ b/flake.nix @@ -571,42 +571,49 @@ sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = basePackages.pg_regress; - getkey-script = pkgs.writeScriptBin "pgsodium-getkey" '' - #!${pkgs.bash}/bin/bash - set -euo pipefail - - TMPDIR_BASE=$(mktemp -d) - - if [[ "$(uname)" == "Darwin" ]]; then - KEY_DIR="/private/tmp/pgsodium" - else - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - fi - KEY_FILE="$KEY_DIR/pgsodium.key" - - if ! mkdir -p "$KEY_DIR" 2>/dev/null; then - echo "Error: Could not create key directory $KEY_DIR" >&2 - exit 1 - fi - chmod 1777 "$KEY_DIR" - - if [[ ! -f "$KEY_FILE" ]]; then - if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then - if ! (openssl rand -hex 32 > "$KEY_FILE"); then - echo "00000000000000000000000000000000" > "$KEY_FILE" - echo "Warning: Using fallback key" >&2 + getkey-script = pkgs.stdenv.mkDerivation { + name = "pgsodium-getkey"; + buildCommand = '' + mkdir -p $out/bin + cat > $out/bin/pgsodium-getkey << 'EOF' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + TMPDIR_BASE=$(mktemp -d) + + if [[ "$(uname)" == "Darwin" ]]; then + KEY_DIR="/private/tmp/pgsodium" + else + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" + fi + KEY_FILE="$KEY_DIR/pgsodium.key" + + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then + echo "Error: Could not create key directory $KEY_DIR" >&2 + exit 1 + fi + chmod 1777 "$KEY_DIR" + + if [[ ! -f "$KEY_FILE" ]]; then + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then + if ! (openssl rand -hex 32 > "$KEY_FILE"); then + echo "00000000000000000000000000000000" > "$KEY_FILE" + echo "Warning: Using fallback key" >&2 + fi fi + chmod 644 "$KEY_FILE" fi - chmod 644 "$KEY_FILE" - fi - - if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then - cat "$KEY_FILE" - else - echo "Error: Cannot read key file $KEY_FILE" >&2 - exit 1 - fi - ''; + + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then + cat "$KEY_FILE" + else + echo "Error: Cannot read key file $KEY_FILE" >&2 + exit 1 + fi + EOF + chmod +x $out/bin/pgsodium-getkey + ''; + }; # Use the shared setup but with a test-specific name start-postgres-server-bin = makePostgresDevSetup { @@ -670,9 +677,13 @@ export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins PGTAP_CLUSTER=$(mktemp -d) initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" + substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ + --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf + echo "Checking shared_preload_libraries setting:" + grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf # Remove timescaledb if running orioledb-17 check echo "I AM ${pgpkg.version}====================================================" if [[ "${pgpkg.version}" == *"17"* ]]; then diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 9914fa3b9..2fedc4366 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -4750,6 +4750,9 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text + supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record @@ -5226,7 +5229,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5055 rows) +(5058 rows) /* @@ -6034,6 +6037,15 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid + supabase_vault | vault | decrypted_secrets | created_at + supabase_vault | vault | decrypted_secrets | decrypted_secret + supabase_vault | vault | decrypted_secrets | description + supabase_vault | vault | decrypted_secrets | id + supabase_vault | vault | decrypted_secrets | key_id + supabase_vault | vault | decrypted_secrets | name + supabase_vault | vault | decrypted_secrets | nonce + supabase_vault | vault | decrypted_secrets | secret + supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -6357,5 +6369,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1097 rows) +(1106 rows) diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 37f417f81..a0177327a 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -4707,6 +4707,9 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text + supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer | SETOF record @@ -4906,7 +4909,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4747 rows) +(4750 rows) /* @@ -5321,6 +5324,15 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid + supabase_vault | vault | decrypted_secrets | created_at + supabase_vault | vault | decrypted_secrets | decrypted_secret + supabase_vault | vault | decrypted_secrets | description + supabase_vault | vault | decrypted_secrets | id + supabase_vault | vault | decrypted_secrets | key_id + supabase_vault | vault | decrypted_secrets | name + supabase_vault | vault | decrypted_secrets | nonce + supabase_vault | vault | decrypted_secrets | secret + supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -5338,5 +5350,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(398 rows) +(407 rows) diff --git a/nix/tests/postgresql.conf.in b/nix/tests/postgresql.conf.in index 3ff7aea4f..483a1a8e2 100644 --- a/nix/tests/postgresql.conf.in +++ b/nix/tests/postgresql.conf.in @@ -795,6 +795,7 @@ jit_provider = 'llvmjit' # JIT library to use # Add settings for extensions here pgsodium.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' +vault.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' auto_explain.log_min_duration = 10s cron.database_name = 'postgres' From 50374e17deb0c888327e710289f20aa9ca98a980 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 13:15:33 -0500 Subject: [PATCH 113/271] chore: need schema files in proper place for tests --- migrations/schema-15.sql | 67 ------------------------------- migrations/schema-orioledb-17.sql | 67 ------------------------------- 2 files changed, 134 deletions(-) diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 1bff8b9d8..cb031f797 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -44,27 +44,6 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA pgsodium; - - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -574,28 +553,6 @@ END $$; --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - SET default_tablespace = ''; SET default_table_access_method = heap; @@ -782,30 +739,6 @@ CREATE TABLE storage.objects ( ); --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT secrets.id, - secrets.name, - secrets.description, - secrets.secret, - CASE - WHEN (secrets.secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (secrets.key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) - END - END AS decrypted_secret, - secrets.key_id, - secrets.nonce, - secrets.created_at, - secrets.updated_at - FROM vault.secrets; - - -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 531970c37..7026b99e3 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -45,27 +45,6 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA pgsodium; - - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -589,28 +568,6 @@ END $$; --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - SET default_tablespace = ''; SET default_table_access_method = orioledb; @@ -797,30 +754,6 @@ CREATE TABLE storage.objects ( ); --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT id, - name, - description, - secret, - CASE - WHEN (secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) - END - END AS decrypted_secret, - key_id, - nonce, - created_at, - updated_at - FROM vault.secrets; - - -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- From d442769c4e01e246c7ce5d83d0462fe4951b6e24 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 13:37:14 -0500 Subject: [PATCH 114/271] chore: try with flake url to target current changes --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6912b38f..6dc194684 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: verify schema.sql is committed run: | - nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} + nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} --flake-url github:supabase/postgres/${{ github.sha }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql From e8d23427125c44a0b94e4ebb2a8ddb40e7aad851 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 13:53:23 -0500 Subject: [PATCH 115/271] fix: a better cleanup process --- nix/tools/dbmate-tool.sh.in | 39 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 8c489839b..fbc3d4d16 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -19,36 +19,49 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ cleanup() { echo "Cleaning up..." - # Kill postgres processes first + # First, gracefully stop Overmind if it's running + if [ -S "./.overmind.sock" ]; then + echo "Stopping Overmind gracefully..." + overmind quit || true + sleep 5 # Give Overmind time to shut down + fi + + # Stop PostgreSQL processes gracefully if pgrep -f "postgres" >/dev/null; then + echo "Stopping PostgreSQL gracefully..." pkill -TERM postgres || true - sleep 2 + sleep 5 # Wait for PostgreSQL to shut down fi - # Then kill overmind - if [ -S "./.overmind.sock" ]; then - overmind kill || true + # Clean up any remaining tmux sessions + if tmux ls 2>/dev/null | grep 'overmind'; then + echo "Cleaning up tmux sessions..." + tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true sleep 2 fi - # Kill tmux sessions explicitly - pkill -f "tmux.*overmind.*postgresql" || true - tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true + # Final cleanup: Force kill if necessary (as a last resort) + if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + echo "Force killing remaining processes..." + pkill -9 -f "(postgres|overmind|tmux.*postgresql)" || true + sleep 2 + fi - # Force kill any stragglers - pkill -9 -f "(postgres|tmux.*overmind.*postgresql)" || true - + # Remove socket and Procfile rm -f .overmind.sock Procfile - # Final verification + # Verify cleanup if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + echo "Warning: Some processes could not be cleaned up:" ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep return 1 + else + echo "Cleanup completed successfully" fi } # Set up trap for cleanup on script exit - +trap cleanup EXIT INT TERM # Function to display help print_help() { echo "Usage: nix run .#dbmate-tool -- [options]" From ca74fb19020f03fc56dc42a976732f7f5678c23b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 14:02:22 -0500 Subject: [PATCH 116/271] chore: more attempts at graceful shutdown --- nix/tools/dbmate-tool.sh.in | 100 ++++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 17 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index fbc3d4d16..a2544b0e0 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -18,41 +18,106 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ # Cleanup function cleanup() { echo "Cleaning up..." - - # First, gracefully stop Overmind if it's running + + # 1. Gracefully stop Overmind if it's running if [ -S "./.overmind.sock" ]; then echo "Stopping Overmind gracefully..." - overmind quit || true - sleep 5 # Give Overmind time to shut down + if overmind quit; then + echo "Overmind stopped successfully" + else + echo "Warning: Overmind quit command failed" + fi + + # Wait for Overmind to fully shut down + max_wait=10 + count=0 + while [ -S "./.overmind.sock" ] && [ $count -lt $max_wait ]; do + echo "Waiting for Overmind socket to close (attempt $count/$max_wait)..." + sleep 1 + count=$((count + 1)) + done + + if [ -S "./.overmind.sock" ]; then + echo "Warning: Overmind socket still exists after waiting" + else + echo "Overmind socket closed successfully" + fi fi - # Stop PostgreSQL processes gracefully + # 2. Gracefully stop PostgreSQL using pg_ctl if possible if pgrep -f "postgres" >/dev/null; then - echo "Stopping PostgreSQL gracefully..." - pkill -TERM postgres || true - sleep 5 # Wait for PostgreSQL to shut down + echo "Attempting to stop PostgreSQL gracefully..." + + # Try to find the PostgreSQL data directory + PGDATA=$(ps aux | grep postgres | grep -v grep | grep -oP '(?<= -D ).*?(?=\s)') + + if [ -n "$PGDATA" ] && [ -d "$PGDATA" ]; then + # Use pg_ctl for graceful shutdown if available + if command -v "${PSQLBIN}/pg_ctl" >/dev/null; then + echo "Using pg_ctl to stop PostgreSQL..." + "${PSQLBIN}/pg_ctl" -D "$PGDATA" stop -m smart + + # Wait for PostgreSQL to shut down + max_wait=30 + count=0 + while pgrep -f "postgres" >/dev/null && [ $count -lt $max_wait ]; do + echo "Waiting for PostgreSQL to stop (attempt $count/$max_wait)..." + sleep 1 + count=$((count + 1)) + done + + if pgrep -f "postgres" >/dev/null; then + echo "Warning: PostgreSQL did not shut down gracefully, attempting fast shutdown..." + "${PSQLBIN}/pg_ctl" -D "$PGDATA" stop -m fast + sleep 5 + fi + else + echo "Warning: pg_ctl not found, falling back to signal-based shutdown" + pkill -TERM postgres || true + sleep 5 + fi + else + echo "Warning: Could not determine PostgreSQL data directory, using signal-based shutdown" + pkill -TERM postgres || true + sleep 5 + fi fi - # Clean up any remaining tmux sessions + # 3. Clean up tmux sessions gracefully if tmux ls 2>/dev/null | grep 'overmind'; then echo "Cleaning up tmux sessions..." - tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true + tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | while IFS= read -r session; do + echo "Stopping tmux session: $session" + tmux send-keys -t "$session" C-c # Send Ctrl+C to gracefully stop processes + sleep 2 + tmux kill-session -t "$session" || true + done sleep 2 fi - # Final cleanup: Force kill if necessary (as a last resort) + # 4. Final verification and cleanup if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Force killing remaining processes..." - pkill -9 -f "(postgres|overmind|tmux.*postgresql)" || true - sleep 2 + echo "Warning: Some processes are still running after graceful shutdown attempts:" + ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep + + # Last resort: Use SIGINT before SIGKILL + echo "Sending SIGINT to remaining processes..." + pkill -INT -f "(postgres|overmind|tmux.*postgresql)" || true + sleep 5 + + # If processes still remain, use SIGKILL as a final measure + if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + echo "Force killing remaining processes..." + pkill -KILL -f "(postgres|overmind|tmux.*postgresql)" || true + fi fi # Remove socket and Procfile rm -f .overmind.sock Procfile - # Verify cleanup + # Final verification if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Warning: Some processes could not be cleaned up:" + echo "Error: Cleanup incomplete. Remaining processes:" ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep return 1 else @@ -70,7 +135,7 @@ print_help() { echo " -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" echo " -p, --port PORT Specify the port number to use (default: 5435)" echo " -h, --help Show this help message" - echo + echo " -f, --flake-url URL Specify the flake URL to use (default: github:supabase/postgres)" echo "Description:" echo " Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions." echo " NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new ' to create a new migration file." @@ -79,6 +144,7 @@ print_help() { echo " nix run .#dbmate-tool" echo " nix run .#dbmate-tool -- --version 15" echo " nix run .#dbmate-tool -- --version 16 --port 5433" + echo " nix run .#dbmate-tool -- --version 16 --port 5433 --flake-url github:supabase/postgres/" } From 5c65fa9e4f0adb25abf25d66ef0a9d053eb35b5f Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 14:14:28 -0500 Subject: [PATCH 117/271] chore: more attempts to handle shutdown across arch --- nix/tools/dbmate-tool.sh.in | 41 +++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index a2544b0e0..4c2e8354e 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -29,7 +29,7 @@ cleanup() { fi # Wait for Overmind to fully shut down - max_wait=10 + max_wait=30 # Increased from 10 to 30 seconds count=0 while [ -S "./.overmind.sock" ] && [ $count -lt $max_wait ]; do echo "Waiting for Overmind socket to close (attempt $count/$max_wait)..." @@ -37,8 +37,10 @@ cleanup() { count=$((count + 1)) done + # Force remove the socket file if it still exists if [ -S "./.overmind.sock" ]; then - echo "Warning: Overmind socket still exists after waiting" + echo "Warning: Overmind socket still exists after waiting, forcefully removing..." + rm -f ./.overmind.sock else echo "Overmind socket closed successfully" fi @@ -48,8 +50,8 @@ cleanup() { if pgrep -f "postgres" >/dev/null; then echo "Attempting to stop PostgreSQL gracefully..." - # Try to find the PostgreSQL data directory - PGDATA=$(ps aux | grep postgres | grep -v grep | grep -oP '(?<= -D ).*?(?=\s)') + # Improved logic to find PostgreSQL data directory + PGDATA=$(ps aux | grep postgres | grep -v grep | grep -oP '(?<= -D ).*?(?=\s)' || true) if [ -n "$PGDATA" ] && [ -d "$PGDATA" ]; then # Use pg_ctl for graceful shutdown if available @@ -58,7 +60,7 @@ cleanup() { "${PSQLBIN}/pg_ctl" -D "$PGDATA" stop -m smart # Wait for PostgreSQL to shut down - max_wait=30 + max_wait=60 # Increased from 30 to 60 seconds count=0 while pgrep -f "postgres" >/dev/null && [ $count -lt $max_wait ]; do echo "Waiting for PostgreSQL to stop (attempt $count/$max_wait)..." @@ -77,9 +79,18 @@ cleanup() { sleep 5 fi else - echo "Warning: Could not determine PostgreSQL data directory, using signal-based shutdown" + echo "Warning: Could not determine PostgreSQL data directory, using enhanced signal-based shutdown" + + # Enhanced shutdown with multiple signals pkill -TERM postgres || true sleep 5 + if pgrep -f "postgres" >/dev/null; then + pkill -INT postgres || true + sleep 5 + if pgrep -f "postgres" >/dev/null; then + pkill -KILL postgres || true + fi + fi fi fi @@ -100,15 +111,20 @@ cleanup() { echo "Warning: Some processes are still running after graceful shutdown attempts:" ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep - # Last resort: Use SIGINT before SIGKILL - echo "Sending SIGINT to remaining processes..." - pkill -INT -f "(postgres|overmind|tmux.*postgresql)" || true + # More aggressive cleanup + echo "Sending SIGTERM to remaining processes..." + pkill -TERM -f "(postgres|overmind|tmux.*postgresql)" || true sleep 5 - # If processes still remain, use SIGKILL as a final measure if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Force killing remaining processes..." - pkill -KILL -f "(postgres|overmind|tmux.*postgresql)" || true + echo "Sending SIGINT to remaining processes..." + pkill -INT -f "(postgres|overmind|tmux.*postgresql)" || true + sleep 5 + + if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + echo "Force killing remaining processes..." + pkill -KILL -f "(postgres|overmind|tmux.*postgresql)" || true + fi fi fi @@ -124,7 +140,6 @@ cleanup() { echo "Cleanup completed successfully" fi } - # Set up trap for cleanup on script exit trap cleanup EXIT INT TERM # Function to display help From 36ed328cf9bfd8cebabd1ead735977e93aa35942 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 14:22:32 -0500 Subject: [PATCH 118/271] chore: revert to earlier --- nix/tools/dbmate-tool.sh.in | 113 +++++------------------------------- 1 file changed, 16 insertions(+), 97 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 4c2e8354e..cf6035f18 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -18,122 +18,41 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ # Cleanup function cleanup() { echo "Cleaning up..." - - # 1. Gracefully stop Overmind if it's running + + # First, gracefully stop Overmind if it's running if [ -S "./.overmind.sock" ]; then echo "Stopping Overmind gracefully..." - if overmind quit; then - echo "Overmind stopped successfully" - else - echo "Warning: Overmind quit command failed" - fi - - # Wait for Overmind to fully shut down - max_wait=30 # Increased from 10 to 30 seconds - count=0 - while [ -S "./.overmind.sock" ] && [ $count -lt $max_wait ]; do - echo "Waiting for Overmind socket to close (attempt $count/$max_wait)..." - sleep 1 - count=$((count + 1)) - done - - # Force remove the socket file if it still exists - if [ -S "./.overmind.sock" ]; then - echo "Warning: Overmind socket still exists after waiting, forcefully removing..." - rm -f ./.overmind.sock - else - echo "Overmind socket closed successfully" - fi + overmind quit || true + sleep 5 # Give Overmind time to shut down fi - # 2. Gracefully stop PostgreSQL using pg_ctl if possible + # Stop PostgreSQL processes gracefully if pgrep -f "postgres" >/dev/null; then - echo "Attempting to stop PostgreSQL gracefully..." - - # Improved logic to find PostgreSQL data directory - PGDATA=$(ps aux | grep postgres | grep -v grep | grep -oP '(?<= -D ).*?(?=\s)' || true) - - if [ -n "$PGDATA" ] && [ -d "$PGDATA" ]; then - # Use pg_ctl for graceful shutdown if available - if command -v "${PSQLBIN}/pg_ctl" >/dev/null; then - echo "Using pg_ctl to stop PostgreSQL..." - "${PSQLBIN}/pg_ctl" -D "$PGDATA" stop -m smart - - # Wait for PostgreSQL to shut down - max_wait=60 # Increased from 30 to 60 seconds - count=0 - while pgrep -f "postgres" >/dev/null && [ $count -lt $max_wait ]; do - echo "Waiting for PostgreSQL to stop (attempt $count/$max_wait)..." - sleep 1 - count=$((count + 1)) - done - - if pgrep -f "postgres" >/dev/null; then - echo "Warning: PostgreSQL did not shut down gracefully, attempting fast shutdown..." - "${PSQLBIN}/pg_ctl" -D "$PGDATA" stop -m fast - sleep 5 - fi - else - echo "Warning: pg_ctl not found, falling back to signal-based shutdown" - pkill -TERM postgres || true - sleep 5 - fi - else - echo "Warning: Could not determine PostgreSQL data directory, using enhanced signal-based shutdown" - - # Enhanced shutdown with multiple signals - pkill -TERM postgres || true - sleep 5 - if pgrep -f "postgres" >/dev/null; then - pkill -INT postgres || true - sleep 5 - if pgrep -f "postgres" >/dev/null; then - pkill -KILL postgres || true - fi - fi - fi + echo "Stopping PostgreSQL gracefully..." + pkill -TERM postgres || true + sleep 5 # Wait for PostgreSQL to shut down fi - # 3. Clean up tmux sessions gracefully + # Clean up any remaining tmux sessions if tmux ls 2>/dev/null | grep 'overmind'; then echo "Cleaning up tmux sessions..." - tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | while IFS= read -r session; do - echo "Stopping tmux session: $session" - tmux send-keys -t "$session" C-c # Send Ctrl+C to gracefully stop processes - sleep 2 - tmux kill-session -t "$session" || true - done + tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true sleep 2 fi - # 4. Final verification and cleanup + # Final cleanup: Force kill if necessary (as a last resort) if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Warning: Some processes are still running after graceful shutdown attempts:" - ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep - - # More aggressive cleanup - echo "Sending SIGTERM to remaining processes..." - pkill -TERM -f "(postgres|overmind|tmux.*postgresql)" || true - sleep 5 - - if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Sending SIGINT to remaining processes..." - pkill -INT -f "(postgres|overmind|tmux.*postgresql)" || true - sleep 5 - - if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Force killing remaining processes..." - pkill -KILL -f "(postgres|overmind|tmux.*postgresql)" || true - fi - fi + echo "Force killing remaining processes..." + pkill -9 -f "(postgres|overmind|tmux.*postgresql)" || true + sleep 2 fi # Remove socket and Procfile rm -f .overmind.sock Procfile - # Final verification + # Verify cleanup if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Error: Cleanup incomplete. Remaining processes:" + echo "Warning: Some processes could not be cleaned up:" ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep return 1 else From 65b947b5c51eb693dc919d91fca9fd2a148504ee Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 14:47:23 -0500 Subject: [PATCH 119/271] fix: gh actions oom try without overmind --- nix/tools/dbmate-tool.sh.in | 89 +++++++++++-------------------------- 1 file changed, 27 insertions(+), 62 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index cf6035f18..0119e744b 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -15,52 +15,41 @@ CURRENT_SYSTEM="@CURRENT_SYSTEM@" ANSIBLE_VARS="@ANSIBLE_VARS@" PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ + +# Start PostgreSQL using nix +start_postgres() { + echo "Starting PostgreSQL..." + nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize & + echo "PostgreSQL started." +} + # Cleanup function cleanup() { echo "Cleaning up..." - # First, gracefully stop Overmind if it's running - if [ -S "./.overmind.sock" ]; then - echo "Stopping Overmind gracefully..." - overmind quit || true - sleep 5 # Give Overmind time to shut down - fi - # Stop PostgreSQL processes gracefully if pgrep -f "postgres" >/dev/null; then echo "Stopping PostgreSQL gracefully..." - pkill -TERM postgres || true + pkill -f "postgres" || true # Adjust this if you have a specific way to stop the service sleep 5 # Wait for PostgreSQL to shut down fi - # Clean up any remaining tmux sessions - if tmux ls 2>/dev/null | grep 'overmind'; then - echo "Cleaning up tmux sessions..." - tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true - sleep 2 - fi - - # Final cleanup: Force kill if necessary (as a last resort) - if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Force killing remaining processes..." - pkill -9 -f "(postgres|overmind|tmux.*postgresql)" || true - sleep 2 - fi - - # Remove socket and Procfile - rm -f .overmind.sock Procfile - # Verify cleanup - if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - echo "Warning: Some processes could not be cleaned up:" - ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep + if pgrep -f "postgres" >/dev/null; then + echo "Warning: Some PostgreSQL processes could not be cleaned up:" + pgrep -f "postgres" return 1 else echo "Cleanup completed successfully" fi } + # Set up trap for cleanup on script exit trap cleanup EXIT INT TERM + +# Start PostgreSQL +start_postgres + # Function to display help print_help() { echo "Usage: nix run .#dbmate-tool -- [options]" @@ -81,7 +70,6 @@ print_help() { echo " nix run .#dbmate-tool -- --version 16 --port 5433 --flake-url github:supabase/postgres/" } - # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -138,7 +126,7 @@ wait_for_postgres() { local max_attempts=30 # Increased significantly local attempt=1 - # Give overmind a moment to actually start the process + # Give PostgreSQL a moment to actually start the process sleep 2 while [ $attempt -le $max_attempts ]; do @@ -155,7 +143,6 @@ wait_for_postgres() { done echo "PostgreSQL failed to start after $max_attempts attempts" - overmind echo postgres return 1 } @@ -188,26 +175,7 @@ trim_schema() { ;; esac } -overmind_start() { - cat > Procfile << EOF -postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations -EOF - overmind start -D - echo "Waiting for overmind socket..." - max_wait=5 - count=0 - while [ $count -lt $max_wait ]; do - if [ -S "./.overmind.sock" ]; then - # Found the socket, give it a moment to be ready - sleep 5 - echo "Socket file found and ready" - break - fi - echo "Waiting for socket file (attempt $count/$max_wait)" - sleep 1 - count=$((count + 1)) - done -} + perform_dump() { local max_attempts=3 local attempt=1 @@ -227,21 +195,18 @@ perform_dump() { echo "All dump attempts failed" return 1 } + migrate_version() { echo "PSQL_VERSION: $PSQL_VERSION" - overmind kill || true - rm -f .overmind.sock Procfile || true + pkill -f "postgres" || true # Ensure PostgreSQL is stopped before starting PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"') echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN" - # Start overmind - overmind_start - echo "Waiting for overmind socket..." - - + # Start PostgreSQL + start_postgres echo "Waiting for PostgreSQL to be ready..." - #Wait for PostgreSQL to be ready to accept connections + # Wait for PostgreSQL to be ready to accept connections if ! wait_for_postgres; then echo "Failed to connect to PostgreSQL server" exit 1 @@ -268,11 +233,11 @@ EOSQL "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" - #set db url to run dbmate + # Set db url to run dbmate export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" - #export path so dbmate can find correct psql and pg_dump + # Export path so dbmate can find correct psql and pg_dump export PATH="$PSQLBIN:$PATH" - # run init scripts + # Run init scripts if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then echo "Error: Initial migration failed" exit 1 From 83dff188588c7a61f878c291e30ccd4745b591bd Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 15:06:05 -0500 Subject: [PATCH 120/271] chore: more tweaks to run in gh actions --- nix/tools/dbmate-tool.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 0119e744b..a6c844365 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -288,11 +288,13 @@ if [ "$PSQL_VERSION" == "all" ]; then echo "$VERSIONS" | while read -r version; do PSQL_VERSION="$version" echo "Migrating to PostgreSQL version $PSQL_VERSION" + start_postgres migrate_version cleanup done else echo "Migrating to PostgreSQL version $PSQL_VERSION" + start_postgres migrate_version cleanup fi From 58db6a3126a94c01a3b91a4a93e7165bf2d11666 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 15:23:47 -0500 Subject: [PATCH 121/271] chore: already in background --- nix/tools/dbmate-tool.sh.in | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index a6c844365..fb5bece6b 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -19,7 +19,7 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ # Start PostgreSQL using nix start_postgres() { echo "Starting PostgreSQL..." - nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize & + nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize echo "PostgreSQL started." } @@ -47,8 +47,6 @@ cleanup() { # Set up trap for cleanup on script exit trap cleanup EXIT INT TERM -# Start PostgreSQL -start_postgres # Function to display help print_help() { @@ -288,13 +286,11 @@ if [ "$PSQL_VERSION" == "all" ]; then echo "$VERSIONS" | while read -r version; do PSQL_VERSION="$version" echo "Migrating to PostgreSQL version $PSQL_VERSION" - start_postgres migrate_version cleanup done else echo "Migrating to PostgreSQL version $PSQL_VERSION" - start_postgres migrate_version cleanup fi From c7c30defb8f2705c78372b3aa79823fe63fc9c18 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 15:38:20 -0500 Subject: [PATCH 122/271] chore: this line may be causing segfault --- nix/tools/dbmate-tool.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index fb5bece6b..c4f2ed980 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -196,7 +196,7 @@ perform_dump() { migrate_version() { echo "PSQL_VERSION: $PSQL_VERSION" - pkill -f "postgres" || true # Ensure PostgreSQL is stopped before starting + #pkill -f "postgres" || true # Ensure PostgreSQL is stopped before starting PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"') echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN" From 9d6b1549be8736bc03e3a6f1cf98b7e3bfd14af2 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 16:10:21 -0500 Subject: [PATCH 123/271] chore: do nothing if not running --- nix/tools/dbmate-tool.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index c4f2ed980..b0d73a4b4 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -32,13 +32,15 @@ cleanup() { echo "Stopping PostgreSQL gracefully..." pkill -f "postgres" || true # Adjust this if you have a specific way to stop the service sleep 5 # Wait for PostgreSQL to shut down + else + echo "PostgreSQL is not running, skipping stop." fi # Verify cleanup if pgrep -f "postgres" >/dev/null; then echo "Warning: Some PostgreSQL processes could not be cleaned up:" pgrep -f "postgres" - return 1 + exit 1 # Exit with an error code else echo "Cleanup completed successfully" fi From cf17ce0f7f63a10ab2fce7d6f125be8a85a2988b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 16:26:25 -0500 Subject: [PATCH 124/271] chore: too many trap exits --- nix/tools/dbmate-tool.sh.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index b0d73a4b4..c34c19d2c 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -46,9 +46,6 @@ cleanup() { fi } -# Set up trap for cleanup on script exit -trap cleanup EXIT INT TERM - # Function to display help print_help() { From fc9e8b2afed60de529a6f36c01faa57a00dac1b3 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 16:44:43 -0500 Subject: [PATCH 125/271] chore: mod stop_postgres for daemon --- nix/tools/run-server.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 172f62db7..22b1fb557 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -56,7 +56,11 @@ start_postgres() { } stop_postgres() { - pg_ctl stop -D "$DATDIR" -m fast + if [ "$DAEMONIZE" = true ]; then + echo "PostgreSQL is running in daemon mode. Please stop it using pg_ctl." + else + pg_ctl stop -D "$DATDIR" -m fast + fi } trap 'stop_postgres' SIGINT SIGTERM @@ -331,6 +335,7 @@ EOSQL fi fi echo "Shutting down PostgreSQL..." + stop_postgres # Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon From 1a4560909a3df327f0ab8535cd0d7c992d761c95 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 5 Feb 2025 16:54:24 -0500 Subject: [PATCH 126/271] chore: adjust cleanup --- nix/tools/dbmate-tool.sh.in | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index c34c19d2c..621912bec 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -27,23 +27,35 @@ start_postgres() { cleanup() { echo "Cleaning up..." - # Stop PostgreSQL processes gracefully + # Check if PostgreSQL processes exist if pgrep -f "postgres" >/dev/null; then echo "Stopping PostgreSQL gracefully..." - pkill -f "postgres" || true # Adjust this if you have a specific way to stop the service - sleep 5 # Wait for PostgreSQL to shut down + + # Use a more specific signal handling approach + pkill -15 -f "postgres" # Send SIGTERM + + # Wait a bit for graceful shutdown + sleep 5 + + # If processes are still running, force kill + if pgrep -f "postgres" >/dev/null; then + echo "Forcing PostgreSQL processes to stop..." + pkill -9 -f "postgres" # Send SIGKILL if SIGTERM didn't work + fi else echo "PostgreSQL is not running, skipping stop." fi - # Verify cleanup + # Always exit successfully, log any remaining processes if pgrep -f "postgres" >/dev/null; then echo "Warning: Some PostgreSQL processes could not be cleaned up:" pgrep -f "postgres" - exit 1 # Exit with an error code else echo "Cleanup completed successfully" fi + + # Explicitly exit with 0 to prevent workflow failure + exit 0 } From 2e4b0ae7111cc5b3b3086026e32aea0d6c8acb36 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 6 Feb 2025 13:33:24 -0500 Subject: [PATCH 127/271] chore: allow other scripts to stop the start-server cluster --- nix/tools/dbmate-tool.sh.in | 17 +++++++---------- nix/tools/run-server.sh.in | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 621912bec..1197228af 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -18,8 +18,9 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ # Start PostgreSQL using nix start_postgres() { - echo "Starting PostgreSQL..." - nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize + DATDIR=$(mktemp -d) + echo "Starting PostgreSQL in directory: $DATDIR" # Create the DATDIR if it doesn't exist + nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize --datdir "$DATDIR" echo "PostgreSQL started." } @@ -31,16 +32,15 @@ cleanup() { if pgrep -f "postgres" >/dev/null; then echo "Stopping PostgreSQL gracefully..." - # Use a more specific signal handling approach - pkill -15 -f "postgres" # Send SIGTERM + # Use pg_ctl to stop PostgreSQL + pg_ctl -D "$DATDIR" stop # Wait a bit for graceful shutdown sleep 5 - # If processes are still running, force kill + # Check if processes are still running if pgrep -f "postgres" >/dev/null; then - echo "Forcing PostgreSQL processes to stop..." - pkill -9 -f "postgres" # Send SIGKILL if SIGTERM didn't work + echo "Warning: Some PostgreSQL processes could not be stopped gracefully." fi else echo "PostgreSQL is not running, skipping stop." @@ -53,9 +53,6 @@ cleanup() { else echo "Cleanup completed successfully" fi - - # Explicitly exit with 0 to prevent workflow failure - exit 0 } diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 22b1fb557..0586e010b 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -65,7 +65,6 @@ stop_postgres() { trap 'stop_postgres' SIGINT SIGTERM -# Parse arguments # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -108,6 +107,15 @@ while [[ "$#" -gt 0 ]]; do print_help exit 0 ;; + --datdir) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + DATDIR="$2" + shift 2 + else + echo "Error: --datadir requires a directory path" + exit 1 + fi + ;; *) if [[ "$1" =~ ^- ]]; then echo "Unknown option: $1" @@ -165,7 +173,9 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ MECAB_LIB=@MECAB_LIB@ # Setup directories and locale settings -DATDIR=$(mktemp -d) +if [[ -z "$DATDIR" ]]; then + DATDIR=$(mktemp -d) +fi LOCALE_ARCHIVE=@LOCALES@ CURRENT_SYSTEM=@CURRENT_SYSTEM@ From 1559c2d922931d13bc0e96965b8de98ac820ba1e Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 10 Feb 2025 16:07:32 -0500 Subject: [PATCH 128/271] chore: also deactivate supabase_vault in test (#1439) * chore: also deactivate supabase_vault in test * chore: check that refs are removed * chore: add a pattern for when vault at end of line * fix: yaml typo * chore: retry on fail for initial installs * chore: revert logic for ansible install --- ansible/tasks/test-image.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ansible/tasks/test-image.yml b/ansible/tasks/test-image.yml index 9a8d4fa27..c680ce68e 100644 --- a/ansible/tasks/test-image.yml +++ b/ansible/tasks/test-image.yml @@ -11,17 +11,34 @@ # cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf # when: debpkg_mode or stage2_nix -- name: Temporarily disable PG Sodium references in config +- name: Temporarily disable PG Sodium and Supabase Vault references in config become: yes become_user: postgres shell: cmd: > - sed -i.bak - -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + sed -i.bak + -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + -e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/' + -e 's/\(shared_preload_libraries = '\''.*\), *supabase_vault'\''/\1'\''/' -e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/' /etc/postgresql/postgresql.conf when: debpkg_mode or stage2_nix +- name: Verify pgsodium and vault removal from config + become: yes + become_user: postgres + shell: + cmd: | + FOUND=$(grep -E "shared_preload_libraries.*pgsodium|shared_preload_libraries.*supabase_vault|^pgsodium\.getkey_script" /etc/postgresql/postgresql.conf) + if [ ! -z "$FOUND" ]; then + echo "Found unremoved references:" + echo "$FOUND" + exit 1 + fi + register: verify_result + failed_when: verify_result.rc != 0 + when: debpkg_mode or stage2_nix + - name: Start Postgres Database to load all extensions. become: yes become_user: postgres From 4a7790c23ae960bb56a52f74cae5810232f9c275 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Wed, 12 Feb 2025 13:38:57 +0200 Subject: [PATCH 129/271] fix: revert migrations --- ...221207154255_create_pgsodium_and_vault.sql | 40 +++++++++++ .../20221207154255_create_vault.sql | 17 ----- ...0529180330_alter_api_roles_for_inherit.sql | 2 + migrations/schema-15.sql | 67 +++++++++++++++++++ migrations/schema-orioledb-17.sql | 67 +++++++++++++++++++ migrations/tests/database/privs.sql | 4 ++ 6 files changed, 180 insertions(+), 17 deletions(-) create mode 100644 migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql delete mode 100644 migrations/db/migrations/20221207154255_create_vault.sql diff --git a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql new file mode 100644 index 000000000..3d3867ab5 --- /dev/null +++ b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql @@ -0,0 +1,40 @@ +-- migrate:up + +DO $$ +DECLARE + pgsodium_exists boolean; + vault_exists boolean; +BEGIN + pgsodium_exists = ( + select count(*) = 1 + from pg_available_extensions + where name = 'pgsodium' + and default_version in ('3.1.6', '3.1.7', '3.1.8', '3.1.9') + ); + + vault_exists = ( + select count(*) = 1 + from pg_available_extensions + where name = 'supabase_vault' + ); + + IF pgsodium_exists + THEN + create extension if not exists pgsodium; + + grant pgsodium_keyiduser to postgres with admin option; + grant pgsodium_keyholder to postgres with admin option; + grant pgsodium_keymaker to postgres with admin option; + + grant execute on function pgsodium.crypto_aead_det_decrypt(bytea, bytea, uuid, bytea) to service_role; + grant execute on function pgsodium.crypto_aead_det_encrypt(bytea, bytea, uuid, bytea) to service_role; + grant execute on function pgsodium.crypto_aead_det_keygen to service_role; + + IF vault_exists + THEN + create extension if not exists supabase_vault; + END IF; + END IF; +END $$; + +-- migrate:down diff --git a/migrations/db/migrations/20221207154255_create_vault.sql b/migrations/db/migrations/20221207154255_create_vault.sql deleted file mode 100644 index d4f714182..000000000 --- a/migrations/db/migrations/20221207154255_create_vault.sql +++ /dev/null @@ -1,17 +0,0 @@ --- migrate:up - -DO $$ -BEGIN - IF EXISTS (select from pg_available_extensions where name = 'supabase_vault') - THEN - create extension if not exists supabase_vault; - - -- for some reason extension custom scripts aren't run during AMI build, so - -- we manually run it here - grant usage on schema vault to postgres with grant option; - grant select, delete on vault.secrets, vault.decrypted_secrets to postgres with grant option; - grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to postgres with grant option; - END IF; -END $$; - --- migrate:down diff --git a/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql b/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql index 013a074fd..4df82e3f4 100644 --- a/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql +++ b/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql @@ -4,5 +4,7 @@ ALTER ROLE authenticated inherit; ALTER ROLE anon inherit; ALTER ROLE service_role inherit; +GRANT pgsodium_keyholder to service_role; + -- migrate:down diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index cb031f797..1bff8b9d8 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -44,6 +44,27 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgsodium; + + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -553,6 +574,28 @@ END $$; +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + SET default_tablespace = ''; SET default_table_access_method = heap; @@ -739,6 +782,30 @@ CREATE TABLE storage.objects ( ); +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT secrets.id, + secrets.name, + secrets.description, + secrets.secret, + CASE + WHEN (secrets.secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (secrets.key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) + END + END AS decrypted_secret, + secrets.key_id, + secrets.nonce, + secrets.created_at, + secrets.updated_at + FROM vault.secrets; + + -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 7026b99e3..531970c37 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -45,6 +45,27 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgsodium; + + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -568,6 +589,28 @@ END $$; +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + SET default_tablespace = ''; SET default_table_access_method = orioledb; @@ -754,6 +797,30 @@ CREATE TABLE storage.objects ( ); +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT id, + name, + description, + secret, + CASE + WHEN (secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) + END + END AS decrypted_secret, + key_id, + nonce, + created_at, + updated_at + FROM vault.secrets; + + -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/tests/database/privs.sql b/migrations/tests/database/privs.sql index ea4f1318a..d164e0cb1 100644 --- a/migrations/tests/database/privs.sql +++ b/migrations/tests/database/privs.sql @@ -2,6 +2,10 @@ SELECT database_privs_are( 'postgres', 'postgres', ARRAY['CONNECT', 'TEMPORARY', 'CREATE'] ); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_decrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_encrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_keygen', array[]::text[], 'service_role', array['EXECUTE']); + -- Verify public schema privileges SELECT schema_privs_are('public', 'postgres', array['CREATE', 'USAGE']); SELECT schema_privs_are('public', 'anon', array['USAGE']); From 447f4492258babcc57ca0307588814016835d24e Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 18 Feb 2025 11:16:38 +0800 Subject: [PATCH 130/271] Revert "feat: vault sans pgsodium" This reverts commit 7207d7af7dfe10f8d3271f4a8749d0fc45eea107. --- .github/workflows/test.yml | 2 +- .../pg_upgrade_scripts/complete.sh | 37 ------- .../postgresql_config/postgresql.conf.j2 | 2 +- .../supabase_vault/after-create.sql | 3 - ansible/files/sodium_extension.sql | 6 ++ ansible/tasks/test-image.yml | 23 +--- ansible/vars.yml | 4 +- .../files/unit-tests/unit-test-01.sql | 10 +- flake.nix | 77 ++++++-------- nix/ext/vault.nix | 13 ++- nix/tests/expected/z_15_ext_interface.out | 16 +-- nix/tests/expected/z_17_ext_interface.out | 16 +-- nix/tests/postgresql.conf.in | 3 +- nix/tools/dbmate-tool.sh.in | 100 ++++++++++-------- nix/tools/run-server.sh.in | 23 +--- 15 files changed, 127 insertions(+), 208 deletions(-) delete mode 100644 ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql create mode 100644 ansible/files/sodium_extension.sql diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dc194684..b6912b38f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: verify schema.sql is committed run: | - nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} --flake-url github:supabase/postgres/${{ github.sha }} + nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index c2367116d..515c490f6 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -150,43 +150,6 @@ EOF run_sql -c "$PATCH_PGMQ_QUERY" run_sql -c "update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';" - - # Patch to handle upgrading to pgsodium-less Vault - REENCRYPT_VAULT_SECRETS_QUERY=$(cat < - sed -i.bak - -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' - -e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/' - -e 's/\(shared_preload_libraries = '\''.*\), *supabase_vault'\''/\1'\''/' + sed -i.bak + -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' -e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/' /etc/postgresql/postgresql.conf when: debpkg_mode or stage2_nix -- name: Verify pgsodium and vault removal from config - become: yes - become_user: postgres - shell: - cmd: | - FOUND=$(grep -E "shared_preload_libraries.*pgsodium|shared_preload_libraries.*supabase_vault|^pgsodium\.getkey_script" /etc/postgresql/postgresql.conf) - if [ ! -z "$FOUND" ]; then - echo "Found unremoved references:" - echo "$FOUND" - exit 1 - fi - register: verify_result - failed_when: verify_result.rc != 0 - when: debpkg_mode or stage2_nix - - name: Start Postgres Database to load all extensions. become: yes become_user: postgres diff --git a/ansible/vars.yml b/ansible/vars.yml index 206cb139f..fe8ec2d35 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.035-orioledb" - postgres15: "15.8.1.039" + postgresorioledb-17: "17.0.1.34-orioledb" + postgres15: "15.8.1.038" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/files/unit-tests/unit-test-01.sql b/ebssurrogate/files/unit-tests/unit-test-01.sql index c466af12e..f3d47459f 100644 --- a/ebssurrogate/files/unit-tests/unit-test-01.sql +++ b/ebssurrogate/files/unit-tests/unit-test-01.sql @@ -17,6 +17,7 @@ BEGIN extension_array := ARRAY[ 'plpgsql', 'pg_stat_statements', + 'pgsodium', 'pgtap', 'pg_graphql', 'pgcrypto', @@ -29,6 +30,7 @@ BEGIN extension_array := ARRAY[ 'plpgsql', 'pg_stat_statements', + 'pgsodium', 'pgtap', 'pg_graphql', 'pgcrypto', @@ -42,7 +44,7 @@ BEGIN PERFORM set_config('myapp.extensions', array_to_string(extension_array, ','), false); END $$; -SELECT no_plan(); +SELECT plan(8); SELECT extensions_are( string_to_array(current_setting('myapp.extensions'), ',')::text[] @@ -54,5 +56,9 @@ SELECT has_schema('pg_catalog'); SELECT has_schema('information_schema'); SELECT has_schema('public'); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_decrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_encrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); +SELECT function_privs_are('pgsodium', 'crypto_aead_det_keygen', array[]::text[], 'service_role', array['EXECUTE']); + SELECT * FROM finish(); -ROLLBACK; +ROLLBACK; \ No newline at end of file diff --git a/flake.nix b/flake.nix index 8bbd79525..c0ecc45f0 100644 --- a/flake.nix +++ b/flake.nix @@ -571,49 +571,42 @@ sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = basePackages.pg_regress; - getkey-script = pkgs.stdenv.mkDerivation { - name = "pgsodium-getkey"; - buildCommand = '' - mkdir -p $out/bin - cat > $out/bin/pgsodium-getkey << 'EOF' - #!${pkgs.bash}/bin/bash - set -euo pipefail - - TMPDIR_BASE=$(mktemp -d) - - if [[ "$(uname)" == "Darwin" ]]; then - KEY_DIR="/private/tmp/pgsodium" - else - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - fi - KEY_FILE="$KEY_DIR/pgsodium.key" - - if ! mkdir -p "$KEY_DIR" 2>/dev/null; then - echo "Error: Could not create key directory $KEY_DIR" >&2 - exit 1 - fi - chmod 1777 "$KEY_DIR" - - if [[ ! -f "$KEY_FILE" ]]; then - if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then - if ! (openssl rand -hex 32 > "$KEY_FILE"); then - echo "00000000000000000000000000000000" > "$KEY_FILE" - echo "Warning: Using fallback key" >&2 - fi + getkey-script = pkgs.writeScriptBin "pgsodium-getkey" '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + TMPDIR_BASE=$(mktemp -d) + + if [[ "$(uname)" == "Darwin" ]]; then + KEY_DIR="/private/tmp/pgsodium" + else + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" + fi + KEY_FILE="$KEY_DIR/pgsodium.key" + + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then + echo "Error: Could not create key directory $KEY_DIR" >&2 + exit 1 + fi + chmod 1777 "$KEY_DIR" + + if [[ ! -f "$KEY_FILE" ]]; then + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then + if ! (openssl rand -hex 32 > "$KEY_FILE"); then + echo "00000000000000000000000000000000" > "$KEY_FILE" + echo "Warning: Using fallback key" >&2 fi - chmod 644 "$KEY_FILE" - fi - - if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then - cat "$KEY_FILE" - else - echo "Error: Cannot read key file $KEY_FILE" >&2 - exit 1 fi - EOF - chmod +x $out/bin/pgsodium-getkey - ''; - }; + chmod 644 "$KEY_FILE" + fi + + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then + cat "$KEY_FILE" + else + echo "Error: Cannot read key file $KEY_FILE" >&2 + exit 1 + fi + ''; # Use the shared setup but with a test-specific name start-postgres-server-bin = makePostgresDevSetup { @@ -682,8 +675,6 @@ echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf - echo "Checking shared_preload_libraries setting:" - grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf # Remove timescaledb if running orioledb-17 check echo "I AM ${pgpkg.version}====================================================" if [[ "${pgpkg.version}" == *"17"* ]]; then diff --git a/nix/ext/vault.nix b/nix/ext/vault.nix index 2cbd7e7a9..c822fcd51 100644 --- a/nix/ext/vault.nix +++ b/nix/ext/vault.nix @@ -1,24 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, libsodium, postgresql }: +{ lib, stdenv, fetchFromGitHub, postgresql }: stdenv.mkDerivation rec { pname = "vault"; - version = "0.3.1"; + version = "0.2.9"; - buildInputs = [ libsodium postgresql ]; + buildInputs = [ postgresql ]; src = fetchFromGitHub { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-MC87bqgtynnDhmNZAu96jvfCpsGDCPB0g5TZfRQHd30="; + hash = "sha256-kXTngBW4K6FkZM8HvJG2Jha6OQqbejhnk7tchxy031I="; }; installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - install -D *${postgresql.dlSuffix} $out/lib - install -D -t $out/share/postgresql/extension sql/*.sql - install -D -t $out/share/postgresql/extension *.control + cp sql/*.sql $out/share/postgresql/extension + cp *.control $out/share/postgresql/extension ''; meta = with lib; { diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 2fedc4366..9914fa3b9 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -4750,9 +4750,6 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text - supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea - supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea - supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record @@ -5229,7 +5226,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5058 rows) +(5055 rows) /* @@ -6037,15 +6034,6 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid - supabase_vault | vault | decrypted_secrets | created_at - supabase_vault | vault | decrypted_secrets | decrypted_secret - supabase_vault | vault | decrypted_secrets | description - supabase_vault | vault | decrypted_secrets | id - supabase_vault | vault | decrypted_secrets | key_id - supabase_vault | vault | decrypted_secrets | name - supabase_vault | vault | decrypted_secrets | nonce - supabase_vault | vault | decrypted_secrets | secret - supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -6369,5 +6357,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1106 rows) +(1097 rows) diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index a0177327a..37f417f81 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -4707,9 +4707,6 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text - supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea - supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea - supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer | SETOF record @@ -4909,7 +4906,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4750 rows) +(4747 rows) /* @@ -5324,15 +5321,6 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid - supabase_vault | vault | decrypted_secrets | created_at - supabase_vault | vault | decrypted_secrets | decrypted_secret - supabase_vault | vault | decrypted_secrets | description - supabase_vault | vault | decrypted_secrets | id - supabase_vault | vault | decrypted_secrets | key_id - supabase_vault | vault | decrypted_secrets | name - supabase_vault | vault | decrypted_secrets | nonce - supabase_vault | vault | decrypted_secrets | secret - supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -5350,5 +5338,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(407 rows) +(398 rows) diff --git a/nix/tests/postgresql.conf.in b/nix/tests/postgresql.conf.in index 483a1a8e2..ef860afcb 100644 --- a/nix/tests/postgresql.conf.in +++ b/nix/tests/postgresql.conf.in @@ -718,7 +718,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, pg_backtrace, supabase_vault' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, pg_backtrace' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use @@ -795,7 +795,6 @@ jit_provider = 'llvmjit' # JIT library to use # Add settings for extensions here pgsodium.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' -vault.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' auto_explain.log_min_duration = 10s cron.database_name = 'postgres' diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 1197228af..8c489839b 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -15,46 +15,39 @@ CURRENT_SYSTEM="@CURRENT_SYSTEM@" ANSIBLE_VARS="@ANSIBLE_VARS@" PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ - -# Start PostgreSQL using nix -start_postgres() { - DATDIR=$(mktemp -d) - echo "Starting PostgreSQL in directory: $DATDIR" # Create the DATDIR if it doesn't exist - nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize --datdir "$DATDIR" - echo "PostgreSQL started." -} - # Cleanup function cleanup() { echo "Cleaning up..." - # Check if PostgreSQL processes exist + # Kill postgres processes first if pgrep -f "postgres" >/dev/null; then - echo "Stopping PostgreSQL gracefully..." - - # Use pg_ctl to stop PostgreSQL - pg_ctl -D "$DATDIR" stop - - # Wait a bit for graceful shutdown - sleep 5 - - # Check if processes are still running - if pgrep -f "postgres" >/dev/null; then - echo "Warning: Some PostgreSQL processes could not be stopped gracefully." - fi - else - echo "PostgreSQL is not running, skipping stop." + pkill -TERM postgres || true + sleep 2 fi - # Always exit successfully, log any remaining processes - if pgrep -f "postgres" >/dev/null; then - echo "Warning: Some PostgreSQL processes could not be cleaned up:" - pgrep -f "postgres" - else - echo "Cleanup completed successfully" + # Then kill overmind + if [ -S "./.overmind.sock" ]; then + overmind kill || true + sleep 2 + fi + + # Kill tmux sessions explicitly + pkill -f "tmux.*overmind.*postgresql" || true + tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true + + # Force kill any stragglers + pkill -9 -f "(postgres|tmux.*overmind.*postgresql)" || true + + rm -f .overmind.sock Procfile + + # Final verification + if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then + ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep + return 1 fi } +# Set up trap for cleanup on script exit # Function to display help print_help() { @@ -64,7 +57,7 @@ print_help() { echo " -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" echo " -p, --port PORT Specify the port number to use (default: 5435)" echo " -h, --help Show this help message" - echo " -f, --flake-url URL Specify the flake URL to use (default: github:supabase/postgres)" + echo echo "Description:" echo " Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions." echo " NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new ' to create a new migration file." @@ -73,9 +66,9 @@ print_help() { echo " nix run .#dbmate-tool" echo " nix run .#dbmate-tool -- --version 15" echo " nix run .#dbmate-tool -- --version 16 --port 5433" - echo " nix run .#dbmate-tool -- --version 16 --port 5433 --flake-url github:supabase/postgres/" } + # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -132,7 +125,7 @@ wait_for_postgres() { local max_attempts=30 # Increased significantly local attempt=1 - # Give PostgreSQL a moment to actually start the process + # Give overmind a moment to actually start the process sleep 2 while [ $attempt -le $max_attempts ]; do @@ -149,6 +142,7 @@ wait_for_postgres() { done echo "PostgreSQL failed to start after $max_attempts attempts" + overmind echo postgres return 1 } @@ -181,7 +175,26 @@ trim_schema() { ;; esac } - +overmind_start() { + cat > Procfile << EOF +postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations +EOF + overmind start -D + echo "Waiting for overmind socket..." + max_wait=5 + count=0 + while [ $count -lt $max_wait ]; do + if [ -S "./.overmind.sock" ]; then + # Found the socket, give it a moment to be ready + sleep 5 + echo "Socket file found and ready" + break + fi + echo "Waiting for socket file (attempt $count/$max_wait)" + sleep 1 + count=$((count + 1)) + done +} perform_dump() { local max_attempts=3 local attempt=1 @@ -201,18 +214,21 @@ perform_dump() { echo "All dump attempts failed" return 1 } - migrate_version() { echo "PSQL_VERSION: $PSQL_VERSION" - #pkill -f "postgres" || true # Ensure PostgreSQL is stopped before starting + overmind kill || true + rm -f .overmind.sock Procfile || true PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"') echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN" - # Start PostgreSQL - start_postgres + # Start overmind + overmind_start + echo "Waiting for overmind socket..." + + echo "Waiting for PostgreSQL to be ready..." - # Wait for PostgreSQL to be ready to accept connections + #Wait for PostgreSQL to be ready to accept connections if ! wait_for_postgres; then echo "Failed to connect to PostgreSQL server" exit 1 @@ -239,11 +255,11 @@ EOSQL "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" - # Set db url to run dbmate + #set db url to run dbmate export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" - # Export path so dbmate can find correct psql and pg_dump + #export path so dbmate can find correct psql and pg_dump export PATH="$PSQLBIN:$PATH" - # Run init scripts + # run init scripts if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then echo "Error: Initial migration failed" exit 1 diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 0586e010b..75c5f8de7 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -56,15 +56,12 @@ start_postgres() { } stop_postgres() { - if [ "$DAEMONIZE" = true ]; then - echo "PostgreSQL is running in daemon mode. Please stop it using pg_ctl." - else - pg_ctl stop -D "$DATDIR" -m fast - fi + pg_ctl stop -D "$DATDIR" -m fast } trap 'stop_postgres' SIGINT SIGTERM +# Parse arguments # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -107,15 +104,6 @@ while [[ "$#" -gt 0 ]]; do print_help exit 0 ;; - --datdir) - if [[ -n "$2" && ! "$2" =~ ^- ]]; then - DATDIR="$2" - shift 2 - else - echo "Error: --datadir requires a directory path" - exit 1 - fi - ;; *) if [[ "$1" =~ ^- ]]; then echo "Unknown option: $1" @@ -173,9 +161,7 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ MECAB_LIB=@MECAB_LIB@ # Setup directories and locale settings -if [[ -z "$DATDIR" ]]; then - DATDIR=$(mktemp -d) -fi +DATDIR=$(mktemp -d) LOCALE_ARCHIVE=@LOCALES@ CURRENT_SYSTEM=@CURRENT_SYSTEM@ @@ -223,8 +209,6 @@ sed -e "1i\\ include = '$DATDIR/supautils.conf'" \ -e "\$a\\ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ --e "\$a\\ -vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "s|data_directory = '/var/lib/postgresql/data'|data_directory = '$DATDIR'|" \ -e "s|hba_file = '/etc/postgresql/pg_hba.conf'|hba_file = '$DATDIR/pg_hba.conf'|" \ -e "s|ident_file = '/etc/postgresql/pg_ident.conf'|ident_file = '$DATDIR/pg_ident.conf'|" \ @@ -345,7 +329,6 @@ EOSQL fi fi echo "Shutting down PostgreSQL..." - stop_postgres # Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon From 5a91952ae216ff363c17445eb28bcd0df6eb9241 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 18 Feb 2025 11:21:27 +0800 Subject: [PATCH 131/271] fix: pgsodium mask_role migration --- ansible/vars.yml | 4 +-- .../20250218031949_pgsodium_mask_role.sql | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 migrations/db/migrations/20250218031949_pgsodium_mask_role.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index fe8ec2d35..6d3d096b1 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.34-orioledb" - postgres15: "15.8.1.038" + postgresorioledb-17: "17.0.1.036-orioledb" + postgres15: "15.8.1.040" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql b/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql new file mode 100644 index 000000000..c4a3eadf4 --- /dev/null +++ b/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql @@ -0,0 +1,25 @@ +-- migrate:up +CREATE OR REPLACE FUNCTION pgsodium.mask_role(masked_role regrole, source_name text, view_name text) +RETURNS void +LANGUAGE plpgsql +SECURITY DEFINER +SET search_path TO '' +AS $function$ +BEGIN + EXECUTE format( + 'GRANT SELECT ON pgsodium.key TO %s', + masked_role); + + EXECUTE format( + 'GRANT pgsodium_keyiduser, pgsodium_keyholder TO %s', + masked_role); + + EXECUTE format( + 'GRANT ALL ON %I TO %s', + view_name, + masked_role); + RETURN; +END +$function$; + +-- migrate:down From 73b48db61a79d2fdc17f526d304c3ee70d395595 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 17 Feb 2025 23:46:29 -0500 Subject: [PATCH 132/271] chore: restore flake-url arg (#1450) * chore: restore flake-url arg * chore: restore dbmate and run server --- .github/workflows/test.yml | 2 +- nix/tools/dbmate-tool.sh.in | 100 +++++++++++++++--------------------- nix/tools/run-server.sh.in | 23 +++++++-- 3 files changed, 63 insertions(+), 62 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6912b38f..6dc194684 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: verify schema.sql is committed run: | - nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} + nix run github:supabase/postgres/${{ github.sha }}#dbmate-tool -- --version ${{ env.PGMAJOR }} --flake-url github:supabase/postgres/${{ github.sha }} if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 8c489839b..1197228af 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -15,39 +15,46 @@ CURRENT_SYSTEM="@CURRENT_SYSTEM@" ANSIBLE_VARS="@ANSIBLE_VARS@" PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ + +# Start PostgreSQL using nix +start_postgres() { + DATDIR=$(mktemp -d) + echo "Starting PostgreSQL in directory: $DATDIR" # Create the DATDIR if it doesn't exist + nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations --daemonize --datdir "$DATDIR" + echo "PostgreSQL started." +} + # Cleanup function cleanup() { echo "Cleaning up..." - # Kill postgres processes first + # Check if PostgreSQL processes exist if pgrep -f "postgres" >/dev/null; then - pkill -TERM postgres || true - sleep 2 - fi - - # Then kill overmind - if [ -S "./.overmind.sock" ]; then - overmind kill || true - sleep 2 + echo "Stopping PostgreSQL gracefully..." + + # Use pg_ctl to stop PostgreSQL + pg_ctl -D "$DATDIR" stop + + # Wait a bit for graceful shutdown + sleep 5 + + # Check if processes are still running + if pgrep -f "postgres" >/dev/null; then + echo "Warning: Some PostgreSQL processes could not be stopped gracefully." + fi + else + echo "PostgreSQL is not running, skipping stop." fi - # Kill tmux sessions explicitly - pkill -f "tmux.*overmind.*postgresql" || true - tmux ls 2>/dev/null | grep 'overmind' | cut -d: -f1 | xargs -I{} tmux kill-session -t {} || true - - # Force kill any stragglers - pkill -9 -f "(postgres|tmux.*overmind.*postgresql)" || true - - rm -f .overmind.sock Procfile - - # Final verification - if ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep >/dev/null; then - ps aux | grep -E "(postgres|overmind|tmux.*postgresql)" | grep -v grep - return 1 + # Always exit successfully, log any remaining processes + if pgrep -f "postgres" >/dev/null; then + echo "Warning: Some PostgreSQL processes could not be cleaned up:" + pgrep -f "postgres" + else + echo "Cleanup completed successfully" fi } -# Set up trap for cleanup on script exit # Function to display help print_help() { @@ -57,7 +64,7 @@ print_help() { echo " -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" echo " -p, --port PORT Specify the port number to use (default: 5435)" echo " -h, --help Show this help message" - echo + echo " -f, --flake-url URL Specify the flake URL to use (default: github:supabase/postgres)" echo "Description:" echo " Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions." echo " NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new ' to create a new migration file." @@ -66,9 +73,9 @@ print_help() { echo " nix run .#dbmate-tool" echo " nix run .#dbmate-tool -- --version 15" echo " nix run .#dbmate-tool -- --version 16 --port 5433" + echo " nix run .#dbmate-tool -- --version 16 --port 5433 --flake-url github:supabase/postgres/" } - # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -125,7 +132,7 @@ wait_for_postgres() { local max_attempts=30 # Increased significantly local attempt=1 - # Give overmind a moment to actually start the process + # Give PostgreSQL a moment to actually start the process sleep 2 while [ $attempt -le $max_attempts ]; do @@ -142,7 +149,6 @@ wait_for_postgres() { done echo "PostgreSQL failed to start after $max_attempts attempts" - overmind echo postgres return 1 } @@ -175,26 +181,7 @@ trim_schema() { ;; esac } -overmind_start() { - cat > Procfile << EOF -postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" -- "$PSQL_VERSION" --skip-migrations -EOF - overmind start -D - echo "Waiting for overmind socket..." - max_wait=5 - count=0 - while [ $count -lt $max_wait ]; do - if [ -S "./.overmind.sock" ]; then - # Found the socket, give it a moment to be ready - sleep 5 - echo "Socket file found and ready" - break - fi - echo "Waiting for socket file (attempt $count/$max_wait)" - sleep 1 - count=$((count + 1)) - done -} + perform_dump() { local max_attempts=3 local attempt=1 @@ -214,21 +201,18 @@ perform_dump() { echo "All dump attempts failed" return 1 } + migrate_version() { echo "PSQL_VERSION: $PSQL_VERSION" - overmind kill || true - rm -f .overmind.sock Procfile || true + #pkill -f "postgres" || true # Ensure PostgreSQL is stopped before starting PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"') echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN" - # Start overmind - overmind_start - echo "Waiting for overmind socket..." - - + # Start PostgreSQL + start_postgres echo "Waiting for PostgreSQL to be ready..." - #Wait for PostgreSQL to be ready to accept connections + # Wait for PostgreSQL to be ready to accept connections if ! wait_for_postgres; then echo "Failed to connect to PostgreSQL server" exit 1 @@ -255,11 +239,11 @@ EOSQL "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$PGBOUNCER_AUTH_SCHEMA_SQL" "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -d postgres -f "$STAT_EXTENSION_SQL" - #set db url to run dbmate + # Set db url to run dbmate export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" - #export path so dbmate can find correct psql and pg_dump + # Export path so dbmate can find correct psql and pg_dump export PATH="$PSQLBIN:$PATH" - # run init scripts + # Run init scripts if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then echo "Error: Initial migration failed" exit 1 diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 75c5f8de7..0586e010b 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -56,12 +56,15 @@ start_postgres() { } stop_postgres() { - pg_ctl stop -D "$DATDIR" -m fast + if [ "$DAEMONIZE" = true ]; then + echo "PostgreSQL is running in daemon mode. Please stop it using pg_ctl." + else + pg_ctl stop -D "$DATDIR" -m fast + fi } trap 'stop_postgres' SIGINT SIGTERM -# Parse arguments # Parse arguments while [[ "$#" -gt 0 ]]; do case "$1" in @@ -104,6 +107,15 @@ while [[ "$#" -gt 0 ]]; do print_help exit 0 ;; + --datdir) + if [[ -n "$2" && ! "$2" =~ ^- ]]; then + DATDIR="$2" + shift 2 + else + echo "Error: --datadir requires a directory path" + exit 1 + fi + ;; *) if [[ "$1" =~ ^- ]]; then echo "Unknown option: $1" @@ -161,7 +173,9 @@ STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ MECAB_LIB=@MECAB_LIB@ # Setup directories and locale settings -DATDIR=$(mktemp -d) +if [[ -z "$DATDIR" ]]; then + DATDIR=$(mktemp -d) +fi LOCALE_ARCHIVE=@LOCALES@ CURRENT_SYSTEM=@CURRENT_SYSTEM@ @@ -209,6 +223,8 @@ sed -e "1i\\ include = '$DATDIR/supautils.conf'" \ -e "\$a\\ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ +-e "\$a\\ +vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "s|data_directory = '/var/lib/postgresql/data'|data_directory = '$DATDIR'|" \ -e "s|hba_file = '/etc/postgresql/pg_hba.conf'|hba_file = '$DATDIR/pg_hba.conf'|" \ -e "s|ident_file = '/etc/postgresql/pg_ident.conf'|ident_file = '$DATDIR/pg_ident.conf'|" \ @@ -329,6 +345,7 @@ EOSQL fi fi echo "Shutting down PostgreSQL..." + stop_postgres # Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon From e88ce4bdfce6cb808e88ad7328f30fc63a7ab680 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 19 Feb 2025 21:54:17 -0500 Subject: [PATCH 133/271] docs: we will now generate readme from data (#1453) * docs: we will now generate readme from data * chore: signifiy if oriole * chore: fixed urls --- README.md | 139 +++++++++++++----------- flake.nix | 14 ++- nix/tools/update_readme.nu | 212 +++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+), 65 deletions(-) create mode 100755 nix/tools/update_readme.nu diff --git a/README.md b/README.md index 074a42ec7..254e62b73 100644 --- a/README.md +++ b/README.md @@ -3,66 +3,99 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to modify Postgres, but to provide some of the most common extensions with a one-click install. ## Primary Features -- ✅ Postgres [15](https://www.postgresql.org/about/news/postgresql-15-released-2526/). +- ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html) +- ✅ Postgres [orioledb-postgresql-17_5](https://github.com/orioledb/orioledb) - ✅ Ubuntu 20.04 (Focal Fossa). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. - ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images. - ## Extensions + +### PostgreSQL 15 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | -| [Postgres contrib modules](https://www.postgresql.org/docs/current/contrib.html) | - | Because everyone should enable `pg_stat_statements`. | -| [PostGIS](https://postgis.net/) | [3.3.2](https://git.osgeo.org/gitea/postgis/postgis/raw/tag/3.3.2/NEWS) | Postgres' most popular extension - support for geographic objects. | -| [pgRouting](https://pgrouting.org/) | [v3.4.1](https://github.com/pgRouting/pgrouting/releases/tag/v3.4.1) | Extension of PostGIS - provides geospatial routing functionalities. | -| [pgTAP](https://pgtap.org/) | [v1.2.0](https://github.com/theory/pgtap/releases/tag/v1.2.0) | Unit Testing for Postgres. | -| [pg_cron](https://github.com/citusdata/pg_cron) | [v1.6.2](https://github.com/citusdata/pg_cron/releases/tag/v1.6.2) | Run CRON jobs inside Postgres. | -| [pgAudit](https://www.pgaudit.org/) | [1.7.0](https://github.com/pgaudit/pgaudit/releases/tag/1.7.0) | Generate highly compliant audit logs. | -| [pgjwt](https://github.com/michelp/pgjwt) | [commit](https://github.com/michelp/pgjwt/commit/9742dab1b2f297ad3811120db7b21451bca2d3c9) | Generate JSON Web Tokens (JWT) in Postgres. | -| [pgsql-http](https://github.com/pramsey/pgsql-http) | [1.5.0](https://github.com/pramsey/pgsql-http/releases/tag/v1.5.0) | HTTP client for Postgres. | -| [plpgsql_check](https://github.com/okbob/plpgsql_check) | [2.2.3](https://github.com/okbob/plpgsql_check/releases/tag/v2.2.3) | Linter tool for PL/pgSQL. | -| [pg-safeupdate](https://github.com/eradman/pg-safeupdate) | [1.4](https://github.com/eradman/pg-safeupdate/releases/tag/1.4) | Protect your data from accidental updates or deletes. | -| [wal2json](https://github.com/eulerto/wal2json) | [commit](https://github.com/eulerto/wal2json/commit/53b548a29ebd6119323b6eb2f6013d7c5fe807ec) | JSON output plugin for logical replication decoding. | -| [PL/Java](https://github.com/tada/pljava) | [1.6.4](https://github.com/tada/pljava/releases/tag/V1_6_4) | Write in Java functions in Postgres. | -| [plv8](https://github.com/plv8/plv8) | [commit](https://github.com/plv8/plv8/commit/bcddd92f71530e117f2f98b92d206dafe824f73a) | Write in Javascript functions in Postgres. | -| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter) | [commit](https://github.com/pgexperts/pg_plan_filter/commit/5081a7b5cb890876e67d8e7486b6a64c38c9a492) | Only allow statements that fulfill set criteria to be executed. | -| [pg_net](https://github.com/supabase/pg_net) | [v0.6.1](https://github.com/supabase/pg_net/releases/tag/v0.6.1) | Expose the SQL interface for async networking. | -| [pg_repack](https://github.com/reorg/pg_repack) | [ver_1.5.0](https://github.com/reorg/pg_repack/releases/tag/ver_1.5.0) | Tool to remove bloat from tables and indexes -| [rum](https://github.com/postgrespro/rum) | [1.3.13](https://github.com/postgrespro/rum/releases/tag/1.3.13) | An alternative to the GIN index. | -| [pg_hashids](https://github.com/iCyberon/pg_hashids) | [commit](https://github.com/iCyberon/pg_hashids/commit/83398bcbb616aac2970f5e77d93a3200f0f28e74) | Generate unique identifiers from numbers. | -| [pgsodium](https://github.com/michelp/pgsodium) | [3.1.0](https://github.com/michelp/pgsodium/releases/tag/2.0.0) | Modern encryption API using libsodium. | -| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor) | [1.0.1](https://github.com/percona/pg_stat_monitor/releases/tag/1.0.1) | Query Performance Monitoring Tool for PostgreSQL -| [pgvector](https://github.com/pgvector/pgvector) | [v0.4.0](https://github.com/pgvector/pgvector/releases/tag/v0.4.0) | Open-source vector similarity search for Postgres - - -Can't find your favorite extension? Suggest for it to be added into future releases [here](https://github.com/supabase/supabase/discussions/679)! - -## Enhanced Security -*This is only available for our AWS EC2/ DO Droplet images* - -Aside from having [ufw](https://help.ubuntu.com/community/UFW),[fail2ban](https://www.fail2ban.org/wiki/index.php/Main_Page), and [unattended-upgrades](https://wiki.debian.org/UnattendedUpgrades) installed, we also have the following enhancements in place: -| Enhancement | Description | -| ------------- | ------------- | -| [fail2ban filter](https://github.com/supabase/postgres/blob/develop/ansible/files/fail2ban_config/filter-postgresql.conf.j2) for PostgreSQL access | Monitors for brute force attempts over at port `5432`. | -| [fail2ban filter](https://github.com/supabase/postgres/blob/develop/ansible/files/fail2ban_config/filter-pgbouncer.conf.j2) for PgBouncer access | Monitors for brute force attempts over at port `6543`. | - +| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | +| [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | +| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | +| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | [1.5.9](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | GraphQL support for PostreSQL | +| [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | +| [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | +| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | +| [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | +| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | +| [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | +| [pgaudit](https://github.com/pgaudit/pgaudit/archive/1.7.0.tar.gz) | [1.7.0](https://github.com/pgaudit/pgaudit/archive/1.7.0.tar.gz) | Open Source PostgreSQL Audit Logging | +| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens | +| [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | +| [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | +| [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | +| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | +| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | +| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | +| [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | +| [plv8](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | [3.1.10](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | V8 Engine Javascript Procedural Language add-on for PostgreSQL | +| [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | +| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | +| [timescaledb-apache](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | [2.16.1](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | Scales PostgreSQL for time-series data via automatic partitioning across time and space | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | + +### PostgreSQL orioledb-17 Extensions +| Extension | Version | Description | +| ------------- | :-------------: | ------------- | +| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | +| [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | orioledb | +| [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | +| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | +| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | [1.5.9](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | GraphQL support for PostreSQL | +| [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | +| [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | +| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | +| [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | +| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | +| [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | +| [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging | +| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens | +| [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | +| [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | +| [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | +| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | +| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | +| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | +| [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | +| [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | +| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | ## Additional Goodies -*This is only available for our AWS EC2/ DO Droplet images* +*This is only available for our AWS EC2* | Goodie | Version | Description | | ------------- | :-------------: | ------------- | | [PgBouncer](https://www.pgbouncer.org/) | [1.16.1](http://www.pgbouncer.org/changelog.html#pgbouncer-116x) | Set up Connection Pooling. | | [PostgREST](https://postgrest.org/en/stable/) | [v12.2.3](https://github.com/PostgREST/postgrest/releases/tag/v12.2.3) | Instantly transform your database into an RESTful API. | -| [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | +| [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | --> ## Install See all installation instructions in the [repo wiki](https://github.com/supabase/postgres/wiki). [![Docker](https://github.com/supabase/postgres/blob/develop/docs/img/docker.png)](https://github.com/supabase/postgres/wiki/Docker) -[![Digital Ocean](https://github.com/supabase/postgres/blob/develop/docs/img/digital-ocean.png)](https://github.com/supabase/postgres/wiki/Digital-Ocean) [![AWS](https://github.com/supabase/postgres/blob/develop/docs/img/aws.png)](https://github.com/supabase/postgres/wiki/AWS-EC2) -### Marketplace Images + ## Motivation - Make it fast and simple to get started with Postgres. - Show off a few of Postgres' most exciting features. - This is the same build we offer at [Supabase](https://supabase.io). - -## Roadmap - -- [Support for more images](https://github.com/supabase/postgres/issues/4) -- [Vote for more plugins/extensions](https://github.com/supabase/postgres/issues/5) - Open a github issue if you have a feature request ## License @@ -108,13 +128,4 @@ $ time packer build -timestamp-ui \ We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. -[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) - - -## Experimental Nix Packaging of resources - -There is a `/nix` folder in this repo, plus a `flake.nix` and `flake.lock` that facilitate using the Nix package management system to package supabase/postgres, and all of our extensions and wrappers. A user will need nix installed on their machine. As of 4/1/2024 the package set only builds on target machines (`x86_64-linux` and `aarch64-linux`), however work is under way to also support building and using directly on `aarch64-darwin` (macOs). As of 4/1/2024, versions of packages and extensions are synced from `/ansible/vars.yml` via a utility that can be run by executing `nix run .#sync-exts-versions` (you must have nix installed and be on the supported `x86_64-linux` and `aarch64-linux` for this command to work). The short term goal is to sync these versions as they are updated by our infrastructure and postgres teams, then to see the nix packaged versions build successfully in parallel over time, along with tests of the nix packaged versions passing. - -The supabase/postgres repo will continue to source it's dependencies from ansible for the short term, while we stabilize this nix build. - -Forthcoming PR's will include: integrating the nix work into our ansible/packer builds, building natively on aarch64-darwin (macOs), more testing +[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) \ No newline at end of file diff --git a/flake.nix b/flake.nix index c0ecc45f0..92ceebf99 100644 --- a/flake.nix +++ b/flake.nix @@ -559,7 +559,17 @@ chmod +x $out/bin/dbmate-tool wrapProgram $out/bin/dbmate-tool \ --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} - ''; + ''; + update-readme = pkgs.runCommand "update-readme" { + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ pkgs.nushell ]; + } '' + mkdir -p $out/bin + cp ${./nix/tools/update_readme.nu} $out/bin/update-readme + chmod +x $out/bin/update-readme + wrapProgram $out/bin/update-readme \ + --prefix PATH : ${pkgs.nushell}/bin + ''; }; @@ -818,6 +828,7 @@ pg-restore = mkApp "pg-restore" "pg-restore"; local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; + update-readme = mkApp "update-readme" "update-readme"; }; # 'devShells.default' lists the set of packages that are included in the @@ -857,6 +868,7 @@ basePackages.migrate-tool basePackages.sync-exts-versions dbmate + nushell ]; shellHook = '' export HISTFILE=.history diff --git a/nix/tools/update_readme.nu b/nix/tools/update_readme.nu new file mode 100755 index 000000000..bfb46ab0a --- /dev/null +++ b/nix/tools/update_readme.nu @@ -0,0 +1,212 @@ +#!/usr/bin/env nu + +# Load required data +def load_flake [] { + nix flake show --json --all-systems | from json +} + +def find_index [list: list, value: any] { + let enumerated = ($list | enumerate) + let found = ($enumerated | where item == $value | first) + if ($found | is-empty) { + -1 + } else { + $found.index + } +} + +def get_systems [flake_json] { + $flake_json | get packages | columns +} + +def get_postgres_versions [flake_json] { + let packages = ($flake_json | get packages | get aarch64-linux) + + # Get available versions from postgresql packages + let available_versions = ($packages + | columns + | where {|col| + # Match exact postgresql_ or postgresql_orioledb- + $col =~ "^postgresql_\\d+$" or $col =~ "^postgresql_orioledb-\\d+$" + } + | each {|pkg_name| + let is_orioledb = ($pkg_name =~ "orioledb") + let pkg_info = ($packages | get $pkg_name) + let version = if $is_orioledb { + $pkg_info.name | str replace "postgresql-" "" | split row "_" | first # Get "17" from "postgresql-17_5" + } else { + $pkg_info.name | str replace "postgresql-" "" | split row "." | first # Get "15" from "postgresql-15.8" + } + { + version: $version, + is_orioledb: $is_orioledb, + name: $pkg_info.name + } + } + ) + + $available_versions | uniq | sort-by version +} + +def get_src_url [pkg_attr] { + let result = (do { nix eval $".#($pkg_attr).src.url" } | complete) + if $result.exit_code == 0 { + $result.stdout | str trim | str replace -a '"' '' # Remove all quotes + } else { + null + } +} + +def get_extension_info [flake_json, pg_info] { + let major_version = ($pg_info.version | split row "." | first) + let version_prefix = if $pg_info.is_orioledb { + "psql_orioledb-" + $major_version + "/exts/" + } else { + "psql_" + $major_version + "/exts/" + } + + print $"Looking for extensions with prefix: ($version_prefix)" + + let sys_packages = ($flake_json | get packages | get aarch64-linux) + let ext_names = ($sys_packages + | columns + | where {|col| $col =~ $"^($version_prefix)"} + ) + print $"Found extensions: ($ext_names | str join ', ')" + + let all_exts = ($ext_names | each {|ext_name| + let ext_info = ($sys_packages | get $ext_name) + let name = ($ext_name | str replace $version_prefix "") + let version = if $name == "orioledb" { + $ext_info.name # Use name directly for orioledb + } else if ($ext_info.name | str contains "-") { + $ext_info.name | split row "-" | last + } else { + $ext_info.name + } + let src_url = (get_src_url $ext_name) + { + name: $name, + version: $version, + description: $ext_info.description, + url: $src_url + } + }) + + $all_exts | sort-by name +} + +def create_version_link [pg_info] { + if $pg_info.is_orioledb { + let display = $"orioledb-($pg_info.name)" + let url = "https://github.com/orioledb/orioledb" + $"- ✅ Postgres [($display)]\(($url)\)" + } else { + let major_version = ($pg_info.version | split row "." | first) + let url = $"https://www.postgresql.org/docs/($major_version)/index.html" + $"- ✅ Postgres [($pg_info.name)]\(($url)\)" # Use full version number + } +} + +def create_ext_table [extensions, pg_info] { + let header_version = if $pg_info.is_orioledb { + $"orioledb-($pg_info.version)" # Add orioledb prefix for orioledb versions + } else { + $pg_info.version + } + + let header = [ + "", # blank line for spacing + $"### PostgreSQL ($header_version) Extensions", + "| Extension | Version | Description |", + "| ------------- | :-------------: | ------------- |" + ] + + let rows = ($extensions | each {|ext| + let name = $ext.name + let version = $ext.version + let desc = $ext.description + let url = $ext.url # Get URL from extension info + + $"| [($name)]\(($url)\) | [($version)]\(($url)\) | ($desc) |" + }) + + $header | append $rows +} + +def update_readme [] { + let flake_json = (load_flake) + let readme_path = ([$env.PWD "README.md"] | path join) + let readme = (open $readme_path | lines) + let pg_versions = (get_postgres_versions $flake_json) + + # Find section indices + let features_start = ($readme | where $it =~ "^## Primary Features" | first) + let features_end = ($readme | where $it =~ "^## Extensions" | first) + let features_start_idx = (find_index $readme $features_start) + let features_end_idx = (find_index $readme $features_end) + + if $features_start_idx == -1 or $features_end_idx == -1 { + error make {msg: "Could not find Features sections"} + } + + # Update Primary Features section + let features_content = [ + ($pg_versions | each {|version| create_version_link $version} | str join "\n") + "- ✅ Ubuntu 20.04 (Focal Fossa)." + "- ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication." + "- ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images." + ] + + # Find extension section indices + let ext_start = ($readme | where $it =~ "^## Extensions" | first) + let ext_start_idx = (find_index $readme $ext_start) + + # Find next section after Extensions or use end of file + let next_section_idx = ($readme + | enumerate + | where {|it| $it.index > $ext_start_idx and ($it.item =~ "^## ")} + | first + | get index + | default ($readme | length) + ) + + if $ext_start_idx == -1 { + error make {msg: "Could not find Extensions section"} + } + + # Create extension sections content + let ext_sections_content = ($pg_versions | each {|version| + let extensions = (get_extension_info $flake_json $version) + create_ext_table $extensions $version + } | flatten) + + # Combine sections, removing duplicate headers + let before_features = ($readme + | range (0)..($features_start_idx) + | where {|line| not ($line =~ "^## Primary Features")} + ) + let features_header = ($readme | get $features_start_idx) + let between_sections = ($readme + | range ($features_end_idx)..($ext_start_idx) + | where {|line| + not ($line =~ "^## Primary Features" or $line =~ "^## Extensions") + } + ) + let ext_header = ($readme | get $ext_start_idx) + let after_ext = ($readme | range ($next_section_idx)..($readme | length)) + + let output = ($before_features + | append $features_header + | append $features_content + | append $between_sections + | append $ext_header + | append $ext_sections_content + | append $after_ext + | str join "\n") + + $output | save --force $readme_path +} + +# Main execution +update_readme From fc5921822cfc175ca4de8eb0d62588cc40f514f3 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 20 Feb 2025 14:43:52 +0800 Subject: [PATCH 134/271] fix: remove pg_net grants --- ansible/vars.yml | 4 +- .../20250220051611_pg_net_perms_fix.sql | 64 +++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 migrations/db/migrations/20250220051611_pg_net_perms_fix.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 6d3d096b1..cee8b8cfd 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.036-orioledb" - postgres15: "15.8.1.040" + postgresorioledb-17: "17.0.1.037-orioledb" + postgres15: "15.8.1.041" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql b/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql new file mode 100644 index 000000000..aac7c8ead --- /dev/null +++ b/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql @@ -0,0 +1,64 @@ +-- migrate:up +DO $$ +BEGIN + IF EXISTS (SELECT FROM pg_extension WHERE extname = 'pg_net') + THEN + CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access() + RETURNS event_trigger + LANGUAGE plpgsql + AS $func$ + BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + IF EXISTS ( + SELECT FROM pg_extension + WHERE extname = 'pg_net' + -- all versions in use on existing projects as of 2025-02-20 + -- version 0.12.0 onwards don't need these applied + AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') + ) THEN + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; + END IF; + END; + $func$; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY INVOKER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY INVOKER; + + REVOKE EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM supabase_functions_admin, postgres, anon, authenticated, service_role; + REVOKE EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM supabase_functions_admin, postgres, anon, authenticated, service_role; + + GRANT ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO PUBLIC; + GRANT ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO PUBLIC; + END IF; +END $$; + +-- migrate:down From 4066b0dbe06e9f673a75139c90f2856c2889a5e2 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 21 Feb 2025 05:46:30 +0800 Subject: [PATCH 135/271] feat: ensure that nfs clients are available on the QEMU artifact --- ansible/vars.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index cee8b8cfd..915fc455a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.0.1.037-orioledb" - postgres15: "15.8.1.041" + postgres15: "15.8.1.042" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 61606c81e..464c4f032 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -22,7 +22,7 @@ function waitfor_boot_finished { } function install_packages { - apt-get update && sudo apt-get install software-properties-common e2fsprogs -y + apt-get update && sudo apt-get install software-properties-common e2fsprogs nfs-common -y add-apt-repository --yes --update ppa:ansible/ansible && sudo apt-get install ansible -y ansible-galaxy collection install community.general } From 6ae2c3b5663cc6c5dad93b38946d32be2de31b89 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Fri, 21 Feb 2025 14:03:52 +0800 Subject: [PATCH 136/271] fix: pg_net event trigger (#1457) * fix: pg_net event trigger * chore: bump version * chore: update schema files --- ansible/vars.yml | 4 +- .../20250220051611_pg_net_perms_fix.sql | 94 +++++++++---------- migrations/schema-15.sql | 30 +++--- migrations/schema-orioledb-17.sql | 30 +++--- 4 files changed, 87 insertions(+), 71 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 915fc455a..99c05f7c8 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.037-orioledb" - postgres15: "15.8.1.042" + postgresorioledb-17: "17.0.1.038-orioledb" + postgres15: "15.8.1.043" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql b/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql index aac7c8ead..cc8ffc2c7 100644 --- a/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql +++ b/migrations/db/migrations/20250220051611_pg_net_perms_fix.sql @@ -1,55 +1,55 @@ -- migrate:up +CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access() +RETURNS event_trigger +LANGUAGE plpgsql +AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + IF EXISTS ( + SELECT FROM pg_extension + WHERE extname = 'pg_net' + -- all versions in use on existing projects as of 2025-02-20 + -- version 0.12.0 onwards don't need these applied + AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') + ) THEN + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; + END IF; +END; +$$; + DO $$ BEGIN IF EXISTS (SELECT FROM pg_extension WHERE extname = 'pg_net') THEN - CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access() - RETURNS event_trigger - LANGUAGE plpgsql - AS $func$ - BEGIN - IF EXISTS ( - SELECT 1 - FROM pg_event_trigger_ddl_commands() AS ev - JOIN pg_extension AS ext - ON ev.objid = ext.oid - WHERE ext.extname = 'pg_net' - ) - THEN - IF NOT EXISTS ( - SELECT 1 - FROM pg_roles - WHERE rolname = 'supabase_functions_admin' - ) - THEN - CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; - END IF; - - GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; - - IF EXISTS ( - SELECT FROM pg_extension - WHERE extname = 'pg_net' - -- all versions in use on existing projects as of 2025-02-20 - -- version 0.12.0 onwards don't need these applied - AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') - ) THEN - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - - REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - - GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - END IF; - END IF; - END; - $func$; - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY INVOKER; ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY INVOKER; diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 1bff8b9d8..33bba060f 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -339,17 +339,25 @@ BEGIN GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - - REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - - GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + IF EXISTS ( + SELECT FROM pg_extension + WHERE extname = 'pg_net' + -- all versions in use on existing projects as of 2025-02-20 + -- version 0.12.0 onwards don't need these applied + AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') + ) THEN + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; END IF; END; $$; diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 531970c37..28e756fc9 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -354,17 +354,25 @@ BEGIN GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - - REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - - GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + IF EXISTS ( + SELECT FROM pg_extension + WHERE extname = 'pg_net' + -- all versions in use on existing projects as of 2025-02-20 + -- version 0.12.0 onwards don't need these applied + AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') + ) THEN + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; END IF; END; $$; From 143645101a2d3866d942d930b9ba5542c97ba281 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 19 Feb 2025 21:16:34 +0800 Subject: [PATCH 137/271] fix: update migration to support vault 0.2.8 and above --- ...221207154255_create_pgsodium_and_vault.sql | 60 +++++++++++-------- ...0529180330_alter_api_roles_for_inherit.sql | 7 ++- .../20250218031949_pgsodium_mask_role.sql | 44 ++++++++------ 3 files changed, 66 insertions(+), 45 deletions(-) diff --git a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql index 3d3867ab5..f93cc211a 100644 --- a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql +++ b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql @@ -5,34 +5,44 @@ DECLARE pgsodium_exists boolean; vault_exists boolean; BEGIN - pgsodium_exists = ( - select count(*) = 1 - from pg_available_extensions - where name = 'pgsodium' - and default_version in ('3.1.6', '3.1.7', '3.1.8', '3.1.9') - ); - - vault_exists = ( + IF EXISTS (SELECT FROM pg_available_extensions WHERE name = 'supabase_vault' AND default_version != '0.2.8') THEN + CREATE EXTENSION IF NOT EXISTS supabase_vault; + + -- for some reason extension custom scripts aren't run during AMI build, so + -- we manually run it here + GRANT USAGE ON SCHEMA vault TO postgres WITH GRANT OPTION; + GRANT SELECT, DELETE ON vault.secrets, vault.decrypted_secrets TO postgres WITH GRANT OPTION; + GRANT EXECUTE ON FUNCTION vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt TO postgres WITH GRANT OPTION; + ELSE + pgsodium_exists = ( select count(*) = 1 from pg_available_extensions - where name = 'supabase_vault' - ); - - IF pgsodium_exists - THEN - create extension if not exists pgsodium; - - grant pgsodium_keyiduser to postgres with admin option; - grant pgsodium_keyholder to postgres with admin option; - grant pgsodium_keymaker to postgres with admin option; - - grant execute on function pgsodium.crypto_aead_det_decrypt(bytea, bytea, uuid, bytea) to service_role; - grant execute on function pgsodium.crypto_aead_det_encrypt(bytea, bytea, uuid, bytea) to service_role; - grant execute on function pgsodium.crypto_aead_det_keygen to service_role; - - IF vault_exists + where name = 'pgsodium' + and default_version in ('3.1.6', '3.1.7', '3.1.8', '3.1.9') + ); + + vault_exists = ( + select count(*) = 1 + from pg_available_extensions + where name = 'supabase_vault' + ); + + IF pgsodium_exists THEN - create extension if not exists supabase_vault; + create extension if not exists pgsodium; + + grant pgsodium_keyiduser to postgres with admin option; + grant pgsodium_keyholder to postgres with admin option; + grant pgsodium_keymaker to postgres with admin option; + + grant execute on function pgsodium.crypto_aead_det_decrypt(bytea, bytea, uuid, bytea) to service_role; + grant execute on function pgsodium.crypto_aead_det_encrypt(bytea, bytea, uuid, bytea) to service_role; + grant execute on function pgsodium.crypto_aead_det_keygen to service_role; + + IF vault_exists + THEN + create extension if not exists supabase_vault; + END IF; END IF; END IF; END $$; diff --git a/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql b/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql index 4df82e3f4..d8291bbaa 100644 --- a/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql +++ b/migrations/db/migrations/20230529180330_alter_api_roles_for_inherit.sql @@ -4,7 +4,12 @@ ALTER ROLE authenticated inherit; ALTER ROLE anon inherit; ALTER ROLE service_role inherit; -GRANT pgsodium_keyholder to service_role; +DO $$ +BEGIN + IF EXISTS (SELECT FROM pg_roles WHERE rolname = 'pgsodium_keyholder') THEN + GRANT pgsodium_keyholder to service_role; + END IF; +END $$; -- migrate:down diff --git a/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql b/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql index c4a3eadf4..f44fa9866 100644 --- a/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql +++ b/migrations/db/migrations/20250218031949_pgsodium_mask_role.sql @@ -1,25 +1,31 @@ -- migrate:up -CREATE OR REPLACE FUNCTION pgsodium.mask_role(masked_role regrole, source_name text, view_name text) -RETURNS void -LANGUAGE plpgsql -SECURITY DEFINER -SET search_path TO '' -AS $function$ + +DO $$ BEGIN - EXECUTE format( - 'GRANT SELECT ON pgsodium.key TO %s', - masked_role); + IF EXISTS (SELECT FROM pg_extension WHERE extname = 'pgsodium') THEN + CREATE OR REPLACE FUNCTION pgsodium.mask_role(masked_role regrole, source_name text, view_name text) + RETURNS void + LANGUAGE plpgsql + SECURITY DEFINER + SET search_path TO '' + AS $function$ + BEGIN + EXECUTE format( + 'GRANT SELECT ON pgsodium.key TO %s', + masked_role); - EXECUTE format( - 'GRANT pgsodium_keyiduser, pgsodium_keyholder TO %s', - masked_role); + EXECUTE format( + 'GRANT pgsodium_keyiduser, pgsodium_keyholder TO %s', + masked_role); - EXECUTE format( - 'GRANT ALL ON %I TO %s', - view_name, - masked_role); - RETURN; -END -$function$; + EXECUTE format( + 'GRANT ALL ON %I TO %s', + view_name, + masked_role); + RETURN; + END + $function$; + END IF; +END $$; -- migrate:down From 32ccff5e3f994501d7b265c8b0b0c02fdf02f26f Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Fri, 21 Feb 2025 10:49:53 +0100 Subject: [PATCH 138/271] chore: bump pg_graphql version (#1455) * chore: bump pg_graphql version * chore: update our nix pkg for pg_graphql too (#1458) * chore: bump version --------- Co-authored-by: samrose --- Dockerfile-15 | 2 +- Dockerfile-orioledb-17 | 2 +- ansible/vars.yml | 4 ++-- flake.nix | 6 ++++++ nix/cargo-pgrx/default.nix | 5 +++++ nix/ext/pg_graphql.nix | 34 ++++++++++++++++++++-------------- 6 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 52c4e5af3..ee9db3c4f 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -24,7 +24,7 @@ ARG rum_release=1.3.13 ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 ARG libsodium_release=1.0.18 ARG pgsodium_release=3.1.6 -ARG pg_graphql_release=1.5.1 +ARG pg_graphql_release=1.5.11 ARG pg_stat_monitor_release=1.1.1 ARG pg_jsonschema_release=0.1.4 ARG pg_repack_release=1.4.8 diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index e75694c16..f5b467828 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -24,7 +24,7 @@ ARG rum_release=1.3.13 ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 ARG libsodium_release=1.0.18 ARG pgsodium_release=3.1.6 -ARG pg_graphql_release=1.5.1 +ARG pg_graphql_release=1.5.11 ARG pg_stat_monitor_release=1.1.1 ARG pg_jsonschema_release=0.1.4 ARG pg_repack_release=1.4.8 diff --git a/ansible/vars.yml b/ansible/vars.yml index 99c05f7c8..2f3defa7d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.038-orioledb" - postgres15: "15.8.1.043" + postgresorioledb-17: "17.0.1.039-orioledb" + postgres15: "15.8.1.044" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 92ceebf99..9ce842d35 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,11 @@ buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6; }; + + buildPgrxExtension_0_12_9 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9; + }; + }) (final: prev: { postgresql = final.callPackage ./nix/postgresql/default.nix { @@ -394,6 +399,7 @@ 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; + cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_orioledb-17 = postgresVersions.psql_orioledb-17; diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 2d5545927..64e15160b 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -66,5 +66,10 @@ in hash = "sha256-7aQkrApALZe6EoQGVShGBj0UIATnfOy2DytFj9IWdEA="; cargoHash = "sha256-Di4UldQwAt3xVyvgQT1gUhdvYUVp7n/a72pnX45kP0w="; }; + cargo-pgrx_0_12_9 = generic { + version = "0.12.9"; + hash = "sha256-aR3DZAjeEEAjLQfZ0ZxkjLqTVMIEbU0UiZ62T4BkQq8="; + cargoHash = "sha256-53HKhvsKLTa2JCByLEcK3UzWXoM+LTatd98zvS1C9no="; + }; inherit rustPlatform; } diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index f54dff46a..54e500924 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -1,35 +1,41 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_6, cargo, rust-bin }: +{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_9, cargo, rust-bin }: + let - rustVersion = "1.80.0"; - cargo = rust-bin.stable.${rustVersion}.default; + rustVersion = "nightly"; + cargo = rust-bin.nightly.latest.default; in -buildPgrxExtension_0_12_6 rec { +buildPgrxExtension_0_12_9 rec { pname = "pg_graphql"; - version = "1.5.9"; + version = "1.5.11"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = pname; rev = "v${version}"; - hash = "sha256-YpLN43FtLhp2cb7cyM+4gEx8GTwsRiKTfxaMq0b8hk0="; + hash = "sha256-BMZc9ui+2J3U24HzZZVCU5+KWhz+5qeUsRGeptiqbek="; }; nativeBuildInputs = [ cargo ]; buildInputs = [ postgresql ]; - CARGO="${cargo}/bin/cargo"; - #darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions + CARGO = "${cargo}/bin/cargo"; + + cargoLock = { + lockFile = "${src}/Cargo.lock"; + }; + # Setting RUSTFLAGS in env to ensure it's available for all phases env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; - RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; PGPORT = "5434"; + RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; + NIX_BUILD_CORES = "4"; # Limit parallel jobs + CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism }; - cargoHash = "sha256-d2RSHtJgbYlOvArjOTaeYoca01UyWPUEO5vhktxxB6U="; +CARGO_BUILD_RUSTFLAGS = "--cfg tokio_unstable -C debuginfo=0"; + CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; - # FIXME (aseipp): disable the tests since they try to install .control - # files into the wrong spot, aside from that the one main test seems - # to work, though + doCheck = false; meta = with lib; { @@ -39,4 +45,4 @@ buildPgrxExtension_0_12_6 rec { platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} +} \ No newline at end of file From 6aa8c5d8c07ada2cf78c30becff3303054b2ee10 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Fri, 21 Feb 2025 19:37:15 +0200 Subject: [PATCH 139/271] fix: correctly select root disk partition (#1244) * fix: correctly select root disk partition * chore: check extracted partition value is a number --------- Co-authored-by: Tom Ashley --- ansible/files/admin_api_scripts/grow_fs.sh | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/ansible/files/admin_api_scripts/grow_fs.sh b/ansible/files/admin_api_scripts/grow_fs.sh index 1bca017b7..c8c14890f 100644 --- a/ansible/files/admin_api_scripts/grow_fs.sh +++ b/ansible/files/admin_api_scripts/grow_fs.sh @@ -9,6 +9,23 @@ if pgrep resizefs; then exit 1 fi +# Parses the output of lsblk to get the root partition number +# Example output: +# NAME MOUNTPOINT +# nvme0n1 +# ├─nvme0n1p1 /boot +# └─nvme0n1p3 / +# nvme1n1 /data +# +# Resulting in: +# └─nvme0n1p3 / -> nvme0n1p3 -> 3 +ROOT_PARTITION_NUMBER=$(lsblk -no NAME,MOUNTPOINT | grep ' /$' | awk '{print $1;}' | sed 's/.*nvme[0-9]n[0-9]p//g') + +if ! [[ "$ROOT_PARTITION_NUMBER" =~ ^[0-9]+$ ]]; then + echo "Error: ROOT_PARTITION_NUMBER is not a valid number: $ROOT_PARTITION_NUMBER" + exit 1 +fi + if [ -b /dev/nvme1n1 ] ; then if [[ "${VOLUME_TYPE}" == "data" ]]; then resize2fs /dev/nvme1n1 @@ -16,8 +33,8 @@ if [ -b /dev/nvme1n1 ] ; then elif [[ "${VOLUME_TYPE}" == "root" ]] ; then PLACEHOLDER_FL=/home/ubuntu/50M_PLACEHOLDER rm -f "${PLACEHOLDER_FL}" || true - growpart /dev/nvme0n1 2 - resize2fs /dev/nvme0n1p2 + growpart /dev/nvme0n1 "${ROOT_PARTITION_NUMBER}" + resize2fs "/dev/nvme0n1p${ROOT_PARTITION_NUMBER}" if [[ ! -f "${PLACEHOLDER_FL}" ]] ; then fallocate -l50M "${PLACEHOLDER_FL}" fi @@ -26,7 +43,7 @@ if [ -b /dev/nvme1n1 ] ; then exit 1 fi else - growpart /dev/nvme0n1 2 - resize2fs /dev/nvme0n1p2 + growpart /dev/nvme0n1 "${ROOT_PARTITION_NUMBER}" + resize2fs "/dev/nvme0n1p${ROOT_PARTITION_NUMBER}" fi echo "Done resizing disk" From 9d7b75c7401d96ba241d8a44490472b8820a9ab2 Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Tue, 25 Feb 2025 10:59:16 +0100 Subject: [PATCH 140/271] feat: add test for security definer functions (#1461) * feat: add test for security definer functions * chore: include nspname to help relate functions to schema/extensions --- nix/tests/expected/security.out | 30 ++++++++++++++++++++++++++++++ nix/tests/sql/security.sql | 9 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 nix/tests/expected/security.out create mode 100644 nix/tests/sql/security.sql diff --git a/nix/tests/expected/security.out b/nix/tests/expected/security.out new file mode 100644 index 000000000..58207b605 --- /dev/null +++ b/nix/tests/expected/security.out @@ -0,0 +1,30 @@ +-- get a list of security definer functions owned by supabase_admin +-- this list should be vetted to ensure the functions are safe to use as security definer +select + n.nspname, p.proname +from pg_catalog.pg_proc p + left join pg_catalog.pg_namespace n ON n.oid = p.pronamespace +where p.proowner = (select oid from pg_catalog.pg_roles where rolname = 'supabase_admin') + and p.prosecdef = true +order by 1,2; + nspname | proname +----------+-------------------------------- + graphql | get_schema_version + graphql | increment_schema_version + pgsodium | disable_security_label_trigger + pgsodium | enable_security_label_trigger + pgsodium | get_key_by_id + pgsodium | get_key_by_name + pgsodium | get_named_keys + pgsodium | mask_role + pgsodium | update_mask + public | dblink_connect_u + public | dblink_connect_u + public | pgaudit_ddl_command_end + public | pgaudit_sql_drop + public | st_estimatedextent + public | st_estimatedextent + public | st_estimatedextent + repack | repack_trigger +(17 rows) + diff --git a/nix/tests/sql/security.sql b/nix/tests/sql/security.sql new file mode 100644 index 000000000..fb72f0e69 --- /dev/null +++ b/nix/tests/sql/security.sql @@ -0,0 +1,9 @@ +-- get a list of security definer functions owned by supabase_admin +-- this list should be vetted to ensure the functions are safe to use as security definer +select + n.nspname, p.proname +from pg_catalog.pg_proc p + left join pg_catalog.pg_namespace n ON n.oid = p.pronamespace +where p.proowner = (select oid from pg_catalog.pg_roles where rolname = 'supabase_admin') + and p.prosecdef = true +order by 1,2; From 084b9146addd163b60f24856c571dd2929a911df Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 26 Feb 2025 14:34:06 +0800 Subject: [PATCH 141/271] feat: no longer ship an initialized pgdata dir as part of QEMU artifact (#1463) --- ansible/vars.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 2f3defa7d..4d30bc23d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.0.1.039-orioledb" - postgres15: "15.8.1.044" + postgres15: "15.8.1.045" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 464c4f032..0fe8b97c1 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -143,4 +143,6 @@ function clean_system { install_nix execute_stage2_playbook +# we do not want to ship an initialized DB as this is performed as needed +rm -rf /data/pgdata cloud-init clean --logs From 44df10ea54e28c60439b44353f6ede0b7fd12cae Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 27 Feb 2025 16:37:12 -0500 Subject: [PATCH 142/271] move orioledb to extensions schema (#1448) * chore: move orioledb to extensions scehama * ore: update schemas * chore: create testing AMI images * chore: bump version for release This change targets orioledb moving installed orioledb extension from "public" schema to "extensions" schema --- ansible/vars.yml | 4 +- migrations/README.md | 7 +- ...616_move_orioledb_to_extensions_schema.sql | 26 +++++ migrations/schema-orioledb-17.sql | 2 +- nix/tests/expected/z_17_ext_interface.out | 110 +++++++++--------- 5 files changed, 89 insertions(+), 60 deletions(-) create mode 100644 migrations/db/migrations/20250205144616_move_orioledb_to_extensions_schema.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 4d30bc23d..b49b27e8c 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.039-orioledb" - postgres15: "15.8.1.045" + postgresorioledb-17: "17.0.1.040-orioledb" + postgres15: "15.8.1.046" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/README.md b/migrations/README.md index 19d2bf4b3..ef3c7215b 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -78,15 +78,18 @@ Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/deve ### Add a Migration +First, start a local postgres server and apply the migrations + ```shell # Start the database server -docker-compose up +nix run .#dbmate-tool -- --version 15 --flake-url "." # create a new migration +nix develop dbmate new '' ``` -Then, populate the migration at `./db/migrations/xxxxxxxxx_` and make sure it execute sucessfully with +Then, execute the migration at `./db/migrations/xxxxxxxxx_` and make sure it runs sucessfully with ```shell dbmate up diff --git a/migrations/db/migrations/20250205144616_move_orioledb_to_extensions_schema.sql b/migrations/db/migrations/20250205144616_move_orioledb_to_extensions_schema.sql new file mode 100644 index 000000000..259a6b0e5 --- /dev/null +++ b/migrations/db/migrations/20250205144616_move_orioledb_to_extensions_schema.sql @@ -0,0 +1,26 @@ +-- migrate:up +do $$ +declare + ext_schema text; + extensions_schema_exists boolean; +begin + -- check if the "extensions" schema exists + select exists ( + select 1 from pg_namespace where nspname = 'extensions' + ) into extensions_schema_exists; + + if extensions_schema_exists then + -- check if the "orioledb" extension is in the "public" schema + select nspname into ext_schema + from pg_extension e + join pg_namespace n on e.extnamespace = n.oid + where extname = 'orioledb'; + + if ext_schema = 'public' then + execute 'alter extension orioledb set schema extensions'; + end if; + end if; +end $$; + +-- migrate:down + diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 28e756fc9..ed5627c7c 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -91,7 +91,7 @@ CREATE SCHEMA vault; -- Name: orioledb; Type: EXTENSION; Schema: -; Owner: - -- -CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public; +CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA extensions; -- diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 37f417f81..45090f6e2 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1078,41 +1078,41 @@ order by ltree | public | subpath | ltree, integer, integer | ltree ltree | public | text2ltree | text | ltree moddatetime | public | moddatetime | | trigger - orioledb | public | orioledb_commit_hash | | text - orioledb | public | orioledb_compression_max_level | | bigint - orioledb | public | orioledb_evict_pages | relid oid, maxlevel integer | void - orioledb | public | orioledb_get_evicted_trees | OUT datoid oid, OUT relnode oid, OUT root_downlink bigint, OUT file_length bigint | SETOF record - orioledb | public | orioledb_get_index_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record - orioledb | public | orioledb_get_table_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record - orioledb | public | orioledb_has_retained_undo | | boolean - orioledb | public | orioledb_idx_structure | relid oid, tree_name text, options character varying, depth integer | text - orioledb | public | orioledb_index_description | datoid oid, relid oid, relnode oid, index_type text, OUT name text, OUT description text | record - orioledb | public | orioledb_index_oids | OUT datoid oid, OUT table_reloid oid, OUT table_relnode oid, OUT index_reloid oid, OUT index_relnode oid, OUT index_type text | SETOF record - orioledb | public | orioledb_index_rows | relid oid, OUT total integer, OUT dead integer | record - orioledb | public | orioledb_page_stats | OUT pool_name text, OUT busy_pages bigint, OUT free_pages bigint, OUT dirty_pages bigint, OUT all_pages bigint | SETOF record - orioledb | public | orioledb_recovery_synchronized | | boolean - orioledb | public | orioledb_relation_size | relid oid | bigint - orioledb | public | orioledb_sys_tree_check | num integer, force_map_check boolean | boolean - orioledb | public | orioledb_sys_tree_rows | num integer | SETOF jsonb - orioledb | public | orioledb_sys_tree_structure | num integer, options character varying, depth integer | text - orioledb | public | orioledb_table_description | datoid oid, relid oid, relnode oid | text - orioledb | public | orioledb_table_description | relid oid | text - orioledb | public | orioledb_table_oids | OUT datoid oid, OUT reloid oid, OUT relnode oid | SETOF record - orioledb | public | orioledb_table_pages | relid oid, OUT blkno bigint, OUT level integer, OUT rightlink bigint, OUT hikey jsonb | SETOF record - orioledb | public | orioledb_tableam_handler | internal | table_am_handler - orioledb | public | orioledb_tbl_are_indices_equal | idx_oid1 regclass, idx_oid2 regclass | boolean - orioledb | public | orioledb_tbl_bin_structure | relid oid, print_bytes boolean, depth integer | text - orioledb | public | orioledb_tbl_check | relid oid, force_map_check boolean | boolean - orioledb | public | orioledb_tbl_compression_check | level bigint, relid oid, ranges integer[] | text - orioledb | public | orioledb_tbl_indices | relid oid | text - orioledb | public | orioledb_tbl_structure | relid oid, options character varying, depth integer | text - orioledb | public | orioledb_tree_stat | relid regclass, OUT level integer, OUT count bigint, OUT avgoccupied double precision, OUT avgvacated double precision | SETOF record - orioledb | public | orioledb_ucm_check | | boolean - orioledb | public | orioledb_version | | text - orioledb | public | orioledb_write_pages | relid oid | void - orioledb | public | pg_stopevent_reset | eventname text | boolean - orioledb | public | pg_stopevent_set | eventname text, condition jsonpath | void - orioledb | public | pg_stopevents | OUT stopevent text, OUT condition jsonpath, OUT waiter_pids integer[] | SETOF record + orioledb | extensions | orioledb_commit_hash | | text + orioledb | extensions | orioledb_compression_max_level | | bigint + orioledb | extensions | orioledb_evict_pages | relid oid, maxlevel integer | void + orioledb | extensions | orioledb_get_evicted_trees | OUT datoid oid, OUT relnode oid, OUT root_downlink bigint, OUT file_length bigint | SETOF record + orioledb | extensions | orioledb_get_index_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record + orioledb | extensions | orioledb_get_table_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record + orioledb | extensions | orioledb_has_retained_undo | | boolean + orioledb | extensions | orioledb_idx_structure | relid oid, tree_name text, options character varying, depth integer | text + orioledb | extensions | orioledb_index_description | datoid oid, relid oid, relnode oid, index_type text, OUT name text, OUT description text | record + orioledb | extensions | orioledb_index_oids | OUT datoid oid, OUT table_reloid oid, OUT table_relnode oid, OUT index_reloid oid, OUT index_relnode oid, OUT index_type text | SETOF record + orioledb | extensions | orioledb_index_rows | relid oid, OUT total integer, OUT dead integer | record + orioledb | extensions | orioledb_page_stats | OUT pool_name text, OUT busy_pages bigint, OUT free_pages bigint, OUT dirty_pages bigint, OUT all_pages bigint | SETOF record + orioledb | extensions | orioledb_recovery_synchronized | | boolean + orioledb | extensions | orioledb_relation_size | relid oid | bigint + orioledb | extensions | orioledb_sys_tree_check | num integer, force_map_check boolean | boolean + orioledb | extensions | orioledb_sys_tree_rows | num integer | SETOF jsonb + orioledb | extensions | orioledb_sys_tree_structure | num integer, options character varying, depth integer | text + orioledb | extensions | orioledb_table_description | datoid oid, relid oid, relnode oid | text + orioledb | extensions | orioledb_table_description | relid oid | text + orioledb | extensions | orioledb_table_oids | OUT datoid oid, OUT reloid oid, OUT relnode oid | SETOF record + orioledb | extensions | orioledb_table_pages | relid oid, OUT blkno bigint, OUT level integer, OUT rightlink bigint, OUT hikey jsonb | SETOF record + orioledb | extensions | orioledb_tableam_handler | internal | table_am_handler + orioledb | extensions | orioledb_tbl_are_indices_equal | idx_oid1 regclass, idx_oid2 regclass | boolean + orioledb | extensions | orioledb_tbl_bin_structure | relid oid, print_bytes boolean, depth integer | text + orioledb | extensions | orioledb_tbl_check | relid oid, force_map_check boolean | boolean + orioledb | extensions | orioledb_tbl_compression_check | level bigint, relid oid, ranges integer[] | text + orioledb | extensions | orioledb_tbl_indices | relid oid | text + orioledb | extensions | orioledb_tbl_structure | relid oid, options character varying, depth integer | text + orioledb | extensions | orioledb_tree_stat | relid regclass, OUT level integer, OUT count bigint, OUT avgoccupied double precision, OUT avgvacated double precision | SETOF record + orioledb | extensions | orioledb_ucm_check | | boolean + orioledb | extensions | orioledb_version | | text + orioledb | extensions | orioledb_write_pages | relid oid | void + orioledb | extensions | pg_stopevent_reset | eventname text | boolean + orioledb | extensions | pg_stopevent_set | eventname text, condition jsonpath | void + orioledb | extensions | pg_stopevents | OUT stopevent text, OUT condition jsonpath, OUT waiter_pids integer[] | SETOF record pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record pageinspect | public | brin_page_type | page bytea | text pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid @@ -4966,26 +4966,26 @@ order by hypopg | public | hypopg_list_indexes | indexrelid hypopg | public | hypopg_list_indexes | schema_name hypopg | public | hypopg_list_indexes | table_name - orioledb | public | orioledb_index | datoid - orioledb | public | orioledb_index | description - orioledb | public | orioledb_index | index_relnode - orioledb | public | orioledb_index | index_reloid - orioledb | public | orioledb_index | index_type - orioledb | public | orioledb_index | name - orioledb | public | orioledb_index | table_relnode - orioledb | public | orioledb_index | table_reloid - orioledb | public | orioledb_index_descr | datoid - orioledb | public | orioledb_index_descr | refcnt - orioledb | public | orioledb_index_descr | relnode - orioledb | public | orioledb_index_descr | reloid - orioledb | public | orioledb_table | datoid - orioledb | public | orioledb_table | description - orioledb | public | orioledb_table | relnode - orioledb | public | orioledb_table | reloid - orioledb | public | orioledb_table_descr | datoid - orioledb | public | orioledb_table_descr | refcnt - orioledb | public | orioledb_table_descr | relnode - orioledb | public | orioledb_table_descr | reloid + orioledb | extensions | orioledb_index | datoid + orioledb | extensions | orioledb_index | description + orioledb | extensions | orioledb_index | index_relnode + orioledb | extensions | orioledb_index | index_reloid + orioledb | extensions | orioledb_index | index_type + orioledb | extensions | orioledb_index | name + orioledb | extensions | orioledb_index | table_relnode + orioledb | extensions | orioledb_index | table_reloid + orioledb | extensions | orioledb_index_descr | datoid + orioledb | extensions | orioledb_index_descr | refcnt + orioledb | extensions | orioledb_index_descr | relnode + orioledb | extensions | orioledb_index_descr | reloid + orioledb | extensions | orioledb_table | datoid + orioledb | extensions | orioledb_table | description + orioledb | extensions | orioledb_table | relnode + orioledb | extensions | orioledb_table | reloid + orioledb | extensions | orioledb_table_descr | datoid + orioledb | extensions | orioledb_table_descr | refcnt + orioledb | extensions | orioledb_table_descr | relnode + orioledb | extensions | orioledb_table_descr | reloid pg_buffercache | public | pg_buffercache | bufferid pg_buffercache | public | pg_buffercache | isdirty pg_buffercache | public | pg_buffercache | pinning_backends From d558fb35e5e65679620992fbc272e2f9d2a4f309 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 28 Feb 2025 22:44:13 -0500 Subject: [PATCH 143/271] chore: try to fix frequent timeout on install of ansible-galaxy (#1466) --- scripts/nix-provision.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/nix-provision.sh b/scripts/nix-provision.sh index a2cda7ffd..6515ecae9 100644 --- a/scripts/nix-provision.sh +++ b/scripts/nix-provision.sh @@ -6,11 +6,18 @@ set -o pipefail set -o xtrace function install_packages { - # Setup Ansible on host VM - sudo apt-get update && sudo apt-get install software-properties-common -y - sudo add-apt-repository --yes --update ppa:ansible/ansible && sudo apt-get install ansible -y - ansible-galaxy collection install community.general + # Setup Ansible on host VM + sudo apt-get update && sudo apt-get install -y software-properties-common + # Manually add GPG key with explicit keyserver + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367 + + # Add repository and install + sudo add-apt-repository --yes ppa:ansible/ansible + sudo apt-get update + sudo apt-get install -y ansible + + ansible-galaxy collection install community.general } From 79c663bf85ad3ef8147ad24e15516dc6d00305c3 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Sat, 1 Mar 2025 14:47:54 +0100 Subject: [PATCH 144/271] feat: remove api key checks in envoy (#1465) * feat: remove api key checks in envoy * bump vars * add `x-sb-error-code` header to envoy lds.yaml when api key or opk don't match --- ansible/files/envoy_config/lds.supabase.yaml | 67 ++------------------ ansible/files/envoy_config/lds.yaml | 4 ++ ansible/vars.yml | 4 +- 3 files changed, 10 insertions(+), 65 deletions(-) diff --git a/ansible/files/envoy_config/lds.supabase.yaml b/ansible/files/envoy_config/lds.supabase.yaml index 40d3d46f2..6fdcb68c7 100644 --- a/ansible/files/envoy_config/lds.supabase.yaml +++ b/ansible/files/envoy_config/lds.supabase.yaml @@ -37,51 +37,6 @@ resources: rules: action: DENY policies: - api_key_missing: - permissions: - - any: true - principals: - - not_id: - or_ids: - ids: - - header: - name: apikey - present_match: true - - header: - name: ':path' - string_match: - contains: apikey= - api_key_not_valid: - permissions: - - any: true - principals: - - not_id: - or_ids: - ids: - - header: - name: apikey - string_match: - exact: anon_key - - header: - name: apikey - string_match: - exact: service_key - - header: - name: apikey - string_match: - exact: supabase_admin_key - - header: - name: ':path' - string_match: - contains: apikey=anon_key - - header: - name: ':path' - string_match: - contains: apikey=service_key - - header: - name: ':path' - string_match: - contains: apikey=supabase_admin_key origin_protection_key_missing: permissions: - any: true @@ -234,6 +189,10 @@ resources: prefix: /metrics/aggregated invert_match: true status_code: 401 + headers_to_add: + - header: + key: x-sb-error-code + value: '%RESPONSE_CODE_DETAILS%' body_format_override: json_format: message: >- @@ -383,24 +342,6 @@ resources: route: cluster: admin_api prefix_rewrite: /privileged/ - typed_per_filter_config: - envoy.filters.http.rbac: - '@type': >- - type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBACPerRoute - rbac: - rules: - action: DENY - policies: - basic_auth: - permissions: - - any: true - principals: - - header: - name: authorization - invert_match: true - string_match: - exact: Basic c2VydmljZV9yb2xlOnNlcnZpY2Vfa2V5 - treat_missing_header_as_empty: true - match: prefix: /metrics/aggregated request_headers_to_remove: diff --git a/ansible/files/envoy_config/lds.yaml b/ansible/files/envoy_config/lds.yaml index 2fc7cae13..97481c889 100644 --- a/ansible/files/envoy_config/lds.yaml +++ b/ansible/files/envoy_config/lds.yaml @@ -215,6 +215,10 @@ resources: prefix: /metrics/aggregated invert_match: true status_code: 401 + headers_to_add: + - header: + key: x-sb-error-code + value: '%RESPONSE_CODE_DETAILS%' body_format_override: json_format: message: >- diff --git a/ansible/vars.yml b/ansible/vars.yml index b49b27e8c..ab9d94b4f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.040-orioledb" - postgres15: "15.8.1.046" + postgresorioledb-17: "17.0.1.041-orioledb" + postgres15: "15.8.1.047" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 3642def34638a0769be89fffa82d44cdbfa84eb2 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 6 Mar 2025 05:01:12 -0500 Subject: [PATCH 145/271] chore: deprecate pg_backtrace (#1468) * deprecate pg_backtrace * handle in upgrade scripts * bump version for release --- .../files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 2 ++ ansible/vars.yml | 4 ++-- flake.nix | 1 - nix/tests/expected/z_15_ext_interface.out | 6 ++---- nix/tests/expected/z_17_ext_interface.out | 6 ++---- nix/tests/postgresql.conf.in | 2 +- nix/tests/prime.sql | 1 - 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 4e11f2d52..82ecb35b6 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -12,6 +12,7 @@ EXTENSIONS_TO_DISABLE=( "pg_graphql" "pg_stat_monitor" + "pg_backtrace" ) PG14_EXTENSIONS_TO_DISABLE=( @@ -217,6 +218,7 @@ function initiate_upgrade { SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/pg_net//" | xargs) SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/check_role_membership//" | xargs) SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/safeupdate//" | xargs) + SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/pg_backtrace//" | xargs) # Exclude empty-string entries, as well as leading/trailing commas and spaces resulting from the above lib exclusions # i.e. " , pg_stat_statements, , pgsodium, " -> "pg_stat_statements, pgsodium" diff --git a/ansible/vars.yml b/ansible/vars.yml index ab9d94b4f..794693711 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.041-orioledb" - postgres15: "15.8.1.047" + postgresorioledb-17: "17.0.1.042-orioledb" + postgres15: "15.8.1.048" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 9ce842d35..4986ccb51 100644 --- a/flake.nix +++ b/flake.nix @@ -125,7 +125,6 @@ ./nix/ext/postgis.nix ./nix/ext/pgrouting.nix ./nix/ext/pgtap.nix - ./nix/ext/pg_backtrace.nix ./nix/ext/pg_cron.nix ./nix/ext/pgsql-http.nix ./nix/ext/pg_plan_filter.nix diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 9914fa3b9..9cc143237 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -77,7 +77,6 @@ order by moddatetime | t old_snapshot | t pageinspect | t - pg_backtrace | t pg_buffercache | t pg_freespacemap | t pg_graphql | f @@ -129,7 +128,7 @@ order by vector | t wrappers | f xml2 | f -(81 rows) +(80 rows) /* @@ -1122,7 +1121,6 @@ order by pageinspect | public | page_header | page bytea, OUT lsn pg_lsn, OUT checksum smallint, OUT flags smallint, OUT lower integer, OUT upper integer, OUT special integer, OUT pagesize integer, OUT version smallint, OUT prune_xid xid | record pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text | bytea[] pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] - pg_backtrace | public | pg_backtrace_init | | void pg_buffercache | public | pg_buffercache_pages | | SETOF record pg_freespacemap | public | pg_freespace | rel regclass, OUT blkno bigint, OUT avail smallint | SETOF record pg_freespacemap | public | pg_freespace | regclass, bigint | smallint @@ -5226,7 +5224,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5055 rows) +(5054 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 45090f6e2..0380ccd84 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -70,7 +70,6 @@ order by moddatetime | t orioledb | t pageinspect | t - pg_backtrace | t pg_buffercache | t pg_freespacemap | t pg_graphql | f @@ -117,7 +116,7 @@ order by vector | t wrappers | f xml2 | f -(75 rows) +(74 rows) /* @@ -1142,7 +1141,6 @@ order by pageinspect | public | page_header | page bytea, OUT lsn pg_lsn, OUT checksum smallint, OUT flags smallint, OUT lower integer, OUT upper integer, OUT special integer, OUT pagesize integer, OUT version smallint, OUT prune_xid xid | record pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text | bytea[] pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] - pg_backtrace | public | pg_backtrace_init | | void pg_buffercache | public | pg_buffercache_evict | integer | boolean pg_buffercache | public | pg_buffercache_pages | | SETOF record pg_freespacemap | public | pg_freespace | regclass, bigint | smallint @@ -4906,7 +4904,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4747 rows) +(4746 rows) /* diff --git a/nix/tests/postgresql.conf.in b/nix/tests/postgresql.conf.in index ef860afcb..ba1df515b 100644 --- a/nix/tests/postgresql.conf.in +++ b/nix/tests/postgresql.conf.in @@ -718,7 +718,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, pg_backtrace' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 5116c419a..d043945ee 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -28,7 +28,6 @@ create extension if not exists lo; create extension if not exists ltree; create extension if not exists moddatetime; create extension if not exists pageinspect; -create extension if not exists pg_backtrace; create extension if not exists pg_buffercache; /* From d65e4843ff9d5c700866ba6b3f59ded84e8970b1 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 12 Mar 2025 14:11:12 +0100 Subject: [PATCH 146/271] chore: rm xmrig src by setting attribute to throw (#1473) * chore: rm xmrig src by setting attribute to null * chore: garbage collect drops source for unused packages * chore: testing id for docker image * chore: bump release --- Dockerfile-15 | 1 + Dockerfile-orioledb-17 | 2 +- ansible/vars.yml | 4 ++-- flake.nix | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index ee9db3c4f..5bc1d1468 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -67,6 +67,7 @@ WORKDIR /nixpg RUN nix profile install .#psql_15/bin +RUN nix store gc WORKDIR / diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index f5b467828..129fa400b 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -68,7 +68,7 @@ WORKDIR /nixpg RUN nix profile install .#psql_orioledb-17/bin - +RUN nix store gc WORKDIR / diff --git a/ansible/vars.yml b/ansible/vars.yml index 794693711..bffc7ce7c 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.042-orioledb" - postgres15: "15.8.1.048" + postgresorioledb-17: "17.0.1.043-orioledb" + postgres15: "15.8.1.049" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 4986ccb51..0ec405c67 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,9 @@ # pull them from the overlays/ directory automatically, but we don't # want to have an arbitrary order, since it might matter. being # explicit is better. + (final: prev: { + xmrig = throw "The xmrig package has been explicitly disabled in this flake."; + }) (import rust-overlay) (final: prev: { cargo-pgrx = final.callPackage ./nix/cargo-pgrx/default.nix { From daf123609d067374add405bcaf1604220d4e1898 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 13 Mar 2025 13:59:00 +0800 Subject: [PATCH 147/271] feat: bundle virtiofsd as part of the k8s artifact Not used by default, but would like to avoid having to install it upon startup if needed. --- Dockerfile-kubernetes | 2 +- ansible/vars.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile-kubernetes b/Dockerfile-kubernetes index 716e72b42..a1a39e498 100644 --- a/Dockerfile-kubernetes +++ b/Dockerfile-kubernetes @@ -2,7 +2,7 @@ FROM alpine:3.21 ADD ./output-cloudimg/packer-cloudimg /disk/focal.qcow2 -RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf +RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf virtiofsd # dev stuff # RUN apk add --no-cache iproute2 diff --git a/ansible/vars.yml b/ansible/vars.yml index bffc7ce7c..30bf0ce03 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.0.1.043-orioledb" - postgres15: "15.8.1.049" + postgres15: "15.8.1.050" # Non Postgres Extensions pgbouncer_release: "1.19.0" From c78104d53ed583e4a8d7dda5fe9b992237dc8d55 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Thu, 13 Mar 2025 18:20:14 +0800 Subject: [PATCH 148/271] fix: pgbouncer ownership (#1474) * fix: pgbouncer ownership * chore: update test snapshots * chore: bump versions --- ansible/vars.yml | 4 +- .../20250312095419_pgbouncer_ownership.sql | 5 +++ nix/tests/expected/security.out | 41 ++++++++++--------- 3 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 migrations/db/migrations/20250312095419_pgbouncer_ownership.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 30bf0ce03..f235e6c31 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.043-orioledb" - postgres15: "15.8.1.050" + postgresorioledb-17: "17.0.1.044-orioledb" + postgres15: "15.8.1.051" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250312095419_pgbouncer_ownership.sql b/migrations/db/migrations/20250312095419_pgbouncer_ownership.sql new file mode 100644 index 000000000..b8cf7073b --- /dev/null +++ b/migrations/db/migrations/20250312095419_pgbouncer_ownership.sql @@ -0,0 +1,5 @@ +-- migrate:up +alter function pgbouncer.get_auth owner to supabase_admin; +grant execute on function pgbouncer.get_auth(p_usename text) to postgres; + +-- migrate:down diff --git a/nix/tests/expected/security.out b/nix/tests/expected/security.out index 58207b605..97047d770 100644 --- a/nix/tests/expected/security.out +++ b/nix/tests/expected/security.out @@ -7,24 +7,25 @@ from pg_catalog.pg_proc p where p.proowner = (select oid from pg_catalog.pg_roles where rolname = 'supabase_admin') and p.prosecdef = true order by 1,2; - nspname | proname -----------+-------------------------------- - graphql | get_schema_version - graphql | increment_schema_version - pgsodium | disable_security_label_trigger - pgsodium | enable_security_label_trigger - pgsodium | get_key_by_id - pgsodium | get_key_by_name - pgsodium | get_named_keys - pgsodium | mask_role - pgsodium | update_mask - public | dblink_connect_u - public | dblink_connect_u - public | pgaudit_ddl_command_end - public | pgaudit_sql_drop - public | st_estimatedextent - public | st_estimatedextent - public | st_estimatedextent - repack | repack_trigger -(17 rows) + nspname | proname +-----------+-------------------------------- + graphql | get_schema_version + graphql | increment_schema_version + pgbouncer | get_auth + pgsodium | disable_security_label_trigger + pgsodium | enable_security_label_trigger + pgsodium | get_key_by_id + pgsodium | get_key_by_name + pgsodium | get_named_keys + pgsodium | mask_role + pgsodium | update_mask + public | dblink_connect_u + public | dblink_connect_u + public | pgaudit_ddl_command_end + public | pgaudit_sql_drop + public | st_estimatedextent + public | st_estimatedextent + public | st_estimatedextent + repack | repack_trigger +(18 rows) From dc011e64b4edbea0ffcddf23e65571ffc2787e3f Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:33:21 +0100 Subject: [PATCH 149/271] Update supautils.conf.j2 | added log_replication_commands to supautils (#1408) Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> --- ansible/files/postgresql_config/supautils.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 1edd4abe4..12762aff1 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -9,6 +9,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' -supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' +supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' From a64fda34783b650fd9bdfdc3d8b7409e2a9e66e9 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 13 Mar 2025 17:20:15 +0100 Subject: [PATCH 150/271] chore: bump gotrue to v2.170.0 (#1477) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index f235e6c31..a3ded86c6 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.044-orioledb" - postgres15: "15.8.1.051" + postgresorioledb-17: "17.0.1.045-orioledb" + postgres15: "15.8.1.052" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -22,8 +22,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.169.0 -gotrue_release_checksum: sha1:1419b94683aac7ddc30355408b8e8b79e61146c4 +gotrue_release: 2.170.0 +gotrue_release_checksum: sha1:a5741163de7d8da490c013cc8566c7210ed9f6fe aws_cli_release: "2.23.11" From d4a4bf362d6e661e687514460e390800d08c6742 Mon Sep 17 00:00:00 2001 From: jose-ledesma <52402874+jose-ledesma@users.noreply.github.com> Date: Fri, 14 Mar 2025 00:51:40 +0100 Subject: [PATCH 151/271] chore: update adminapi release (#1478) Co-authored-by: Jose Ledesma Co-authored-by: Div Arora --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a3ded86c6..5e7bfdc8c 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.045-orioledb" - postgres15: "15.8.1.052" + postgresorioledb-17: "17.0.1.046-orioledb" + postgres15: "15.8.1.053" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.74.0 +adminapi_release: 0.75.0 adminmgr_release: 0.24.1 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From f11520d8ccf7e619942240c60df1edf36566353c Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Fri, 14 Mar 2025 09:42:47 +0100 Subject: [PATCH 152/271] chore: bump wrappers version to v0.4.5 (#1460) * chore: bump wrappers version to v0.4.5 * chore: make unique ami name * change back release tag * increase release version --- Dockerfile-15 | 2 +- Dockerfile-orioledb-17 | 2 +- ansible/vars.yml | 4 ++-- nix/ext/wrappers/default.nix | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 5bc1d1468..6224767ff 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.3.0 +ARG wrappers_release=0.4.5 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 129fa400b..5f8fed70e 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.3.0 +ARG wrappers_release=0.4.5 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/ansible/vars.yml b/ansible/vars.yml index 5e7bfdc8c..435945901 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.046-orioledb" - postgres15: "15.8.1.053" + postgresorioledb-17: "17.0.1.047-orioledb" + postgres15: "15.8.1.054" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 5dda1992d..e51589eb4 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -4,7 +4,7 @@ , openssl , pkg-config , postgresql -, buildPgrxExtension_0_12_6 +, buildPgrxExtension_0_12_9 , cargo , darwin , jq @@ -12,21 +12,21 @@ , git }: let - rustVersion = "1.80.0"; + rustVersion = "1.81.0"; cargo = rust-bin.stable.${rustVersion}.default; in -buildPgrxExtension_0_12_6 rec { +buildPgrxExtension_0_12_9 rec { pname = "supabase-wrappers"; - version = "0.4.4"; + version = "0.4.5"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = ["0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; rev = "v${version}"; - hash = "sha256-QoGFJpq8PuvMM8SS+VZd7MlNl56uFivRjs1tCtwX+oE="; + hash = "sha256-IgDfVFROMCHYLZ/Iqj12MsQjPPCdRoH+3oi3Ki/iaRI="; }; nativeBuildInputs = [ pkg-config cargo git ]; From ce5251dd466ad9ebd01c0ab995e0b4887150f21e Mon Sep 17 00:00:00 2001 From: angelico Date: Fri, 14 Mar 2025 12:02:37 +0100 Subject: [PATCH 153/271] chore: add cleanup for qemu bootstrap (#1479) * chore: add cleanup for qemu bootstrap * chore: bump pg15 version --- ansible/vars.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 435945901..a81a519db 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.0.1.047-orioledb" - postgres15: "15.8.1.054" + postgres15: "15.8.1.055" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 0fe8b97c1..2f72c5f70 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -145,4 +145,5 @@ install_nix execute_stage2_playbook # we do not want to ship an initialized DB as this is performed as needed rm -rf /data/pgdata +clean_system cloud-init clean --logs From 132a51361fb18cf124e75dc8ec0785b21a014d57 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 17 Mar 2025 03:18:30 +0100 Subject: [PATCH 154/271] chore: create a programmatic listing of the commands that can be run (#1480) * chore: create a programmtic listing of the commands that can be run * chore: deactivate sync-exts-versions * chore: deprecate old migrate-postgres command --- flake.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 0ec405c67..3abdbafff 100644 --- a/flake.nix +++ b/flake.nix @@ -568,6 +568,21 @@ wrapProgram $out/bin/dbmate-tool \ --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} ''; + show-commands = pkgs.runCommand "show-commands" { + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ pkgs.nushell ]; + } '' + mkdir -p $out/bin + cat > $out/bin/show-commands << 'EOF' + #!${pkgs.nushell}/bin/nu + let json_output = (nix flake show --json --quiet --all-systems | from json) + let apps = ($json_output | get apps.${system}) + $apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" } + EOF + chmod +x $out/bin/show-commands + wrapProgram $out/bin/show-commands \ + --prefix PATH : ${pkgs.nushell}/bin + ''; update-readme = pkgs.runCommand "update-readme" { nativeBuildInputs = [ pkgs.makeWrapper ]; buildInputs = [ pkgs.nushell ]; @@ -831,8 +846,8 @@ start-server = mkApp "start-server" "start-postgres-server"; start-client = mkApp "start-client" "start-postgres-client"; start-replica = mkApp "start-replica" "start-postgres-replica"; - migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; - sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; + # migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; + # sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; pg-restore = mkApp "pg-restore" "pg-restore"; local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; From de733aa77d2978cba230260c01905684fba00156 Mon Sep 17 00:00:00 2001 From: angelico Date: Mon, 17 Mar 2025 10:43:14 +0100 Subject: [PATCH 155/271] chore: bump pg 17 oriole (#1482) --- ansible/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a81a519db..381fb9510 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,7 +8,7 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.047-orioledb" + postgresorioledb-17: "17.0.1.048-orioledb" postgres15: "15.8.1.055" # Non Postgres Extensions From cfaabdd748c6aebe92c26a9511cccbdca8da815f Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 18 Mar 2025 03:31:52 +0100 Subject: [PATCH 156/271] chore: update README with nix run .#update-readme (#1481) --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 254e62b73..1bf35b29c 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,8 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | | [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | | [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | -| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | [1.5.9](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | GraphQL support for PostreSQL | +| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | | [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | | [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | @@ -39,7 +38,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [plv8](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | [3.1.10](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | V8 Engine Javascript Procedural Language add-on for PostgreSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | [0.4.5](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | | [timescaledb-apache](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | [2.16.1](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | Scales PostgreSQL for time-series data via automatic partitioning across time and space | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | @@ -52,9 +51,8 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | | [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | orioledb | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | | [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | -| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | [1.5.9](https://github.com/supabase/pg_graphql/archive/v1.5.9.tar.gz) | GraphQL support for PostreSQL | +| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | | [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | | [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | @@ -74,7 +72,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | [0.4.5](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | From bf7327c13554adaf0d18841f956294eee83027ae Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 18 Mar 2025 14:57:25 +0100 Subject: [PATCH 157/271] fix: protect plpgsql --- ansible/files/postgresql_config/supautils.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 12762aff1..51f29457c 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -5,7 +5,8 @@ supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.ide # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 # omitted because doesn't require superuser: pgmq -supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' +# omitted because protected: plpgsql +supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' From 70657e2f3b7ea7ac66031ab324f4db20c937d67f Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 18 Mar 2025 15:46:08 -0500 Subject: [PATCH 158/271] feature: wal-g v 3 (#1456) * feature: wal-g v 3 * chore: install, symlink * chore: wal-g user and groups in stage 1 * chore: bump versions to test wal-g * chore: build wal-g in ci and copy to binary cache on success * chore: minor correction * chore: maintainer * chore: release wal-g 3 --- ansible/playbook.yml | 2 +- ansible/tasks/setup-wal-g.yml | 142 +++++++++++++++++++--------------- ansible/vars.yml | 5 +- docker/nix/build_nix.sh | 4 +- flake.nix | 2 + nix/wal-g.nix | 58 ++++++++++++++ 6 files changed, 144 insertions(+), 69 deletions(-) create mode 100644 nix/wal-g.nix diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 5c5f8da3a..5c8a9f70e 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -38,7 +38,7 @@ - name: Install WAL-G import_tasks: tasks/setup-wal-g.yml - when: debpkg_mode or nixpkg_mode + when: debpkg_mode or nixpkg_mode or stage2_nix - name: Install Gotrue import_tasks: tasks/setup-gotrue.yml diff --git a/ansible/tasks/setup-wal-g.yml b/ansible/tasks/setup-wal-g.yml index bbc64cdde..9907d3ee7 100644 --- a/ansible/tasks/setup-wal-g.yml +++ b/ansible/tasks/setup-wal-g.yml @@ -1,72 +1,73 @@ # Downloading dependencies -- name: wal-g dependencies - become: yes - apt: - pkg: - - libbrotli-dev - - liblzo2-dev - - libsodium-dev - - cmake +# - name: wal-g dependencies +# become: yes +# apt: +# pkg: +# - libbrotli-dev +# - liblzo2-dev +# - libsodium-dev +# - cmake # install go dependency for WAL-G -- name: wal-g go dependency - get_url: - url: "https://golang.org/dl/go{{ golang_version }}.linux-{{ platform }}.tar.gz" - dest: /tmp - checksum: "{{ golang_version_checksum[platform] }}" - timeout: 60 +# - name: wal-g go dependency +# get_url: +# url: "https://golang.org/dl/go{{ golang_version }}.linux-{{ platform }}.tar.gz" +# dest: /tmp +# checksum: "{{ golang_version_checksum[platform] }}" +# timeout: 60 -- name: unpack go archive - unarchive: - remote_src: yes - src: "/tmp/go{{ golang_version }}.linux-{{ platform }}.tar.gz" - dest: /usr/local +# - name: unpack go archive +# unarchive: +# remote_src: yes +# src: "/tmp/go{{ golang_version }}.linux-{{ platform }}.tar.gz" +# dest: /usr/local -# Download WAL-G -- name: wal-g - download latest version - git: - repo: https://github.com/wal-g/wal-g.git - dest: /tmp/wal-g - version: "v{{ wal_g_release }}" - become: yes +# # Download WAL-G +# - name: wal-g - download latest version +# git: +# repo: https://github.com/wal-g/wal-g.git +# dest: /tmp/wal-g +# version: "v{{ wal_g_release }}" +# become: yes -- name: wal-g - pg_clean - make: - chdir: /tmp/wal-g - target: pg_clean - params: - GOBIN: "/usr/local/bin" - PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" - USE_LIBSODIUM: true - become: yes - ignore_errors: yes +# - name: wal-g - pg_clean +# make: +# chdir: /tmp/wal-g +# target: pg_clean +# params: +# GOBIN: "/usr/local/bin" +# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" +# USE_LIBSODIUM: true +# become: yes +# ignore_errors: yes -- name: wal-g - deps - make: - chdir: /tmp/wal-g - target: deps - params: - GOBIN: "/usr/local/bin" - PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" - USE_LIBSODIUM: true - become: yes - ignore_errors: yes +# - name: wal-g - deps +# make: +# chdir: /tmp/wal-g +# target: deps +# params: +# GOBIN: "/usr/local/bin" +# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" +# USE_LIBSODIUM: true +# become: yes +# ignore_errors: yes -- name: wal-g - build and install - community.general.make: - chdir: /tmp/wal-g - target: pg_install - jobs: "{{ parallel_jobs | default(omit) }}" - params: - GOBIN: "/usr/local/bin" - PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" - USE_LIBSODIUM: true - become: yes +# - name: wal-g - build and install +# community.general.make: +# chdir: /tmp/wal-g +# target: pg_install +# jobs: "{{ parallel_jobs | default(omit) }}" +# params: +# GOBIN: "/usr/local/bin" +# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" +# USE_LIBSODIUM: true +# become: yes - name: Create wal-g group group: name: wal-g state: present + when: nixpkg_mode - name: Create wal-g user user: @@ -75,7 +76,7 @@ comment: WAL-G user group: wal-g groups: wal-g, postgres - + when: nixpkg_mode - name: Create a config directory owned by wal-g file: path: /etc/wal-g @@ -83,7 +84,22 @@ owner: wal-g group: wal-g mode: '0770' + when: nixpkg_mode +- name: Install wal-g from nix binary cache + become: yes + shell: | + sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#wal-g" + when: stage2_nix + +- name: Create symlink for wal-g from Nix profile to /usr/local/bin + ansible.builtin.file: + src: /home/wal-g/.nix-profile/bin/wal-g + dest: /usr/local/bin/wal-g + state: link + force: yes # This will replace existing file/symlink if it exists + become: yes # Need sudo to write to /usr/local/bin + when: stage2_nix - name: Create /etc/wal-g/config.json file: path: /etc/wal-g/config.json @@ -91,6 +107,7 @@ owner: wal-g group: wal-g mode: '0664' + when: stage2_nix - name: Move custom wal-g.conf file to /etc/postgresql-custom/wal-g.conf template: @@ -99,6 +116,7 @@ mode: 0664 owner: postgres group: postgres + when: stage2_nix - name: Add script to be run for restore_command template: @@ -107,6 +125,7 @@ mode: 0500 owner: postgres group: postgres + when: stage2_nix - name: Add helper script for wal_fetch.sh template: @@ -114,6 +133,7 @@ dest: /root/wal_change_ownership.sh mode: 0700 owner: root + when: stage2_nix - name: Include /etc/postgresql-custom/wal-g.conf in postgresql.conf become: yes @@ -121,10 +141,4 @@ path: /etc/postgresql/postgresql.conf regexp: "#include = '/etc/postgresql-custom/wal-g.conf'" replace: "include = '/etc/postgresql-custom/wal-g.conf'" - -# Clean up Go -- name: Uninstall Go - become: yes - file: - path: /usr/local/go - state: absent + when: stage2_nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 381fb9510..d8e963b70 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.048-orioledb" - postgres15: "15.8.1.055" + postgresorioledb-17: "17.0.1.049-orioledb" + postgres15: "15.8.1.056" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -45,7 +45,6 @@ kong_deb_checksum: sha1:2086f6ccf8454fe64435252fea4d29d736d7ec61 nginx_release: 1.22.0 nginx_release_checksum: sha1:419efb77b80f165666e2ee406ad8ae9b845aba93 -wal_g_release: "2.0.1" postgres_exporter_release: "0.15.0" postgres_exporter_release_checksum: diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index b0eef9863..48286907e 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -13,8 +13,9 @@ nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link nix build .#psql_15/bin -o psql_15 nix build .#psql_orioledb-17/bin -o psql_orioledb_17 - +nix build .#wal-g -o wal-g # Copy to S3 +nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g 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 if [ "$SYSTEM" = "aarch64-linux" ]; then @@ -26,4 +27,5 @@ if [ "$SYSTEM" = "aarch64-linux" ]; then nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g fi diff --git a/flake.nix b/flake.nix index 3abdbafff..ba7ad70ec 100644 --- a/flake.nix +++ b/flake.nix @@ -87,6 +87,7 @@ 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 { }; + wal-g = pkgs.callPackage ./nix/wal-g.nix { }; # Our list of PostgreSQL extensions which come from upstream Nixpkgs. # These are maintained upstream and can easily be used here just by # listing their name. Anytime the version of nixpkgs is upgraded, these @@ -405,6 +406,7 @@ # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_orioledb-17 = postgresVersions.psql_orioledb-17; + wal-g = wal-g; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; inherit postgresql_15 postgresql_orioledb-17; diff --git a/nix/wal-g.nix b/nix/wal-g.nix new file mode 100644 index 000000000..13f2bbc90 --- /dev/null +++ b/nix/wal-g.nix @@ -0,0 +1,58 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + brotli, + libsodium, + installShellFiles, +}: + +buildGoModule rec { + pname = "wal-g"; + version = "3.0.5"; + + src = fetchFromGitHub { + owner = "wal-g"; + repo = "wal-g"; + rev = "v${version}"; + sha256 = "sha256-wVr0L2ZXMuEo6tc2ajNzPinVQ8ZVzNOSoaHZ4oFsA+U="; + }; + + vendorHash = "sha256-YDLAmRfDl9TgbabXj/1rxVQ052NZDg3IagXVTe5i9dw="; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = [ + brotli + libsodium + ]; + + subPackages = [ "main/pg" ]; + + tags = [ + "brotli" + "libsodium" + ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/wal-g/wal-g/cmd/pg.walgVersion=${version}" + "-X github.com/wal-g/wal-g/cmd/pg.gitRevision=${src.rev}" + ]; + + postInstall = '' + mv $out/bin/pg $out/bin/wal-g + installShellCompletion --cmd wal-g \ + --bash <($out/bin/wal-g completion bash) \ + --zsh <($out/bin/wal-g completion zsh) + ''; + + meta = with lib; { + homepage = "https://github.com/wal-g/wal-g"; + license = licenses.asl20; + description = "Archival restoration tool for PostgreSQL"; + mainProgram = "wal-g"; + maintainers = [ samrose ]; + }; +} From 01978ef405269c1db5d35fb8210e1e7df1f558f2 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:45:12 +0800 Subject: [PATCH 159/271] feat: reland vault w/o pgsodium (#1452) * Reapply "feat: vault sans pgsodium" This reverts commit 447f4492258babcc57ca0307588814016835d24e. * chore: update schema snapshots * chore: print regress diffs for easier debugging * chore: remove pgsodium priv checks * fix: move it out of if else * chore: bump version * chore: bump version --- .../pg_upgrade_scripts/complete.sh | 37 +++++++++ .../postgresql_config/postgresql.conf.j2 | 2 +- .../supabase_vault/after-create.sql | 3 + ansible/files/sodium_extension.sql | 6 -- ansible/tasks/test-image.yml | 23 +++++- ansible/vars.yml | 4 +- .../files/unit-tests/unit-test-01.sql | 10 +-- flake.nix | 78 +++++++++++-------- migrations/schema-15.sql | 67 ---------------- migrations/schema-orioledb-17.sql | 67 ---------------- migrations/schema.sql | 67 ---------------- migrations/tests/database/privs.sql | 4 - nix/ext/vault.nix | 13 ++-- nix/tests/expected/security.out | 4 +- nix/tests/expected/z_15_ext_interface.out | 16 +++- nix/tests/expected/z_17_ext_interface.out | 16 +++- nix/tests/postgresql.conf.in | 3 +- 17 files changed, 149 insertions(+), 271 deletions(-) create mode 100644 ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql delete mode 100644 ansible/files/sodium_extension.sql diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 515c490f6..cd6c1f066 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -152,6 +152,43 @@ EOF run_sql -c "update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';" fi + # Patch to handle upgrading to pgsodium-less Vault + REENCRYPT_VAULT_SECRETS_QUERY=$(cat < - sed -i.bak - -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + sed -i.bak + -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + -e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/' + -e 's/\(shared_preload_libraries = '\''.*\), *supabase_vault'\''/\1'\''/' -e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/' /etc/postgresql/postgresql.conf when: debpkg_mode or stage2_nix +- name: Verify pgsodium and vault removal from config + become: yes + become_user: postgres + shell: + cmd: | + FOUND=$(grep -E "shared_preload_libraries.*pgsodium|shared_preload_libraries.*supabase_vault|^pgsodium\.getkey_script" /etc/postgresql/postgresql.conf) + if [ ! -z "$FOUND" ]; then + echo "Found unremoved references:" + echo "$FOUND" + exit 1 + fi + register: verify_result + failed_when: verify_result.rc != 0 + when: debpkg_mode or stage2_nix + - name: Start Postgres Database to load all extensions. become: yes become_user: postgres diff --git a/ansible/vars.yml b/ansible/vars.yml index d8e963b70..88fe86749 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.049-orioledb" - postgres15: "15.8.1.056" + postgresorioledb-17: "17.0.1.050-orioledb" + postgres15: "15.8.1.057" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/files/unit-tests/unit-test-01.sql b/ebssurrogate/files/unit-tests/unit-test-01.sql index f3d47459f..c466af12e 100644 --- a/ebssurrogate/files/unit-tests/unit-test-01.sql +++ b/ebssurrogate/files/unit-tests/unit-test-01.sql @@ -17,7 +17,6 @@ BEGIN extension_array := ARRAY[ 'plpgsql', 'pg_stat_statements', - 'pgsodium', 'pgtap', 'pg_graphql', 'pgcrypto', @@ -30,7 +29,6 @@ BEGIN extension_array := ARRAY[ 'plpgsql', 'pg_stat_statements', - 'pgsodium', 'pgtap', 'pg_graphql', 'pgcrypto', @@ -44,7 +42,7 @@ BEGIN PERFORM set_config('myapp.extensions', array_to_string(extension_array, ','), false); END $$; -SELECT plan(8); +SELECT no_plan(); SELECT extensions_are( string_to_array(current_setting('myapp.extensions'), ',')::text[] @@ -56,9 +54,5 @@ SELECT has_schema('pg_catalog'); SELECT has_schema('information_schema'); SELECT has_schema('public'); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_decrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_encrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_keygen', array[]::text[], 'service_role', array['EXECUTE']); - SELECT * FROM finish(); -ROLLBACK; \ No newline at end of file +ROLLBACK; diff --git a/flake.nix b/flake.nix index ba7ad70ec..dadc55253 100644 --- a/flake.nix +++ b/flake.nix @@ -606,42 +606,49 @@ sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = basePackages.pg_regress; - getkey-script = pkgs.writeScriptBin "pgsodium-getkey" '' - #!${pkgs.bash}/bin/bash - set -euo pipefail - - TMPDIR_BASE=$(mktemp -d) - - if [[ "$(uname)" == "Darwin" ]]; then - KEY_DIR="/private/tmp/pgsodium" - else - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - fi - KEY_FILE="$KEY_DIR/pgsodium.key" - - if ! mkdir -p "$KEY_DIR" 2>/dev/null; then - echo "Error: Could not create key directory $KEY_DIR" >&2 - exit 1 - fi - chmod 1777 "$KEY_DIR" - - if [[ ! -f "$KEY_FILE" ]]; then - if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then - if ! (openssl rand -hex 32 > "$KEY_FILE"); then - echo "00000000000000000000000000000000" > "$KEY_FILE" - echo "Warning: Using fallback key" >&2 + getkey-script = pkgs.stdenv.mkDerivation { + name = "pgsodium-getkey"; + buildCommand = '' + mkdir -p $out/bin + cat > $out/bin/pgsodium-getkey << 'EOF' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + TMPDIR_BASE=$(mktemp -d) + + if [[ "$(uname)" == "Darwin" ]]; then + KEY_DIR="/private/tmp/pgsodium" + else + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" + fi + KEY_FILE="$KEY_DIR/pgsodium.key" + + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then + echo "Error: Could not create key directory $KEY_DIR" >&2 + exit 1 + fi + chmod 1777 "$KEY_DIR" + + if [[ ! -f "$KEY_FILE" ]]; then + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then + if ! (openssl rand -hex 32 > "$KEY_FILE"); then + echo "00000000000000000000000000000000" > "$KEY_FILE" + echo "Warning: Using fallback key" >&2 + fi fi + chmod 644 "$KEY_FILE" fi - chmod 644 "$KEY_FILE" - fi - - if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then - cat "$KEY_FILE" - else - echo "Error: Cannot read key file $KEY_FILE" >&2 - exit 1 - fi - ''; + + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then + cat "$KEY_FILE" + else + echo "Error: Cannot read key file $KEY_FILE" >&2 + exit 1 + fi + EOF + chmod +x $out/bin/pgsodium-getkey + ''; + }; # Use the shared setup but with a test-specific name start-postgres-server-bin = makePostgresDevSetup { @@ -710,6 +717,8 @@ echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf + echo "Checking shared_preload_libraries setting:" + grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf # Remove timescaledb if running orioledb-17 check echo "I AM ${pgpkg.version}====================================================" if [[ "${pgpkg.version}" == *"17"* ]]; then @@ -808,6 +817,7 @@ --user=supabase_admin \ ${builtins.concatStringsSep " " sortedTestList}; then echo "pg_regress tests failed" + cat $out/regression_output/regression.diffs exit 1 fi diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 33bba060f..802fbae79 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -44,27 +44,6 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA pgsodium; - - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -582,28 +561,6 @@ END $$; --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - SET default_tablespace = ''; SET default_table_access_method = heap; @@ -790,30 +747,6 @@ CREATE TABLE storage.objects ( ); --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT secrets.id, - secrets.name, - secrets.description, - secrets.secret, - CASE - WHEN (secrets.secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (secrets.key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) - END - END AS decrypted_secret, - secrets.key_id, - secrets.nonce, - secrets.created_at, - secrets.updated_at - FROM vault.secrets; - - -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index ed5627c7c..6c2d37f46 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -45,27 +45,6 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA pgsodium; - - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -597,28 +576,6 @@ END $$; --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - SET default_tablespace = ''; SET default_table_access_method = orioledb; @@ -805,30 +762,6 @@ CREATE TABLE storage.objects ( ); --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT id, - name, - description, - secret, - CASE - WHEN (secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secret, 'base64'::text), convert_to(((((id)::text || description) || (created_at)::text) || (updated_at)::text), 'utf8'::name), key_id, nonce), 'utf8'::name) - END - END AS decrypted_secret, - key_id, - nonce, - created_at, - updated_at - FROM vault.secrets; - - -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/schema.sql b/migrations/schema.sql index 1bff8b9d8..cb031f797 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -44,27 +44,6 @@ CREATE SCHEMA graphql_public; CREATE SCHEMA pgbouncer; --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA pgsodium; - - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - -- -- Name: realtime; Type: SCHEMA; Schema: -; Owner: - -- @@ -574,28 +553,6 @@ END $$; --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: - --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - SET default_tablespace = ''; SET default_table_access_method = heap; @@ -782,30 +739,6 @@ CREATE TABLE storage.objects ( ); --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: - --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT secrets.id, - secrets.name, - secrets.description, - secrets.secret, - CASE - WHEN (secrets.secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (secrets.key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) - END - END AS decrypted_secret, - secrets.key_id, - secrets.nonce, - secrets.created_at, - secrets.updated_at - FROM vault.secrets; - - -- -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - -- diff --git a/migrations/tests/database/privs.sql b/migrations/tests/database/privs.sql index d164e0cb1..ea4f1318a 100644 --- a/migrations/tests/database/privs.sql +++ b/migrations/tests/database/privs.sql @@ -2,10 +2,6 @@ SELECT database_privs_are( 'postgres', 'postgres', ARRAY['CONNECT', 'TEMPORARY', 'CREATE'] ); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_decrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_encrypt', array['bytea', 'bytea', 'uuid', 'bytea'], 'service_role', array['EXECUTE']); -SELECT function_privs_are('pgsodium', 'crypto_aead_det_keygen', array[]::text[], 'service_role', array['EXECUTE']); - -- Verify public schema privileges SELECT schema_privs_are('public', 'postgres', array['CREATE', 'USAGE']); SELECT schema_privs_are('public', 'anon', array['USAGE']); diff --git a/nix/ext/vault.nix b/nix/ext/vault.nix index c822fcd51..2cbd7e7a9 100644 --- a/nix/ext/vault.nix +++ b/nix/ext/vault.nix @@ -1,23 +1,24 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ lib, stdenv, fetchFromGitHub, libsodium, postgresql }: stdenv.mkDerivation rec { pname = "vault"; - version = "0.2.9"; + version = "0.3.1"; - buildInputs = [ postgresql ]; + buildInputs = [ libsodium postgresql ]; src = fetchFromGitHub { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-kXTngBW4K6FkZM8HvJG2Jha6OQqbejhnk7tchxy031I="; + hash = "sha256-MC87bqgtynnDhmNZAu96jvfCpsGDCPB0g5TZfRQHd30="; }; installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp sql/*.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + install -D *${postgresql.dlSuffix} $out/lib + install -D -t $out/share/postgresql/extension sql/*.sql + install -D -t $out/share/postgresql/extension *.control ''; meta = with lib; { diff --git a/nix/tests/expected/security.out b/nix/tests/expected/security.out index 97047d770..81b6b8705 100644 --- a/nix/tests/expected/security.out +++ b/nix/tests/expected/security.out @@ -27,5 +27,7 @@ order by 1,2; public | st_estimatedextent public | st_estimatedextent repack | repack_trigger -(18 rows) + vault | create_secret + vault | update_secret +(20 rows) diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 9cc143237..566da6aed 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -4748,6 +4748,9 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text + supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record @@ -5224,7 +5227,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5054 rows) +(5057 rows) /* @@ -6032,6 +6035,15 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid + supabase_vault | vault | decrypted_secrets | created_at + supabase_vault | vault | decrypted_secrets | decrypted_secret + supabase_vault | vault | decrypted_secrets | description + supabase_vault | vault | decrypted_secrets | id + supabase_vault | vault | decrypted_secrets | key_id + supabase_vault | vault | decrypted_secrets | name + supabase_vault | vault | decrypted_secrets | nonce + supabase_vault | vault | decrypted_secrets | secret + supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -6355,5 +6367,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1097 rows) +(1106 rows) diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 0380ccd84..92ce9ac2b 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -4705,6 +4705,9 @@ order by sslinfo | public | ssl_issuer_dn | | text sslinfo | public | ssl_issuer_field | text | text sslinfo | public | ssl_version | | text + supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void tablefunc | public | connectby | text, text, text, text, integer | SETOF record @@ -4904,7 +4907,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4746 rows) +(4749 rows) /* @@ -5319,6 +5322,15 @@ order by postgis_topology | topology | topology | name postgis_topology | topology | topology | precision postgis_topology | topology | topology | srid + supabase_vault | vault | decrypted_secrets | created_at + supabase_vault | vault | decrypted_secrets | decrypted_secret + supabase_vault | vault | decrypted_secrets | description + supabase_vault | vault | decrypted_secrets | id + supabase_vault | vault | decrypted_secrets | key_id + supabase_vault | vault | decrypted_secrets | name + supabase_vault | vault | decrypted_secrets | nonce + supabase_vault | vault | decrypted_secrets | secret + supabase_vault | vault | decrypted_secrets | updated_at supabase_vault | vault | secrets | created_at supabase_vault | vault | secrets | description supabase_vault | vault | secrets | id @@ -5336,5 +5348,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(398 rows) +(407 rows) diff --git a/nix/tests/postgresql.conf.in b/nix/tests/postgresql.conf.in index ba1df515b..e4f844d07 100644 --- a/nix/tests/postgresql.conf.in +++ b/nix/tests/postgresql.conf.in @@ -718,7 +718,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter' # (change requires restart) +shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, supabase_vault' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use @@ -795,6 +795,7 @@ jit_provider = 'llvmjit' # JIT library to use # Add settings for extensions here pgsodium.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' +vault.getkey_script = '@PGSODIUM_GETKEY_SCRIPT@' auto_explain.log_min_duration = 10s cron.database_name = 'postgres' From d1cb4cafed449347b11476cbcc1aeb8edc62cf90 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 20 Mar 2025 16:39:44 -0400 Subject: [PATCH 160/271] Sam/wal g 2 and 3 (#1485) * feature: wal-g v 3 and v 2 * chore: install, symlink * chore: bump versions to test wal-g * chore: build wal-g in ci and copy to binary cache on success * chore: release wal-g 3 * chore: cover installing both versions of wal-g 2 and 3 2 as default * chore: add the "v" as requested * major version on pkg name to avoid collision can alias on install * chore: cover in package build as well * chore: better support for both versions, symlink default to v3 on new image * chore: cleanup file * chore: bump version for release * chore: update dockerfiles * chore: get aliases right * chore: remove rendundant * chore: testing suffix * chore: bump for release --- Dockerfile-15 | 20 +++--- Dockerfile-orioledb-17 | 22 +++--- ansible/tasks/setup-wal-g.yml | 91 ++++++------------------ ansible/vars.yml | 4 +- docker/nix/build_nix.sh | 11 +-- flake.nix | 5 +- nix/wal-g.nix | 127 ++++++++++++++++++++-------------- 7 files changed, 134 insertions(+), 146 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 6224767ff..7b1d7099f 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -120,14 +120,14 @@ ENV PGDATA=/var/lib/postgresql/data #################### FROM base as walg ARG wal_g_release -# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz -RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ - apt-get update && apt-get install -y --no-install-recommends curl && \ - curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \ - tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ - rm -rf /tmp/wal-g.tar.gz && \ - mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g +WORKDIR /nixpg + +RUN nix profile install .#wal-g-3 && \ + ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g +RUN nix store gc + +WORKDIR / # #################### # # Download gosu for easy step-down from root # #################### @@ -179,7 +179,8 @@ RUN sed -i \ -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ - echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ @@ -219,4 +220,7 @@ ENV LC_ALL en_US.UTF-8 ENV LC_CTYPE=C.UTF-8 ENV LC_COLLATE=C.UTF-8 ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive +RUN mkdir -p /usr/share/postgresql/extension/ && \ + ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ + chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 5f8fed70e..fe9b902cb 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -37,7 +37,7 @@ 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.0 -ARG wal_g_release=2.0.1 +ARG wal_g_release=3.0.5 FROM ubuntu:focal as base @@ -118,14 +118,15 @@ ENV PGDATA=/var/lib/postgresql/data #################### FROM base as walg ARG wal_g_release -# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz -RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \ - apt-get update && apt-get install -y --no-install-recommends curl && \ - curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \ - tar -xvf /tmp/wal-g.tar.gz -C /tmp && \ - rm -rf /tmp/wal-g.tar.gz && \ - mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g +WORKDIR /nixpg + +RUN nix profile install .#wal-g-3 && \ + ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g + +RUN nix store gc + +WORKDIR / # #################### # # Download gosu for easy step-down from root # #################### @@ -178,6 +179,7 @@ RUN sed -i \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ @@ -231,4 +233,8 @@ ENV LC_ALL en_US.UTF-8 ENV LC_CTYPE=C.UTF-8 ENV LC_COLLATE=C.UTF-8 ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive +RUN mkdir -p /usr/share/postgresql/extension/ && \ + ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ + chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh + CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/ansible/tasks/setup-wal-g.yml b/ansible/tasks/setup-wal-g.yml index 9907d3ee7..5ba268cf9 100644 --- a/ansible/tasks/setup-wal-g.yml +++ b/ansible/tasks/setup-wal-g.yml @@ -1,68 +1,3 @@ -# Downloading dependencies -# - name: wal-g dependencies -# become: yes -# apt: -# pkg: -# - libbrotli-dev -# - liblzo2-dev -# - libsodium-dev -# - cmake - -# install go dependency for WAL-G -# - name: wal-g go dependency -# get_url: -# url: "https://golang.org/dl/go{{ golang_version }}.linux-{{ platform }}.tar.gz" -# dest: /tmp -# checksum: "{{ golang_version_checksum[platform] }}" -# timeout: 60 - -# - name: unpack go archive -# unarchive: -# remote_src: yes -# src: "/tmp/go{{ golang_version }}.linux-{{ platform }}.tar.gz" -# dest: /usr/local - -# # Download WAL-G -# - name: wal-g - download latest version -# git: -# repo: https://github.com/wal-g/wal-g.git -# dest: /tmp/wal-g -# version: "v{{ wal_g_release }}" -# become: yes - -# - name: wal-g - pg_clean -# make: -# chdir: /tmp/wal-g -# target: pg_clean -# params: -# GOBIN: "/usr/local/bin" -# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" -# USE_LIBSODIUM: true -# become: yes -# ignore_errors: yes - -# - name: wal-g - deps -# make: -# chdir: /tmp/wal-g -# target: deps -# params: -# GOBIN: "/usr/local/bin" -# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" -# USE_LIBSODIUM: true -# become: yes -# ignore_errors: yes - -# - name: wal-g - build and install -# community.general.make: -# chdir: /tmp/wal-g -# target: pg_install -# jobs: "{{ parallel_jobs | default(omit) }}" -# params: -# GOBIN: "/usr/local/bin" -# PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" -# USE_LIBSODIUM: true -# become: yes - - name: Create wal-g group group: name: wal-g @@ -86,20 +21,36 @@ mode: '0770' when: nixpkg_mode -- name: Install wal-g from nix binary cache +- name: Install wal-g 2 from nix binary cache become: yes shell: | - sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#wal-g" + sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#wal-g-2" when: stage2_nix -- name: Create symlink for wal-g from Nix profile to /usr/local/bin +- name: Install wal-g 3 from nix binary cache + become: yes + shell: | + sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#wal-g-3" + when: stage2_nix + +- name: Create symlink for wal-g-3 from Nix profile to /usr/local/bin ansible.builtin.file: - src: /home/wal-g/.nix-profile/bin/wal-g - dest: /usr/local/bin/wal-g + src: /home/wal-g/.nix-profile/bin/wal-g-3 + dest: /usr/local/bin/wal-g-v3 state: link force: yes # This will replace existing file/symlink if it exists become: yes # Need sudo to write to /usr/local/bin when: stage2_nix + +- name: Create symlink to make wal-g-v2 the default wal-g + ansible.builtin.file: + src: /usr/local/bin/wal-g-v2 + dest: /usr/local/bin/wal-g + state: link + force: yes + become: yes + when: stage2_nix + - name: Create /etc/wal-g/config.json file: path: /etc/wal-g/config.json diff --git a/ansible/vars.yml b/ansible/vars.yml index 88fe86749..495b65858 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.050-orioledb" - postgres15: "15.8.1.057" + postgresorioledb-17: "17.0.1.051-orioledb" + postgres15: "15.8.1.058" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index 48286907e..135031afc 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -10,12 +10,14 @@ 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 .#psql_15/bin -o psql_15 +nix build .#psql_15/bin -o psql_15 -L -nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -nix build .#wal-g -o wal-g +nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -L +nix build .#wal-g-2 -o wal-g-2 -L +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 +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 ./psql_15 nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 if [ "$SYSTEM" = "aarch64-linux" ]; then @@ -27,5 +29,4 @@ if [ "$SYSTEM" = "aarch64-linux" ]; then nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g fi diff --git a/flake.nix b/flake.nix index dadc55253..b36ccda57 100644 --- a/flake.nix +++ b/flake.nix @@ -87,7 +87,7 @@ 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 { }; - wal-g = pkgs.callPackage ./nix/wal-g.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 # listing their name. Anytime the version of nixpkgs is upgraded, these @@ -406,7 +406,8 @@ # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_orioledb-17 = postgresVersions.psql_orioledb-17; - wal-g = wal-g; + wal-g-2 = wal-g-2; + wal-g-3 = wal-g-3; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; inherit postgresql_15 postgresql_orioledb-17; diff --git a/nix/wal-g.nix b/nix/wal-g.nix index 13f2bbc90..764b1c9e4 100644 --- a/nix/wal-g.nix +++ b/nix/wal-g.nix @@ -1,58 +1,83 @@ -{ - lib, - buildGoModule, - fetchFromGitHub, - brotli, - libsodium, - installShellFiles, +{ lib +, buildGoModule +, fetchFromGitHub +, brotli +, libsodium +, installShellFiles +, }: -buildGoModule rec { - pname = "wal-g"; - version = "3.0.5"; +let + walGCommon = { version, vendorHash, sha256, majorVersion }: + buildGoModule rec { + pname = "wal-g-${majorVersion}"; + inherit version; - src = fetchFromGitHub { - owner = "wal-g"; - repo = "wal-g"; - rev = "v${version}"; - sha256 = "sha256-wVr0L2ZXMuEo6tc2ajNzPinVQ8ZVzNOSoaHZ4oFsA+U="; + src = fetchFromGitHub { + owner = "wal-g"; + repo = "wal-g"; + rev = "v${version}"; + inherit sha256; + }; + + inherit vendorHash; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = [ + brotli + libsodium + ]; + + subPackages = [ "main/pg" ]; + + tags = [ + "brotli" + "libsodium" + ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/wal-g/wal-g/cmd/pg.walgVersion=${version}" + "-X github.com/wal-g/wal-g/cmd/pg.gitRevision=${src.rev}" + ]; + + postInstall = '' + mv $out/bin/pg $out/bin/wal-g-${majorVersion} + + # Create version-specific completions + mkdir -p $out/share/bash-completion/completions + $out/bin/wal-g-${majorVersion} completion bash > $out/share/bash-completion/completions/wal-g-${majorVersion} + + mkdir -p $out/share/zsh/site-functions + $out/bin/wal-g-${majorVersion} completion zsh > $out/share/zsh/site-functions/_wal-g-${majorVersion} + + ''; + + meta = with lib; { + homepage = "https://github.com/wal-g/wal-g"; + license = licenses.asl20; + description = "Archival restoration tool for PostgreSQL"; + mainProgram = "wal-g-${majorVersion}"; + maintainers = [ samrose ]; + }; + }; +in +{ + # wal-g v2.0.1 + wal-g-2 = walGCommon { + version = "2.0.1"; + sha256 = "sha256-5mwA55aAHwEFabGZ6c3pi8NLcYofvoe4bb/cFj7NWok="; + vendorHash = "sha256-BbQuY6r30AkxlCZjY8JizaOrqEBdv7rIQet9KQwYB/g="; + majorVersion = "2"; }; - vendorHash = "sha256-YDLAmRfDl9TgbabXj/1rxVQ052NZDg3IagXVTe5i9dw="; - - nativeBuildInputs = [ installShellFiles ]; - - buildInputs = [ - brotli - libsodium - ]; - - subPackages = [ "main/pg" ]; - - tags = [ - "brotli" - "libsodium" - ]; - - ldflags = [ - "-s" - "-w" - "-X github.com/wal-g/wal-g/cmd/pg.walgVersion=${version}" - "-X github.com/wal-g/wal-g/cmd/pg.gitRevision=${src.rev}" - ]; - - postInstall = '' - mv $out/bin/pg $out/bin/wal-g - installShellCompletion --cmd wal-g \ - --bash <($out/bin/wal-g completion bash) \ - --zsh <($out/bin/wal-g completion zsh) - ''; - - meta = with lib; { - homepage = "https://github.com/wal-g/wal-g"; - license = licenses.asl20; - description = "Archival restoration tool for PostgreSQL"; - mainProgram = "wal-g"; - maintainers = [ samrose ]; + # wal-g v3.0.5 + wal-g-3 = walGCommon { + version = "3.0.5"; + sha256 = "sha256-wVr0L2ZXMuEo6tc2ajNzPinVQ8ZVzNOSoaHZ4oFsA+U="; + vendorHash = "sha256-YDLAmRfDl9TgbabXj/1rxVQ052NZDg3IagXVTe5i9dw="; + majorVersion = "3"; }; } From fc3508d73b27acc501e1e87daa8e49af4642a76d Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 21 Mar 2025 07:29:36 +0800 Subject: [PATCH 161/271] chore: add PG team as codeowners on the repo (#1483) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0576d01a0..3dc75ee31 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ -* @supabase/backend +* @supabase/backend @supabase/postgres migrations/ @supabase/cli @supabase/backend docker/orioledb @supabase/postgres @supabase/backend common.vars.pkr.hcl @supabase/postgres @supabase/backend From 6cc336b72872d552957f79a6488de11fb51b771e Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 19 Mar 2025 18:01:11 +0100 Subject: [PATCH 162/271] feat: enable pg_buffercache --- ansible/files/postgresql_config/supautils.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 51f29457c..433f5ae8f 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -2,11 +2,11 @@ supautils.extensions_parameter_overrides = '{"pg_cron":{"schema":"pg_catalog"}}' supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' # full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 -# omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility +# omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 # omitted because doesn't require superuser: pgmq # omitted because protected: plpgsql -supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' +supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_buffercache, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' From 5b1b1f43cd4f0901cdc285c5e904ba6bef23b1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Fri, 21 Mar 2025 11:06:18 +0100 Subject: [PATCH 163/271] chore: update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1bf35b29c..eb992c824 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | Goodie | Version | Description | | ------------- | :-------------: | ------------- | -| [PgBouncer](https://www.pgbouncer.org/) | [1.16.1](http://www.pgbouncer.org/changelog.html#pgbouncer-116x) | Set up Connection Pooling. | +| [PgBouncer](https://www.pgbouncer.org/) | [1.19.0](http://www.pgbouncer.org/changelog.html#pgbouncer-119x) | Set up Connection Pooling. | | [PostgREST](https://postgrest.org/en/stable/) | [v12.2.3](https://github.com/PostgREST/postgrest/releases/tag/v12.2.3) | Instantly transform your database into an RESTful API. | | [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | --> @@ -126,4 +126,4 @@ TODO: find way to automate this We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. -[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) \ No newline at end of file +[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) From dd8c99de29bc4b8f00fc1a8e5e9e510e2f4146f2 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Sat, 22 Mar 2025 09:42:51 +0800 Subject: [PATCH 164/271] feat: build pg17-oriole qemu artifacts --- .github/workflows/qemu-image-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 464ee01fe..373026425 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -23,10 +23,10 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - - name: Set PostgreSQL versions - only builds pg15 atm + - name: Set PostgreSQL versions - only builds pg17 atm id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[0]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: From 9eaaa417a1f72dad691268be938168b6eb5200c4 Mon Sep 17 00:00:00 2001 From: angelico Date: Mon, 24 Mar 2025 18:36:08 +0100 Subject: [PATCH 165/271] chore: bump adminapi_release to `0.76.0` (#1491) * chore: bump adminapi_release * chore: bump pg versions --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 495b65858..da19e42ef 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.051-orioledb" - postgres15: "15.8.1.058" + postgresorioledb-17: "17.0.1.052-orioledb" + postgres15: "15.8.1.059" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -51,7 +51,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.75.0 +adminapi_release: 0.76.0 adminmgr_release: 0.24.1 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From 6c81754c9fa33c888c41b5b6add99ef042fa08a0 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 24 Mar 2025 22:03:48 -0400 Subject: [PATCH 166/271] chore: set pg_graphql to stable rust (#1476) * chore: set pg_graphql to stable rust * chore: handle ports per version in test * chore: pushed too soon. rm typo * chore: suffix for testing * chore: bump * chore: remove unnecessary build flag * chore: bump * chore: need to link wal-g v2 correctly * chore: bump * Chore: bump to release --- ansible/tasks/setup-wal-g.yml | 2 +- ansible/vars.yml | 4 ++-- nix/ext/pg_graphql.nix | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ansible/tasks/setup-wal-g.yml b/ansible/tasks/setup-wal-g.yml index 5ba268cf9..a05106ede 100644 --- a/ansible/tasks/setup-wal-g.yml +++ b/ansible/tasks/setup-wal-g.yml @@ -44,7 +44,7 @@ - name: Create symlink to make wal-g-v2 the default wal-g ansible.builtin.file: - src: /usr/local/bin/wal-g-v2 + src: /home/wal-g/.nix-profile/bin/wal-g-2 dest: /usr/local/bin/wal-g state: link force: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index da19e42ef..5652df014 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -8,8 +8,8 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.052-orioledb" - postgres15: "15.8.1.059" + postgresorioledb-17: "17.0.1.053-orioledb" + postgres15: "15.8.1.060" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index 54e500924..4ee04bac8 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -1,8 +1,8 @@ { lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_9, cargo, rust-bin }: let - rustVersion = "nightly"; - cargo = rust-bin.nightly.latest.default; + rustVersion = "1.81.0"; + cargo = rust-bin.stable.${rustVersion}.default; in buildPgrxExtension_0_12_9 rec { pname = "pg_graphql"; @@ -27,12 +27,11 @@ buildPgrxExtension_0_12_9 rec { # Setting RUSTFLAGS in env to ensure it's available for all phases env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; - PGPORT = "5434"; + PGPORT = if (lib.versions.major postgresql.version) == "17" then "5440" else "5439"; RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; NIX_BUILD_CORES = "4"; # Limit parallel jobs CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism }; -CARGO_BUILD_RUSTFLAGS = "--cfg tokio_unstable -C debuginfo=0"; CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; @@ -45,4 +44,4 @@ CARGO_BUILD_RUSTFLAGS = "--cfg tokio_unstable -C debuginfo=0"; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} \ No newline at end of file +} From 6e38ed0c241be8ab2812c0c36f1272eb86cd99f9 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 25 Mar 2025 19:44:12 +0800 Subject: [PATCH 167/271] chore: update codeowners Rename CLI team, and add PG team as owner on migrations --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3dc75ee31..744719139 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ * @supabase/backend @supabase/postgres -migrations/ @supabase/cli @supabase/backend +migrations/ @supabase/dev-workflows @supabase/postgres @supabase/backend docker/orioledb @supabase/postgres @supabase/backend common.vars.pkr.hcl @supabase/postgres @supabase/backend From 020aabb8fd72b0010ee987e0d557bacf9a8a9399 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 21 Mar 2025 18:55:48 -0500 Subject: [PATCH 168/271] fix: flake check not working locally on linux When running `flake check` there was an error: ``` error: undefined variable 'samrose' ``` Remove `maintainers = with maintainers; [ samrose ];` to solve this. --- nix/docs/adding-new-package.md | 1 - nix/ext/hypopg.nix | 1 - nix/ext/index_advisor.nix | 1 - nix/ext/mecab-naist-jdic/default.nix | 11 +++++------ nix/ext/orioledb.nix | 9 ++++----- nix/ext/pg-safeupdate.nix | 1 - nix/ext/pg_backtrace.nix | 1 - nix/ext/pg_cron.nix | 1 - nix/ext/pg_graphql.nix | 3 +-- nix/ext/pg_hashids.nix | 1 - nix/ext/pg_jsonschema.nix | 3 +-- nix/ext/pg_net.nix | 1 - nix/ext/pg_partman.nix | 1 - nix/ext/pg_plan_filter.nix | 1 - nix/ext/pg_regress.nix | 3 +-- nix/ext/pg_repack.nix | 1 - nix/ext/pg_stat_monitor.nix | 1 - nix/ext/pg_tle.nix | 1 - nix/ext/pgaudit.nix | 1 - nix/ext/pgjwt.nix | 1 - nix/ext/pgroonga.nix | 3 +-- nix/ext/pgrouting.nix | 1 - nix/ext/pgsodium.nix | 1 - nix/ext/pgsql-http.nix | 1 - nix/ext/pgtap.nix | 1 - nix/ext/pljava.nix | 1 - nix/ext/plv8.nix | 1 - nix/ext/postgis.nix | 1 - nix/ext/rum.nix | 1 - nix/ext/sfcgal/sfcgal.nix | 1 - nix/ext/timescaledb-2.9.1.nix | 1 - nix/ext/timescaledb.nix | 1 - nix/ext/vault.nix | 1 - nix/ext/wal2json.nix | 1 - nix/ext/wrappers/default.nix | 1 - nix/supabase-groonga.nix | 1 - nix/wal-g.nix | 1 - 37 files changed, 13 insertions(+), 50 deletions(-) diff --git a/nix/docs/adding-new-package.md b/nix/docs/adding-new-package.md index 30a85f7b5..6f7753953 100644 --- a/nix/docs/adding-new-package.md +++ b/nix/docs/adding-new-package.md @@ -131,7 +131,6 @@ buildPgrxExtension_0_11_3 rec { meta = with lib; { description = "JSON Schema Validation for PostgreSQL"; homepage = "https://github.com/supabase/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/hypopg.nix b/nix/ext/hypopg.nix index 300a44900..ffafe904e 100644 --- a/nix/ext/hypopg.nix +++ b/nix/ext/hypopg.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Hypothetical Indexes for PostgreSQL"; homepage = "https://github.com/HypoPG/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/index_advisor.nix b/nix/ext/index_advisor.nix index 3ed5a5fbc..ae23354b9 100644 --- a/nix/ext/index_advisor.nix +++ b/nix/ext/index_advisor.nix @@ -23,7 +23,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Recommend indexes to improve query performance in PostgreSQL"; homepage = "https://github.com/olirice/index_advisor"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/mecab-naist-jdic/default.nix b/nix/ext/mecab-naist-jdic/default.nix index d7ea6c541..82f0ed37c 100644 --- a/nix/ext/mecab-naist-jdic/default.nix +++ b/nix/ext/mecab-naist-jdic/default.nix @@ -21,21 +21,20 @@ stdenv.mkDerivation rec { ${mecab}/libexec/mecab/mecab-dict-index -d . -o . -f UTF-8 -t utf-8 runHook postBuild ''; - + installPhase = '' runHook preInstall - + mkdir -p $out/lib/mecab/dic/naist-jdic cp *.dic *.bin *.def $out/lib/mecab/dic/naist-jdic/ - + runHook postInstall ''; - + meta = with lib; { description = "Naist Japanese Dictionary for MeCab"; homepage = "https://taku910.github.io/mecab/"; license = licenses.gpl2; platforms = platforms.unix; - maintainers = with maintainers; [ samrose ]; }; -} \ No newline at end of file +} diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 856539d56..0e0ae9cdc 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -14,24 +14,23 @@ stdenv.mkDerivation rec { buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5"; installPhase = '' runHook preInstall - + mkdir -p $out/{lib,share/postgresql/extension} # Copy the extension library cp orioledb${postgresql.dlSuffix} $out/lib/ - + # Copy sql files from the sql directory cp sql/*.sql $out/share/postgresql/extension/ - + # Copy control file cp orioledb.control $out/share/postgresql/extension/ - + runHook postInstall ''; doCheck = true; meta = with lib; { description = "orioledb"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg-safeupdate.nix b/nix/ext/pg-safeupdate.nix index d24fab54a..f5ad17a82 100644 --- a/nix/ext/pg-safeupdate.nix +++ b/nix/ext/pg-safeupdate.nix @@ -24,6 +24,5 @@ stdenv.mkDerivation rec { platforms = postgresql.meta.platforms; license = licenses.postgresql; broken = versionOlder postgresql.version "14"; - maintainers = with maintainers; [ samrose ]; }; } diff --git a/nix/ext/pg_backtrace.nix b/nix/ext/pg_backtrace.nix index 47ede88e2..0a0b0ae4f 100644 --- a/nix/ext/pg_backtrace.nix +++ b/nix/ext/pg_backtrace.nix @@ -26,7 +26,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Updated fork of pg_backtrace"; homepage = "https://github.com/pashkinelfe/pg_backtrace"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_cron.nix b/nix/ext/pg_cron.nix index d51254aa2..792db7676 100644 --- a/nix/ext/pg_cron.nix +++ b/nix/ext/pg_cron.nix @@ -25,7 +25,6 @@ stdenv.mkDerivation rec { description = "Run Cron jobs through PostgreSQL"; homepage = "https://github.com/citusdata/pg_cron"; changelog = "https://github.com/citusdata/pg_cron/raw/v${version}/CHANGELOG.md"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index 4ee04bac8..af2f02447 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -34,13 +34,12 @@ buildPgrxExtension_0_12_9 rec { }; CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; - + doCheck = false; meta = with lib; { description = "GraphQL support for PostreSQL"; homepage = "https://github.com/supabase/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_hashids.nix b/nix/ext/pg_hashids.nix index 50bff95da..828db60fb 100644 --- a/nix/ext/pg_hashids.nix +++ b/nix/ext/pg_hashids.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Generate short unique IDs in PostgreSQL"; homepage = "https://github.com/iCyberon/pg_hashids"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix index 50a2d3472..642519f08 100644 --- a/nix/ext/pg_jsonschema.nix +++ b/nix/ext/pg_jsonschema.nix @@ -66,8 +66,7 @@ buildPgrxExtension_0_12_6 rec { meta = with lib; { description = "JSON Schema Validation for PostgreSQL"; homepage = "https://github.com/supabase/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} \ No newline at end of file +} diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 22be10893..0f20163e5 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -26,7 +26,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Async networking for Postgres"; homepage = "https://github.com/supabase/pg_net"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_partman.nix b/nix/ext/pg_partman.nix index 1ece63386..899716b44 100644 --- a/nix/ext/pg_partman.nix +++ b/nix/ext/pg_partman.nix @@ -26,7 +26,6 @@ stdenv.mkDerivation rec { description = "Partition management extension for PostgreSQL"; homepage = "https://github.com/pgpartman/pg_partman"; changelog = "https://github.com/pgpartman/pg_partman/blob/v${version}/CHANGELOG.md"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; broken = versionOlder postgresql.version "14"; diff --git a/nix/ext/pg_plan_filter.nix b/nix/ext/pg_plan_filter.nix index 0ed527251..6281d0b67 100644 --- a/nix/ext/pg_plan_filter.nix +++ b/nix/ext/pg_plan_filter.nix @@ -23,7 +23,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Filter PostgreSQL statements by execution plans"; homepage = "https://github.com/pgexperts/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pg_regress.nix b/nix/ext/pg_regress.nix index 6e581c475..08f82aa79 100644 --- a/nix/ext/pg_regress.nix +++ b/nix/ext/pg_regress.nix @@ -17,8 +17,7 @@ stdenv.mkDerivation { meta = with lib; { description = "Regression testing tool for PostgreSQL"; homepage = "https://www.postgresql.org/"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} \ No newline at end of file +} diff --git a/nix/ext/pg_repack.nix b/nix/ext/pg_repack.nix index 7b8a69593..076e878f2 100644 --- a/nix/ext/pg_repack.nix +++ b/nix/ext/pg_repack.nix @@ -59,7 +59,6 @@ stdenv.mkDerivation (finalAttrs: { ''; homepage = "https://github.com/reorg/pg_repack"; license = licenses.bsd3; - maintainers = with maintainers; [ samrose ]; inherit (postgresql.meta) platforms; mainProgram = "pg_repack"; }; diff --git a/nix/ext/pg_stat_monitor.nix b/nix/ext/pg_stat_monitor.nix index c3e91fe2b..8469f4b98 100644 --- a/nix/ext/pg_stat_monitor.nix +++ b/nix/ext/pg_stat_monitor.nix @@ -41,7 +41,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Query Performance Monitoring Tool for PostgreSQL"; homepage = "https://github.com/percona/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; broken = lib.versionOlder postgresql.version "15"; diff --git a/nix/ext/pg_tle.nix b/nix/ext/pg_tle.nix index 0221d8768..a0e9385b2 100644 --- a/nix/ext/pg_tle.nix +++ b/nix/ext/pg_tle.nix @@ -29,7 +29,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Framework for 'Trusted Language Extensions' in PostgreSQL"; homepage = "https://github.com/aws/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pgaudit.nix b/nix/ext/pgaudit.nix index 84fbf440d..01ab66f15 100644 --- a/nix/ext/pgaudit.nix +++ b/nix/ext/pgaudit.nix @@ -41,7 +41,6 @@ stdenv.mkDerivation { description = "Open Source PostgreSQL Audit Logging"; homepage = "https://github.com/pgaudit/pgaudit"; changelog = "https://github.com/pgaudit/pgaudit/releases/tag/${source.version}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pgjwt.nix b/nix/ext/pgjwt.nix index 2eb60f72e..4ecd76339 100644 --- a/nix/ext/pgjwt.nix +++ b/nix/ext/pgjwt.nix @@ -26,6 +26,5 @@ stdenv.mkDerivation rec { ''; license = licenses.mit; platforms = postgresql.meta.platforms; - maintainers = with maintainers; [samrose]; }; } diff --git a/nix/ext/pgroonga.nix b/nix/ext/pgroonga.nix index 7ebe84960..de0dedc93 100644 --- a/nix/ext/pgroonga.nix +++ b/nix/ext/pgroonga.nix @@ -74,6 +74,5 @@ stdenv.mkDerivation rec { changelog = "https://github.com/pgroonga/pgroonga/releases/tag/${version}"; license = licenses.postgresql; platforms = postgresql.meta.platforms; - maintainers = with maintainers; [ samrose ]; }; -} \ No newline at end of file +} diff --git a/nix/ext/pgrouting.nix b/nix/ext/pgrouting.nix index 5587566cd..3e898022f 100644 --- a/nix/ext/pgrouting.nix +++ b/nix/ext/pgrouting.nix @@ -53,7 +53,6 @@ stdenv.mkDerivation rec { description = "A PostgreSQL/PostGIS extension that provides geospatial routing functionality"; homepage = "https://pgrouting.org/"; changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v${version}"; - maintainers = with maintainers; [ steve-chavez samrose ]; platforms = postgresql.meta.platforms; license = licenses.gpl2Plus; }; diff --git a/nix/ext/pgsodium.nix b/nix/ext/pgsodium.nix index 4e184faa9..ec2979499 100644 --- a/nix/ext/pgsodium.nix +++ b/nix/ext/pgsodium.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Modern cryptography for PostgreSQL"; homepage = "https://github.com/michelp/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index 03fc3e683..8b74f191b 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "HTTP client for Postgres"; homepage = "https://github.com/pramsey/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/pgtap.nix b/nix/ext/pgtap.nix index c5a17c97f..159fec433 100644 --- a/nix/ext/pgtap.nix +++ b/nix/ext/pgtap.nix @@ -25,7 +25,6 @@ stdenv.mkDerivation rec { as well as the ability to integrate with other TAP-emitting test frameworks. It can also be used in the xUnit testing style. ''; - maintainers = with maintainers; [ samrose ]; homepage = "https://pgtap.org"; inherit (postgresql.meta) platforms; license = licenses.mit; diff --git a/nix/ext/pljava.nix b/nix/ext/pljava.nix index 16f8a59c3..51c5e1317 100644 --- a/nix/ext/pljava.nix +++ b/nix/ext/pljava.nix @@ -46,6 +46,5 @@ maven.buildMavenPackage rec { description = "PL/Java extension for PostgreSQL"; homepage = https://github.com/tada/pljava; license = licenses.bsd3; - maintainers = [ maintainers.samrose ]; # Update with actual maintainer info }; } diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index 340a07382..b3fd03e07 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -139,7 +139,6 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; homepage = "https://plv8.github.io/"; - maintainers = with maintainers; [ samrose ]; platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; license = licenses.postgresql; }; diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index 2c8a36ce5..e5ccda443 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -81,7 +81,6 @@ postInstall = '' homepage = "https://postgis.net/"; changelog = "https://git.osgeo.org/gitea/postgis/postgis/raw/tag/${version}/NEWS"; license = licenses.gpl2; - maintainers = with maintainers; [ samrose ]; inherit (postgresql.meta) platforms; }; } diff --git a/nix/ext/rum.nix b/nix/ext/rum.nix index 1270f1ff1..574ef3d3a 100644 --- a/nix/ext/rum.nix +++ b/nix/ext/rum.nix @@ -26,6 +26,5 @@ stdenv.mkDerivation rec { homepage = "https://github.com/postgrespro/rum"; license = licenses.postgresql; platforms = postgresql.meta.platforms; - maintainers = with maintainers; [ samrose ]; }; } diff --git a/nix/ext/sfcgal/sfcgal.nix b/nix/ext/sfcgal/sfcgal.nix index 54d7b52cb..b1d5842f8 100644 --- a/nix/ext/sfcgal/sfcgal.nix +++ b/nix/ext/sfcgal/sfcgal.nix @@ -26,6 +26,5 @@ stdenv.mkDerivation rec { homepage = "https://sfcgal.gitlab.io/SFCGAL/"; license = with licenses; [ gpl3Plus lgpl3Plus]; platforms = platforms.all; - maintainers = with maintainers; [ samrose ]; }; } diff --git a/nix/ext/timescaledb-2.9.1.nix b/nix/ext/timescaledb-2.9.1.nix index ad955e86f..92d5d73fe 100644 --- a/nix/ext/timescaledb-2.9.1.nix +++ b/nix/ext/timescaledb-2.9.1.nix @@ -43,7 +43,6 @@ stdenv.mkDerivation rec { description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; homepage = "https://www.timescale.com/"; changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.asl20; broken = versionOlder postgresql.version "13"; diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 1c87916be..1d7360762 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -35,7 +35,6 @@ stdenv.mkDerivation rec { description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; homepage = "https://www.timescale.com/"; changelog = "https://github.com/timescale/timescaledb/blob/${version}/CHANGELOG.md"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.asl20; broken = versionOlder postgresql.version "13"; diff --git a/nix/ext/vault.nix b/nix/ext/vault.nix index 2cbd7e7a9..fcc1a9129 100644 --- a/nix/ext/vault.nix +++ b/nix/ext/vault.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Store encrypted secrets in PostgreSQL"; homepage = "https://github.com/supabase/${pname}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/ext/wal2json.nix b/nix/ext/wal2json.nix index ed578c7fd..b1f532dcf 100644 --- a/nix/ext/wal2json.nix +++ b/nix/ext/wal2json.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation rec { description = "PostgreSQL JSON output plugin for changeset extraction"; homepage = "https://github.com/eulerto/wal2json"; changelog = "https://github.com/eulerto/wal2json/releases/tag/wal2json_${version}"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.bsd3; }; diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index e51589eb4..74810a342 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -157,7 +157,6 @@ buildPgrxExtension_0_12_9 rec { meta = with lib; { description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; homepage = "https://github.com/supabase/wrappers"; - maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; diff --git a/nix/supabase-groonga.nix b/nix/supabase-groonga.nix index 410bab067..5035f369f 100644 --- a/nix/supabase-groonga.nix +++ b/nix/supabase-groonga.nix @@ -65,7 +65,6 @@ in stdenv.mkDerivation (finalAttrs: { homepage = "https://groonga.org/"; description = "Open-source fulltext search engine and column store"; license = licenses.lgpl21; - maintainers = [ maintainers.samrose ]; platforms = platforms.all; longDescription = '' Groonga is an open-source fulltext search engine and column store. diff --git a/nix/wal-g.nix b/nix/wal-g.nix index 764b1c9e4..0e29fd272 100644 --- a/nix/wal-g.nix +++ b/nix/wal-g.nix @@ -60,7 +60,6 @@ let license = licenses.asl20; description = "Archival restoration tool for PostgreSQL"; mainProgram = "wal-g-${majorVersion}"; - maintainers = [ samrose ]; }; }; in From 868691f3d748c38f7720787781a08f6f539ad06b Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 24 Mar 2025 18:20:06 -0500 Subject: [PATCH 169/271] chore: mv ansible migration test to nix flake check migration tests are now run on `nix flake check`: - tests for some extensions are adjusted to run conditionally on non-orioledb + preserves behavior from the ansible tests - ebssurrogate/files/unit-tests/unit-test-01.sql are deleted + these tests are already included nix/test/prime.sql cleanup ansible/tasks/test-image.yml: - remove pg_prove since it's no longer used - remove unit tests since the same logic is already included nix/tests/prime.sql - remove migration tests since it's now tested with nix flake check --- amazon-arm64-nix.pkr.hcl | 5 -- ansible/tasks/test-image.yml | 67 +---------------- .../files/unit-tests/unit-test-01.sql | 58 --------------- .../scripts/surrogate-bootstrap-nix.sh | 3 - flake.nix | 3 + migrations/tests/extensions/01-postgis.sql | 73 +++++++++---------- migrations/tests/extensions/02-pgrouting.sql | 12 ++- .../tests/extensions/10-timescaledb.sql | 12 ++- migrations/tests/extensions/13-plv8.sql | 12 ++- qemu-arm64-nix.pkr.hcl | 5 -- stage2-nix-psql.pkr.hcl | 15 ++-- 11 files changed, 72 insertions(+), 193 deletions(-) delete mode 100644 ebssurrogate/files/unit-tests/unit-test-01.sql diff --git a/amazon-arm64-nix.pkr.hcl b/amazon-arm64-nix.pkr.hcl index ec427ff9f..e460dfc72 100644 --- a/amazon-arm64-nix.pkr.hcl +++ b/amazon-arm64-nix.pkr.hcl @@ -228,11 +228,6 @@ build { destination = "/tmp" } - provisioner "file" { - source = "ebssurrogate/files/unit-tests" - destination = "/tmp" - } - # Copy ansible playbook provisioner "shell" { inline = ["mkdir /tmp/ansible-playbook"] diff --git a/ansible/tasks/test-image.yml b/ansible/tasks/test-image.yml index c680ce68e..a0d3b2b78 100644 --- a/ansible/tasks/test-image.yml +++ b/ansible/tasks/test-image.yml @@ -1,9 +1,3 @@ -- name: install pg_prove - apt: - pkg: - - libtap-parser-sourcehandler-pgtap-perl - when: debpkg_mode - # - name: Temporarily disable PG Sodium references in config # become: yes # become_user: postgres @@ -16,9 +10,9 @@ become_user: postgres shell: cmd: > - sed -i.bak - -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' - -e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/' + sed -i.bak + -e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/' + -e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/' -e 's/\(shared_preload_libraries = '\''.*\), *supabase_vault'\''/\1'\''/' -e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/' /etc/postgresql/postgresql.conf @@ -74,53 +68,6 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive when: stage2_nix - -- name: Check psql_version and modify migrations if oriole-xx - block: - - name: Check if psql_version is psql_orioledb-xx - set_fact: - is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" - - - name: Remove specified extensions from SQL file - ansible.builtin.command: - cmd: > - sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql - when: is_psql_oriole - become: yes - - - name: Remove specified extension files from extensions directory - ansible.builtin.find: - paths: /tmp/migrations/tests/extensions - patterns: - - '*timescaledb*.sql' - - '*plv8*.sql' - - '*postgis*.sql' - - '*pgrouting*.sql' - register: files_to_remove - when: is_psql_oriole - - - name: Delete matched extension files - ansible.builtin.file: - path: "{{ item.path }}" - state: absent - loop: "{{ files_to_remove.files }}" - when: is_psql_oriole - become: yes - -- name: Run Unit tests (with filename unit-test-*) on Postgres Database - shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql - register: retval - failed_when: retval.rc != 0 - when: debpkg_mode or stage2_nix - -- name: Run migrations tests - shell: /usr/bin/pg_prove -U supabase_admin -h localhost -d postgres -v tests/test.sql - register: retval - failed_when: retval.rc != 0 - when: debpkg_mode or stage2_nix - args: - chdir: /tmp/migrations - - name: Re-enable PG Sodium references in config become: yes become_user: postgres @@ -132,14 +79,6 @@ shell: /usr/lib/postgresql/bin/psql --no-password --no-psqlrc -d postgres -h localhost -U supabase_admin -c 'SELECT pg_stat_statements_reset(); SELECT pg_stat_reset();' when: debpkg_mode or stage2_nix -- name: remove pg_prove - apt: - pkg: - - libtap-parser-sourcehandler-pgtap-perl - state: absent - autoremove: yes - when: debpkg_mode - - name: Stop Postgres Database become: yes become_user: postgres diff --git a/ebssurrogate/files/unit-tests/unit-test-01.sql b/ebssurrogate/files/unit-tests/unit-test-01.sql deleted file mode 100644 index c466af12e..000000000 --- a/ebssurrogate/files/unit-tests/unit-test-01.sql +++ /dev/null @@ -1,58 +0,0 @@ -BEGIN; -CREATE EXTENSION IF NOT EXISTS pgtap; - -DO $$ -DECLARE - extension_array text[]; - orioledb_available boolean; -BEGIN - -- Check if orioledb is available - SELECT EXISTS ( - SELECT 1 FROM pg_available_extensions WHERE name = 'orioledb' - ) INTO orioledb_available; - - -- If available, create it and add to the expected extensions list - IF orioledb_available THEN - CREATE EXTENSION IF NOT EXISTS orioledb; - extension_array := ARRAY[ - 'plpgsql', - 'pg_stat_statements', - 'pgtap', - 'pg_graphql', - 'pgcrypto', - 'pgjwt', - 'uuid-ossp', - 'supabase_vault', - 'orioledb' - ]; - ELSE - extension_array := ARRAY[ - 'plpgsql', - 'pg_stat_statements', - 'pgtap', - 'pg_graphql', - 'pgcrypto', - 'pgjwt', - 'uuid-ossp', - 'supabase_vault' - ]; - END IF; - - -- Set the array as a temporary variable to use in the test - PERFORM set_config('myapp.extensions', array_to_string(extension_array, ','), false); -END $$; - -SELECT no_plan(); - -SELECT extensions_are( - string_to_array(current_setting('myapp.extensions'), ',')::text[] -); - - -SELECT has_schema('pg_toast'); -SELECT has_schema('pg_catalog'); -SELECT has_schema('information_schema'); -SELECT has_schema('public'); - -SELECT * FROM finish(); -ROLLBACK; diff --git a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh index b204b326a..39b8f4e82 100755 --- a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh +++ b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh @@ -180,9 +180,6 @@ function setup_chroot_environment { # Copy migrations cp -r /tmp/migrations /mnt/tmp/ - # Copy unit tests - cp -r /tmp/unit-tests /mnt/tmp/ - # Copy the bootstrap script into place and execute inside chroot cp /tmp/chroot-bootstrap-nix.sh /mnt/tmp/chroot-bootstrap-nix.sh chroot /mnt /tmp/chroot-bootstrap-nix.sh diff --git a/flake.nix b/flake.nix index b36ccda57..afbbb7c54 100644 --- a/flake.nix +++ b/flake.nix @@ -807,6 +807,9 @@ exit 1 fi + echo "Running migrations tests" + pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + mkdir -p $out/regression_output if ! pg_regress \ --use-existing \ diff --git a/migrations/tests/extensions/01-postgis.sql b/migrations/tests/extensions/01-postgis.sql index 23fab501c..6c3e154e3 100644 --- a/migrations/tests/extensions/01-postgis.sql +++ b/migrations/tests/extensions/01-postgis.sql @@ -1,43 +1,38 @@ -BEGIN; -create extension if not exists postgis_sfcgal with schema "extensions" cascade; -ROLLBACK; +begin; +do $_$ +begin + if not exists (select 1 from pg_extension where extname = 'orioledb') then + -- create postgis tiger as supabase_admin + create extension if not exists postgis_tiger_geocoder cascade; -BEGIN; -create extension if not exists postgis_raster with schema "extensions" cascade; -ROLLBACK; + -- \ir ansible/files/postgresql_extension_custom_scripts/postgis_tiger_geocoder/after-create.sql + grant usage on schema tiger, tiger_data to postgres with grant option; + grant all privileges on all tables in schema tiger, tiger_data to postgres with grant option; + grant all privileges on all routines in schema tiger, tiger_data to postgres with grant option; + grant all privileges on all sequences in schema tiger, tiger_data to postgres with grant option; + alter default privileges in schema tiger, tiger_data grant all on tables to postgres with grant option; + alter default privileges in schema tiger, tiger_data grant all on routines to postgres with grant option; + alter default privileges in schema tiger, tiger_data grant all on sequences to postgres with grant option; + SET search_path TO extensions, public, tiger, tiger_data; + -- postgres role should have access + set local role postgres; + perform tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); -BEGIN; --- create postgis tiger as supabase_admin -create extension if not exists address_standardizer with schema extensions; -create extension if not exists postgis_tiger_geocoder cascade; + -- other roles can be granted access + grant usage on schema tiger, tiger_data to authenticated; + grant select on all tables in schema tiger, tiger_data to authenticated; + grant execute on all routines in schema tiger, tiger_data to authenticated; --- \ir ansible/files/postgresql_extension_custom_scripts/postgis_tiger_geocoder/after-create.sql -grant usage on schema tiger, tiger_data to postgres with grant option; -grant all privileges on all tables in schema tiger, tiger_data to postgres with grant option; -grant all privileges on all routines in schema tiger, tiger_data to postgres with grant option; -grant all privileges on all sequences in schema tiger, tiger_data to postgres with grant option; -alter default privileges in schema tiger, tiger_data grant all on tables to postgres with grant option; -alter default privileges in schema tiger, tiger_data grant all on routines to postgres with grant option; -alter default privileges in schema tiger, tiger_data grant all on sequences to postgres with grant option; -SET search_path TO extensions, public, tiger, tiger_data; --- postgres role should have access -set local role postgres; -select tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); + -- authenticated role should have access now + set local role authenticated; + perform tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); + reset role; --- other roles can be granted access -grant usage on schema tiger, tiger_data to authenticated; -grant select on all tables in schema tiger, tiger_data to authenticated; -grant execute on all routines in schema tiger, tiger_data to authenticated; - --- authenticated role should have access now -set local role authenticated; -select tiger.pprint_addy(tiger.pagc_normalize_address('710 E Ben White Blvd, Austin, TX 78704')); -ROLLBACK; - -BEGIN; --- address standardizer creates a table in extensions schema, owned by supabase_admin -create extension if not exists address_standardizer_data_us with schema extensions; --- postgres role should have access -set local role postgres; -select * from extensions.us_lex; -ROLLBACK; + -- postgres role should have access to address_standardizer_data_us + set local role postgres; + perform 1 from us_lex; + reset role; + end if; +end +$_$; +rollback; diff --git a/migrations/tests/extensions/02-pgrouting.sql b/migrations/tests/extensions/02-pgrouting.sql index 27dec0b55..f8d478657 100644 --- a/migrations/tests/extensions/02-pgrouting.sql +++ b/migrations/tests/extensions/02-pgrouting.sql @@ -1,3 +1,9 @@ -BEGIN; -create extension if not exists pgrouting with schema "extensions" cascade; -ROLLBACK; +begin; +do $_$ +begin + if not exists (select 1 from pg_extension where extname = 'orioledb') then + create extension if not exists pgrouting with schema "extensions" cascade; + end if; +end +$_$; +rollback; diff --git a/migrations/tests/extensions/10-timescaledb.sql b/migrations/tests/extensions/10-timescaledb.sql index acf32b8d2..2d787a8b8 100644 --- a/migrations/tests/extensions/10-timescaledb.sql +++ b/migrations/tests/extensions/10-timescaledb.sql @@ -1,3 +1,9 @@ -BEGIN; -create extension if not exists timescaledb with schema "extensions"; -ROLLBACK; +begin; +do $_$ +begin + if not exists (select 1 from pg_extension where extname = 'orioledb') then + create extension if not exists timescaledb with schema "extensions"; + end if; +end +$_$; +rollback; diff --git a/migrations/tests/extensions/13-plv8.sql b/migrations/tests/extensions/13-plv8.sql index a40792504..b19b908dc 100644 --- a/migrations/tests/extensions/13-plv8.sql +++ b/migrations/tests/extensions/13-plv8.sql @@ -1,3 +1,9 @@ -BEGIN; -create extension if not exists plv8 with schema "pg_catalog"; -ROLLBACK; +begin; +do $_$ +begin + if not exists (select 1 from pg_extension where extname = 'orioledb') then + create extension if not exists plv8 with schema "pg_catalog"; + end if; +end +$_$; +rollback; diff --git a/qemu-arm64-nix.pkr.hcl b/qemu-arm64-nix.pkr.hcl index a9843d1ad..192796205 100644 --- a/qemu-arm64-nix.pkr.hcl +++ b/qemu-arm64-nix.pkr.hcl @@ -122,11 +122,6 @@ build { destination = "/tmp" } - provisioner "file" { - source = "ebssurrogate/files/unit-tests" - destination = "/tmp" - } - provisioner "shell" { environment_vars = [ "POSTGRES_MAJOR_VERSION=${var.postgres-major-version}", diff --git a/stage2-nix-psql.pkr.hcl b/stage2-nix-psql.pkr.hcl index 2897ffd32..243e5e2e4 100644 --- a/stage2-nix-psql.pkr.hcl +++ b/stage2-nix-psql.pkr.hcl @@ -73,17 +73,17 @@ source "amazon-ebs" "ubuntu" { most_recent = true owners = ["amazon", "self"] } - + communicator = "ssh" ssh_pty = true ssh_username = "ubuntu" ssh_timeout = "5m" - + associate_public_ip_address = true ena_support = true - + run_tags = { creator = "packer" appType = "postgres" @@ -126,16 +126,11 @@ build { destination = "/tmp" } - provisioner "file" { - source = "ebssurrogate/files/unit-tests" - destination = "/tmp/unit-tests" - } - provisioner "file" { source = "scripts" destination = "/tmp/ansible-playbook" } - + provisioner "shell" { environment_vars = [ "GIT_SHA=${var.git_sha}", @@ -143,5 +138,5 @@ build { ] script = "scripts/nix-provision.sh" } - + } From 6ae63d39a36c010069812266612ee5815c399d09 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 25 Mar 2025 08:04:00 -0400 Subject: [PATCH 170/271] chore: remove migration file from client (#1494) * chore: remove migration file from client * chore: somehow lost var for show-commands restoring --- flake.nix | 1 + nix/tools/run-client.sh.in | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index afbbb7c54..19a20146f 100644 --- a/flake.nix +++ b/flake.nix @@ -868,6 +868,7 @@ local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; update-readme = mkApp "update-readme" "update-readme"; + show-commands = mkApp "show-commands" "show-commands"; }; # 'devShells.default' lists the set of packages that are included in the diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index ef81d58c1..5c1b78341 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -5,7 +5,6 @@ # Default values PSQL_VERSION="15" -MIGRATION_FILE="" PORTNO="@PGSQL_DEFAULT_PORT@" PSQL_USER="postgres" @@ -15,7 +14,6 @@ print_help() { echo echo "Options:" echo " -v, --version [15|16|orioledb-16] Specify the PostgreSQL version to use (required)" - echo " -f, --file FILE Provide a custom migration script" echo " -u, --user USER Specify the user/role to use (default: postgres)" echo " -h, --help Show this help message" echo @@ -29,7 +27,6 @@ print_help() { echo "Examples:" echo " nix run .#start-client" echo " nix run .#start-client -- --version 15" - echo " nix run .#start-client -- --version 16 --file custom_migration.sql" echo " nix run .#start-client -- --version 16 --port 5433" echo " nix run .#start-client -- --version 16 --user supabase_admin" } @@ -46,15 +43,6 @@ while [[ "$#" -gt 0 ]]; do exit 1 fi ;; - -f|--file) - if [[ -n "$2" && ! "$2" =~ ^- ]]; then - MIGRATION_FILE="$2" - shift 2 - else - echo "Error: --file requires a filename" - exit 1 - fi - ;; -u|--user) if [[ -n "$2" && ! "$2" =~ ^- ]]; then PSQL_USER="$2" @@ -115,11 +103,5 @@ export PATH=$BINDIR/bin:$PATH export POSTGRES_DB=postgres export POSTGRES_HOST=localhost -PGSQL_SUPERUSER=@PGSQL_SUPERUSER@ -MIGRATIONS_DIR=@MIGRATIONS_DIR@ -POSTGRESQL_SCHEMA_SQL=@POSTGRESQL_SCHEMA_SQL@ -PGBOUNCER_AUTH_SCHEMA_SQL=@PGBOUNCER_AUTH_SCHEMA_SQL@ -STAT_EXTENSION_SQL=@STAT_EXTENSION_SQL@ - # Start interactive psql session exec psql -U "$PSQL_USER" -p "$PORTNO" -h localhost postgres From ff0574294c85bbc3140f2f2db97114e99492765b Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Tue, 25 Mar 2025 11:15:47 -0700 Subject: [PATCH 171/271] feat: enable runtime configuration reloads for auth (#1229) This is a small diff doing three things: - Create the `/etc/auth.d` directory. - Copies the `gotrue-optimizations.service.j2` to also copy the `gotrue.generated.env` file to the `/etc/auth.d` directory. - Change the `gotrue.service.j2` to use the `--config-dir` flag set to the newly created `/etc/auth.d` directory. Co-authored-by: Chris Stockton --- ansible/files/gotrue-optimizations.service.j2 | 1 + ansible/files/gotrue.service.j2 | 2 +- ansible/tasks/setup-gotrue.yml | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/files/gotrue-optimizations.service.j2 b/ansible/files/gotrue-optimizations.service.j2 index d9c2f018e..fe5b26cd7 100644 --- a/ansible/files/gotrue-optimizations.service.j2 +++ b/ansible/files/gotrue-optimizations.service.j2 @@ -5,6 +5,7 @@ Description=GoTrue (Auth) optimizations Type=oneshot # we don't want failures from this command to cause PG startup to fail ExecStart=/bin/bash -c "/opt/supabase-admin-api optimize auth --destination-config-file-path /etc/gotrue/gotrue.generated.env ; exit 0" +ExecStartPost=/bin/bash -c "cp -a /etc/gotrue/gotrue.generated.env /etc/auth.d/20_generated.env ; exit 0" User=postgrest [Install] diff --git a/ansible/files/gotrue.service.j2 b/ansible/files/gotrue.service.j2 index c1f7f584f..272e5b871 100644 --- a/ansible/files/gotrue.service.j2 +++ b/ansible/files/gotrue.service.j2 @@ -4,7 +4,7 @@ Description=Gotrue [Service] Type=simple WorkingDirectory=/opt/gotrue -ExecStart=/opt/gotrue/gotrue +ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d User=gotrue Restart=always RestartSec=3 diff --git a/ansible/tasks/setup-gotrue.yml b/ansible/tasks/setup-gotrue.yml index 0998468b3..d2c763853 100644 --- a/ansible/tasks/setup-gotrue.yml +++ b/ansible/tasks/setup-gotrue.yml @@ -30,6 +30,13 @@ owner: gotrue mode: 0775 +- name: gotrue - create /etc/auth.d + file: + path: /etc/auth.d + state: directory + owner: gotrue + mode: 0755 + - name: gotrue - unpack archive in /opt/gotrue unarchive: remote_src: yes From 948b5feb51b9605babc6820475b5ccff44f29552 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 25 Mar 2025 18:15:43 -0500 Subject: [PATCH 172/271] test: regress default privileges --- nix/tests/expected/default_privs.out | 12 ++++++++++++ nix/tests/sql/default_privs.sql | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 nix/tests/expected/default_privs.out create mode 100644 nix/tests/sql/default_privs.sql diff --git a/nix/tests/expected/default_privs.out b/nix/tests/expected/default_privs.out new file mode 100644 index 000000000..862d10087 --- /dev/null +++ b/nix/tests/expected/default_privs.out @@ -0,0 +1,12 @@ +-- this tests the outcome of doing ALTER DEFAULT PRIVILEGES.. +select defaclrole::regrole, defaclnamespace::regnamespace, defaclobjtype from pg_default_acl where defaclnamespace = 'public'::regnamespace::oid order by defaclrole::regrole, defaclobjtype; + defaclrole | defaclnamespace | defaclobjtype +----------------+-----------------+--------------- + supabase_admin | public | S + supabase_admin | public | f + supabase_admin | public | r + postgres | public | S + postgres | public | f + postgres | public | r +(6 rows) + diff --git a/nix/tests/sql/default_privs.sql b/nix/tests/sql/default_privs.sql new file mode 100644 index 000000000..5df2629b9 --- /dev/null +++ b/nix/tests/sql/default_privs.sql @@ -0,0 +1,2 @@ +-- this tests the outcome of doing ALTER DEFAULT PRIVILEGES.. +select defaclrole::regrole, defaclnamespace::regnamespace, defaclobjtype from pg_default_acl where defaclnamespace = 'public'::regnamespace::oid order by defaclrole::regrole, defaclobjtype; From ef851d1d90f3f032a0a1cc5ecbd8a0acb081d4d1 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Tue, 25 Mar 2025 22:49:16 -0500 Subject: [PATCH 173/271] fix: evtrigs ownership (#1489) Fixes https://github.com/supabase/postgres/issues/1437 + Moves migrations/db/init-scripts to migrations/db/migrations. + Make initial migrations idempotent. + Adds test for event triggers. + explicit alter default privs using the postgres role --- flake.nix | 8 +- migrations/README.md | 7 +- .../00000000000000-initial-schema.sql | 57 -------- migrations/db/migrate.sh | 7 - .../00000000000000-initial-schema.sql | 138 ++++++++++++++++++ .../00000000000001-auth-schema.sql | 40 +++-- .../00000000000002-storage-schema.sql | 30 ++-- .../00000000000003-post-setup.sql | 31 +++- migrations/tests/extensions/04-pg_cron.sql | 1 - migrations/tests/extensions/15-pg_net.sql | 1 - nix/tests/expected/evtrigs.out | 19 +++ nix/tests/sql/evtrigs.sql | 3 + nix/tools/dbmate-tool.sh.in | 5 - nix/tools/run-server.sh.in | 8 - 14 files changed, 239 insertions(+), 116 deletions(-) delete mode 100644 migrations/db/init-scripts/00000000000000-initial-schema.sql create mode 100644 migrations/db/migrations/00000000000000-initial-schema.sql rename migrations/db/{init-scripts => migrations}/00000000000001-auth-schema.sql (75%) rename migrations/db/{init-scripts => migrations}/00000000000002-storage-schema.sql (80%) rename migrations/db/{init-scripts => migrations}/00000000000003-post-setup.sql (89%) create mode 100644 nix/tests/expected/evtrigs.out create mode 100644 nix/tests/sql/evtrigs.sql diff --git a/flake.nix b/flake.nix index 19a20146f..4038a152d 100644 --- a/flake.nix +++ b/flake.nix @@ -807,9 +807,6 @@ exit 1 fi - echo "Running migrations tests" - pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql - mkdir -p $out/regression_output if ! pg_regress \ --use-existing \ @@ -825,12 +822,15 @@ exit 1 fi + echo "Running migrations tests" + pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do cp "$logfile" $out/postgresql.log done exit 0 - ''; + ''; in rec { # The list of all packages that can be built with 'nix build'. The list diff --git a/migrations/README.md b/migrations/README.md index ef3c7215b..e74fe4a53 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -42,8 +42,6 @@ nix run github:supabase/postgres/mybranch#dbmate-tool -- --version 15 aiming to provide a single source of truth for migrations on the platform that can be depended upon by those components. For more information on goals see [the RFC](https://www.notion.so/supabase/Centralize-SQL-Migrations-cd3847ae027d4f2bba9defb2cc82f69a) - - ## How it was Created Migrations were pulled (in order) from: @@ -53,9 +51,8 @@ Migrations were pulled (in order) from: For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that executes migrations in the same order as ami build: -1. Run all `db/init-scripts` with `postgres` superuser role. -2. Run all `db/migrations` with `supabase_admin` superuser role. -3. Finalize role passwords with `/etc/postgresql.schema.sql` if present. +1. Run all `db/migrations` with `supabase_admin` superuser role. +2. Finalize role passwords with `/etc/postgresql.schema.sql` if present. Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/develop/ansible/playbook-docker.yml#L9) image contains several migration scripts to configure default extensions. These are run first by docker entrypoint and included in ami by ansible. diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql deleted file mode 100644 index ecce79a3d..000000000 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ /dev/null @@ -1,57 +0,0 @@ --- migrate:up - --- Set up realtime --- defaults to empty publication -create publication supabase_realtime; - --- Supabase super admin -alter user supabase_admin with superuser createdb createrole replication bypassrls; - --- Supabase replication user -create user supabase_replication_admin with login replication; - --- Supabase read-only user -create role supabase_read_only_user with login bypassrls; -grant pg_read_all_data to supabase_read_only_user; - --- Extension namespacing -create schema if not exists extensions; -create extension if not exists "uuid-ossp" with schema extensions; -create extension if not exists pgcrypto with schema extensions; -create extension if not exists pgjwt with schema extensions; - --- Set up auth roles for the developer -create role anon nologin noinherit; -create role authenticated nologin noinherit; -- "logged in" user: web_user, app_user, etc -create role service_role nologin noinherit bypassrls; -- allow developers to create JWT's that bypass their policies - -create user authenticator noinherit; -grant anon to authenticator; -grant authenticated to authenticator; -grant service_role to authenticator; -grant supabase_admin to authenticator; - -grant usage on schema public to postgres, anon, authenticated, service_role; -alter default privileges in schema public grant all on tables to postgres, anon, authenticated, service_role; -alter default privileges in schema public grant all on functions to postgres, anon, authenticated, service_role; -alter default privileges in schema public grant all on sequences to postgres, anon, authenticated, service_role; - --- Allow Extensions to be used in the API -grant usage on schema extensions to postgres, anon, authenticated, service_role; - --- Set up namespacing -alter user supabase_admin SET search_path TO public, extensions; -- don't include the "auth" schema - --- These are required so that the users receive grants whenever "supabase_admin" creates tables/function -alter default privileges for user supabase_admin in schema public grant all - on sequences to postgres, anon, authenticated, service_role; -alter default privileges for user supabase_admin in schema public grant all - on tables to postgres, anon, authenticated, service_role; -alter default privileges for user supabase_admin in schema public grant all - on functions to postgres, anon, authenticated, service_role; - --- Set short statement/query timeouts for API roles -alter role anon set statement_timeout = '3s'; -alter role authenticated set statement_timeout = '8s'; - --- migrate:down diff --git a/migrations/db/migrate.sh b/migrations/db/migrate.sh index 0a84d1e6c..40b5cac6b 100755 --- a/migrations/db/migrate.sh +++ b/migrations/db/migrate.sh @@ -38,11 +38,6 @@ begin end if; end \$\$ EOSQL - # run init scripts as postgres user - for sql in "$db"/init-scripts/*.sql; do - echo "$0: running $sql" - psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -f "$sql" - done psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" # run migrations as super user - postgres user demoted in post-setup for sql in "$db"/migrations/*.sql; do @@ -54,8 +49,6 @@ else create role postgres superuser login password '$PGPASSWORD'; alter database postgres owner to postgres; EOSQL - # run init scripts as postgres user - DBMATE_MIGRATIONS_DIR="$db/init-scripts" DATABASE_URL="postgres://postgres:$connect" dbmate --no-dump-schema migrate psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" # run migrations as super user - postgres user demoted in post-setup DBMATE_MIGRATIONS_DIR="$db/migrations" DATABASE_URL="postgres://supabase_admin:$connect" dbmate --no-dump-schema migrate diff --git a/migrations/db/migrations/00000000000000-initial-schema.sql b/migrations/db/migrations/00000000000000-initial-schema.sql new file mode 100644 index 000000000..c89057633 --- /dev/null +++ b/migrations/db/migrations/00000000000000-initial-schema.sql @@ -0,0 +1,138 @@ +-- migrate:up + +-- Set up realtime +-- 1. Create publication supabase_realtime if it doesn't already exist +do $$ +begin + if not exists ( + select 1 from pg_catalog.pg_publication + where pubname = 'supabase_realtime' + ) + then + create publication supabase_realtime; + end if; +end +$$; + +-- Supabase super admin +alter user supabase_admin with superuser createdb createrole replication bypassrls; + +-- Supabase replication user +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'supabase_replication_admin' + ) + then + create user supabase_replication_admin with + login + replication; + end if; +end +$$; + +-- Supabase read-only user +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'supabase_read_only_user' + ) + then + create role supabase_read_only_user with + login + bypassrls; + end if; +end +$$; +grant pg_read_all_data to supabase_read_only_user; + +-- Extension namespacing +create schema if not exists extensions; +create extension if not exists "uuid-ossp" with schema extensions; +create extension if not exists pgcrypto with schema extensions; +create extension if not exists pgjwt with schema extensions; + +-- Set up auth roles for the developer +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'anon' + ) + then + create role anon nologin noinherit; + end if; +end +$$; + +-- "logged in" user: web_user, app_user, etc +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'authenticated' + ) + then + create role authenticated nologin noinherit; + end if; +end +$$; + + -- allow developers to create JWT's that bypass their policies +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'service_role' + ) + then + create role service_role nologin noinherit bypassrls; + end if; +end +$$; + +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'authenticator' + ) + then + create role authenticator login noinherit; + end if; +end +$$; + + +grant anon to authenticator; +grant authenticated to authenticator; +grant service_role to authenticator; +grant supabase_admin to authenticator; + +-- These are required so that the users receive grants whenever "postgres" creates tables/function +grant usage on schema public to postgres, anon, authenticated, service_role; +alter default privileges for role postgres in schema public grant all on tables to postgres, anon, authenticated, service_role; +alter default privileges for role postgres in schema public grant all on functions to postgres, anon, authenticated, service_role; +alter default privileges for role postgres in schema public grant all on sequences to postgres, anon, authenticated, service_role; + +-- Allow Extensions to be used in the API +grant usage on schema extensions to postgres, anon, authenticated, service_role; + +-- Set up namespacing +alter user supabase_admin SET search_path TO public, extensions; -- don't include the "auth" schema + +-- These are required so that the users receive grants whenever "supabase_admin" creates tables/function +alter default privileges for user supabase_admin in schema public grant all + on sequences to postgres, anon, authenticated, service_role; +alter default privileges for user supabase_admin in schema public grant all + on tables to postgres, anon, authenticated, service_role; +alter default privileges for user supabase_admin in schema public grant all + on functions to postgres, anon, authenticated, service_role; + +-- Set short statement/query timeouts for API roles +alter role anon set statement_timeout = '3s'; +alter role authenticated set statement_timeout = '8s'; + +-- migrate:down diff --git a/migrations/db/init-scripts/00000000000001-auth-schema.sql b/migrations/db/migrations/00000000000001-auth-schema.sql similarity index 75% rename from migrations/db/init-scripts/00000000000001-auth-schema.sql rename to migrations/db/migrations/00000000000001-auth-schema.sql index ad47aadd9..d76eb10cf 100644 --- a/migrations/db/init-scripts/00000000000001-auth-schema.sql +++ b/migrations/db/migrations/00000000000001-auth-schema.sql @@ -4,7 +4,7 @@ CREATE SCHEMA IF NOT EXISTS auth AUTHORIZATION supabase_admin; -- auth.users definition -CREATE TABLE auth.users ( +CREATE TABLE IF NOT EXISTS auth.users ( instance_id uuid NULL, id uuid NOT NULL UNIQUE, aud varchar(255) NULL, @@ -28,13 +28,13 @@ CREATE TABLE auth.users ( updated_at timestamptz NULL, CONSTRAINT users_pkey PRIMARY KEY (id) ); -CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); -CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); +CREATE INDEX IF NOT EXISTS users_instance_id_email_idx ON auth.users USING btree (instance_id, email); +CREATE INDEX IF NOT EXISTS users_instance_id_idx ON auth.users USING btree (instance_id); comment on table auth.users is 'Auth: Stores user login data within a secure schema.'; -- auth.refresh_tokens definition -CREATE TABLE auth.refresh_tokens ( +CREATE TABLE IF NOT EXISTS auth.refresh_tokens ( instance_id uuid NULL, id bigserial NOT NULL, "token" varchar(255) NULL, @@ -44,14 +44,14 @@ CREATE TABLE auth.refresh_tokens ( updated_at timestamptz NULL, CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id) ); -CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); -CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); -CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); +CREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); +CREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); +CREATE INDEX IF NOT EXISTS refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); comment on table auth.refresh_tokens is 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; -- auth.instances definition -CREATE TABLE auth.instances ( +CREATE TABLE IF NOT EXISTS auth.instances ( id uuid NOT NULL, uuid uuid NULL, raw_base_config text NULL, @@ -63,24 +63,25 @@ comment on table auth.instances is 'Auth: Manages users across multiple sites.'; -- auth.audit_log_entries definition -CREATE TABLE auth.audit_log_entries ( +CREATE TABLE IF NOT EXISTS auth.audit_log_entries ( instance_id uuid NULL, id uuid NOT NULL, payload json NULL, created_at timestamptz NULL, CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id) ); -CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); +CREATE INDEX IF NOT EXISTS audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); comment on table auth.audit_log_entries is 'Auth: Audit trail for user actions.'; -- auth.schema_migrations definition -CREATE TABLE auth.schema_migrations ( +CREATE TABLE IF NOT EXISTS auth.schema_migrations ( "version" varchar(255) NOT NULL, CONSTRAINT schema_migrations_pkey PRIMARY KEY ("version") ); comment on table auth.schema_migrations is 'Auth: Manages updates to the auth system.'; +-- insert migrations if they do not yet exist INSERT INTO auth.schema_migrations (version) VALUES ('20171026211738'), ('20171026211808'), @@ -88,7 +89,8 @@ VALUES ('20171026211738'), ('20180103212743'), ('20180108183307'), ('20180119214651'), - ('20180125194653'); + ('20180125194653') +ON CONFLICT DO NOTHING; -- Gets the User ID from the request cookie create or replace function auth.uid() returns uuid as $$ @@ -109,8 +111,18 @@ $$ language sql stable; GRANT USAGE ON SCHEMA auth TO anon, authenticated, service_role; -- Supabase super admin -CREATE USER supabase_auth_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; -GRANT ALL PRIVILEGES ON SCHEMA auth TO supabase_auth_admin; +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'supabase_auth_admin' + ) + then + CREATE USER supabase_auth_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + end if; +end +$$; + GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA auth TO supabase_auth_admin; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA auth TO supabase_auth_admin; ALTER USER supabase_auth_admin SET search_path = "auth"; diff --git a/migrations/db/init-scripts/00000000000002-storage-schema.sql b/migrations/db/migrations/00000000000002-storage-schema.sql similarity index 80% rename from migrations/db/init-scripts/00000000000002-storage-schema.sql rename to migrations/db/migrations/00000000000002-storage-schema.sql index 40503e4dd..3446c3420 100644 --- a/migrations/db/init-scripts/00000000000002-storage-schema.sql +++ b/migrations/db/migrations/00000000000002-storage-schema.sql @@ -7,7 +7,7 @@ alter default privileges in schema storage grant all on tables to postgres, anon alter default privileges in schema storage grant all on functions to postgres, anon, authenticated, service_role; alter default privileges in schema storage grant all on sequences to postgres, anon, authenticated, service_role; -CREATE TABLE "storage"."buckets" ( +CREATE TABLE IF NOT EXISTS "storage"."buckets" ( "id" text not NULL, "name" text NOT NULL, "owner" uuid, @@ -16,9 +16,9 @@ CREATE TABLE "storage"."buckets" ( CONSTRAINT "buckets_owner_fkey" FOREIGN KEY ("owner") REFERENCES "auth"."users"("id"), PRIMARY KEY ("id") ); -CREATE UNIQUE INDEX "bname" ON "storage"."buckets" USING BTREE ("name"); +CREATE UNIQUE INDEX IF NOT EXISTS "bname" ON "storage"."buckets" USING BTREE ("name"); -CREATE TABLE "storage"."objects" ( +CREATE TABLE IF NOT EXISTS "storage"."objects" ( "id" uuid NOT NULL DEFAULT extensions.uuid_generate_v4(), "bucket_id" text, "name" text, @@ -31,12 +31,12 @@ CREATE TABLE "storage"."objects" ( CONSTRAINT "objects_owner_fkey" FOREIGN KEY ("owner") REFERENCES "auth"."users"("id"), PRIMARY KEY ("id") ); -CREATE UNIQUE INDEX "bucketid_objname" ON "storage"."objects" USING BTREE ("bucket_id","name"); -CREATE INDEX name_prefix_search ON storage.objects(name text_pattern_ops); +CREATE UNIQUE INDEX IF NOT EXISTS "bucketid_objname" ON "storage"."objects" USING BTREE ("bucket_id","name"); +CREATE INDEX IF NOT EXISTS name_prefix_search ON storage.objects(name text_pattern_ops); ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; -CREATE FUNCTION storage.foldername(name text) +CREATE OR REPLACE FUNCTION storage.foldername(name text) RETURNS text[] LANGUAGE plpgsql AS $function$ @@ -48,7 +48,7 @@ BEGIN END $function$; -CREATE FUNCTION storage.filename(name text) +CREATE OR REPLACE FUNCTION storage.filename(name text) RETURNS text LANGUAGE plpgsql AS $function$ @@ -60,7 +60,7 @@ BEGIN END $function$; -CREATE FUNCTION storage.extension(name text) +CREATE OR REPLACE FUNCTION storage.extension(name text) RETURNS text LANGUAGE plpgsql AS $function$ @@ -75,7 +75,7 @@ BEGIN END $function$; -CREATE FUNCTION storage.search(prefix text, bucketname text, limits int DEFAULT 100, levels int DEFAULT 1, offsets int DEFAULT 0) +CREATE OR REPLACE FUNCTION storage.search(prefix text, bucketname text, limits int DEFAULT 100, levels int DEFAULT 1, offsets int DEFAULT 0) RETURNS TABLE ( name text, id uuid, @@ -104,7 +104,17 @@ CREATE TABLE IF NOT EXISTS storage.migrations ( executed_at timestamp DEFAULT current_timestamp ); -CREATE USER supabase_storage_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'supabase_storage_admin' + ) + then + CREATE USER supabase_storage_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + end if; +end +$$; GRANT ALL PRIVILEGES ON SCHEMA storage TO supabase_storage_admin; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA storage TO supabase_storage_admin; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA storage TO supabase_storage_admin; diff --git a/migrations/db/init-scripts/00000000000003-post-setup.sql b/migrations/db/migrations/00000000000003-post-setup.sql similarity index 89% rename from migrations/db/init-scripts/00000000000003-post-setup.sql rename to migrations/db/migrations/00000000000003-post-setup.sql index 47cdd13a0..8b7730cdd 100644 --- a/migrations/db/init-scripts/00000000000003-post-setup.sql +++ b/migrations/db/migrations/00000000000003-post-setup.sql @@ -39,8 +39,20 @@ BEGIN END; $$; -CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG in ('CREATE SCHEMA') -EXECUTE PROCEDURE extensions.grant_pg_cron_access(); +DO $$ + +BEGIN + IF NOT EXISTS ( + SELECT 1 + FROM pg_catalog.pg_event_trigger + WHERE evtname = 'issue_pg_cron_access' + ) + THEN + CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG in ('CREATE SCHEMA') + EXECUTE PROCEDURE extensions.grant_pg_cron_access(); + END IF; +END +$$; COMMENT ON FUNCTION extensions.grant_pg_cron_access IS 'Grants access to pg_cron'; -- Event trigger for pg_net @@ -82,7 +94,6 @@ BEGIN END IF; END; $$; -COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net'; DO $$ @@ -99,9 +110,21 @@ BEGIN END IF; END $$; +COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net'; -- Supabase dashboard user -CREATE ROLE dashboard_user NOSUPERUSER CREATEDB CREATEROLE REPLICATION; +do $$ +begin + if not exists ( + select 1 from pg_roles + where rolname = 'dashboard_user' + ) + then + CREATE ROLE dashboard_user NOSUPERUSER CREATEDB CREATEROLE REPLICATION; + end if; +end +$$; + GRANT ALL ON DATABASE postgres TO dashboard_user; GRANT ALL ON SCHEMA auth TO dashboard_user; GRANT ALL ON SCHEMA extensions TO dashboard_user; diff --git a/migrations/tests/extensions/04-pg_cron.sql b/migrations/tests/extensions/04-pg_cron.sql index 7f6686f13..111f28004 100644 --- a/migrations/tests/extensions/04-pg_cron.sql +++ b/migrations/tests/extensions/04-pg_cron.sql @@ -2,7 +2,6 @@ BEGIN; -- create cron extension as supabase_admin create extension if not exists pg_cron; --- \ir migrations/db/init-scripts/00000000000003-post-setup.sql grant usage on schema cron to postgres with grant option; alter default privileges in schema cron grant all on tables to postgres with grant option; alter default privileges in schema cron grant all on routines to postgres with grant option; diff --git a/migrations/tests/extensions/15-pg_net.sql b/migrations/tests/extensions/15-pg_net.sql index 121e11e14..db1d6b15b 100644 --- a/migrations/tests/extensions/15-pg_net.sql +++ b/migrations/tests/extensions/15-pg_net.sql @@ -2,7 +2,6 @@ BEGIN; -- create net extension as supabase_admin create extension if not exists pg_net with schema "extensions"; --- \ir migrations/db/init-scripts/00000000000003-post-setup.sql grant usage on schema net TO postgres, anon, authenticated, service_role; alter function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) security definer; alter function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) security definer; diff --git a/nix/tests/expected/evtrigs.out b/nix/tests/expected/evtrigs.out new file mode 100644 index 000000000..332f04c35 --- /dev/null +++ b/nix/tests/expected/evtrigs.out @@ -0,0 +1,19 @@ +select proname, proowner::regrole +from pg_proc where prorettype = 'event_trigger'::regtype +order by proname; + proname | proowner +------------------------------+---------------- + event_trigger_in | supabase_admin + grant_pg_cron_access | supabase_admin + grant_pg_graphql_access | supabase_admin + grant_pg_net_access | supabase_admin + increment_schema_version | supabase_admin + pg_tle_feature_info_sql_drop | supabase_admin + pgaudit_ddl_command_end | supabase_admin + pgaudit_sql_drop | supabase_admin + pgrst_ddl_watch | supabase_admin + pgrst_drop_watch | supabase_admin + set_graphql_placeholder | supabase_admin + trg_mask_update | supabase_admin +(12 rows) + diff --git a/nix/tests/sql/evtrigs.sql b/nix/tests/sql/evtrigs.sql new file mode 100644 index 000000000..1cd376b62 --- /dev/null +++ b/nix/tests/sql/evtrigs.sql @@ -0,0 +1,3 @@ +select proname, proowner::regrole +from pg_proc where prorettype = 'event_trigger'::regtype +order by proname; diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 1197228af..ccac958ad 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -243,11 +243,6 @@ EOSQL export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" # Export path so dbmate can find correct psql and pg_dump export PATH="$PSQLBIN:$PATH" - # Run init scripts - if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then - echo "Error: Initial migration failed" - exit 1 - fi # Password update command if ! "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 0586e010b..a799da15c 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -309,14 +309,6 @@ EOSQL 'stop_postgres' 1 fi else - # Run default init scripts - for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do - echo "Running $sql" - if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -f "$sql" postgres; then - 'stop_postgres' 1 - fi - done - # Set superuser password if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then 'stop_postgres' 1 From ea0e40f420053b28b1115c98e44dac21ecdb152b Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Thu, 27 Mar 2025 12:57:11 +0200 Subject: [PATCH 174/271] Revert "fix: evtrigs ownership" (#1500) * Revert "fix: evtrigs ownership (#1489)" This reverts commit ef851d1d90f3f032a0a1cc5ecbd8a0acb081d4d1. * chore: improve migration workflows --- .github/workflows/publish-migrations-prod.yml | 41 ++++++ ...ons.yml => publish-migrations-staging.yml} | 14 +- flake.nix | 8 +- migrations/README.md | 7 +- .../00000000000000-initial-schema.sql | 57 ++++++++ .../00000000000001-auth-schema.sql | 40 ++--- .../00000000000002-storage-schema.sql | 30 ++-- .../00000000000003-post-setup.sql | 31 +--- migrations/db/migrate.sh | 7 + .../00000000000000-initial-schema.sql | 138 ------------------ migrations/tests/extensions/04-pg_cron.sql | 1 + migrations/tests/extensions/15-pg_net.sql | 1 + nix/tests/expected/evtrigs.out | 19 --- nix/tests/sql/evtrigs.sql | 3 - nix/tools/dbmate-tool.sh.in | 5 + nix/tools/run-server.sh.in | 8 + 16 files changed, 158 insertions(+), 252 deletions(-) create mode 100644 .github/workflows/publish-migrations-prod.yml rename .github/workflows/{publish-migrations.yml => publish-migrations-staging.yml} (65%) create mode 100644 migrations/db/init-scripts/00000000000000-initial-schema.sql rename migrations/db/{migrations => init-scripts}/00000000000001-auth-schema.sql (75%) rename migrations/db/{migrations => init-scripts}/00000000000002-storage-schema.sql (80%) rename migrations/db/{migrations => init-scripts}/00000000000003-post-setup.sql (89%) delete mode 100644 migrations/db/migrations/00000000000000-initial-schema.sql delete mode 100644 nix/tests/expected/evtrigs.out delete mode 100644 nix/tests/sql/evtrigs.sql diff --git a/.github/workflows/publish-migrations-prod.yml b/.github/workflows/publish-migrations-prod.yml new file mode 100644 index 000000000..d7e813667 --- /dev/null +++ b/.github/workflows/publish-migrations-prod.yml @@ -0,0 +1,41 @@ +name: Release Migrations - Prod + +on: + workflow_dispatch: + +jobs: + build: + runs-on: [self-hosted, linux] + timeout-minutes: 15 + permissions: + id-token: write + contents: read + + steps: + - name: Guard + run: | + if [ $GITHUB_REF != 'refs/heads/develop' ]; then + echo "This action can only be run on the develop branch" + exit 1 + fi + env: + GITHUB_REF: ${{ github.ref }} + + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Merging migration files + run: cat $(ls -1) > ../migration-output.sql + working-directory: ${{ github.workspace }}/migrations/db/migrations + + - name: configure aws credentials - prod + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.PROD_AWS_ROLE }} + aws-region: "ap-southeast-1" + + - name: Deploy to S3 prod + shell: bash + run: aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete + env: + AWS_S3_BUCKET: ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_PROD }} diff --git a/.github/workflows/publish-migrations.yml b/.github/workflows/publish-migrations-staging.yml similarity index 65% rename from .github/workflows/publish-migrations.yml rename to .github/workflows/publish-migrations-staging.yml index 1abc9f2b6..440838ac7 100644 --- a/.github/workflows/publish-migrations.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -1,4 +1,4 @@ -name: Release Migrations +name: Release Migrations - Staging on: push: @@ -32,15 +32,3 @@ jobs: run: aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete env: AWS_S3_BUCKET: ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_STAGING }} - - - name: configure aws credentials - prod - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.PROD_AWS_ROLE }} - aws-region: "ap-southeast-1" - - - name: Deploy to S3 prod - shell: bash - run: aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete - env: - AWS_S3_BUCKET: ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_PROD }} diff --git a/flake.nix b/flake.nix index 4038a152d..19a20146f 100644 --- a/flake.nix +++ b/flake.nix @@ -807,6 +807,9 @@ exit 1 fi + echo "Running migrations tests" + pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + mkdir -p $out/regression_output if ! pg_regress \ --use-existing \ @@ -822,15 +825,12 @@ exit 1 fi - echo "Running migrations tests" - pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql - # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do cp "$logfile" $out/postgresql.log done exit 0 - ''; + ''; in rec { # The list of all packages that can be built with 'nix build'. The list diff --git a/migrations/README.md b/migrations/README.md index e74fe4a53..ef3c7215b 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -42,6 +42,8 @@ nix run github:supabase/postgres/mybranch#dbmate-tool -- --version 15 aiming to provide a single source of truth for migrations on the platform that can be depended upon by those components. For more information on goals see [the RFC](https://www.notion.so/supabase/Centralize-SQL-Migrations-cd3847ae027d4f2bba9defb2cc82f69a) + + ## How it was Created Migrations were pulled (in order) from: @@ -51,8 +53,9 @@ Migrations were pulled (in order) from: For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that executes migrations in the same order as ami build: -1. Run all `db/migrations` with `supabase_admin` superuser role. -2. Finalize role passwords with `/etc/postgresql.schema.sql` if present. +1. Run all `db/init-scripts` with `postgres` superuser role. +2. Run all `db/migrations` with `supabase_admin` superuser role. +3. Finalize role passwords with `/etc/postgresql.schema.sql` if present. Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/develop/ansible/playbook-docker.yml#L9) image contains several migration scripts to configure default extensions. These are run first by docker entrypoint and included in ami by ansible. diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql new file mode 100644 index 000000000..ecce79a3d --- /dev/null +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -0,0 +1,57 @@ +-- migrate:up + +-- Set up realtime +-- defaults to empty publication +create publication supabase_realtime; + +-- Supabase super admin +alter user supabase_admin with superuser createdb createrole replication bypassrls; + +-- Supabase replication user +create user supabase_replication_admin with login replication; + +-- Supabase read-only user +create role supabase_read_only_user with login bypassrls; +grant pg_read_all_data to supabase_read_only_user; + +-- Extension namespacing +create schema if not exists extensions; +create extension if not exists "uuid-ossp" with schema extensions; +create extension if not exists pgcrypto with schema extensions; +create extension if not exists pgjwt with schema extensions; + +-- Set up auth roles for the developer +create role anon nologin noinherit; +create role authenticated nologin noinherit; -- "logged in" user: web_user, app_user, etc +create role service_role nologin noinherit bypassrls; -- allow developers to create JWT's that bypass their policies + +create user authenticator noinherit; +grant anon to authenticator; +grant authenticated to authenticator; +grant service_role to authenticator; +grant supabase_admin to authenticator; + +grant usage on schema public to postgres, anon, authenticated, service_role; +alter default privileges in schema public grant all on tables to postgres, anon, authenticated, service_role; +alter default privileges in schema public grant all on functions to postgres, anon, authenticated, service_role; +alter default privileges in schema public grant all on sequences to postgres, anon, authenticated, service_role; + +-- Allow Extensions to be used in the API +grant usage on schema extensions to postgres, anon, authenticated, service_role; + +-- Set up namespacing +alter user supabase_admin SET search_path TO public, extensions; -- don't include the "auth" schema + +-- These are required so that the users receive grants whenever "supabase_admin" creates tables/function +alter default privileges for user supabase_admin in schema public grant all + on sequences to postgres, anon, authenticated, service_role; +alter default privileges for user supabase_admin in schema public grant all + on tables to postgres, anon, authenticated, service_role; +alter default privileges for user supabase_admin in schema public grant all + on functions to postgres, anon, authenticated, service_role; + +-- Set short statement/query timeouts for API roles +alter role anon set statement_timeout = '3s'; +alter role authenticated set statement_timeout = '8s'; + +-- migrate:down diff --git a/migrations/db/migrations/00000000000001-auth-schema.sql b/migrations/db/init-scripts/00000000000001-auth-schema.sql similarity index 75% rename from migrations/db/migrations/00000000000001-auth-schema.sql rename to migrations/db/init-scripts/00000000000001-auth-schema.sql index d76eb10cf..ad47aadd9 100644 --- a/migrations/db/migrations/00000000000001-auth-schema.sql +++ b/migrations/db/init-scripts/00000000000001-auth-schema.sql @@ -4,7 +4,7 @@ CREATE SCHEMA IF NOT EXISTS auth AUTHORIZATION supabase_admin; -- auth.users definition -CREATE TABLE IF NOT EXISTS auth.users ( +CREATE TABLE auth.users ( instance_id uuid NULL, id uuid NOT NULL UNIQUE, aud varchar(255) NULL, @@ -28,13 +28,13 @@ CREATE TABLE IF NOT EXISTS auth.users ( updated_at timestamptz NULL, CONSTRAINT users_pkey PRIMARY KEY (id) ); -CREATE INDEX IF NOT EXISTS users_instance_id_email_idx ON auth.users USING btree (instance_id, email); -CREATE INDEX IF NOT EXISTS users_instance_id_idx ON auth.users USING btree (instance_id); +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); comment on table auth.users is 'Auth: Stores user login data within a secure schema.'; -- auth.refresh_tokens definition -CREATE TABLE IF NOT EXISTS auth.refresh_tokens ( +CREATE TABLE auth.refresh_tokens ( instance_id uuid NULL, id bigserial NOT NULL, "token" varchar(255) NULL, @@ -44,14 +44,14 @@ CREATE TABLE IF NOT EXISTS auth.refresh_tokens ( updated_at timestamptz NULL, CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id) ); -CREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); -CREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); -CREATE INDEX IF NOT EXISTS refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); +CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); comment on table auth.refresh_tokens is 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; -- auth.instances definition -CREATE TABLE IF NOT EXISTS auth.instances ( +CREATE TABLE auth.instances ( id uuid NOT NULL, uuid uuid NULL, raw_base_config text NULL, @@ -63,25 +63,24 @@ comment on table auth.instances is 'Auth: Manages users across multiple sites.'; -- auth.audit_log_entries definition -CREATE TABLE IF NOT EXISTS auth.audit_log_entries ( +CREATE TABLE auth.audit_log_entries ( instance_id uuid NULL, id uuid NOT NULL, payload json NULL, created_at timestamptz NULL, CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id) ); -CREATE INDEX IF NOT EXISTS audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); comment on table auth.audit_log_entries is 'Auth: Audit trail for user actions.'; -- auth.schema_migrations definition -CREATE TABLE IF NOT EXISTS auth.schema_migrations ( +CREATE TABLE auth.schema_migrations ( "version" varchar(255) NOT NULL, CONSTRAINT schema_migrations_pkey PRIMARY KEY ("version") ); comment on table auth.schema_migrations is 'Auth: Manages updates to the auth system.'; --- insert migrations if they do not yet exist INSERT INTO auth.schema_migrations (version) VALUES ('20171026211738'), ('20171026211808'), @@ -89,8 +88,7 @@ VALUES ('20171026211738'), ('20180103212743'), ('20180108183307'), ('20180119214651'), - ('20180125194653') -ON CONFLICT DO NOTHING; + ('20180125194653'); -- Gets the User ID from the request cookie create or replace function auth.uid() returns uuid as $$ @@ -111,18 +109,8 @@ $$ language sql stable; GRANT USAGE ON SCHEMA auth TO anon, authenticated, service_role; -- Supabase super admin -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'supabase_auth_admin' - ) - then - CREATE USER supabase_auth_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; - end if; -end -$$; - +CREATE USER supabase_auth_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; +GRANT ALL PRIVILEGES ON SCHEMA auth TO supabase_auth_admin; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA auth TO supabase_auth_admin; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA auth TO supabase_auth_admin; ALTER USER supabase_auth_admin SET search_path = "auth"; diff --git a/migrations/db/migrations/00000000000002-storage-schema.sql b/migrations/db/init-scripts/00000000000002-storage-schema.sql similarity index 80% rename from migrations/db/migrations/00000000000002-storage-schema.sql rename to migrations/db/init-scripts/00000000000002-storage-schema.sql index 3446c3420..40503e4dd 100644 --- a/migrations/db/migrations/00000000000002-storage-schema.sql +++ b/migrations/db/init-scripts/00000000000002-storage-schema.sql @@ -7,7 +7,7 @@ alter default privileges in schema storage grant all on tables to postgres, anon alter default privileges in schema storage grant all on functions to postgres, anon, authenticated, service_role; alter default privileges in schema storage grant all on sequences to postgres, anon, authenticated, service_role; -CREATE TABLE IF NOT EXISTS "storage"."buckets" ( +CREATE TABLE "storage"."buckets" ( "id" text not NULL, "name" text NOT NULL, "owner" uuid, @@ -16,9 +16,9 @@ CREATE TABLE IF NOT EXISTS "storage"."buckets" ( CONSTRAINT "buckets_owner_fkey" FOREIGN KEY ("owner") REFERENCES "auth"."users"("id"), PRIMARY KEY ("id") ); -CREATE UNIQUE INDEX IF NOT EXISTS "bname" ON "storage"."buckets" USING BTREE ("name"); +CREATE UNIQUE INDEX "bname" ON "storage"."buckets" USING BTREE ("name"); -CREATE TABLE IF NOT EXISTS "storage"."objects" ( +CREATE TABLE "storage"."objects" ( "id" uuid NOT NULL DEFAULT extensions.uuid_generate_v4(), "bucket_id" text, "name" text, @@ -31,12 +31,12 @@ CREATE TABLE IF NOT EXISTS "storage"."objects" ( CONSTRAINT "objects_owner_fkey" FOREIGN KEY ("owner") REFERENCES "auth"."users"("id"), PRIMARY KEY ("id") ); -CREATE UNIQUE INDEX IF NOT EXISTS "bucketid_objname" ON "storage"."objects" USING BTREE ("bucket_id","name"); -CREATE INDEX IF NOT EXISTS name_prefix_search ON storage.objects(name text_pattern_ops); +CREATE UNIQUE INDEX "bucketid_objname" ON "storage"."objects" USING BTREE ("bucket_id","name"); +CREATE INDEX name_prefix_search ON storage.objects(name text_pattern_ops); ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; -CREATE OR REPLACE FUNCTION storage.foldername(name text) +CREATE FUNCTION storage.foldername(name text) RETURNS text[] LANGUAGE plpgsql AS $function$ @@ -48,7 +48,7 @@ BEGIN END $function$; -CREATE OR REPLACE FUNCTION storage.filename(name text) +CREATE FUNCTION storage.filename(name text) RETURNS text LANGUAGE plpgsql AS $function$ @@ -60,7 +60,7 @@ BEGIN END $function$; -CREATE OR REPLACE FUNCTION storage.extension(name text) +CREATE FUNCTION storage.extension(name text) RETURNS text LANGUAGE plpgsql AS $function$ @@ -75,7 +75,7 @@ BEGIN END $function$; -CREATE OR REPLACE FUNCTION storage.search(prefix text, bucketname text, limits int DEFAULT 100, levels int DEFAULT 1, offsets int DEFAULT 0) +CREATE FUNCTION storage.search(prefix text, bucketname text, limits int DEFAULT 100, levels int DEFAULT 1, offsets int DEFAULT 0) RETURNS TABLE ( name text, id uuid, @@ -104,17 +104,7 @@ CREATE TABLE IF NOT EXISTS storage.migrations ( executed_at timestamp DEFAULT current_timestamp ); -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'supabase_storage_admin' - ) - then - CREATE USER supabase_storage_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; - end if; -end -$$; +CREATE USER supabase_storage_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; GRANT ALL PRIVILEGES ON SCHEMA storage TO supabase_storage_admin; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA storage TO supabase_storage_admin; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA storage TO supabase_storage_admin; diff --git a/migrations/db/migrations/00000000000003-post-setup.sql b/migrations/db/init-scripts/00000000000003-post-setup.sql similarity index 89% rename from migrations/db/migrations/00000000000003-post-setup.sql rename to migrations/db/init-scripts/00000000000003-post-setup.sql index 8b7730cdd..47cdd13a0 100644 --- a/migrations/db/migrations/00000000000003-post-setup.sql +++ b/migrations/db/init-scripts/00000000000003-post-setup.sql @@ -39,20 +39,8 @@ BEGIN END; $$; -DO $$ - -BEGIN - IF NOT EXISTS ( - SELECT 1 - FROM pg_catalog.pg_event_trigger - WHERE evtname = 'issue_pg_cron_access' - ) - THEN - CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG in ('CREATE SCHEMA') - EXECUTE PROCEDURE extensions.grant_pg_cron_access(); - END IF; -END -$$; +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG in ('CREATE SCHEMA') +EXECUTE PROCEDURE extensions.grant_pg_cron_access(); COMMENT ON FUNCTION extensions.grant_pg_cron_access IS 'Grants access to pg_cron'; -- Event trigger for pg_net @@ -94,6 +82,7 @@ BEGIN END IF; END; $$; +COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net'; DO $$ @@ -110,21 +99,9 @@ BEGIN END IF; END $$; -COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net'; -- Supabase dashboard user -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'dashboard_user' - ) - then - CREATE ROLE dashboard_user NOSUPERUSER CREATEDB CREATEROLE REPLICATION; - end if; -end -$$; - +CREATE ROLE dashboard_user NOSUPERUSER CREATEDB CREATEROLE REPLICATION; GRANT ALL ON DATABASE postgres TO dashboard_user; GRANT ALL ON SCHEMA auth TO dashboard_user; GRANT ALL ON SCHEMA extensions TO dashboard_user; diff --git a/migrations/db/migrate.sh b/migrations/db/migrate.sh index 40b5cac6b..0a84d1e6c 100755 --- a/migrations/db/migrate.sh +++ b/migrations/db/migrate.sh @@ -38,6 +38,11 @@ begin end if; end \$\$ EOSQL + # run init scripts as postgres user + for sql in "$db"/init-scripts/*.sql; do + echo "$0: running $sql" + psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -f "$sql" + done psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" # run migrations as super user - postgres user demoted in post-setup for sql in "$db"/migrations/*.sql; do @@ -49,6 +54,8 @@ else create role postgres superuser login password '$PGPASSWORD'; alter database postgres owner to postgres; EOSQL + # run init scripts as postgres user + DBMATE_MIGRATIONS_DIR="$db/init-scripts" DATABASE_URL="postgres://postgres:$connect" dbmate --no-dump-schema migrate psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'" # run migrations as super user - postgres user demoted in post-setup DBMATE_MIGRATIONS_DIR="$db/migrations" DATABASE_URL="postgres://supabase_admin:$connect" dbmate --no-dump-schema migrate diff --git a/migrations/db/migrations/00000000000000-initial-schema.sql b/migrations/db/migrations/00000000000000-initial-schema.sql deleted file mode 100644 index c89057633..000000000 --- a/migrations/db/migrations/00000000000000-initial-schema.sql +++ /dev/null @@ -1,138 +0,0 @@ --- migrate:up - --- Set up realtime --- 1. Create publication supabase_realtime if it doesn't already exist -do $$ -begin - if not exists ( - select 1 from pg_catalog.pg_publication - where pubname = 'supabase_realtime' - ) - then - create publication supabase_realtime; - end if; -end -$$; - --- Supabase super admin -alter user supabase_admin with superuser createdb createrole replication bypassrls; - --- Supabase replication user -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'supabase_replication_admin' - ) - then - create user supabase_replication_admin with - login - replication; - end if; -end -$$; - --- Supabase read-only user -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'supabase_read_only_user' - ) - then - create role supabase_read_only_user with - login - bypassrls; - end if; -end -$$; -grant pg_read_all_data to supabase_read_only_user; - --- Extension namespacing -create schema if not exists extensions; -create extension if not exists "uuid-ossp" with schema extensions; -create extension if not exists pgcrypto with schema extensions; -create extension if not exists pgjwt with schema extensions; - --- Set up auth roles for the developer -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'anon' - ) - then - create role anon nologin noinherit; - end if; -end -$$; - --- "logged in" user: web_user, app_user, etc -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'authenticated' - ) - then - create role authenticated nologin noinherit; - end if; -end -$$; - - -- allow developers to create JWT's that bypass their policies -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'service_role' - ) - then - create role service_role nologin noinherit bypassrls; - end if; -end -$$; - -do $$ -begin - if not exists ( - select 1 from pg_roles - where rolname = 'authenticator' - ) - then - create role authenticator login noinherit; - end if; -end -$$; - - -grant anon to authenticator; -grant authenticated to authenticator; -grant service_role to authenticator; -grant supabase_admin to authenticator; - --- These are required so that the users receive grants whenever "postgres" creates tables/function -grant usage on schema public to postgres, anon, authenticated, service_role; -alter default privileges for role postgres in schema public grant all on tables to postgres, anon, authenticated, service_role; -alter default privileges for role postgres in schema public grant all on functions to postgres, anon, authenticated, service_role; -alter default privileges for role postgres in schema public grant all on sequences to postgres, anon, authenticated, service_role; - --- Allow Extensions to be used in the API -grant usage on schema extensions to postgres, anon, authenticated, service_role; - --- Set up namespacing -alter user supabase_admin SET search_path TO public, extensions; -- don't include the "auth" schema - --- These are required so that the users receive grants whenever "supabase_admin" creates tables/function -alter default privileges for user supabase_admin in schema public grant all - on sequences to postgres, anon, authenticated, service_role; -alter default privileges for user supabase_admin in schema public grant all - on tables to postgres, anon, authenticated, service_role; -alter default privileges for user supabase_admin in schema public grant all - on functions to postgres, anon, authenticated, service_role; - --- Set short statement/query timeouts for API roles -alter role anon set statement_timeout = '3s'; -alter role authenticated set statement_timeout = '8s'; - --- migrate:down diff --git a/migrations/tests/extensions/04-pg_cron.sql b/migrations/tests/extensions/04-pg_cron.sql index 111f28004..7f6686f13 100644 --- a/migrations/tests/extensions/04-pg_cron.sql +++ b/migrations/tests/extensions/04-pg_cron.sql @@ -2,6 +2,7 @@ BEGIN; -- create cron extension as supabase_admin create extension if not exists pg_cron; +-- \ir migrations/db/init-scripts/00000000000003-post-setup.sql grant usage on schema cron to postgres with grant option; alter default privileges in schema cron grant all on tables to postgres with grant option; alter default privileges in schema cron grant all on routines to postgres with grant option; diff --git a/migrations/tests/extensions/15-pg_net.sql b/migrations/tests/extensions/15-pg_net.sql index db1d6b15b..121e11e14 100644 --- a/migrations/tests/extensions/15-pg_net.sql +++ b/migrations/tests/extensions/15-pg_net.sql @@ -2,6 +2,7 @@ BEGIN; -- create net extension as supabase_admin create extension if not exists pg_net with schema "extensions"; +-- \ir migrations/db/init-scripts/00000000000003-post-setup.sql grant usage on schema net TO postgres, anon, authenticated, service_role; alter function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) security definer; alter function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) security definer; diff --git a/nix/tests/expected/evtrigs.out b/nix/tests/expected/evtrigs.out deleted file mode 100644 index 332f04c35..000000000 --- a/nix/tests/expected/evtrigs.out +++ /dev/null @@ -1,19 +0,0 @@ -select proname, proowner::regrole -from pg_proc where prorettype = 'event_trigger'::regtype -order by proname; - proname | proowner -------------------------------+---------------- - event_trigger_in | supabase_admin - grant_pg_cron_access | supabase_admin - grant_pg_graphql_access | supabase_admin - grant_pg_net_access | supabase_admin - increment_schema_version | supabase_admin - pg_tle_feature_info_sql_drop | supabase_admin - pgaudit_ddl_command_end | supabase_admin - pgaudit_sql_drop | supabase_admin - pgrst_ddl_watch | supabase_admin - pgrst_drop_watch | supabase_admin - set_graphql_placeholder | supabase_admin - trg_mask_update | supabase_admin -(12 rows) - diff --git a/nix/tests/sql/evtrigs.sql b/nix/tests/sql/evtrigs.sql deleted file mode 100644 index 1cd376b62..000000000 --- a/nix/tests/sql/evtrigs.sql +++ /dev/null @@ -1,3 +0,0 @@ -select proname, proowner::regrole -from pg_proc where prorettype = 'event_trigger'::regtype -order by proname; diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index ccac958ad..1197228af 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -243,6 +243,11 @@ EOSQL export DATABASE_URL="postgres://$PGSQL_USER:$PGPASSWORD@localhost:$PORTNO/postgres?sslmode=disable" # Export path so dbmate can find correct psql and pg_dump export PATH="$PSQLBIN:$PATH" + # Run init scripts + if ! dbmate --migrations-dir "$MIGRATIONS_DIR/init-scripts" up; then + echo "Error: Initial migration failed" + exit 1 + fi # Password update command if ! "${PSQLBIN}/psql" -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U postgres -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index a799da15c..0586e010b 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -309,6 +309,14 @@ EOSQL 'stop_postgres' 1 fi else + # Run default init scripts + for sql in "$MIGRATIONS_DIR"/init-scripts/*.sql; do + echo "Running $sql" + if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -f "$sql" postgres; then + 'stop_postgres' 1 + fi + done + # Set superuser password if ! psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U "$PSQL_USER" -p "$PORTNO" -h localhost -c "ALTER USER supabase_admin WITH PASSWORD '$PGPASSWORD'"; then 'stop_postgres' 1 From fae1fdfe0c9a6113578d887c447d6c89850d5b50 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 31 Mar 2025 16:09:45 -0400 Subject: [PATCH 175/271] chore: introduce tooling for pg 17.4 non-orioledb (#1420) * chore: introduce tooling for pg 17.4 non-orioledb rebase develop * chore: using md5 on order of query to make it work on all arch * chore: try to have migrations check just use start-server directly * chore: update regress tests * fix: install PG major version appropriate flake during upgrades * fix: exclude timescaledb for PG17+ upgrades * chore advance to pg 17.4 * chore: remove pgjwt except for in pg 15.x * chore: roles already created * chore: try to resolve pgjwt for pg 15 * chore: update regression tests * chore: update regression tests after rebase * chore: update schema for 17 * chore: bring Dockerfile-17 up to date * chore: need to exclude migtest except for pg 15 on timescale plv8 * chore: bump versions for testing * chore: advance versions for release * chore: suffix for Docker pre-release * chore: bump pre-release suffix * chore: bump for actual merge --------- Co-authored-by: Paul Cioanca --- Dockerfile-15 | 1 - Dockerfile-17 | 234 + README.md | 34 +- .../pg_upgrade_scripts/initiate.sh | 8 +- ansible/tasks/setup-extensions.yml | 91 - ansible/tasks/setup-postgres.yml | 7 +- ansible/tasks/stage2-setup-postgres.yml | 41 +- ansible/vars.yml | 6 +- docker/nix/build_nix.sh | 10 +- flake.nix | 83 +- .../00000000000000-initial-schema.sql | 10 +- migrations/schema-17.sql | 992 ++++ migrations/schema-orioledb-17.sql | 14 - migrations/tests/extensions/06-pgjwt.sql | 9 +- .../tests/extensions/10-timescaledb.sql | 2 +- migrations/tests/extensions/13-plv8.sql | 2 +- nix/postgresql/16.nix | 4 - nix/postgresql/17.nix | 4 + nix/postgresql/default.nix | 3 +- nix/postgresql/generic.nix | 4 +- nix/postgresql/orioledb-16.nix | 4 - .../expected/{pgjwt.out => z_15_pgjwt.out} | 0 nix/tests/expected/z_17_ext_interface.out | 2149 ++++--- .../expected/z_orioledb-17_ext_interface.out | 5289 +++++++++++++++++ .../z_orioledb-17_pg_stat_monitor.out | 10 + nix/tests/expected/z_orioledb-17_pgvector.out | 59 + nix/tests/prime.sql | 13 +- nix/tests/sql/{pgjwt.sql => z_15_pgjwt.sql} | 0 nix/tests/sql/z_17_ext_interface.sql | 2 +- nix/tests/sql/z_orioledb-17_ext_interface.sql | 114 + .../sql/z_orioledb-17_pg_stat_monitor.sql | 6 + nix/tests/sql/z_orioledb-17_pgvector.sql | 52 + nix/tools/dbmate-tool.sh.in | 3 +- nix/tools/run-client.sh.in | 14 +- nix/tools/run-server.sh.in | 23 +- 35 files changed, 7995 insertions(+), 1302 deletions(-) create mode 100644 Dockerfile-17 delete mode 100644 ansible/tasks/setup-extensions.yml create mode 100644 migrations/schema-17.sql delete mode 100644 nix/postgresql/16.nix create mode 100644 nix/postgresql/17.nix delete mode 100644 nix/postgresql/orioledb-16.nix rename nix/tests/expected/{pgjwt.out => z_15_pgjwt.out} (100%) create mode 100644 nix/tests/expected/z_orioledb-17_ext_interface.out create mode 100644 nix/tests/expected/z_orioledb-17_pg_stat_monitor.out create mode 100644 nix/tests/expected/z_orioledb-17_pgvector.out rename nix/tests/sql/{pgjwt.sql => z_15_pgjwt.sql} (100%) create mode 100644 nix/tests/sql/z_orioledb-17_ext_interface.sql create mode 100644 nix/tests/sql/z_orioledb-17_pg_stat_monitor.sql create mode 100644 nix/tests/sql/z_orioledb-17_pgvector.sql diff --git a/Dockerfile-15 b/Dockerfile-15 index 7b1d7099f..b7f48977e 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -10,7 +10,6 @@ ARG pgrouting_release=3.4.1 ARG pgtap_release=1.2.0 ARG pg_cron_release=1.6.2 ARG pgaudit_release=1.7.0 -ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 ARG pgsql_http_release=1.5.0 ARG plpgsql_check_release=2.2.5 ARG pg_safeupdate_release=1.4 diff --git a/Dockerfile-17 b/Dockerfile-17 new file mode 100644 index 000000000..83d2f265b --- /dev/null +++ b/Dockerfile-17 @@ -0,0 +1,234 @@ +# syntax=docker/dockerfile:1.6 +ARG postgresql_major=17-orioledb +ARG postgresql_release=${postgresql_major}.1 + +# Bump default build arg to build a package from source +# Bump vars.yml to specify runtime package version +ARG sfcgal_release=1.3.10 +ARG postgis_release=3.3.2 +ARG pgrouting_release=3.4.1 +ARG pgtap_release=1.2.0 +ARG pg_cron_release=1.6.2 +ARG pgaudit_release=1.7.0 +ARG pgjwt_release=9742dab1b2f297ad3811120db7b21451bca2d3c9 +ARG pgsql_http_release=1.5.0 +ARG plpgsql_check_release=2.2.5 +ARG pg_safeupdate_release=1.4 +ARG timescaledb_release=2.9.1 +ARG wal2json_release=2_5 +ARG pljava_release=1.6.4 +ARG plv8_release=3.1.5 +ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492 +ARG pg_net_release=0.7.1 +ARG rum_release=1.3.13 +ARG pg_hashids_release=cd0e1b31d52b394a0df64079406a14a4f7387cd6 +ARG libsodium_release=1.0.18 +ARG pgsodium_release=3.1.6 +ARG pg_graphql_release=1.5.11 +ARG pg_stat_monitor_release=1.1.1 +ARG pg_jsonschema_release=0.1.4 +ARG pg_repack_release=1.4.8 +ARG vault_release=0.2.8 +ARG groonga_release=12.0.8 +ARG pgroonga_release=2.4.0 +ARG wrappers_release=0.4.5 +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.0 +ARG wal_g_release=3.0.5 + +FROM ubuntu:focal as base + +RUN apt update -y && apt install -y \ + curl \ + gnupg \ + lsb-release \ + software-properties-common \ + wget \ + sudo \ + tree \ + && apt clean + + +RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres +RUN adduser --system --no-create-home --shell /bin/bash --group wal-g +RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ +--init none \ +--no-confirm \ +--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + +ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" + +COPY . /nixpg + +WORKDIR /nixpg + +RUN nix profile install .#psql_17/bin + +RUN nix store gc + +WORKDIR / + + +RUN mkdir -p /usr/lib/postgresql/bin \ + /usr/lib/postgresql/share/postgresql \ + /usr/share/postgresql \ + /var/lib/postgresql \ + && chown -R postgres:postgres /usr/lib/postgresql \ + && chown -R postgres:postgres /var/lib/postgresql \ + && chown -R postgres:postgres /usr/share/postgresql + +# Create symbolic links +RUN ln -s /nix/var/nix/profiles/default/bin/* /usr/lib/postgresql/bin/ \ + && ln -s /nix/var/nix/profiles/default/bin/* /usr/bin/ \ + && chown -R postgres:postgres /usr/bin + +# Create symbolic links for PostgreSQL shares +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/share/postgresql/ +RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ +RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ +RUN chown -R postgres:postgres /usr/share/postgresql/ +# Create symbolic links for contrib directory +RUN tree /nix > /tmp/tree.txt && cat /tmp/tree.txt && cat /tmp/tree.txt >&2 + +RUN chown -R postgres:postgres /usr/lib/postgresql + +RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets + + +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + checkinstall \ + cmake + +ENV PGDATA=/var/lib/postgresql/data + +#################### +# setup-wal-g.yml +#################### +FROM base as walg +ARG wal_g_release + +WORKDIR /nixpg + +RUN nix profile install .#wal-g-3 && \ + ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g + +RUN nix store gc + +WORKDIR / +# #################### +# # Download gosu for easy step-down from root +# #################### +FROM base as gosu +ARG TARGETARCH +# Install dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gnupg \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* +# Download binary +ARG GOSU_VERSION=1.16 +ARG GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4 +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH \ + /usr/local/bin/gosu +ADD https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$TARGETARCH.asc \ + /usr/local/bin/gosu.asc +# Verify checksum +RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY && \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ + gpgconf --kill all && \ + chmod +x /usr/local/bin/gosu + +# #################### +# # Build final image +# #################### +FROM gosu as production +RUN id postgres || (echo "postgres user does not exist" && exit 1) +# # Setup extensions +COPY --from=walg /tmp/wal-g /usr/local/bin/ + +# # Initialise configs +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts +COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh +COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh + +RUN sed -i \ + -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ + -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ + #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ + echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ + echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + usermod -aG postgres wal-g && \ + mkdir -p /etc/postgresql-custom && \ + chown postgres:postgres /etc/postgresql-custom + + # Remove items from postgresql.conf +RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" + #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present +RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/supautils.conf" + + + +# # Include schema migrations +COPY migrations/db /docker-entrypoint-initdb.d/ +COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql +COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql + +# # Add upstream entrypoint script +COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu +ADD --chmod=0755 \ + https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ + /usr/local/bin/ + +RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql + +ENTRYPOINT ["docker-entrypoint.sh"] + +HEALTHCHECK --interval=2s --timeout=2s --retries=10 CMD pg_isready -U postgres -h localhost +STOPSIGNAL SIGINT +EXPOSE 5432 + +ENV POSTGRES_HOST=/var/run/postgresql +ENV POSTGRES_USER=supabase_admin +ENV POSTGRES_DB=postgres +ENV POSTGRES_INITDB_ARGS="--allow-group-access --locale-provider=icu --encoding=UTF-8 --icu-locale=en_US.UTF-8" +RUN apt-get update && apt-get install -y --no-install-recommends \ + locales \ + && rm -rf /var/lib/apt/lists/* && \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ + && localedef -i C -c -f UTF-8 -A /usr/share/locale/locale.alias C.UTF-8 +RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 +ENV LC_CTYPE=C.UTF-8 +ENV LC_COLLATE=C.UTF-8 +ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive +RUN mkdir -p /usr/share/postgresql/extension/ && \ + ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ + chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh +CMD ["postgres", "-D", "/etc/postgresql"] diff --git a/README.md b/README.md index eb992c824..d7b106cf8 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to ## Primary Features - ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html) +- ✅ Postgres [postgresql-17.4](https://www.postgresql.org/docs/17/index.html) - ✅ Postgres [orioledb-postgresql-17_5](https://github.com/orioledb/orioledb) - ✅ Ubuntu 20.04 (Focal Fossa). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. @@ -44,6 +45,38 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | +### PostgreSQL 17 Extensions +| Extension | Version | Description | +| ------------- | :-------------: | ------------- | +| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | +| [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | +| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | +| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | +| [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | +| [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | +| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | +| [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | +| [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | +| [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | +| [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging | +| [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | +| [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | +| [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | +| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | +| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | +| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | +| [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | +| [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | +| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | + ### PostgreSQL orioledb-17 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | @@ -61,7 +94,6 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | | [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | | [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging | -| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens | | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 82ecb35b6..92c1516a5 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -214,6 +214,12 @@ function initiate_upgrade { if [[ "$OLD_PGVERSION" =~ 14* ]]; then SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/wrappers//" | xargs) fi + + # Timescale is no longer supported for PG17+ upgrades + if [[ "$PGVERSION" != "15" ]]; then + SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/timescaledb//" | xargs) + fi + SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/pg_cron//" | xargs) SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/pg_net//" | xargs) SHARED_PRELOAD_LIBRARIES=$(echo "$SHARED_PRELOAD_LIBRARIES" | sed "s/check_role_membership//" | xargs) @@ -289,7 +295,7 @@ function initiate_upgrade { # shellcheck disable=SC1091 source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh nix-collect-garbage -d > /tmp/pg_upgrade-nix-gc.log 2>&1 || true - PG_UPGRADE_BIN_DIR=$(nix build "github:supabase/postgres/${NIX_FLAKE_VERSION}#psql_15/bin" --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes) + PG_UPGRADE_BIN_DIR=$(nix build "github:supabase/postgres/${NIX_FLAKE_VERSION}#psql_${PGVERSION}/bin" --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes) PGSHARENEW="$PG_UPGRADE_BIN_DIR/share/postgresql" fi diff --git a/ansible/tasks/setup-extensions.yml b/ansible/tasks/setup-extensions.yml deleted file mode 100644 index a560ae868..000000000 --- a/ansible/tasks/setup-extensions.yml +++ /dev/null @@ -1,91 +0,0 @@ -- name: Install plv8 - import_tasks: tasks/postgres-extensions/13-plv8.yml - -- name: Install pg_jsonschema - import_tasks: tasks/postgres-extensions/22-pg_jsonschema.yml - -- name: Install postgis - import_tasks: tasks/postgres-extensions/01-postgis.yml - -- name: Install pgrouting - import_tasks: tasks/postgres-extensions/02-pgrouting.yml - -- name: Install pgtap - import_tasks: tasks/postgres-extensions/03-pgtap.yml - -- name: Install pg_cron - import_tasks: tasks/postgres-extensions/04-pg_cron.yml - -- name: Install pgaudit - import_tasks: tasks/postgres-extensions/05-pgaudit.yml - -- name: Install pgjwt - import_tasks: tasks/postgres-extensions/06-pgjwt.yml - -- name: Install pgsql-http - import_tasks: tasks/postgres-extensions/07-pgsql-http.yml - -- name: Install plpgsql_check - import_tasks: tasks/postgres-extensions/08-plpgsql_check.yml - -- name: Install pg-safeupdate - import_tasks: tasks/postgres-extensions/09-pg-safeupdate.yml - -- name: Install timescaledb - import_tasks: tasks/postgres-extensions/10-timescaledb.yml - -- name: Install wal2json - import_tasks: tasks/postgres-extensions/11-wal2json.yml - -- name: Install pljava - import_tasks: tasks/postgres-extensions/12-pljava.yml - tags: - - legacy-incompatible - -- name: Install pg_plan_filter - import_tasks: tasks/postgres-extensions/14-pg_plan_filter.yml - -- name: Install pg_net - import_tasks: tasks/postgres-extensions/15-pg_net.yml - -- name: Install rum - import_tasks: tasks/postgres-extensions/16-rum.yml - -- name: Install pg_hashids - import_tasks: tasks/postgres-extensions/17-pg_hashids.yml - -- name: Install pgsodium - import_tasks: tasks/postgres-extensions/18-pgsodium.yml - -- name: Install pg_graphql - import_tasks: tasks/postgres-extensions/19-pg_graphql.yml - tags: - - legacy-incompatible - -- name: Install pg_stat_monitor - import_tasks: tasks/postgres-extensions/20-pg_stat_monitor.yml - -- name: Install vault - import_tasks: tasks/postgres-extensions/23-vault.yml - -- name: Install PGroonga - import_tasks: tasks/postgres-extensions/24-pgroonga.yml - -- name: Install wrappers - import_tasks: tasks/postgres-extensions/25-wrappers.yml - -- name: Install hypopg - import_tasks: tasks/postgres-extensions/26-hypopg.yml - - - name: Install pg_repack - import_tasks: tasks/postgres-extensions/27-pg_repack.yml - -- name: Install pgvector - import_tasks: tasks/postgres-extensions/28-pgvector.yml - -- name: Install Trusted Language Extensions - import_tasks: tasks/postgres-extensions/29-pg_tle.yml - -- name: Verify async task status - import_tasks: tasks/postgres-extensions/99-finish_async_tasks.yml - when: async_mode diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index a45b7a502..29527d335 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -216,7 +216,8 @@ block: - name: Check if psql_version is psql_orioledb set_fact: - is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" + is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}" + is_psql_17: "{{ psql_version in ['psql_17'] }}" - name: Initialize the database stage2_nix (non-orioledb) become: yes @@ -232,7 +233,7 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive vars: ansible_command_timeout: 60 - when: stage2_nix and not is_psql_oriole + when: stage2_nix and not is_psql_oriole and not is_psql_17 - name: Initialize the database stage2_nix (orioledb) become: yes @@ -254,7 +255,7 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive vars: ansible_command_timeout: 60 - when: stage2_nix and is_psql_oriole + when: stage2_nix and is_psql_oriole or is_psql_17 - name: copy PG systemd unit template: diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index d2877e239..99b89d6d9 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -6,32 +6,36 @@ - name: Check psql_version and modify supautils.conf and postgresql.conf if necessary block: - - name: Check if psql_version is psql_orioledb-16 + - name: Check if psql_version is psql_orioledb-17 set_fact: - is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}" + is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}" - - name: Remove specified extensions from postgresql.conf if oriole-16 build + - name: Check if psql_version is psql_17 + set_fact: + is_psql_17: "{{ psql_version in ['psql_17'] }}" + + - name: Remove specified extensions from postgresql.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > sed -i 's/ timescaledb,//g' /etc/postgresql/postgresql.conf - when: is_psql_oriole and stage2_nix + when: is_psql_oriole or is_psql_17 and stage2_nix become: yes - - name: Remove specified extensions from supautils.conf if oriole-16 build + - name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > - sed -i 's/ timescaledb,//g; s/ vector,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g' /etc/postgresql-custom/supautils.conf - when: is_psql_oriole and stage2_nix + when: is_psql_oriole or is_psql_17 and stage2_nix become: yes - - name: Remove db_user_namespace from postgresql.conf if oriole-xx build + - name: Remove db_user_namespace from postgresql.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' /etc/postgresql/postgresql.conf - when: is_psql_oriole and stage2_nix + when: is_psql_oriole or is_psql_17 and stage2_nix become: yes - name: Append orioledb to shared_preload_libraries append within closing quote @@ -153,15 +157,6 @@ group: postgres when: stage2_nix -# - name: Ensure /usr/lib/postgresql/share/postgresql/pljava directory exists -# file: -# path: /usr/lib/postgresql/share/postgresql/pljava -# state: directory -# owner: postgres -# group: postgres -# when: stage2_nix -# It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task - - name: import pgsodium_getkey script template: src: files/pgsodium_getkey_readonly.sh.j2 @@ -199,16 +194,6 @@ become: yes when: stage2_nix -# - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/pljava to /usr/lib/postgresql/share/postgresql/pljava -# file: -# src: "{{ item }}" -# dest: "/usr/lib/postgresql/share/postgresql/pljava/{{ item | basename }}" -# state: link -# with_fileglob: -# - "/var/lib/postgresql/.nix-profile/share/pljava/*" -# become: yes -# It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task - - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql to /usr/lib/postgresql/share/postgresql shell: >- find /var/lib/postgresql/.nix-profile/share/postgresql/ -maxdepth 1 -type f,l -exec sh -c 'ln -s "$0" "/usr/lib/postgresql/share/postgresql/$(basename $0)"' {} \; diff --git a/ansible/vars.yml b/ansible/vars.yml index 5652df014..3d8a05ec9 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -4,12 +4,14 @@ async_mode: true postgres_major: - "15" + - "17" - "orioledb-17" # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.053-orioledb" - postgres15: "15.8.1.060" + postgresorioledb-17: "17.0.1.54-orioledb" + postgres17: "17.4.1.004" + postgres15: "15.8.1.061" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index 135031afc..efaafbe89 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -10,23 +10,31 @@ 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 .#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 nix build .#wal-g-2 -o wal-g-2 -L 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 ./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 + if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_15_debug -o ./postgresql_15_debug nix build .#postgresql_15_src -o ./postgresql_15_src nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src + nix build .#postgresql_17_debug -o ./postgresql_17_debug + nix build .#postgresql_17_src -o ./postgresql_17_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src fi diff --git a/flake.nix b/flake.nix index 19a20146f..9f2171f44 100644 --- a/flake.nix +++ b/flake.nix @@ -149,15 +149,17 @@ #Where we import and build the orioledb extension, we add on our custom extensions # plus the orioledb option - #we're not using timescaledb in the orioledb version of supabase extensions + #we're not using timescaledb or plv8 in the orioledb-17 version or pg 17 of supabase extensions orioleFilteredExtensions = builtins.filter ( x: x != ./nix/ext/timescaledb.nix && x != ./nix/ext/timescaledb-2.9.1.nix && - x != ./nix/ext/plv8.nix + x != ./nix/ext/plv8.nix && + x != ./nix/ext/pgjwt.nix ) ourExtensions; orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; + dbExtensions17 = orioleFilteredExtensions; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way @@ -165,9 +167,8 @@ # tools to inspect what the contents of the install are: the PSQL # version, the installed extensions, et cetera. # - # This takes three arguments: + # This takes two arguments: # - pgbin: the postgresql package we are building on top of - # - upstreamExts: the list of extensions from upstream nixpkgs. This is # not a list of packages, but an attrset containing extension names # mapped to versions. # - ourExts: the list of extensions from upstream nixpkgs. This is not @@ -176,7 +177,7 @@ # # The output is a package containing the receipt.json file, which can be # merged with the PostgreSQL installation using 'symlinkJoin'. - makeReceipt = pgbin: upstreamExts: ourExts: pkgs.writeTextFile { + makeReceipt = pgbin: ourExts: pkgs.writeTextFile { name = "receipt"; destination = "/receipt.json"; text = builtins.toJSON { @@ -184,7 +185,6 @@ psql-version = pgbin.version; nixpkgs = { revision = nixpkgs.rev; - extensions = upstreamExts; }; extensions = ourExts; @@ -201,6 +201,8 @@ postgresql = getPostgresqlPackage version; extensionsToUse = if (builtins.elem version ["orioledb-17"]) then orioledbExtensions + else if (builtins.elem version ["17"]) + then dbExtensions17 else ourExtensions; in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; @@ -225,21 +227,15 @@ makePostgresBin = version: let postgresql = getPostgresqlPackage version; - upstreamExts = map - (ext: { - name = postgresql.pkgs."${ext}".pname; - version = postgresql.pkgs."${ext}".version; - }) - psqlExtensions; ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurPostgresPkgs version); pgbin = postgresql.withPackages (ps: - (map (ext: ps."${ext}") psqlExtensions) ++ (makeOurPostgresPkgs version) + makeOurPostgresPkgs version ); in pkgs.symlinkJoin { inherit (pgbin) name version; - paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; + paths = [ pgbin (makeReceipt pgbin ourExts) ]; }; # Create an attribute set, containing all the relevant packages for a @@ -319,6 +315,7 @@ PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; PGSQL_SUPERUSER = "${pgsqlSuperuser}"; PSQL15_BINDIR = "${basePackages.psql_15.bin}"; + PSQL17_BINDIR = "${basePackages.psql_17.bin}"; PSQL_CONF_FILE = "${paths.pgconfigFile}"; PSQLORIOLEDB17_BINDIR = "${basePackages.psql_orioledb-17.bin}"; PGSODIUM_GETKEY = "${paths.getkeyScript}"; @@ -381,6 +378,7 @@ # Define the available PostgreSQL versions postgresVersions = { psql_15 = makePostgres "15"; + psql_17 = makePostgres "17"; psql_orioledb-17 = makePostgres "orioledb-17" ; }; @@ -396,6 +394,7 @@ postgresql = postgresqlPackage; }; postgresql_15 = getPostgresqlPackage "15"; + postgresql_17 = getPostgresqlPackage "17"; postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; in postgresVersions // { @@ -405,13 +404,15 @@ cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; # PostgreSQL versions. psql_15 = postgresVersions.psql_15; + psql_17 = postgresVersions.psql_17; psql_orioledb-17 = postgresVersions.psql_orioledb-17; wal-g-2 = wal-g-2; wal-g-3 = wal-g-3; sfcgal = sfcgal; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_orioledb-17; + inherit postgresql_15 postgresql_17 postgresql_orioledb-17; postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; + postgresql_17_debug = if pkgs.stdenv.isLinux then postgresql_17.debug else null; postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; @@ -435,6 +436,26 @@ platforms = platforms.all; }; }; + postgresql_17_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-17-src"; + version = postgresql_17.version; + src = postgresql_17.src; + + nativeBuildInputs = [ pkgs.bzip2 ]; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + meta = with pkgs.lib; { + description = "PostgreSQL 17 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; + }; postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { pname = "postgresql-17-src"; version = postgresql_orioledb-17.version; @@ -480,6 +501,7 @@ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL17_BINDIR' '${basePackages.psql_17.bin}' \ --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ @@ -665,7 +687,8 @@ name = pkg.version; in if builtins.match "15.*" name != null then "15" - else if builtins.match "17.*" name != null then "orioledb-17" + else if builtins.match "17.*" name != null then "17" + else if builtins.match "orioledb-17.*" name != null then "orioledb-17" else throw "Unsupported PostgreSQL version: ${name}"; # Helper function to filter SQL files based on version @@ -674,10 +697,15 @@ files = builtins.readDir dir; isValidFile = name: let - isVersionSpecific = builtins.match "z_([0-9]+)_.*" name != null; + isVersionSpecific = builtins.match "z_.*" name != null; matchesVersion = if isVersionSpecific - then builtins.match ("z_" + version + "_.*") name != null + then + if version == "orioledb-17" + then builtins.match "z_orioledb-17_.*" name != null + else if version == "17" + then builtins.match "z_17_.*" name != null + else builtins.match "z_15_.*" name != null else true; in pkgs.lib.hasSuffix ".sql" name && matchesVersion; @@ -685,10 +713,20 @@ pkgs.lib.filterAttrs (name: _: isValidFile name) files; # Get the major version for filtering - majorVersion = - if builtins.match ".*17.*" pgpkg.version != null - then "17" - else "15"; + majorVersion = + let + version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version; + _ = builtins.trace "Entering majorVersion logic"; + isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null; + isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null; + result = + if isOrioledbMatch + then "orioledb-17" + else if isSeventeenMatch + then "17" + else "15"; + in + builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8" # Filter SQL test files filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; @@ -845,6 +883,7 @@ # flake check'. This is run in the CI system, as well. checks = { psql_15 = makeCheckHarness basePackages.psql_15.bin; + psql_17 = makeCheckHarness basePackages.psql_17.bin; psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; }; diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index ecce79a3d..3d71bb176 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -18,7 +18,15 @@ grant pg_read_all_data to supabase_read_only_user; create schema if not exists extensions; create extension if not exists "uuid-ossp" with schema extensions; create extension if not exists pgcrypto with schema extensions; -create extension if not exists pgjwt with schema extensions; +do $$ +begin + if exists (select 1 from pg_available_extensions where name = 'pgjwt') then + if not exists (select 1 from pg_extension where extname = 'pgjwt') then + create extension if not exists pgjwt with schema "extensions" cascade; + end if; + end if; +end $$; + -- Set up auth roles for the developer create role anon nologin noinherit; diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql new file mode 100644 index 000000000..eac1280b1 --- /dev/null +++ b/migrations/schema-17.sql @@ -0,0 +1,992 @@ +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET transaction_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: auth; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA auth; + + +-- +-- Name: extensions; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA extensions; + + +-- +-- Name: graphql; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql; + + +-- +-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA graphql_public; + + +-- +-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA pgbouncer; + + +-- +-- Name: realtime; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA realtime; + + +-- +-- Name: storage; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA storage; + + +-- +-- Name: vault; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA vault; + + +-- +-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; + + +-- +-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; + + +-- +-- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +-- +-- Name: email(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.email() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.email', true), '')::text; +$$; + + +-- +-- Name: role(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.role() RETURNS text + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.role', true), '')::text; +$$; + + +-- +-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: - +-- + +CREATE FUNCTION auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid; +$$; + + +-- +-- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_cron' + ) + THEN + grant usage on schema cron to postgres with grant option; + + alter default privileges in schema cron grant all on tables to postgres with grant option; + alter default privileges in schema cron grant all on functions to postgres with grant option; + alter default privileges in schema cron grant all on sequences to postgres with grant option; + + alter default privileges for user supabase_admin in schema cron grant all + on sequences to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on tables to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on functions to postgres with grant option; + + grant all privileges on all tables in schema cron to postgres with grant option; + revoke all on table cron.job from postgres; + grant select on table cron.job to postgres with grant option; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; + + +-- +-- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ +DECLARE + func_is_graphql_resolve bool; +BEGIN + func_is_graphql_resolve = ( + SELECT n.proname = 'resolve' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_proc AS n + ON ev.objid = n.oid + ); + + IF func_is_graphql_resolve + THEN + -- Update public wrapper to pass all arguments through to the pg_graphql resolve func + DROP FUNCTION IF EXISTS graphql_public.graphql; + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language sql + as $$ + select graphql.resolve( + query := query, + variables := coalesce(variables, '{}'), + "operationName" := "operationName", + extensions := extensions + ); + $$; + + -- This hook executes when `graphql.resolve` is created. That is not necessarily the last + -- function in the extension so we need to grant permissions on existing entities AND + -- update default permissions to any others that are created after `graphql.resolve` + grant usage on schema graphql to postgres, anon, authenticated, service_role; + grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; + grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; + grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; + + -- Allow postgres role to allow granting usage on graphql and graphql_public schemas to custom roles + grant usage on schema graphql_public to postgres with grant option; + grant usage on schema graphql to postgres with grant option; + END IF; + +END; +$_$; + + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; + + +-- +-- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + IF EXISTS ( + SELECT FROM pg_extension + WHERE extname = 'pg_net' + -- all versions in use on existing projects as of 2025-02-20 + -- version 0.12.0 onwards don't need these applied + AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0') + ) THEN + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; + END IF; +END; +$$; + + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; + + +-- +-- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + cmd record; +BEGIN + FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + IF cmd.command_tag IN ( + 'CREATE SCHEMA', 'ALTER SCHEMA' + , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' + , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' + , 'CREATE VIEW', 'ALTER VIEW' + , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' + , 'CREATE FUNCTION', 'ALTER FUNCTION' + , 'CREATE TRIGGER' + , 'CREATE TYPE', 'ALTER TYPE' + , 'CREATE RULE' + , 'COMMENT' + ) + -- don't notify in case of CREATE TEMP table or other objects created on pg_temp + AND cmd.schema_name is distinct from 'pg_temp' + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + obj record; +BEGIN + FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() + LOOP + IF obj.object_type IN ( + 'schema' + , 'table' + , 'foreign table' + , 'view' + , 'materialized view' + , 'function' + , 'trigger' + , 'type' + , 'rule' + ) + AND obj.is_temporary IS false -- no pg_temp objects + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +-- +-- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: - +-- + +CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ + DECLARE + graphql_is_dropped bool; + BEGIN + graphql_is_dropped = ( + SELECT ev.schema_name = 'graphql_public' + FROM pg_event_trigger_dropped_objects() AS ev + WHERE ev.schema_name = 'graphql_public' + ); + + IF graphql_is_dropped + THEN + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language plpgsql + as $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; + $$; + END IF; + + END; +$_$; + + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: - +-- + +COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; + + +-- +-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: - +-- + +CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) + LANGUAGE plpgsql SECURITY DEFINER + AS $$ +BEGIN + RAISE WARNING 'PgBouncer auth request: %', p_usename; + + RETURN QUERY + SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow + WHERE usename = p_usename; +END; +$$; + + +-- +-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.extension(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +_filename text; +BEGIN + select string_to_array(name, '/') into _parts; + select _parts[array_length(_parts,1)] into _filename; + -- @todo return the last part instead of 2 + return split_part(_filename, '.', 2); +END +$$; + + +-- +-- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.filename(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[array_length(_parts,1)]; +END +$$; + + +-- +-- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.foldername(name text) RETURNS text[] + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[1:array_length(_parts,1)-1]; +END +$$; + + +-- +-- Name: search(text, text, integer, integer, integer); Type: FUNCTION; Schema: storage; Owner: - +-- + +CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) + LANGUAGE plpgsql + AS $$ +DECLARE +_bucketId text; +BEGIN + -- will be replaced by migrations when server starts + -- saving space for cloud-init +END +$$; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.audit_log_entries ( + instance_id uuid, + id uuid NOT NULL, + payload json, + created_at timestamp with time zone +); + + +-- +-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; + + +-- +-- Name: instances; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.instances ( + id uuid NOT NULL, + uuid uuid, + raw_base_config text, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; + + +-- +-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.refresh_tokens ( + instance_id uuid, + id bigint NOT NULL, + token character varying(255), + user_id character varying(255), + revoked boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: - +-- + +CREATE SEQUENCE auth.refresh_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: - +-- + +ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.schema_migrations ( + version character varying(255) NOT NULL +); + + +-- +-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; + + +-- +-- Name: users; Type: TABLE; Schema: auth; Owner: - +-- + +CREATE TABLE auth.users ( + instance_id uuid, + id uuid NOT NULL, + aud character varying(255), + role character varying(255), + email character varying(255), + encrypted_password character varying(255), + confirmed_at timestamp with time zone, + invited_at timestamp with time zone, + confirmation_token character varying(255), + confirmation_sent_at timestamp with time zone, + recovery_token character varying(255), + recovery_sent_at timestamp with time zone, + email_change_token character varying(255), + email_change character varying(255), + email_change_sent_at timestamp with time zone, + last_sign_in_at timestamp with time zone, + raw_app_meta_data jsonb, + raw_user_meta_data jsonb, + is_super_admin boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +-- +-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: - +-- + +COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.schema_migrations ( + version character varying(128) NOT NULL +); + + +-- +-- Name: buckets; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.buckets ( + id text NOT NULL, + name text NOT NULL, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now() +); + + +-- +-- Name: migrations; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.migrations ( + id integer NOT NULL, + name character varying(100) NOT NULL, + hash character varying(40) NOT NULL, + executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +-- +-- Name: objects; Type: TABLE; Schema: storage; Owner: - +-- + +CREATE TABLE storage.objects ( + id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, + bucket_id text, + name text, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + last_accessed_at timestamp with time zone DEFAULT now(), + metadata jsonb +); + + +-- +-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); + + +-- +-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.audit_log_entries + ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); + + +-- +-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.instances + ADD CONSTRAINT instances_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: users users_email_key; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_email_key UNIQUE (email); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: - +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); + + +-- +-- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_name_key UNIQUE (name); + + +-- +-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); + + +-- +-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_pkey PRIMARY KEY (id); + + +-- +-- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); + + +-- +-- Name: refresh_tokens_token_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token); + + +-- +-- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, email); + + +-- +-- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: - +-- + +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); + + +-- +-- Name: bname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); + + +-- +-- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); + + +-- +-- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: - +-- + +CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); + + +-- +-- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); + + +-- +-- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: - +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: - +-- + +ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; + +-- +-- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: - +-- + +CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); + + +-- +-- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop + WHEN TAG IN ('DROP EXTENSION') + EXECUTE FUNCTION extensions.set_graphql_placeholder(); + + +-- +-- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_cron_access(); + + +-- +-- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end + WHEN TAG IN ('CREATE FUNCTION') + EXECUTE FUNCTION extensions.grant_pg_graphql_access(); + + +-- +-- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + + +-- +-- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end + EXECUTE FUNCTION extensions.pgrst_ddl_watch(); + + +-- +-- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: - +-- + +CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop + EXECUTE FUNCTION extensions.pgrst_drop_watch(); + + +-- +-- PostgreSQL database dump complete +-- + + +-- +-- Dbmate schema migrations +-- + diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 6c2d37f46..013b23d1f 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -122,20 +122,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; --- --- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; - - --- --- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; - - -- -- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - -- diff --git a/migrations/tests/extensions/06-pgjwt.sql b/migrations/tests/extensions/06-pgjwt.sql index 36782fd05..31716d37d 100644 --- a/migrations/tests/extensions/06-pgjwt.sql +++ b/migrations/tests/extensions/06-pgjwt.sql @@ -1,3 +1,10 @@ BEGIN; -create extension if not exists pgjwt with schema "extensions" cascade; +do $$ +begin + if exists (select 1 from pg_available_extensions where name = 'pgjwt') then + if not exists (select 1 from pg_extension where extname = 'pgjwt') then + create extension if not exists pgjwt with schema "extensions" cascade; + end if; + end if; +end $$; ROLLBACK; diff --git a/migrations/tests/extensions/10-timescaledb.sql b/migrations/tests/extensions/10-timescaledb.sql index 2d787a8b8..71fc3b19c 100644 --- a/migrations/tests/extensions/10-timescaledb.sql +++ b/migrations/tests/extensions/10-timescaledb.sql @@ -1,7 +1,7 @@ begin; do $_$ begin - if not exists (select 1 from pg_extension where extname = 'orioledb') then + if current_setting('server_version_num')::integer >= 150000 and current_setting('server_version_num')::integer < 160000 then create extension if not exists timescaledb with schema "extensions"; end if; end diff --git a/migrations/tests/extensions/13-plv8.sql b/migrations/tests/extensions/13-plv8.sql index b19b908dc..8ce134a05 100644 --- a/migrations/tests/extensions/13-plv8.sql +++ b/migrations/tests/extensions/13-plv8.sql @@ -1,7 +1,7 @@ begin; do $_$ begin - if not exists (select 1 from pg_extension where extname = 'orioledb') then + if current_setting('server_version_num')::integer >= 150000 and current_setting('server_version_num')::integer < 160000 then create extension if not exists plv8 with schema "pg_catalog"; end if; end diff --git a/nix/postgresql/16.nix b/nix/postgresql/16.nix deleted file mode 100644 index c964fc580..000000000 --- a/nix/postgresql/16.nix +++ /dev/null @@ -1,4 +0,0 @@ -import ./generic.nix { - version = "16.3"; - hash = "sha256-Mxlj1dPcTK9CFqBJ+kC2bWvLjHMGFYWUEblRh2TmBYU="; -} diff --git a/nix/postgresql/17.nix b/nix/postgresql/17.nix new file mode 100644 index 000000000..32102fdb6 --- /dev/null +++ b/nix/postgresql/17.nix @@ -0,0 +1,4 @@ +import ./generic.nix { + version = "17.4"; + hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c="; +} diff --git a/nix/postgresql/default.nix b/nix/postgresql/default.nix index a065d5aa7..f7b3c5583 100644 --- a/nix/postgresql/default.nix +++ b/nix/postgresql/default.nix @@ -2,8 +2,7 @@ self: let versions = { postgresql_15 = ./15.nix; - postgresql_16 = ./16.nix; - postgresql_orioledb-16 = ./orioledb-16.nix; + postgresql_17 = ./17.nix; postgresql_orioledb-17 = ./orioledb-17.nix; }; mkAttributes = jitSupport: diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index 19b73c162..cefd5a61b 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -83,8 +83,8 @@ let ++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals stdenv'.isLinux [ linux-pam ] ++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ] - ++ lib.optionals (builtins.match "[0-9][0-9]_.*" version != null) [ - perl bison flex docbook_xsl docbook_xml_dtd_45 docbook_xsl_ns libxslt + ++ lib.optionals ((builtins.match "[0-9][0-9]_.*" version != null) || (lib.versionAtLeast version "17")) [ + perl bison flex docbook_xsl docbook_xml_dtd_45 docbook_xsl_ns libxslt ]; nativeBuildInputs = [ diff --git a/nix/postgresql/orioledb-16.nix b/nix/postgresql/orioledb-16.nix deleted file mode 100644 index e9a66850e..000000000 --- a/nix/postgresql/orioledb-16.nix +++ /dev/null @@ -1,4 +0,0 @@ -import ./generic.nix { - version = "16_31"; - hash = "sha256-29uHUACwZKh8e4zJ9tWzEhLNjEuh6P31KbpxnMEhtuI="; -} diff --git a/nix/tests/expected/pgjwt.out b/nix/tests/expected/z_15_pgjwt.out similarity index 100% rename from nix/tests/expected/pgjwt.out rename to nix/tests/expected/z_15_pgjwt.out diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 92ce9ac2b..db2962678 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -68,7 +68,6 @@ order by lo | t ltree | t moddatetime | t - orioledb | t pageinspect | t pg_buffercache | t pg_freespacemap | t @@ -87,7 +86,6 @@ order by pg_walinspect | t pgaudit | t pgcrypto | t - pgjwt | f pgmq | f pgroonga | f pgroonga_database | f @@ -116,7 +114,7 @@ order by vector | t wrappers | f xml2 | f -(74 rows) +(72 rows) /* @@ -155,19 +153,19 @@ order by e.extname, n.nspname, p.proname, - pg_catalog.pg_get_function_identity_arguments(p.oid); + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); extension_name | schema_name | function_name | argument_types | return_type ----------------------+----------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr amcheck | public | bt_index_check | index regclass | void - amcheck | public | bt_index_check | index regclass, heapallindexed boolean | void amcheck | public | bt_index_check | index regclass, heapallindexed boolean, checkunique boolean | void + amcheck | public | bt_index_check | index regclass, heapallindexed boolean | void amcheck | public | bt_index_parent_check | index regclass | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean, checkunique boolean | void amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean | void amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean | void - amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean, checkunique boolean | void amcheck | public | verify_heapam | relation regclass, on_error_stop boolean, check_toast boolean, skip text, startblock bigint, endblock bigint, OUT blkno bigint, OUT offnum integer, OUT attnum integer, OUT msg text | SETOF record autoinc | public | autoinc | | trigger bloom | public | blhandler | internal | index_am_handler @@ -447,8 +445,8 @@ order by btree_gist | public | ts_dist | timestamp without time zone, timestamp without time zone | interval btree_gist | public | tstz_dist | timestamp with time zone, timestamp with time zone | interval citext | public | citext | boolean | citext - citext | public | citext | character | citext citext | public | citext | inet | citext + citext | public | citext | character | citext citext | public | citext_cmp | citext, citext | integer citext | public | citext_eq | citext, citext | boolean citext | public | citext_ge | citext, citext | boolean @@ -475,8 +473,8 @@ order by citext | public | regexp_match | citext, citext, text | text[] citext | public | regexp_matches | citext, citext | SETOF text[] citext | public | regexp_matches | citext, citext, text | SETOF text[] - citext | public | regexp_replace | citext, citext, text | text citext | public | regexp_replace | citext, citext, text, text | text + citext | public | regexp_replace | citext, citext, text | text citext | public | regexp_split_to_array | citext, citext | text[] citext | public | regexp_split_to_array | citext, citext, text | text[] citext | public | regexp_split_to_table | citext, citext | SETOF text @@ -493,12 +491,12 @@ order by citext | public | texticregexne | citext, citext | boolean citext | public | texticregexne | citext, text | boolean citext | public | translate | citext, citext, text | text - cube | public | cube | cube, double precision | cube cube | public | cube | cube, double precision, double precision | cube cube | public | cube | double precision | cube + cube | public | cube | double precision[], double precision[] | cube + cube | public | cube | cube, double precision | cube cube | public | cube | double precision, double precision | cube cube | public | cube | double precision[] | cube - cube | public | cube | double precision[], double precision[] | cube cube | public | cube_cmp | cube, cube | integer cube | public | cube_contained | cube, cube | boolean cube | public | cube_contains | cube, cube | boolean @@ -533,16 +531,16 @@ order by cube | public | g_cube_picksplit | internal, internal | internal cube | public | g_cube_same | cube, cube, internal | internal cube | public | g_cube_union | internal, internal | cube - dblink | public | dblink | text | SETOF record dblink | public | dblink | text, boolean | SETOF record + dblink | public | dblink | text | SETOF record dblink | public | dblink | text, text | SETOF record dblink | public | dblink | text, text, boolean | SETOF record dblink | public | dblink_build_sql_delete | text, int2vector, integer, text[] | text dblink | public | dblink_build_sql_insert | text, int2vector, integer, text[], text[] | text dblink | public | dblink_build_sql_update | text, int2vector, integer, text[], text[] | text dblink | public | dblink_cancel_query | text | text - dblink | public | dblink_close | text | text dblink | public | dblink_close | text, boolean | text + dblink | public | dblink_close | text | text dblink | public | dblink_close | text, text | text dblink | public | dblink_close | text, text, boolean | text dblink | public | dblink_connect | text | text @@ -550,29 +548,29 @@ order by dblink | public | dblink_connect_u | text | text dblink | public | dblink_connect_u | text, text | text dblink | public | dblink_current_query | | text - dblink | public | dblink_disconnect | | text dblink | public | dblink_disconnect | text | text + dblink | public | dblink_disconnect | | text dblink | public | dblink_error_message | text | text - dblink | public | dblink_exec | text | text dblink | public | dblink_exec | text, boolean | text + dblink | public | dblink_exec | text | text dblink | public | dblink_exec | text, text | text dblink | public | dblink_exec | text, text, boolean | text dblink | public | dblink_fdw_validator | options text[], catalog oid | void + dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record dblink | public | dblink_fetch | text, integer | SETOF record - dblink | public | dblink_fetch | text, integer, boolean | SETOF record dblink | public | dblink_fetch | text, text, integer | SETOF record - dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record + dblink | public | dblink_fetch | text, integer, boolean | SETOF record dblink | public | dblink_get_connections | | text[] - dblink | public | dblink_get_notify | conname text, OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record dblink | public | dblink_get_notify | OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record + dblink | public | dblink_get_notify | conname text, OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record dblink | public | dblink_get_pkey | text | SETOF dblink_pkey_results - dblink | public | dblink_get_result | text | SETOF record dblink | public | dblink_get_result | text, boolean | SETOF record + dblink | public | dblink_get_result | text | SETOF record dblink | public | dblink_is_busy | text | integer + dblink | public | dblink_open | text, text, text, boolean | text dblink | public | dblink_open | text, text | text dblink | public | dblink_open | text, text, boolean | text dblink | public | dblink_open | text, text, text | text - dblink | public | dblink_open | text, text, text, boolean | text dblink | public | dblink_send_query | text, text | integer dict_int | public | dintdict_init | internal | internal dict_int | public | dintdict_lexize | internal, internal, internal, internal | internal @@ -594,17 +592,17 @@ order by fuzzystrmatch | public | dmetaphone_alt | text | text fuzzystrmatch | public | levenshtein | text, text | integer fuzzystrmatch | public | levenshtein | text, text, integer, integer, integer | integer - fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer fuzzystrmatch | public | levenshtein_less_equal | text, text, integer, integer, integer, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer fuzzystrmatch | public | metaphone | text, integer | text fuzzystrmatch | public | soundex | text | text fuzzystrmatch | public | text_soundex | text | text hstore | public | akeys | hstore | text[] hstore | public | avals | hstore | text[] hstore | public | defined | hstore, text | boolean - hstore | public | delete | hstore, hstore | hstore hstore | public | delete | hstore, text | hstore hstore | public | delete | hstore, text[] | hstore + hstore | public | delete | hstore, hstore | hstore hstore | public | each | hs hstore, OUT key text, OUT value text | SETOF record hstore | public | exist | hstore, text | boolean hstore | public | exists_all | hstore, text[] | boolean @@ -626,10 +624,10 @@ order by hstore | public | hs_concat | hstore, hstore | hstore hstore | public | hs_contained | hstore, hstore | boolean hstore | public | hs_contains | hstore, hstore | boolean - hstore | public | hstore | record | hstore + hstore | public | hstore | text[], text[] | hstore hstore | public | hstore | text, text | hstore hstore | public | hstore | text[] | hstore - hstore | public | hstore | text[], text[] | hstore + hstore | public | hstore | record | hstore hstore | public | hstore_cmp | hstore, hstore | integer hstore | public | hstore_eq | hstore, hstore | boolean hstore | public | hstore_ge | hstore, hstore | boolean @@ -661,23 +659,23 @@ order by hstore | public | tconvert | text, text | hstore http | public | bytea_to_text | data bytea | text http | public | http | request http_request | http_response - http | public | http_delete | uri character varying | http_response http | public | http_delete | uri character varying, content character varying, content_type character varying | http_response - http | public | http_get | uri character varying | http_response + http | public | http_delete | uri character varying | http_response http | public | http_get | uri character varying, data jsonb | http_response + http | public | http_get | uri character varying | http_response http | public | http_head | uri character varying | http_response http | public | http_header | field character varying, value character varying | http_header http | public | http_list_curlopt | | TABLE(curlopt text, value text) http | public | http_patch | uri character varying, content character varying, content_type character varying | http_response - http | public | http_post | uri character varying, content character varying, content_type character varying | http_response http | public | http_post | uri character varying, data jsonb | http_response + http | public | http_post | uri character varying, content character varying, content_type character varying | http_response http | public | http_put | uri character varying, content character varying, content_type character varying | http_response http | public | http_reset_curlopt | | boolean http | public | http_set_curlopt | curlopt character varying, value character varying | boolean http | public | text_to_bytea | data text | bytea http | public | urlencode | data jsonb | text - http | public | urlencode | string bytea | text http | public | urlencode | string character varying | text + http | public | urlencode | string bytea | text hypopg | public | hypopg | OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid | SETOF record hypopg | public | hypopg_create_index | sql_order text, OUT indexrelid oid, OUT indexname text | SETOF record hypopg | public | hypopg_drop_index | indexid oid | boolean @@ -750,37 +748,37 @@ order by intarray | public | subarray | integer[], integer, integer | integer[] intarray | public | uniq | integer[] | integer[] isn | public | btean13cmp | ean13, ean13 | integer - isn | public | btean13cmp | ean13, isbn | integer - isn | public | btean13cmp | ean13, isbn13 | integer - isn | public | btean13cmp | ean13, ismn | integer - isn | public | btean13cmp | ean13, ismn13 | integer isn | public | btean13cmp | ean13, issn | integer - isn | public | btean13cmp | ean13, issn13 | integer isn | public | btean13cmp | ean13, upc | integer + isn | public | btean13cmp | ean13, issn13 | integer + isn | public | btean13cmp | ean13, ismn | integer + isn | public | btean13cmp | ean13, ismn13 | integer + isn | public | btean13cmp | ean13, isbn13 | integer + isn | public | btean13cmp | ean13, isbn | integer + isn | public | btisbn13cmp | isbn13, isbn13 | integer isn | public | btisbn13cmp | isbn13, ean13 | integer isn | public | btisbn13cmp | isbn13, isbn | integer - isn | public | btisbn13cmp | isbn13, isbn13 | integer isn | public | btisbncmp | isbn, ean13 | integer isn | public | btisbncmp | isbn, isbn | integer isn | public | btisbncmp | isbn, isbn13 | integer + isn | public | btismn13cmp | ismn13, ismn13 | integer isn | public | btismn13cmp | ismn13, ean13 | integer isn | public | btismn13cmp | ismn13, ismn | integer - isn | public | btismn13cmp | ismn13, ismn13 | integer - isn | public | btismncmp | ismn, ean13 | integer isn | public | btismncmp | ismn, ismn | integer + isn | public | btismncmp | ismn, ean13 | integer isn | public | btismncmp | ismn, ismn13 | integer + isn | public | btissn13cmp | issn13, issn13 | integer isn | public | btissn13cmp | issn13, ean13 | integer isn | public | btissn13cmp | issn13, issn | integer - isn | public | btissn13cmp | issn13, issn13 | integer isn | public | btissncmp | issn, ean13 | integer - isn | public | btissncmp | issn, issn | integer isn | public | btissncmp | issn, issn13 | integer - isn | public | btupccmp | upc, ean13 | integer + isn | public | btissncmp | issn, issn | integer isn | public | btupccmp | upc, upc | integer + isn | public | btupccmp | upc, ean13 | integer isn | public | ean13_in | cstring | ean13 - isn | public | ean13_out | ean13 | cstring isn | public | ean13_out | isbn13 | cstring isn | public | ean13_out | ismn13 | cstring + isn | public | ean13_out | ean13 | cstring isn | public | ean13_out | issn13 | cstring isn | public | hashean13 | ean13 | integer isn | public | hashisbn | isbn | integer @@ -790,14 +788,14 @@ order by isn | public | hashissn | issn | integer isn | public | hashissn13 | issn13 | integer isn | public | hashupc | upc | integer - isn | public | is_valid | ean13 | boolean - isn | public | is_valid | isbn | boolean isn | public | is_valid | isbn13 | boolean + isn | public | is_valid | upc | boolean isn | public | is_valid | ismn | boolean - isn | public | is_valid | ismn13 | boolean isn | public | is_valid | issn | boolean + isn | public | is_valid | isbn | boolean + isn | public | is_valid | ismn13 | boolean + isn | public | is_valid | ean13 | boolean isn | public | is_valid | issn13 | boolean - isn | public | is_valid | upc | boolean isn | public | isbn | ean13 | isbn isn | public | isbn13 | ean13 | isbn13 isn | public | isbn13_in | cstring | isbn13 @@ -806,192 +804,192 @@ order by isn | public | ismn13 | ean13 | ismn13 isn | public | ismn13_in | cstring | ismn13 isn | public | ismn_in | cstring | ismn - isn | public | isn_out | isbn | cstring + isn | public | isn_out | upc | cstring isn | public | isn_out | ismn | cstring isn | public | isn_out | issn | cstring - isn | public | isn_out | upc | cstring - isn | public | isn_weak | | boolean + isn | public | isn_out | isbn | cstring isn | public | isn_weak | boolean | boolean + isn | public | isn_weak | | boolean + isn | public | isneq | ismn, ismn | boolean isn | public | isneq | ean13, ean13 | boolean - isn | public | isneq | ean13, isbn | boolean - isn | public | isneq | ean13, isbn13 | boolean - isn | public | isneq | ean13, ismn | boolean - isn | public | isneq | ean13, ismn13 | boolean - isn | public | isneq | ean13, issn | boolean - isn | public | isneq | ean13, issn13 | boolean - isn | public | isneq | ean13, upc | boolean isn | public | isneq | isbn, ean13 | boolean + isn | public | isneq | issn, ean13 | boolean + isn | public | isneq | isbn13, isbn13 | boolean + isn | public | isneq | ean13, issn | boolean isn | public | isneq | isbn, isbn | boolean - isn | public | isneq | isbn, isbn13 | boolean + isn | public | isneq | ean13, upc | boolean + isn | public | isneq | ean13, issn13 | boolean + isn | public | isneq | ean13, ismn | boolean + isn | public | isneq | upc, upc | boolean + isn | public | isneq | issn13, issn13 | boolean + isn | public | isneq | upc, ean13 | boolean + isn | public | isneq | ismn13, ismn13 | boolean + isn | public | isneq | issn13, ean13 | boolean + isn | public | isneq | ean13, ismn13 | boolean + isn | public | isneq | ismn13, ean13 | boolean + isn | public | isneq | issn13, issn | boolean + isn | public | isneq | ismn, ean13 | boolean + isn | public | isneq | ismn13, ismn | boolean + isn | public | isneq | ean13, isbn13 | boolean isn | public | isneq | isbn13, ean13 | boolean isn | public | isneq | isbn13, isbn | boolean - isn | public | isneq | isbn13, isbn13 | boolean - isn | public | isneq | ismn, ean13 | boolean - isn | public | isneq | ismn, ismn | boolean + isn | public | isneq | isbn, isbn13 | boolean isn | public | isneq | ismn, ismn13 | boolean - isn | public | isneq | ismn13, ean13 | boolean - isn | public | isneq | ismn13, ismn | boolean - isn | public | isneq | ismn13, ismn13 | boolean - isn | public | isneq | issn, ean13 | boolean - isn | public | isneq | issn, issn | boolean + isn | public | isneq | ean13, isbn | boolean isn | public | isneq | issn, issn13 | boolean - isn | public | isneq | issn13, ean13 | boolean - isn | public | isneq | issn13, issn | boolean - isn | public | isneq | issn13, issn13 | boolean - isn | public | isneq | upc, ean13 | boolean - isn | public | isneq | upc, upc | boolean + isn | public | isneq | issn, issn | boolean + isn | public | isnge | ismn, ismn | boolean isn | public | isnge | ean13, ean13 | boolean - isn | public | isnge | ean13, isbn | boolean - isn | public | isnge | ean13, isbn13 | boolean - isn | public | isnge | ean13, ismn | boolean - isn | public | isnge | ean13, ismn13 | boolean - isn | public | isnge | ean13, issn | boolean - isn | public | isnge | ean13, issn13 | boolean - isn | public | isnge | ean13, upc | boolean isn | public | isnge | isbn, ean13 | boolean + isn | public | isnge | issn, ean13 | boolean + isn | public | isnge | isbn13, isbn13 | boolean + isn | public | isnge | ean13, issn | boolean isn | public | isnge | isbn, isbn | boolean - isn | public | isnge | isbn, isbn13 | boolean + isn | public | isnge | ean13, upc | boolean + isn | public | isnge | ean13, issn13 | boolean + isn | public | isnge | ean13, ismn | boolean + isn | public | isnge | upc, upc | boolean + isn | public | isnge | issn13, issn13 | boolean + isn | public | isnge | upc, ean13 | boolean + isn | public | isnge | ismn13, ismn13 | boolean + isn | public | isnge | issn13, ean13 | boolean + isn | public | isnge | ean13, ismn13 | boolean + isn | public | isnge | ismn13, ean13 | boolean + isn | public | isnge | issn13, issn | boolean + isn | public | isnge | ismn, ean13 | boolean + isn | public | isnge | ismn13, ismn | boolean + isn | public | isnge | ean13, isbn13 | boolean isn | public | isnge | isbn13, ean13 | boolean isn | public | isnge | isbn13, isbn | boolean - isn | public | isnge | isbn13, isbn13 | boolean - isn | public | isnge | ismn, ean13 | boolean - isn | public | isnge | ismn, ismn | boolean + isn | public | isnge | isbn, isbn13 | boolean isn | public | isnge | ismn, ismn13 | boolean - isn | public | isnge | ismn13, ean13 | boolean - isn | public | isnge | ismn13, ismn | boolean - isn | public | isnge | ismn13, ismn13 | boolean - isn | public | isnge | issn, ean13 | boolean - isn | public | isnge | issn, issn | boolean + isn | public | isnge | ean13, isbn | boolean isn | public | isnge | issn, issn13 | boolean - isn | public | isnge | issn13, ean13 | boolean - isn | public | isnge | issn13, issn | boolean - isn | public | isnge | issn13, issn13 | boolean - isn | public | isnge | upc, ean13 | boolean - isn | public | isnge | upc, upc | boolean + isn | public | isnge | issn, issn | boolean + isn | public | isngt | ismn, ismn | boolean isn | public | isngt | ean13, ean13 | boolean - isn | public | isngt | ean13, isbn | boolean - isn | public | isngt | ean13, isbn13 | boolean - isn | public | isngt | ean13, ismn | boolean - isn | public | isngt | ean13, ismn13 | boolean - isn | public | isngt | ean13, issn | boolean - isn | public | isngt | ean13, issn13 | boolean - isn | public | isngt | ean13, upc | boolean isn | public | isngt | isbn, ean13 | boolean + isn | public | isngt | issn, ean13 | boolean + isn | public | isngt | isbn13, isbn13 | boolean + isn | public | isngt | ean13, issn | boolean isn | public | isngt | isbn, isbn | boolean - isn | public | isngt | isbn, isbn13 | boolean + isn | public | isngt | ean13, upc | boolean + isn | public | isngt | ean13, issn13 | boolean + isn | public | isngt | ean13, ismn | boolean + isn | public | isngt | upc, upc | boolean + isn | public | isngt | issn13, issn13 | boolean + isn | public | isngt | upc, ean13 | boolean + isn | public | isngt | ismn13, ismn13 | boolean + isn | public | isngt | issn13, ean13 | boolean + isn | public | isngt | ean13, ismn13 | boolean + isn | public | isngt | ismn13, ean13 | boolean + isn | public | isngt | issn13, issn | boolean + isn | public | isngt | ismn, ean13 | boolean + isn | public | isngt | ismn13, ismn | boolean + isn | public | isngt | ean13, isbn13 | boolean isn | public | isngt | isbn13, ean13 | boolean isn | public | isngt | isbn13, isbn | boolean - isn | public | isngt | isbn13, isbn13 | boolean - isn | public | isngt | ismn, ean13 | boolean - isn | public | isngt | ismn, ismn | boolean + isn | public | isngt | isbn, isbn13 | boolean isn | public | isngt | ismn, ismn13 | boolean - isn | public | isngt | ismn13, ean13 | boolean - isn | public | isngt | ismn13, ismn | boolean - isn | public | isngt | ismn13, ismn13 | boolean - isn | public | isngt | issn, ean13 | boolean - isn | public | isngt | issn, issn | boolean + isn | public | isngt | ean13, isbn | boolean isn | public | isngt | issn, issn13 | boolean - isn | public | isngt | issn13, ean13 | boolean - isn | public | isngt | issn13, issn | boolean - isn | public | isngt | issn13, issn13 | boolean - isn | public | isngt | upc, ean13 | boolean - isn | public | isngt | upc, upc | boolean + isn | public | isngt | issn, issn | boolean + isn | public | isnle | ismn, ismn | boolean isn | public | isnle | ean13, ean13 | boolean - isn | public | isnle | ean13, isbn | boolean - isn | public | isnle | ean13, isbn13 | boolean - isn | public | isnle | ean13, ismn | boolean - isn | public | isnle | ean13, ismn13 | boolean - isn | public | isnle | ean13, issn | boolean - isn | public | isnle | ean13, issn13 | boolean - isn | public | isnle | ean13, upc | boolean isn | public | isnle | isbn, ean13 | boolean + isn | public | isnle | issn, ean13 | boolean + isn | public | isnle | isbn13, isbn13 | boolean + isn | public | isnle | ean13, issn | boolean isn | public | isnle | isbn, isbn | boolean - isn | public | isnle | isbn, isbn13 | boolean + isn | public | isnle | ean13, upc | boolean + isn | public | isnle | ean13, issn13 | boolean + isn | public | isnle | ean13, ismn | boolean + isn | public | isnle | upc, upc | boolean + isn | public | isnle | issn13, issn13 | boolean + isn | public | isnle | upc, ean13 | boolean + isn | public | isnle | ismn13, ismn13 | boolean + isn | public | isnle | issn13, ean13 | boolean + isn | public | isnle | ean13, ismn13 | boolean + isn | public | isnle | ismn13, ean13 | boolean + isn | public | isnle | issn13, issn | boolean + isn | public | isnle | ismn, ean13 | boolean + isn | public | isnle | ismn13, ismn | boolean + isn | public | isnle | ean13, isbn13 | boolean isn | public | isnle | isbn13, ean13 | boolean isn | public | isnle | isbn13, isbn | boolean - isn | public | isnle | isbn13, isbn13 | boolean - isn | public | isnle | ismn, ean13 | boolean - isn | public | isnle | ismn, ismn | boolean + isn | public | isnle | isbn, isbn13 | boolean isn | public | isnle | ismn, ismn13 | boolean - isn | public | isnle | ismn13, ean13 | boolean - isn | public | isnle | ismn13, ismn | boolean - isn | public | isnle | ismn13, ismn13 | boolean - isn | public | isnle | issn, ean13 | boolean - isn | public | isnle | issn, issn | boolean + isn | public | isnle | ean13, isbn | boolean isn | public | isnle | issn, issn13 | boolean - isn | public | isnle | issn13, ean13 | boolean - isn | public | isnle | issn13, issn | boolean - isn | public | isnle | issn13, issn13 | boolean - isn | public | isnle | upc, ean13 | boolean - isn | public | isnle | upc, upc | boolean + isn | public | isnle | issn, issn | boolean + isn | public | isnlt | ismn, ismn | boolean isn | public | isnlt | ean13, ean13 | boolean - isn | public | isnlt | ean13, isbn | boolean - isn | public | isnlt | ean13, isbn13 | boolean - isn | public | isnlt | ean13, ismn | boolean - isn | public | isnlt | ean13, ismn13 | boolean - isn | public | isnlt | ean13, issn | boolean - isn | public | isnlt | ean13, issn13 | boolean - isn | public | isnlt | ean13, upc | boolean isn | public | isnlt | isbn, ean13 | boolean + isn | public | isnlt | issn, ean13 | boolean + isn | public | isnlt | isbn13, isbn13 | boolean + isn | public | isnlt | ean13, issn | boolean isn | public | isnlt | isbn, isbn | boolean - isn | public | isnlt | isbn, isbn13 | boolean + isn | public | isnlt | ean13, upc | boolean + isn | public | isnlt | ean13, issn13 | boolean + isn | public | isnlt | ean13, ismn | boolean + isn | public | isnlt | upc, upc | boolean + isn | public | isnlt | issn13, issn13 | boolean + isn | public | isnlt | upc, ean13 | boolean + isn | public | isnlt | ismn13, ismn13 | boolean + isn | public | isnlt | issn13, ean13 | boolean + isn | public | isnlt | ean13, ismn13 | boolean + isn | public | isnlt | ismn13, ean13 | boolean + isn | public | isnlt | issn13, issn | boolean + isn | public | isnlt | ismn, ean13 | boolean + isn | public | isnlt | ismn13, ismn | boolean + isn | public | isnlt | ean13, isbn13 | boolean isn | public | isnlt | isbn13, ean13 | boolean isn | public | isnlt | isbn13, isbn | boolean - isn | public | isnlt | isbn13, isbn13 | boolean - isn | public | isnlt | ismn, ean13 | boolean - isn | public | isnlt | ismn, ismn | boolean + isn | public | isnlt | isbn, isbn13 | boolean isn | public | isnlt | ismn, ismn13 | boolean - isn | public | isnlt | ismn13, ean13 | boolean - isn | public | isnlt | ismn13, ismn | boolean - isn | public | isnlt | ismn13, ismn13 | boolean - isn | public | isnlt | issn, ean13 | boolean - isn | public | isnlt | issn, issn | boolean + isn | public | isnlt | ean13, isbn | boolean isn | public | isnlt | issn, issn13 | boolean - isn | public | isnlt | issn13, ean13 | boolean - isn | public | isnlt | issn13, issn | boolean - isn | public | isnlt | issn13, issn13 | boolean - isn | public | isnlt | upc, ean13 | boolean - isn | public | isnlt | upc, upc | boolean + isn | public | isnlt | issn, issn | boolean + isn | public | isnne | ismn, ismn | boolean isn | public | isnne | ean13, ean13 | boolean - isn | public | isnne | ean13, isbn | boolean - isn | public | isnne | ean13, isbn13 | boolean - isn | public | isnne | ean13, ismn | boolean - isn | public | isnne | ean13, ismn13 | boolean - isn | public | isnne | ean13, issn | boolean - isn | public | isnne | ean13, issn13 | boolean - isn | public | isnne | ean13, upc | boolean isn | public | isnne | isbn, ean13 | boolean + isn | public | isnne | issn, ean13 | boolean + isn | public | isnne | isbn13, isbn13 | boolean + isn | public | isnne | ean13, issn | boolean isn | public | isnne | isbn, isbn | boolean - isn | public | isnne | isbn, isbn13 | boolean + isn | public | isnne | ean13, upc | boolean + isn | public | isnne | ean13, issn13 | boolean + isn | public | isnne | ean13, ismn | boolean + isn | public | isnne | upc, upc | boolean + isn | public | isnne | issn13, issn13 | boolean + isn | public | isnne | upc, ean13 | boolean + isn | public | isnne | ismn13, ismn13 | boolean + isn | public | isnne | issn13, ean13 | boolean + isn | public | isnne | ean13, ismn13 | boolean + isn | public | isnne | ismn13, ean13 | boolean + isn | public | isnne | issn13, issn | boolean + isn | public | isnne | ismn, ean13 | boolean + isn | public | isnne | ismn13, ismn | boolean + isn | public | isnne | ean13, isbn13 | boolean isn | public | isnne | isbn13, ean13 | boolean isn | public | isnne | isbn13, isbn | boolean - isn | public | isnne | isbn13, isbn13 | boolean - isn | public | isnne | ismn, ean13 | boolean - isn | public | isnne | ismn, ismn | boolean + isn | public | isnne | isbn, isbn13 | boolean isn | public | isnne | ismn, ismn13 | boolean - isn | public | isnne | ismn13, ean13 | boolean - isn | public | isnne | ismn13, ismn | boolean - isn | public | isnne | ismn13, ismn13 | boolean - isn | public | isnne | issn, ean13 | boolean - isn | public | isnne | issn, issn | boolean + isn | public | isnne | ean13, isbn | boolean isn | public | isnne | issn, issn13 | boolean - isn | public | isnne | issn13, ean13 | boolean - isn | public | isnne | issn13, issn | boolean - isn | public | isnne | issn13, issn13 | boolean - isn | public | isnne | upc, ean13 | boolean - isn | public | isnne | upc, upc | boolean + isn | public | isnne | issn, issn | boolean isn | public | issn | ean13 | issn isn | public | issn13 | ean13 | issn13 isn | public | issn13_in | cstring | issn13 isn | public | issn_in | cstring | issn - isn | public | make_valid | ean13 | ean13 - isn | public | make_valid | isbn | isbn isn | public | make_valid | isbn13 | isbn13 + isn | public | make_valid | upc | upc isn | public | make_valid | ismn | ismn - isn | public | make_valid | ismn13 | ismn13 isn | public | make_valid | issn | issn + isn | public | make_valid | isbn | isbn + isn | public | make_valid | ismn13 | ismn13 + isn | public | make_valid | ean13 | ean13 isn | public | make_valid | issn13 | issn13 - isn | public | make_valid | upc | upc isn | public | upc | ean13 | upc isn | public | upc_in | cstring | upc lo | public | lo_manage | | trigger @@ -1021,14 +1019,14 @@ order by ltree | public | hash_ltree_extended | ltree, bigint | bigint ltree | public | index | ltree, ltree | integer ltree | public | index | ltree, ltree, integer | integer + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree, ltree | ltree ltree | public | lca | ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree - ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree ltree | public | lca | ltree[] | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree | ltree ltree | public | lquery_in | cstring | lquery ltree | public | lquery_out | lquery | cstring ltree | public | lquery_recv | internal | lquery @@ -1077,41 +1075,6 @@ order by ltree | public | subpath | ltree, integer, integer | ltree ltree | public | text2ltree | text | ltree moddatetime | public | moddatetime | | trigger - orioledb | extensions | orioledb_commit_hash | | text - orioledb | extensions | orioledb_compression_max_level | | bigint - orioledb | extensions | orioledb_evict_pages | relid oid, maxlevel integer | void - orioledb | extensions | orioledb_get_evicted_trees | OUT datoid oid, OUT relnode oid, OUT root_downlink bigint, OUT file_length bigint | SETOF record - orioledb | extensions | orioledb_get_index_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record - orioledb | extensions | orioledb_get_table_descrs | OUT datoid oid, OUT reloid oid, OUT relnode oid, OUT refcnt oid | SETOF record - orioledb | extensions | orioledb_has_retained_undo | | boolean - orioledb | extensions | orioledb_idx_structure | relid oid, tree_name text, options character varying, depth integer | text - orioledb | extensions | orioledb_index_description | datoid oid, relid oid, relnode oid, index_type text, OUT name text, OUT description text | record - orioledb | extensions | orioledb_index_oids | OUT datoid oid, OUT table_reloid oid, OUT table_relnode oid, OUT index_reloid oid, OUT index_relnode oid, OUT index_type text | SETOF record - orioledb | extensions | orioledb_index_rows | relid oid, OUT total integer, OUT dead integer | record - orioledb | extensions | orioledb_page_stats | OUT pool_name text, OUT busy_pages bigint, OUT free_pages bigint, OUT dirty_pages bigint, OUT all_pages bigint | SETOF record - orioledb | extensions | orioledb_recovery_synchronized | | boolean - orioledb | extensions | orioledb_relation_size | relid oid | bigint - orioledb | extensions | orioledb_sys_tree_check | num integer, force_map_check boolean | boolean - orioledb | extensions | orioledb_sys_tree_rows | num integer | SETOF jsonb - orioledb | extensions | orioledb_sys_tree_structure | num integer, options character varying, depth integer | text - orioledb | extensions | orioledb_table_description | datoid oid, relid oid, relnode oid | text - orioledb | extensions | orioledb_table_description | relid oid | text - orioledb | extensions | orioledb_table_oids | OUT datoid oid, OUT reloid oid, OUT relnode oid | SETOF record - orioledb | extensions | orioledb_table_pages | relid oid, OUT blkno bigint, OUT level integer, OUT rightlink bigint, OUT hikey jsonb | SETOF record - orioledb | extensions | orioledb_tableam_handler | internal | table_am_handler - orioledb | extensions | orioledb_tbl_are_indices_equal | idx_oid1 regclass, idx_oid2 regclass | boolean - orioledb | extensions | orioledb_tbl_bin_structure | relid oid, print_bytes boolean, depth integer | text - orioledb | extensions | orioledb_tbl_check | relid oid, force_map_check boolean | boolean - orioledb | extensions | orioledb_tbl_compression_check | level bigint, relid oid, ranges integer[] | text - orioledb | extensions | orioledb_tbl_indices | relid oid | text - orioledb | extensions | orioledb_tbl_structure | relid oid, options character varying, depth integer | text - orioledb | extensions | orioledb_tree_stat | relid regclass, OUT level integer, OUT count bigint, OUT avgoccupied double precision, OUT avgvacated double precision | SETOF record - orioledb | extensions | orioledb_ucm_check | | boolean - orioledb | extensions | orioledb_version | | text - orioledb | extensions | orioledb_write_pages | relid oid | void - orioledb | extensions | pg_stopevent_reset | eventname text | boolean - orioledb | extensions | pg_stopevent_set | eventname text, condition jsonpath | void - orioledb | extensions | pg_stopevents | OUT stopevent text, OUT condition jsonpath, OUT waiter_pids integer[] | SETOF record pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record pageinspect | public | brin_page_type | page bytea | text pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid @@ -1133,8 +1096,8 @@ order by pageinspect | public | hash_page_items | page bytea, OUT itemoffset integer, OUT ctid tid, OUT data bigint | SETOF record pageinspect | public | hash_page_stats | page bytea, OUT live_items integer, OUT dead_items integer, OUT page_size integer, OUT free_size integer, OUT hasho_prevblkno bigint, OUT hasho_nextblkno bigint, OUT hasho_bucket bigint, OUT hasho_flag integer, OUT hasho_page_id integer | record pageinspect | public | hash_page_type | page bytea | text - pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, do_detoast boolean, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record + pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, do_detoast boolean, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record pageinspect | public | heap_page_items | page bytea, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_data bytea | SETOF record pageinspect | public | heap_tuple_infomask_flags | t_infomask integer, t_infomask2 integer, OUT raw_flags text[], OUT combined_flags text[] | record pageinspect | public | page_checksum | page bytea, blkno bigint | smallint @@ -1143,8 +1106,8 @@ order by pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] pg_buffercache | public | pg_buffercache_evict | integer | boolean pg_buffercache | public | pg_buffercache_pages | | SETOF record - pg_freespacemap | public | pg_freespace | regclass, bigint | smallint pg_freespacemap | public | pg_freespace | rel regclass, OUT blkno bigint, OUT avail smallint | SETOF record + pg_freespacemap | public | pg_freespace | regclass, bigint | smallint pg_graphql | graphql | _internal_resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb pg_graphql | graphql | comment_directive | comment_ text | jsonb pg_graphql | graphql | exception | message text | text @@ -1158,19 +1121,19 @@ order by pg_hashids | public | hash_encode | bigint, text, integer | text pg_hashids | public | id_decode | text | bigint[] pg_hashids | public | id_decode | text, text | bigint[] - pg_hashids | public | id_decode | text, text, integer | bigint[] pg_hashids | public | id_decode | text, text, integer, text | bigint[] + pg_hashids | public | id_decode | text, text, integer | bigint[] pg_hashids | public | id_decode_once | text | bigint pg_hashids | public | id_decode_once | text, text | bigint - pg_hashids | public | id_decode_once | text, text, integer | bigint pg_hashids | public | id_decode_once | text, text, integer, text | bigint + pg_hashids | public | id_decode_once | text, text, integer | bigint pg_hashids | public | id_encode | bigint | text - pg_hashids | public | id_encode | bigint, text | text - pg_hashids | public | id_encode | bigint, text, integer | text - pg_hashids | public | id_encode | bigint, text, integer, text | text pg_hashids | public | id_encode | bigint[] | text pg_hashids | public | id_encode | bigint[], text | text pg_hashids | public | id_encode | bigint[], text, integer | text + pg_hashids | public | id_encode | bigint, text | text + pg_hashids | public | id_encode | bigint, text, integer | text + pg_hashids | public | id_encode | bigint, text, integer, text | text pg_hashids | public | id_encode | bigint[], text, integer, text | text pg_jsonschema | public | json_matches_schema | schema json, instance json | boolean pg_jsonschema | public | jsonb_matches_schema | schema json, instance jsonb | boolean @@ -1291,8 +1254,8 @@ order by pg_visibility | public | pg_check_frozen | regclass, OUT t_ctid tid | SETOF tid pg_visibility | public | pg_check_visible | regclass, OUT t_ctid tid | SETOF tid pg_visibility | public | pg_truncate_visibility_map | regclass | void - pg_visibility | public | pg_visibility | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | record pg_visibility | public | pg_visibility | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | SETOF record + pg_visibility | public | pg_visibility | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | record pg_visibility | public | pg_visibility_map | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | record pg_visibility | public | pg_visibility_map | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | SETOF record pg_visibility | public | pg_visibility_map_summary | regclass, OUT all_visible bigint, OUT all_frozen bigint | record @@ -1301,32 +1264,32 @@ order by pg_walinspect | public | pg_get_wal_stats | start_lsn pg_lsn, end_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record pgaudit | public | pgaudit_ddl_command_end | | event_trigger pgaudit | public | pgaudit_sql_drop | | event_trigger - pgcrypto | extensions | armor | bytea | text pgcrypto | extensions | armor | bytea, text[], text[] | text + pgcrypto | extensions | armor | bytea | text pgcrypto | extensions | crypt | text, text | text pgcrypto | extensions | dearmor | text | bytea pgcrypto | extensions | decrypt | bytea, bytea, text | bytea pgcrypto | extensions | decrypt_iv | bytea, bytea, bytea, text | bytea - pgcrypto | extensions | digest | bytea, text | bytea pgcrypto | extensions | digest | text, text | bytea + pgcrypto | extensions | digest | bytea, text | bytea pgcrypto | extensions | encrypt | bytea, bytea, text | bytea pgcrypto | extensions | encrypt_iv | bytea, bytea, bytea, text | bytea pgcrypto | extensions | gen_random_bytes | integer | bytea pgcrypto | extensions | gen_random_uuid | | uuid pgcrypto | extensions | gen_salt | text | text pgcrypto | extensions | gen_salt | text, integer | text - pgcrypto | extensions | hmac | bytea, bytea, text | bytea pgcrypto | extensions | hmac | text, text, text | bytea + pgcrypto | extensions | hmac | bytea, bytea, text | bytea pgcrypto | extensions | pgp_armor_headers | text, OUT key text, OUT value text | SETOF record pgcrypto | extensions | pgp_key_id | bytea | text pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea | text - pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text | text pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text, text | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text | text pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea | bytea - pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text, text | bytea - pgcrypto | extensions | pgp_pub_encrypt | text, bytea | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea pgcrypto | extensions | pgp_pub_encrypt | text, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea | bytea pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea | bytea pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea, text | bytea pgcrypto | extensions | pgp_sym_decrypt | bytea, text | text @@ -1337,12 +1300,6 @@ order by pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea - pgjwt | extensions | algorithm_sign | signables text, secret text, algorithm text | text - pgjwt | extensions | sign | payload json, secret text, algorithm text | text - pgjwt | extensions | try_cast_double | inp text | double precision - pgjwt | extensions | url_decode | data text | bytea - pgjwt | extensions | url_encode | data bytea | text - pgjwt | extensions | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void pgmq | pgmq | _get_partition_col | partition_interval text | text @@ -1376,15 +1333,15 @@ order by pgroonga | pgroonga | command_escape_value | value text | text pgroonga | pgroonga | contain_varchar_array | character varying[], character varying | boolean pgroonga | pgroonga | escape | value bigint | text - pgroonga | pgroonga | escape | value boolean | text pgroonga | pgroonga | escape | value double precision | text - pgroonga | pgroonga | escape | value integer | text - pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value text, special_characters text | text + pgroonga | pgroonga | escape | value timestamp without time zone | text pgroonga | pgroonga | escape | value smallint | text pgroonga | pgroonga | escape | value text | text - pgroonga | pgroonga | escape | value text, special_characters text | text pgroonga | pgroonga | escape | value timestamp with time zone | text - pgroonga | pgroonga | escape | value timestamp without time zone | text + pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value boolean | text + pgroonga | pgroonga | escape | value integer | text pgroonga | pgroonga | flush | indexname cstring | boolean pgroonga | pgroonga | highlight_html | target text, keywords text[] | text pgroonga | pgroonga | match_in_text | text, text[] | boolean @@ -1393,16 +1350,16 @@ order by pgroonga | pgroonga | match_jsonb | jsonb, text | boolean pgroonga | pgroonga | match_positions_byte | target text, keywords text[] | integer[] pgroonga | pgroonga | match_positions_character | target text, keywords text[] | integer[] - pgroonga | pgroonga | match_query | character varying, character varying | boolean pgroonga | pgroonga | match_query | text, text | boolean + pgroonga | pgroonga | match_query | character varying, character varying | boolean pgroonga | pgroonga | match_query | text[], text | boolean - pgroonga | pgroonga | match_regexp | character varying, character varying | boolean pgroonga | pgroonga | match_regexp | text, text | boolean + pgroonga | pgroonga | match_regexp | character varying, character varying | boolean pgroonga | pgroonga | match_script_jsonb | jsonb, text | boolean - pgroonga | pgroonga | match_term | target character varying, term character varying | boolean - pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean pgroonga | pgroonga | match_term | target text, term text | boolean pgroonga | pgroonga | match_term | target text[], term text | boolean + pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean + pgroonga | pgroonga | match_term | target character varying, term character varying | boolean pgroonga | pgroonga | match_text | text, text | boolean pgroonga | pgroonga | match_text_array | text[], text | boolean pgroonga | pgroonga | match_varchar | character varying, character varying | boolean @@ -1448,27 +1405,27 @@ order by pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_equal_text | target text, other text | boolean - pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean - pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_escape | value bigint | text - pgroonga | public | pgroonga_escape | value boolean | text pgroonga | public | pgroonga_escape | value double precision | text - pgroonga | public | pgroonga_escape | value integer | text - pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value text, special_characters text | text + pgroonga | public | pgroonga_escape | value timestamp without time zone | text pgroonga | public | pgroonga_escape | value smallint | text pgroonga | public | pgroonga_escape | value text | text - pgroonga | public | pgroonga_escape | value text, special_characters text | text pgroonga | public | pgroonga_escape | value timestamp with time zone | text - pgroonga | public | pgroonga_escape | value timestamp without time zone | text + pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value boolean | text + pgroonga | public | pgroonga_escape | value integer | text pgroonga | public | pgroonga_flush | indexname cstring | boolean pgroonga | public | pgroonga_handler | internal | index_am_handler - pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text pgroonga | public | pgroonga_highlight_html | target text, keywords text[], indexname cstring | text - pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[], indexname cstring | text[] + pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text pgroonga | public | pgroonga_is_writable | | boolean @@ -1478,31 +1435,31 @@ order by pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean pgroonga | public | pgroonga_match_jsonb | jsonb, text | boolean - pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[], indexname cstring | integer[] - pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_positions_character | target text, keywords text[], indexname cstring | integer[] - pgroonga | public | pgroonga_match_query | character varying, character varying | boolean + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] pgroonga | public | pgroonga_match_query | text, text | boolean + pgroonga | public | pgroonga_match_query | character varying, character varying | boolean pgroonga | public | pgroonga_match_query | text[], text | boolean - pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean pgroonga | public | pgroonga_match_regexp | text, text | boolean + pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean pgroonga | public | pgroonga_match_script_jsonb | jsonb, text | boolean - pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean - pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean pgroonga | public | pgroonga_match_term | target text, term text | boolean pgroonga | public | pgroonga_match_term | target text[], term text | boolean + pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean + pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean pgroonga | public | pgroonga_match_text | text, text | boolean pgroonga | public | pgroonga_match_text_array | text[], text | boolean - pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_array_condition_with_scorers | target text[], condition pgroonga_full_text_search_condition_with_scorers | boolean - pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_match_varchar | character varying, character varying | boolean - pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_match_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_normalize | target text | text pgroonga | public | pgroonga_normalize | target text, normalizername text | text @@ -1522,13 +1479,13 @@ order by pgroonga | public | pgroonga_prefix_text | text, text | boolean pgroonga | public | pgroonga_prefix_text_array | text[], text | boolean pgroonga | public | pgroonga_prefix_text_array_condition | text[], pgroonga_condition | boolean - pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_varchar | character varying, character varying | boolean pgroonga | public | pgroonga_prefix_varchar_array | character varying[], character varying | boolean pgroonga | public | pgroonga_prefix_varchar_array_condition | character varying[], pgroonga_condition | boolean - pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_condition | boolean pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_condition | boolean pgroonga | public | pgroonga_query_escape | query text | text pgroonga | public | pgroonga_query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text pgroonga | public | pgroonga_query_extract_keywords | query text, index_name text | text[] @@ -1541,12 +1498,12 @@ order by pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean pgroonga | public | pgroonga_query_text_array_condition_with_scorers | targets text[], condition pgroonga_full_text_search_condition_with_scorers | boolean - pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_query_varchar | character varying, character varying | boolean - pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_condition | boolean pgroonga | public | pgroonga_query_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean pgroonga | public | pgroonga_regexp_in_text | text, text[] | boolean pgroonga | public | pgroonga_regexp_in_varchar | character varying, character varying[] | boolean @@ -1570,27 +1527,27 @@ order by pgroonga | public | pgroonga_table_name | indexname cstring | text pgroonga | public | pgroonga_tokenize | target text, VARIADIC options text[] | json[] pgroonga | public | pgroonga_vacuum | | boolean - pgroonga | public | pgroonga_wal_apply | | bigint pgroonga | public | pgroonga_wal_apply | indexname cstring | bigint - pgroonga | public | pgroonga_wal_set_applied_position | | boolean + pgroonga | public | pgroonga_wal_apply | | bigint pgroonga | public | pgroonga_wal_set_applied_position | block bigint, "offset" bigint | boolean - pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring, block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean + pgroonga | public | pgroonga_wal_set_applied_position | | boolean pgroonga | public | pgroonga_wal_status | | TABLE(name text, oid oid, current_block bigint, current_offset bigint, current_size bigint, last_block bigint, last_offset bigint, last_size bigint) - pgroonga | public | pgroonga_wal_truncate | | bigint pgroonga | public | pgroonga_wal_truncate | indexname cstring | bigint + pgroonga | public | pgroonga_wal_truncate | | bigint pgroonga_database | public | pgroonga_database_remove | | boolean pgrouting | public | _pgr_alphashape | text, alpha double precision, OUT seq1 bigint, OUT textgeom text | SETOF record pgrouting | public | _pgr_array_reverse | anyarray | anyarray pgrouting | public | _pgr_articulationpoints | edges_sql text, OUT seq integer, OUT node bigint | SETOF record - pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_astar | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bdastar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bddijkstra | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bddijkstra | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_bellmanford | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_biconnectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1607,15 +1564,15 @@ order by pgrouting | public | _pgr_compiler_version | | text pgrouting | public | _pgr_connectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record pgrouting | public | _pgr_contraction | edges_sql text, contraction_order bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record - pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void pgrouting | public | _pgr_createindex | tabname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void pgrouting | public | _pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record pgrouting | public | _pgr_dagshortestpath | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dagshortestpath | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_depthfirstsearch | edges_sql text, root_vids anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstranear | text, anyarray, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_dijkstranear | text, anyarray, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1623,22 +1580,22 @@ order by pgrouting | public | _pgr_dijkstravia | edges_sql text, via_vids anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_drivingdistance | edges_sql text, start_vids anyarray, distance double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edgecoloring | edges_sql text, OUT edge_id bigint, OUT color_id bigint | SETOF record - pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edwardmoore | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_edwardmoore | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_endpoint | g geometry | geometry pgrouting | public | _pgr_floydwarshall | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_get_statement | o_sql text | text - pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text pgrouting | public | _pgr_getcolumnname | tab text, col text, reporterrs integer, fnname text | text - pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text pgrouting | public | _pgr_getcolumntype | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text pgrouting | public | _pgr_gettablename | tab text, reporterrs integer, fnname text, OUT sname text, OUT tname text | record pgrouting | public | _pgr_git_hash | | text pgrouting | public | _pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean pgrouting | public | _pgr_iscolumnindexed | tab text, col text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean pgrouting | public | _pgr_iscolumnintable | tab text, col text | boolean pgrouting | public | _pgr_isplanar | text | boolean pgrouting | public | _pgr_johnson | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record @@ -1652,8 +1609,8 @@ order by pgrouting | public | _pgr_maxcardinalitymatch | edges_sql text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record pgrouting | public | _pgr_maxflow | edges_sql text, combinations_sql text, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | _pgr_maxflow | edges_sql text, sources anyarray, targets anyarray, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_maxflowmincost | edges_sql text, sources anyarray, targets anyarray, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_msg | msgkind integer, fnname text, msg text | void pgrouting | public | _pgr_onerror | errcond boolean, reporterrs integer, fnname text, msgerr text, hinto text, msgok text | void pgrouting | public | _pgr_operating_system | | text @@ -1673,10 +1630,10 @@ order by pgrouting | public | _pgr_trsp | sql text, source_eid integer, source_pos double precision, target_eid integer, target_pos double precision, directed boolean, has_reverse_cost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _pgr_trspvia | text, text, anyarray, boolean, boolean, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_trspvia_withpoints | text, text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_trspviavertices | sql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record @@ -1692,62 +1649,62 @@ order by pgrouting | public | _pgr_withpointsvia | sql text, via_edges bigint[], fraction double precision[], directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _pgr_withpointsvia | text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrouting | public | _trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | _v4trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_alphashape | geometry, alpha double precision | geometry pgrouting | public | pgr_analyzegraph | text, double precision, the_geom text, id text, source text, target text, rows_where text | character varying pgrouting | public | pgr_analyzeoneway | text, text[], text[], text[], text[], two_way_if_null boolean, oneway text, source text, target text | text pgrouting | public | pgr_articulationpoints | text, OUT node bigint | SETOF bigint - pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcost | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_astarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastar | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcost | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bdastarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bddijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bellmanford | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_biconnectedcomponents | text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record - pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_binarybreadthfirstsearch | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bipartite | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_boykovkolmogorov | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_breadthfirstsearch | text, anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_breadthfirstsearch | text, bigint, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_bridges | text, OUT edge bigint | SETOF bigint @@ -1759,54 +1716,54 @@ order by pgrouting | public | pgr_createverticestable | text, the_geom text, source text, target text, rows_where text | text pgrouting | public | pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record pgrouting | public | pgr_dagshortestpath | text, anyarray, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dagshortestpath | text, bigint, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dagshortestpath | text, text, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_degree | text, text, dryrun boolean, OUT node bigint, OUT degree bigint | SETOF record - pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_depthfirstsearch | text, bigint, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranear | text, bigint, anyarray, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranear | text, text, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranearcost | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstranearcost | text, bigint, anyarray, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_dijkstravia | text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record - pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_drivingdistance | text, bigint, double precision, directed boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgecoloring | text, OUT edge_id bigint, OUT color_id bigint | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgedisjointpaths | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edmondskarp | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edmondskarp | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edmondskarp | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_edwardmoore | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_edwardmoore | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_extractvertices | text, dryrun boolean, OUT id bigint, OUT in_edges bigint[], OUT out_edges bigint[], OUT x double precision, OUT y double precision, OUT geom geometry | SETOF record - pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record pgrouting | public | pgr_findcloseedges | text, geometry[], double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record pgrouting | public | pgr_floydwarshall | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_full_version | OUT version text, OUT build_type text, OUT compile_date text, OUT library text, OUT system text, OUT postgresql text, OUT compiler text, OUT boost text, OUT hash text | record pgrouting | public | pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1815,10 +1772,10 @@ order by pgrouting | public | pgr_kruskal | text, OUT edge bigint, OUT cost double precision | SETOF record pgrouting | public | pgr_kruskalbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskalbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_kruskaldfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_ksp | text, bigint, bigint, integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record @@ -1829,52 +1786,52 @@ order by pgrouting | public | pgr_maxcardinalitymatch | text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record pgrouting | public | pgr_maxcardinalitymatch | text, OUT edge bigint | SETOF bigint pgrouting | public | pgr_maxflow | text, anyarray, anyarray | bigint - pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint + pgrouting | public | pgr_maxflow | text, text | bigint pgrouting | public | pgr_maxflow | text, bigint, anyarray | bigint + pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint pgrouting | public | pgr_maxflow | text, bigint, bigint | bigint - pgrouting | public | pgr_maxflow | text, text | bigint - pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, anyarray | double precision - pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision pgrouting | public | pgr_maxflowmincost_cost | text, bigint, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision pgrouting | public | pgr_maxflowmincost_cost | text, bigint, bigint | double precision - pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision pgrouting | public | pgr_nodenetwork | text, double precision, id text, the_geom text, table_ending text, rows_where text, outall boolean | text pgrouting | public | pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record pgrouting | public | pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record pgrouting | public | pgr_prim | text, OUT edge bigint, OUT cost double precision | SETOF record pgrouting | public | pgr_primbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_primdfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_pushrelabel | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_pushrelabel | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_pushrelabel | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record - pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record pgrouting | public | pgr_sequentialvertexcoloring | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record pgrouting | public | pgr_stoerwagner | text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record pgrouting | public | pgr_strongcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record pgrouting | public | pgr_topologicalsort | text, OUT seq integer, OUT sorted_v bigint | SETOF record pgrouting | public | pgr_transitiveclosure | text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp | text, integer, double precision, integer, double precision, boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record pgrouting | public | pgr_trsp | text, integer, integer, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_trspvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record @@ -1886,64 +1843,64 @@ order by pgrouting | public | pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_version | | text pgrouting | public | pgr_vrponedepot | text, text, text, integer, OUT oid integer, OUT opos integer, OUT vid integer, OUT tarrival integer, OUT tdepart integer | SETOF record - pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpoints | text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, anyarray, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, anyarray, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscost | text, text, bigint, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointscostmatrix | text, text, anyarray, directed boolean, driving_side character, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record - pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsdd | text, text, bigint, double precision, directed boolean, driving_side character, details boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsksp | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record pgrouting | public | pgr_withpointsvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record pgrowlocks | public | pgrowlocks | relname text, OUT locked_row tid, OUT locker xid, OUT multi boolean, OUT xids xid[], OUT modes text[], OUT pids integer[] | SETOF record pgsodium | pgsodium | create_key | key_type pgsodium.key_type, name text, raw_key bytea, raw_key_nonce bytea, parent_key uuid, key_context bytea, expires timestamp with time zone, associated_data text | pgsodium.valid_key pgsodium | pgsodium | create_mask_view | relid oid, debug boolean | void pgsodium | pgsodium | create_mask_view | relid oid, subid integer, debug boolean | void - pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea - pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea pgsodium | pgsodium | crypto_aead_det_keygen | | bytea pgsodium | pgsodium | crypto_aead_det_noncegen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea pgsodium | pgsodium | crypto_aead_ietf_keygen | | bytea pgsodium | pgsodium | crypto_aead_ietf_noncegen | | bytea pgsodium | pgsodium | crypto_auth | message bytea, key bytea | bytea - pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth | message bytea, key_uuid uuid | bytea - pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha256_keygen | | bytea pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha256_verify | signature bytea, message bytea, key_uuid uuid | boolean - pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea - pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_auth_hmacsha512_keygen | | bytea pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_hmacsha512_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean pgsodium | pgsodium | crypto_auth_keygen | | bytea + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key bytea | boolean pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_id bigint, context bytea | boolean - pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean pgsodium | pgsodium | crypto_box | message bytea, nonce bytea, public bytea, secret bytea | bytea pgsodium | pgsodium | crypto_box_new_keypair | | pgsodium.crypto_box_keypair pgsodium | pgsodium | crypto_box_new_seed | | bytea @@ -1959,8 +1916,8 @@ order by pgsodium | pgsodium | crypto_generichash_keygen | | bytea pgsodium | pgsodium | crypto_hash_sha256 | message bytea | bytea pgsodium | pgsodium | crypto_hash_sha512 | message bytea | bytea - pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size integer, subkey_id bigint, context bytea, primary_key uuid | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea pgsodium | pgsodium | crypto_kdf_keygen | | bytea pgsodium | pgsodium | crypto_kx_client_session_keys | client_pk bytea, client_sk bytea, server_pk bytea | pgsodium.crypto_kx_session pgsodium | pgsodium | crypto_kx_new_keypair | | pgsodium.crypto_kx_keypair @@ -1971,9 +1928,9 @@ order by pgsodium | pgsodium | crypto_pwhash_saltgen | | bytea pgsodium | pgsodium | crypto_pwhash_str | password bytea | bytea pgsodium | pgsodium | crypto_pwhash_str_verify | hashed_password bytea, password bytea | boolean - pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_id bigint, context bytea | bytea pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea pgsodium | pgsodium | crypto_secretbox_keygen | | bytea pgsodium | pgsodium | crypto_secretbox_noncegen | | bytea pgsodium | pgsodium | crypto_secretbox_open | ciphertext bytea, nonce bytea, key bytea | bytea @@ -2005,8 +1962,8 @@ order by pgsodium | pgsodium | crypto_signcrypt_verify_after | state bytea, signature bytea, sender_pk bytea, ciphertext bytea | boolean pgsodium | pgsodium | crypto_signcrypt_verify_before | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, recipient_sk bytea | pgsodium.crypto_signcrypt_state_key pgsodium | pgsodium | crypto_signcrypt_verify_public | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, ciphertext bytea | boolean - pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea pgsodium | pgsodium | crypto_stream_xchacha20_keygen | | bytea pgsodium | pgsodium | crypto_stream_xchacha20_noncegen | | bytea pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bigint, context bytea | bytea @@ -2039,14 +1996,14 @@ order by pgsodium | pgsodium | update_mask | target oid, debug boolean | void pgsodium | pgsodium | update_masks | debug boolean | void pgsodium | pgsodium | version | | text - pgstattuple | public | pg_relpages | relname regclass | bigint pgstattuple | public | pg_relpages | relname text | bigint + pgstattuple | public | pg_relpages | relname regclass | bigint pgstattuple | public | pgstatginindex | relname regclass, OUT version integer, OUT pending_pages integer, OUT pending_tuples bigint | record pgstattuple | public | pgstathashindex | relname regclass, OUT version integer, OUT bucket_pages bigint, OUT overflow_pages bigint, OUT bitmap_pages bigint, OUT unused_pages bigint, OUT live_items bigint, OUT dead_items bigint, OUT free_percent double precision | record pgstattuple | public | pgstatindex | relname regclass, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record pgstattuple | public | pgstatindex | relname text, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record - pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record pgstattuple | public | pgstattuple | reloid regclass, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record pgstattuple | public | pgstattuple_approx | reloid regclass, OUT table_len bigint, OUT scanned_percent double precision, OUT approx_tuple_count bigint, OUT approx_tuple_len bigint, OUT approx_tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT approx_free_space bigint, OUT approx_free_percent double precision | record pgtap | public | _add | text, integer | integer pgtap | public | _add | text, integer, text | integer @@ -2057,9 +2014,9 @@ order by pgtap | public | _areni | text, text[], text[], text | text pgtap | public | _array_to_sorted_string | name[], text | text pgtap | public | _assets_are | text, text[], text[], text | text + pgtap | public | _cast_exists | name, name, name, name | boolean pgtap | public | _cast_exists | name, name | boolean pgtap | public | _cast_exists | name, name, name | boolean - pgtap | public | _cast_exists | name, name, name, name | boolean pgtap | public | _cdi | name, name, anyelement | text pgtap | public | _cdi | name, name, anyelement, text | text pgtap | public | _cdi | name, name, name, anyelement, text | text @@ -2077,10 +2034,10 @@ order by pgtap | public | _currtest | | integer pgtap | public | _db_privs | | name[] pgtap | public | _def_is | text, text, anyelement, text | text - pgtap | public | _definer | name | boolean - pgtap | public | _definer | name, name | boolean pgtap | public | _definer | name, name, name[] | boolean pgtap | public | _definer | name, name[] | boolean + pgtap | public | _definer | name | boolean + pgtap | public | _definer | name, name | boolean pgtap | public | _dexists | name | boolean pgtap | public | _dexists | name, name | boolean pgtap | public | _do_ne | text, text, text, text | text @@ -2091,20 +2048,20 @@ order by pgtap | public | _expand_vol | character | text pgtap | public | _ext_exists | name | boolean pgtap | public | _ext_exists | name, name | boolean - pgtap | public | _extensions | | SETOF name pgtap | public | _extensions | name | SETOF name + pgtap | public | _extensions | | SETOF name pgtap | public | _extras | character, name, name[] | name[] + pgtap | public | _extras | character[], name[] | name[] pgtap | public | _extras | character, name[] | name[] pgtap | public | _extras | character[], name, name[] | name[] - pgtap | public | _extras | character[], name[] | name[] pgtap | public | _finish | integer, integer, integer, boolean | SETOF text pgtap | public | _fkexists | name, name, name[] | boolean pgtap | public | _fkexists | name, name[] | boolean pgtap | public | _fprivs_are | text, name, name[], text | text - pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text pgtap | public | _func_compare | name, name, boolean, text | text pgtap | public | _func_compare | name, name, name[], anyelement, anyelement, text | text pgtap | public | _func_compare | name, name, name[], boolean, text | text + pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text pgtap | public | _funkargs | name[] | text pgtap | public | _get | text | integer pgtap | public | _get_ac_privs | name, text | text[] @@ -2115,8 +2072,8 @@ order by pgtap | public | _get_context | name, name | "char" pgtap | public | _get_db_owner | name | name pgtap | public | _get_db_privs | name, text | text[] - pgtap | public | _get_dtype | name | text pgtap | public | _get_dtype | name, text, boolean | text + pgtap | public | _get_dtype | name | text pgtap | public | _get_fdw_privs | name, text | text[] pgtap | public | _get_func_owner | name, name, name[] | name pgtap | public | _get_func_owner | name, name[] | name @@ -2131,12 +2088,12 @@ order by pgtap | public | _get_note | text | text pgtap | public | _get_opclass_owner | name | name pgtap | public | _get_opclass_owner | name, name | name - pgtap | public | _get_rel_owner | character, name | name - pgtap | public | _get_rel_owner | character, name, name | name - pgtap | public | _get_rel_owner | character[], name | name pgtap | public | _get_rel_owner | character[], name, name | name + pgtap | public | _get_rel_owner | character, name | name pgtap | public | _get_rel_owner | name | name pgtap | public | _get_rel_owner | name, name | name + pgtap | public | _get_rel_owner | character[], name | name + pgtap | public | _get_rel_owner | character, name, name | name pgtap | public | _get_schema_owner | name | name pgtap | public | _get_schema_privs | name, text | text[] pgtap | public | _get_sequence_privs | name, text | text[] @@ -2146,17 +2103,17 @@ order by pgtap | public | _get_tablespaceprivs | name, text | text[] pgtap | public | _get_type_owner | name | name pgtap | public | _get_type_owner | name, name | name - pgtap | public | _got_func | name | boolean - pgtap | public | _got_func | name, name | boolean pgtap | public | _got_func | name, name, name[] | boolean pgtap | public | _got_func | name, name[] | boolean + pgtap | public | _got_func | name | boolean + pgtap | public | _got_func | name, name | boolean pgtap | public | _grolist | name | oid[] pgtap | public | _has_def | name, name | boolean pgtap | public | _has_def | name, name, name | boolean pgtap | public | _has_group | name | boolean pgtap | public | _has_role | name | boolean - pgtap | public | _has_type | name, character[] | boolean pgtap | public | _has_type | name, name, character[] | boolean + pgtap | public | _has_type | name, character[] | boolean pgtap | public | _has_user | name | boolean pgtap | public | _hasc | name, character | boolean pgtap | public | _hasc | name, name, character | boolean @@ -2177,22 +2134,22 @@ order by pgtap | public | _is_verbose | | boolean pgtap | public | _keys | name, character | SETOF name[] pgtap | public | _keys | name, name, character | SETOF name[] - pgtap | public | _lang | name | name - pgtap | public | _lang | name, name | name pgtap | public | _lang | name, name, name[] | name pgtap | public | _lang | name, name[] | name + pgtap | public | _lang | name | name + pgtap | public | _lang | name, name | name pgtap | public | _missing | character, name, name[] | name[] + pgtap | public | _missing | character[], name[] | name[] pgtap | public | _missing | character, name[] | name[] pgtap | public | _missing | character[], name, name[] | name[] - pgtap | public | _missing | character[], name[] | name[] pgtap | public | _nosuch | name, name, name[] | text - pgtap | public | _op_exists | name, name, name | boolean pgtap | public | _op_exists | name, name, name, name | boolean pgtap | public | _op_exists | name, name, name, name, name | boolean + pgtap | public | _op_exists | name, name, name | boolean pgtap | public | _opc_exists | name | boolean pgtap | public | _opc_exists | name, name | boolean - pgtap | public | _partof | name, name | boolean pgtap | public | _partof | name, name, name, name | boolean + pgtap | public | _partof | name, name | boolean pgtap | public | _parts | name | SETOF name pgtap | public | _parts | name, name | SETOF name pgtap | public | _pg_sv_column_array | oid, smallint[] | name[] @@ -2202,35 +2159,35 @@ order by pgtap | public | _query | text | text pgtap | public | _quote_ident_like | text, text | text pgtap | public | _refine_vol | text | text - pgtap | public | _relcomp | text, anyarray, text, text | text - pgtap | public | _relcomp | text, text, text, text | text pgtap | public | _relcomp | text, text, text, text, text | text + pgtap | public | _relcomp | text, text, text, text | text + pgtap | public | _relcomp | text, anyarray, text, text | text pgtap | public | _relexists | name | boolean pgtap | public | _relexists | name, name | boolean - pgtap | public | _relne | text, anyarray, text, text | text pgtap | public | _relne | text, text, text, text | text - pgtap | public | _returns | name | text - pgtap | public | _returns | name, name | text + pgtap | public | _relne | text, anyarray, text, text | text pgtap | public | _returns | name, name, name[] | text pgtap | public | _returns | name, name[] | text + pgtap | public | _returns | name | text + pgtap | public | _returns | name, name | text + pgtap | public | _rexists | character[], name, name | boolean pgtap | public | _rexists | character, name | boolean - pgtap | public | _rexists | character, name, name | boolean pgtap | public | _rexists | character[], name | boolean - pgtap | public | _rexists | character[], name, name | boolean + pgtap | public | _rexists | character, name, name | boolean pgtap | public | _rule_on | name, name | "char" pgtap | public | _rule_on | name, name, name | "char" pgtap | public | _runem | text[], boolean | SETOF text pgtap | public | _runner | text[], text[], text[], text[], text[] | SETOF text - pgtap | public | _set | integer, integer | integer pgtap | public | _set | text, integer | integer + pgtap | public | _set | integer, integer | integer pgtap | public | _set | text, integer, text | integer - pgtap | public | _strict | name | boolean - pgtap | public | _strict | name, name | boolean pgtap | public | _strict | name, name, name[] | boolean pgtap | public | _strict | name, name[] | boolean + pgtap | public | _strict | name | boolean + pgtap | public | _strict | name, name | boolean pgtap | public | _table_privs | | name[] - pgtap | public | _temptable | anyarray, text | text pgtap | public | _temptable | text, text | text + pgtap | public | _temptable | anyarray, text | text pgtap | public | _temptypes | text | text pgtap | public | _time_trials | text, integer, numeric | SETOF _time_trial_type pgtap | public | _tlike | boolean, text, text, text | text @@ -2238,667 +2195,667 @@ order by pgtap | public | _trig | name, name | boolean pgtap | public | _trig | name, name, name | boolean pgtap | public | _type_func | "char", name | boolean - pgtap | public | _type_func | "char", name, name | boolean pgtap | public | _type_func | "char", name, name, name[] | boolean pgtap | public | _type_func | "char", name, name[] | boolean + pgtap | public | _type_func | "char", name, name | boolean pgtap | public | _types_are | name, name[], text, character[] | text pgtap | public | _types_are | name[], text, character[] | text pgtap | public | _unalike | boolean, anyelement, text, text | text - pgtap | public | _vol | name | text - pgtap | public | _vol | name, name | text pgtap | public | _vol | name, name, name[] | text pgtap | public | _vol | name, name[] | text + pgtap | public | _vol | name | text + pgtap | public | _vol | name, name | text pgtap | public | add_result | boolean, boolean, text, text, text | integer pgtap | public | alike | anyelement, text | text pgtap | public | alike | anyelement, text, text | text - pgtap | public | any_column_privs_are | name, name, name, name[] | text pgtap | public | any_column_privs_are | name, name, name, name[], text | text pgtap | public | any_column_privs_are | name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name, name[] | text pgtap | public | any_column_privs_are | name, name, name[], text | text - pgtap | public | bag_eq | text, anyarray | text pgtap | public | bag_eq | text, anyarray, text | text pgtap | public | bag_eq | text, text | text pgtap | public | bag_eq | text, text, text | text + pgtap | public | bag_eq | text, anyarray | text pgtap | public | bag_has | text, text | text pgtap | public | bag_has | text, text, text | text pgtap | public | bag_hasnt | text, text | text pgtap | public | bag_hasnt | text, text, text | text - pgtap | public | bag_ne | text, anyarray | text pgtap | public | bag_ne | text, anyarray, text | text pgtap | public | bag_ne | text, text | text pgtap | public | bag_ne | text, text, text | text - pgtap | public | can | name, name[] | text - pgtap | public | can | name, name[], text | text + pgtap | public | bag_ne | text, anyarray | text pgtap | public | can | name[] | text pgtap | public | can | name[], text | text - pgtap | public | cast_context_is | name, name, text | text + pgtap | public | can | name, name[], text | text + pgtap | public | can | name, name[] | text pgtap | public | cast_context_is | name, name, text, text | text + pgtap | public | cast_context_is | name, name, text | text pgtap | public | casts_are | text[] | text pgtap | public | casts_are | text[], text | text pgtap | public | check_test | text, boolean | SETOF text - pgtap | public | check_test | text, boolean, text | SETOF text + pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text pgtap | public | check_test | text, boolean, text, text | SETOF text + pgtap | public | check_test | text, boolean, text | SETOF text pgtap | public | check_test | text, boolean, text, text, text | SETOF text - pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text pgtap | public | cmp_ok | anyelement, text, anyelement | text pgtap | public | cmp_ok | anyelement, text, anyelement, text | text pgtap | public | col_default_is | name, name, anyelement | text - pgtap | public | col_default_is | name, name, anyelement, text | text - pgtap | public | col_default_is | name, name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, text, text | text pgtap | public | col_default_is | name, name, name, text, text | text pgtap | public | col_default_is | name, name, text | text - pgtap | public | col_default_is | name, name, text, text | text - pgtap | public | col_has_check | name, name | text + pgtap | public | col_default_is | name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, name, anyelement, text | text pgtap | public | col_has_check | name, name, name, text | text - pgtap | public | col_has_check | name, name, name[], text | text - pgtap | public | col_has_check | name, name, text | text - pgtap | public | col_has_check | name, name[] | text pgtap | public | col_has_check | name, name[], text | text - pgtap | public | col_has_default | name, name | text + pgtap | public | col_has_check | name, name[] | text + pgtap | public | col_has_check | name, name, text | text + pgtap | public | col_has_check | name, name, name[], text | text + pgtap | public | col_has_check | name, name | text pgtap | public | col_has_default | name, name, name, text | text pgtap | public | col_has_default | name, name, text | text - pgtap | public | col_hasnt_default | name, name | text + pgtap | public | col_has_default | name, name | text pgtap | public | col_hasnt_default | name, name, name, text | text pgtap | public | col_hasnt_default | name, name, text | text - pgtap | public | col_is_fk | name, name | text + pgtap | public | col_hasnt_default | name, name | text pgtap | public | col_is_fk | name, name, name, text | text - pgtap | public | col_is_fk | name, name, name[], text | text - pgtap | public | col_is_fk | name, name, text | text - pgtap | public | col_is_fk | name, name[] | text pgtap | public | col_is_fk | name, name[], text | text - pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_is_fk | name, name[] | text + pgtap | public | col_is_fk | name, name, text | text + pgtap | public | col_is_fk | name, name, name[], text | text + pgtap | public | col_is_fk | name, name | text pgtap | public | col_is_null | table_name name, column_name name, description text | text - pgtap | public | col_is_pk | name, name | text + pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text pgtap | public | col_is_pk | name, name, name, text | text - pgtap | public | col_is_pk | name, name, name[], text | text - pgtap | public | col_is_pk | name, name, text | text - pgtap | public | col_is_pk | name, name[] | text pgtap | public | col_is_pk | name, name[], text | text - pgtap | public | col_is_unique | name, name | text - pgtap | public | col_is_unique | name, name, name | text + pgtap | public | col_is_pk | name, name[] | text + pgtap | public | col_is_pk | name, name, text | text + pgtap | public | col_is_pk | name, name, name[], text | text + pgtap | public | col_is_pk | name, name | text pgtap | public | col_is_unique | name, name, name, text | text + pgtap | public | col_is_unique | name, name[], text | text pgtap | public | col_is_unique | name, name, name[] | text - pgtap | public | col_is_unique | name, name, name[], text | text - pgtap | public | col_is_unique | name, name, text | text pgtap | public | col_is_unique | name, name[] | text - pgtap | public | col_is_unique | name, name[], text | text - pgtap | public | col_isnt_fk | name, name | text + pgtap | public | col_is_unique | name, name, text | text + pgtap | public | col_is_unique | name, name, name[], text | text + pgtap | public | col_is_unique | name, name | text + pgtap | public | col_is_unique | name, name, name | text pgtap | public | col_isnt_fk | name, name, name, text | text - pgtap | public | col_isnt_fk | name, name, name[], text | text - pgtap | public | col_isnt_fk | name, name, text | text - pgtap | public | col_isnt_fk | name, name[] | text pgtap | public | col_isnt_fk | name, name[], text | text - pgtap | public | col_isnt_pk | name, name | text + pgtap | public | col_isnt_fk | name, name[] | text + pgtap | public | col_isnt_fk | name, name, text | text + pgtap | public | col_isnt_fk | name, name, name[], text | text + pgtap | public | col_isnt_fk | name, name | text pgtap | public | col_isnt_pk | name, name, name, text | text - pgtap | public | col_isnt_pk | name, name, name[], text | text - pgtap | public | col_isnt_pk | name, name, text | text - pgtap | public | col_isnt_pk | name, name[] | text pgtap | public | col_isnt_pk | name, name[], text | text - pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text - pgtap | public | col_not_null | table_name name, column_name name, description text | text - pgtap | public | col_type_is | name, name, name, name, text | text - pgtap | public | col_type_is | name, name, name, name, text, text | text + pgtap | public | col_isnt_pk | name, name[] | text + pgtap | public | col_isnt_pk | name, name, text | text + pgtap | public | col_isnt_pk | name, name, name[], text | text + pgtap | public | col_isnt_pk | name, name | text + pgtap | public | col_not_null | table_name name, column_name name, description text | text + pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text pgtap | public | col_type_is | name, name, name, text | text + pgtap | public | col_type_is | name, name, text, text | text pgtap | public | col_type_is | name, name, name, text, text | text + pgtap | public | col_type_is | name, name, name, name, text, text | text pgtap | public | col_type_is | name, name, text | text - pgtap | public | col_type_is | name, name, text, text | text - pgtap | public | collect_tap | character varying[] | text + pgtap | public | col_type_is | name, name, name, name, text | text pgtap | public | collect_tap | VARIADIC text[] | text + pgtap | public | collect_tap | character varying[] | text + pgtap | public | column_privs_are | name, name, name, name[], text | text pgtap | public | column_privs_are | name, name, name, name, name[] | text - pgtap | public | column_privs_are | name, name, name, name, name[], text | text pgtap | public | column_privs_are | name, name, name, name[] | text - pgtap | public | column_privs_are | name, name, name, name[], text | text + pgtap | public | column_privs_are | name, name, name, name, name[], text | text + pgtap | public | columns_are | name, name[], text | text pgtap | public | columns_are | name, name, name[] | text - pgtap | public | columns_are | name, name, name[], text | text pgtap | public | columns_are | name, name[] | text - pgtap | public | columns_are | name, name[], text | text - pgtap | public | composite_owner_is | name, name | text - pgtap | public | composite_owner_is | name, name, name | text + pgtap | public | columns_are | name, name, name[], text | text pgtap | public | composite_owner_is | name, name, name, text | text pgtap | public | composite_owner_is | name, name, text | text + pgtap | public | composite_owner_is | name, name | text + pgtap | public | composite_owner_is | name, name, name | text pgtap | public | database_privs_are | name, name, name[] | text pgtap | public | database_privs_are | name, name, name[], text | text - pgtap | public | db_owner_is | name, name | text pgtap | public | db_owner_is | name, name, text | text - pgtap | public | diag | msg anyelement | text + pgtap | public | db_owner_is | name, name | text pgtap | public | diag | msg text | text - pgtap | public | diag | VARIADIC anyarray | text pgtap | public | diag | VARIADIC text[] | text + pgtap | public | diag | VARIADIC anyarray | text + pgtap | public | diag | msg anyelement | text pgtap | public | diag_test_name | text | text pgtap | public | display_oper | name, oid | text - pgtap | public | do_tap | | SETOF text - pgtap | public | do_tap | name | SETOF text - pgtap | public | do_tap | name, text | SETOF text pgtap | public | do_tap | text | SETOF text + pgtap | public | do_tap | name, text | SETOF text + pgtap | public | do_tap | name | SETOF text + pgtap | public | do_tap | | SETOF text pgtap | public | doesnt_imatch | anyelement, text | text pgtap | public | doesnt_imatch | anyelement, text, text | text pgtap | public | doesnt_match | anyelement, text | text pgtap | public | doesnt_match | anyelement, text, text | text - pgtap | public | domain_type_is | name, text, name, text | text pgtap | public | domain_type_is | name, text, name, text, text | text - pgtap | public | domain_type_is | name, text, text | text - pgtap | public | domain_type_is | name, text, text, text | text pgtap | public | domain_type_is | text, text | text + pgtap | public | domain_type_is | name, text, text, text | text + pgtap | public | domain_type_is | name, text, text | text pgtap | public | domain_type_is | text, text, text | text - pgtap | public | domain_type_isnt | name, text, name, text | text + pgtap | public | domain_type_is | name, text, name, text | text pgtap | public | domain_type_isnt | name, text, name, text, text | text - pgtap | public | domain_type_isnt | name, text, text | text - pgtap | public | domain_type_isnt | name, text, text, text | text pgtap | public | domain_type_isnt | text, text | text + pgtap | public | domain_type_isnt | name, text, text, text | text + pgtap | public | domain_type_isnt | name, text, text | text pgtap | public | domain_type_isnt | text, text, text | text - pgtap | public | domains_are | name, name[] | text - pgtap | public | domains_are | name, name[], text | text + pgtap | public | domain_type_isnt | name, text, name, text | text pgtap | public | domains_are | name[] | text pgtap | public | domains_are | name[], text | text + pgtap | public | domains_are | name, name[], text | text + pgtap | public | domains_are | name, name[] | text + pgtap | public | enum_has_labels | name, name[], text | text pgtap | public | enum_has_labels | name, name, name[] | text - pgtap | public | enum_has_labels | name, name, name[], text | text pgtap | public | enum_has_labels | name, name[] | text - pgtap | public | enum_has_labels | name, name[], text | text - pgtap | public | enums_are | name, name[] | text - pgtap | public | enums_are | name, name[], text | text + pgtap | public | enum_has_labels | name, name, name[], text | text pgtap | public | enums_are | name[] | text pgtap | public | enums_are | name[], text | text - pgtap | public | extensions_are | name, name[] | text - pgtap | public | extensions_are | name, name[], text | text + pgtap | public | enums_are | name, name[], text | text + pgtap | public | enums_are | name, name[] | text pgtap | public | extensions_are | name[] | text pgtap | public | extensions_are | name[], text | text - pgtap | public | fail | | text + pgtap | public | extensions_are | name, name[], text | text + pgtap | public | extensions_are | name, name[] | text pgtap | public | fail | text | text + pgtap | public | fail | | text pgtap | public | fdw_privs_are | name, name, name[] | text pgtap | public | fdw_privs_are | name, name, name[], text | text - pgtap | public | findfuncs | name, text | text[] - pgtap | public | findfuncs | name, text, text | text[] pgtap | public | findfuncs | text | text[] pgtap | public | findfuncs | text, text | text[] + pgtap | public | findfuncs | name, text, text | text[] + pgtap | public | findfuncs | name, text | text[] pgtap | public | finish | exception_on_failure boolean | SETOF text - pgtap | public | fk_ok | name, name, name, name | text - pgtap | public | fk_ok | name, name, name, name, name, name, text | text pgtap | public | fk_ok | name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name | text pgtap | public | fk_ok | name, name, name, name, text | text - pgtap | public | fk_ok | name, name, name[], name, name, name[] | text pgtap | public | fk_ok | name, name, name[], name, name, name[], text | text + pgtap | public | fk_ok | name, name, name[], name, name, name[] | text pgtap | public | fk_ok | name, name[], name, name[] | text pgtap | public | fk_ok | name, name[], name, name[], text | text - pgtap | public | foreign_table_owner_is | name, name | text - pgtap | public | foreign_table_owner_is | name, name, name | text pgtap | public | foreign_table_owner_is | name, name, name, text | text pgtap | public | foreign_table_owner_is | name, name, text | text - pgtap | public | foreign_tables_are | name, name[] | text - pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_table_owner_is | name, name | text + pgtap | public | foreign_table_owner_is | name, name, name | text pgtap | public | foreign_tables_are | name[] | text pgtap | public | foreign_tables_are | name[], text | text - pgtap | public | function_lang_is | name, name | text - pgtap | public | function_lang_is | name, name, name | text + pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_tables_are | name, name[] | text pgtap | public | function_lang_is | name, name, name, text | text - pgtap | public | function_lang_is | name, name, name[], name | text - pgtap | public | function_lang_is | name, name, name[], name, text | text pgtap | public | function_lang_is | name, name, text | text - pgtap | public | function_lang_is | name, name[], name | text pgtap | public | function_lang_is | name, name[], name, text | text + pgtap | public | function_lang_is | name, name, name[], name | text + pgtap | public | function_lang_is | name, name | text + pgtap | public | function_lang_is | name, name, name | text + pgtap | public | function_lang_is | name, name[], name | text + pgtap | public | function_lang_is | name, name, name[], name, text | text + pgtap | public | function_owner_is | name, name[], name, text | text pgtap | public | function_owner_is | name, name, name[], name | text - pgtap | public | function_owner_is | name, name, name[], name, text | text pgtap | public | function_owner_is | name, name[], name | text - pgtap | public | function_owner_is | name, name[], name, text | text - pgtap | public | function_privs_are | name, name, name[], name, name[] | text + pgtap | public | function_owner_is | name, name, name[], name, text | text pgtap | public | function_privs_are | name, name, name[], name, name[], text | text pgtap | public | function_privs_are | name, name[], name, name[] | text pgtap | public | function_privs_are | name, name[], name, name[], text | text - pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_privs_are | name, name, name[], name, name[] | text pgtap | public | function_returns | name, name, name[], text, text | text - pgtap | public | function_returns | name, name, text | text - pgtap | public | function_returns | name, name, text, text | text pgtap | public | function_returns | name, name[], text | text - pgtap | public | function_returns | name, name[], text, text | text - pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, name, text, text | text + pgtap | public | function_returns | name, name, text | text pgtap | public | function_returns | name, text, text | text - pgtap | public | functions_are | name, name[] | text - pgtap | public | functions_are | name, name[], text | text + pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_returns | name, name[], text, text | text pgtap | public | functions_are | name[] | text pgtap | public | functions_are | name[], text | text + pgtap | public | functions_are | name, name[], text | text + pgtap | public | functions_are | name, name[] | text pgtap | public | groups_are | name[] | text pgtap | public | groups_are | name[], text | text - pgtap | public | has_cast | name, name | text - pgtap | public | has_cast | name, name, name | text - pgtap | public | has_cast | name, name, name, name | text - pgtap | public | has_cast | name, name, name, name, text | text pgtap | public | has_cast | name, name, name, text | text + pgtap | public | has_cast | name, name, name, name | text pgtap | public | has_cast | name, name, text | text - pgtap | public | has_check | name | text + pgtap | public | has_cast | name, name, name, name, text | text + pgtap | public | has_cast | name, name | text + pgtap | public | has_cast | name, name, name | text pgtap | public | has_check | name, name, text | text pgtap | public | has_check | name, text | text - pgtap | public | has_column | name, name | text + pgtap | public | has_check | name | text pgtap | public | has_column | name, name, name, text | text pgtap | public | has_column | name, name, text | text - pgtap | public | has_composite | name | text + pgtap | public | has_column | name, name | text pgtap | public | has_composite | name, name, text | text pgtap | public | has_composite | name, text | text - pgtap | public | has_domain | name | text - pgtap | public | has_domain | name, name | text + pgtap | public | has_composite | name | text pgtap | public | has_domain | name, name, text | text pgtap | public | has_domain | name, text | text - pgtap | public | has_enum | name | text - pgtap | public | has_enum | name, name | text + pgtap | public | has_domain | name | text + pgtap | public | has_domain | name, name | text pgtap | public | has_enum | name, name, text | text pgtap | public | has_enum | name, text | text - pgtap | public | has_extension | name | text - pgtap | public | has_extension | name, name | text + pgtap | public | has_enum | name | text + pgtap | public | has_enum | name, name | text pgtap | public | has_extension | name, name, text | text pgtap | public | has_extension | name, text | text - pgtap | public | has_fk | name | text + pgtap | public | has_extension | name | text + pgtap | public | has_extension | name, name | text pgtap | public | has_fk | name, name, text | text pgtap | public | has_fk | name, text | text - pgtap | public | has_foreign_table | name | text - pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_fk | name | text pgtap | public | has_foreign_table | name, name, text | text pgtap | public | has_foreign_table | name, text | text - pgtap | public | has_function | name | text - pgtap | public | has_function | name, name | text + pgtap | public | has_foreign_table | name | text + pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_function | name, name[], text | text pgtap | public | has_function | name, name, name[] | text - pgtap | public | has_function | name, name, name[], text | text - pgtap | public | has_function | name, name, text | text pgtap | public | has_function | name, name[] | text - pgtap | public | has_function | name, name[], text | text + pgtap | public | has_function | name, name, text | text pgtap | public | has_function | name, text | text - pgtap | public | has_group | name | text + pgtap | public | has_function | name | text + pgtap | public | has_function | name, name, name[], text | text + pgtap | public | has_function | name, name | text pgtap | public | has_group | name, text | text - pgtap | public | has_index | name, name | text - pgtap | public | has_index | name, name, name | text - pgtap | public | has_index | name, name, name, name | text - pgtap | public | has_index | name, name, name, name, text | text - pgtap | public | has_index | name, name, name, name[] | text - pgtap | public | has_index | name, name, name, name[], text | text + pgtap | public | has_group | name | text pgtap | public | has_index | name, name, name, text | text + pgtap | public | has_index | name, name, name, name[], text | text pgtap | public | has_index | name, name, name[] | text - pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name, name, name | text pgtap | public | has_index | name, name, text | text - pgtap | public | has_inherited_tables | name | text - pgtap | public | has_inherited_tables | name, name | text + pgtap | public | has_index | name, name, name, name[] | text + pgtap | public | has_index | name, name, name, name, text | text + pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name | text + pgtap | public | has_index | name, name, name | text pgtap | public | has_inherited_tables | name, name, text | text pgtap | public | has_inherited_tables | name, text | text - pgtap | public | has_language | name | text + pgtap | public | has_inherited_tables | name | text + pgtap | public | has_inherited_tables | name, name | text pgtap | public | has_language | name, text | text - pgtap | public | has_leftop | name, name | text - pgtap | public | has_leftop | name, name, name | text - pgtap | public | has_leftop | name, name, name, name | text - pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_language | name | text pgtap | public | has_leftop | name, name, name, text | text + pgtap | public | has_leftop | name, name, name, name | text pgtap | public | has_leftop | name, name, text | text - pgtap | public | has_materialized_view | name | text + pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_leftop | name, name | text + pgtap | public | has_leftop | name, name, name | text pgtap | public | has_materialized_view | name, name, text | text pgtap | public | has_materialized_view | name, text | text - pgtap | public | has_opclass | name | text - pgtap | public | has_opclass | name, name | text + pgtap | public | has_materialized_view | name | text pgtap | public | has_opclass | name, name, text | text pgtap | public | has_opclass | name, text | text - pgtap | public | has_operator | name, name, name | text - pgtap | public | has_operator | name, name, name, name | text - pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_opclass | name | text + pgtap | public | has_opclass | name, name | text + pgtap | public | has_operator | name, name, name, text | text pgtap | public | has_operator | name, name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, name | text pgtap | public | has_operator | name, name, name, name, text | text - pgtap | public | has_operator | name, name, name, text | text - pgtap | public | has_pk | name | text + pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_operator | name, name, name | text pgtap | public | has_pk | name, name, text | text pgtap | public | has_pk | name, text | text - pgtap | public | has_relation | name | text + pgtap | public | has_pk | name | text pgtap | public | has_relation | name, name, text | text pgtap | public | has_relation | name, text | text - pgtap | public | has_rightop | name, name | text - pgtap | public | has_rightop | name, name, name | text - pgtap | public | has_rightop | name, name, name, name | text - pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_relation | name | text pgtap | public | has_rightop | name, name, name, text | text + pgtap | public | has_rightop | name, name, name, name | text pgtap | public | has_rightop | name, name, text | text - pgtap | public | has_role | name | text + pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_rightop | name, name | text + pgtap | public | has_rightop | name, name, name | text pgtap | public | has_role | name, text | text - pgtap | public | has_rule | name, name | text - pgtap | public | has_rule | name, name, name | text + pgtap | public | has_role | name | text pgtap | public | has_rule | name, name, name, text | text pgtap | public | has_rule | name, name, text | text - pgtap | public | has_schema | name | text + pgtap | public | has_rule | name, name | text + pgtap | public | has_rule | name, name, name | text pgtap | public | has_schema | name, text | text - pgtap | public | has_sequence | name | text - pgtap | public | has_sequence | name, name | text + pgtap | public | has_schema | name | text pgtap | public | has_sequence | name, name, text | text pgtap | public | has_sequence | name, text | text - pgtap | public | has_table | name | text - pgtap | public | has_table | name, name | text + pgtap | public | has_sequence | name | text + pgtap | public | has_sequence | name, name | text pgtap | public | has_table | name, name, text | text pgtap | public | has_table | name, text | text - pgtap | public | has_tablespace | name | text - pgtap | public | has_tablespace | name, text | text + pgtap | public | has_table | name | text + pgtap | public | has_table | name, name | text pgtap | public | has_tablespace | name, text, text | text - pgtap | public | has_trigger | name, name | text - pgtap | public | has_trigger | name, name, name | text + pgtap | public | has_tablespace | name, text | text + pgtap | public | has_tablespace | name | text pgtap | public | has_trigger | name, name, name, text | text pgtap | public | has_trigger | name, name, text | text - pgtap | public | has_type | name | text - pgtap | public | has_type | name, name | text + pgtap | public | has_trigger | name, name | text + pgtap | public | has_trigger | name, name, name | text pgtap | public | has_type | name, name, text | text pgtap | public | has_type | name, text | text + pgtap | public | has_type | name | text + pgtap | public | has_type | name, name | text pgtap | public | has_unique | text | text pgtap | public | has_unique | text, text | text pgtap | public | has_unique | text, text, text | text - pgtap | public | has_user | name | text pgtap | public | has_user | name, text | text - pgtap | public | has_view | name | text - pgtap | public | has_view | name, name | text + pgtap | public | has_user | name | text pgtap | public | has_view | name, name, text | text pgtap | public | has_view | name, text | text - pgtap | public | hasnt_cast | name, name | text - pgtap | public | hasnt_cast | name, name, name | text - pgtap | public | hasnt_cast | name, name, name, name | text - pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | has_view | name | text + pgtap | public | has_view | name, name | text pgtap | public | hasnt_cast | name, name, name, text | text + pgtap | public | hasnt_cast | name, name, name, name | text pgtap | public | hasnt_cast | name, name, text | text - pgtap | public | hasnt_column | name, name | text - pgtap | public | hasnt_column | name, name, name, text | text - pgtap | public | hasnt_column | name, name, text | text - pgtap | public | hasnt_composite | name | text + pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | hasnt_cast | name, name | text + pgtap | public | hasnt_cast | name, name, name | text + pgtap | public | hasnt_column | name, name, name, text | text + pgtap | public | hasnt_column | name, name, text | text + pgtap | public | hasnt_column | name, name | text pgtap | public | hasnt_composite | name, name, text | text pgtap | public | hasnt_composite | name, text | text - pgtap | public | hasnt_domain | name | text - pgtap | public | hasnt_domain | name, name | text + pgtap | public | hasnt_composite | name | text pgtap | public | hasnt_domain | name, name, text | text pgtap | public | hasnt_domain | name, text | text - pgtap | public | hasnt_enum | name | text - pgtap | public | hasnt_enum | name, name | text + pgtap | public | hasnt_domain | name | text + pgtap | public | hasnt_domain | name, name | text pgtap | public | hasnt_enum | name, name, text | text pgtap | public | hasnt_enum | name, text | text - pgtap | public | hasnt_extension | name | text - pgtap | public | hasnt_extension | name, name | text + pgtap | public | hasnt_enum | name | text + pgtap | public | hasnt_enum | name, name | text pgtap | public | hasnt_extension | name, name, text | text pgtap | public | hasnt_extension | name, text | text - pgtap | public | hasnt_fk | name | text + pgtap | public | hasnt_extension | name | text + pgtap | public | hasnt_extension | name, name | text pgtap | public | hasnt_fk | name, name, text | text pgtap | public | hasnt_fk | name, text | text - pgtap | public | hasnt_foreign_table | name | text - pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_fk | name | text pgtap | public | hasnt_foreign_table | name, name, text | text pgtap | public | hasnt_foreign_table | name, text | text - pgtap | public | hasnt_function | name | text - pgtap | public | hasnt_function | name, name | text + pgtap | public | hasnt_foreign_table | name | text + pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_function | name, name[], text | text pgtap | public | hasnt_function | name, name, name[] | text - pgtap | public | hasnt_function | name, name, name[], text | text - pgtap | public | hasnt_function | name, name, text | text pgtap | public | hasnt_function | name, name[] | text - pgtap | public | hasnt_function | name, name[], text | text + pgtap | public | hasnt_function | name, name, text | text pgtap | public | hasnt_function | name, text | text - pgtap | public | hasnt_group | name | text + pgtap | public | hasnt_function | name | text + pgtap | public | hasnt_function | name, name, name[], text | text + pgtap | public | hasnt_function | name, name | text pgtap | public | hasnt_group | name, text | text - pgtap | public | hasnt_index | name, name | text - pgtap | public | hasnt_index | name, name, name | text + pgtap | public | hasnt_group | name | text pgtap | public | hasnt_index | name, name, name, text | text pgtap | public | hasnt_index | name, name, text | text - pgtap | public | hasnt_inherited_tables | name | text - pgtap | public | hasnt_inherited_tables | name, name | text + pgtap | public | hasnt_index | name, name | text + pgtap | public | hasnt_index | name, name, name | text pgtap | public | hasnt_inherited_tables | name, name, text | text pgtap | public | hasnt_inherited_tables | name, text | text - pgtap | public | hasnt_language | name | text + pgtap | public | hasnt_inherited_tables | name | text + pgtap | public | hasnt_inherited_tables | name, name | text pgtap | public | hasnt_language | name, text | text - pgtap | public | hasnt_leftop | name, name | text - pgtap | public | hasnt_leftop | name, name, name | text - pgtap | public | hasnt_leftop | name, name, name, name | text - pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_language | name | text pgtap | public | hasnt_leftop | name, name, name, text | text + pgtap | public | hasnt_leftop | name, name, name, name | text pgtap | public | hasnt_leftop | name, name, text | text - pgtap | public | hasnt_materialized_view | name | text + pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_leftop | name, name | text + pgtap | public | hasnt_leftop | name, name, name | text pgtap | public | hasnt_materialized_view | name, name, text | text pgtap | public | hasnt_materialized_view | name, text | text - pgtap | public | hasnt_opclass | name | text - pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_materialized_view | name | text pgtap | public | hasnt_opclass | name, name, text | text pgtap | public | hasnt_opclass | name, text | text - pgtap | public | hasnt_operator | name, name, name | text - pgtap | public | hasnt_operator | name, name, name, name | text - pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_opclass | name | text + pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_operator | name, name, name, text | text pgtap | public | hasnt_operator | name, name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name | text pgtap | public | hasnt_operator | name, name, name, name, text | text - pgtap | public | hasnt_operator | name, name, name, text | text - pgtap | public | hasnt_pk | name | text + pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name | text pgtap | public | hasnt_pk | name, name, text | text pgtap | public | hasnt_pk | name, text | text - pgtap | public | hasnt_relation | name | text + pgtap | public | hasnt_pk | name | text pgtap | public | hasnt_relation | name, name, text | text pgtap | public | hasnt_relation | name, text | text - pgtap | public | hasnt_rightop | name, name | text - pgtap | public | hasnt_rightop | name, name, name | text - pgtap | public | hasnt_rightop | name, name, name, name | text - pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_relation | name | text pgtap | public | hasnt_rightop | name, name, name, text | text + pgtap | public | hasnt_rightop | name, name, name, name | text pgtap | public | hasnt_rightop | name, name, text | text - pgtap | public | hasnt_role | name | text + pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_rightop | name, name | text + pgtap | public | hasnt_rightop | name, name, name | text pgtap | public | hasnt_role | name, text | text - pgtap | public | hasnt_rule | name, name | text - pgtap | public | hasnt_rule | name, name, name | text + pgtap | public | hasnt_role | name | text pgtap | public | hasnt_rule | name, name, name, text | text pgtap | public | hasnt_rule | name, name, text | text - pgtap | public | hasnt_schema | name | text + pgtap | public | hasnt_rule | name, name | text + pgtap | public | hasnt_rule | name, name, name | text pgtap | public | hasnt_schema | name, text | text - pgtap | public | hasnt_sequence | name | text + pgtap | public | hasnt_schema | name | text pgtap | public | hasnt_sequence | name, name, text | text pgtap | public | hasnt_sequence | name, text | text - pgtap | public | hasnt_table | name | text - pgtap | public | hasnt_table | name, name | text + pgtap | public | hasnt_sequence | name | text pgtap | public | hasnt_table | name, name, text | text pgtap | public | hasnt_table | name, text | text - pgtap | public | hasnt_tablespace | name | text + pgtap | public | hasnt_table | name | text + pgtap | public | hasnt_table | name, name | text pgtap | public | hasnt_tablespace | name, text | text - pgtap | public | hasnt_trigger | name, name | text - pgtap | public | hasnt_trigger | name, name, name | text + pgtap | public | hasnt_tablespace | name | text pgtap | public | hasnt_trigger | name, name, name, text | text pgtap | public | hasnt_trigger | name, name, text | text - pgtap | public | hasnt_type | name | text - pgtap | public | hasnt_type | name, name | text + pgtap | public | hasnt_trigger | name, name | text + pgtap | public | hasnt_trigger | name, name, name | text pgtap | public | hasnt_type | name, name, text | text pgtap | public | hasnt_type | name, text | text - pgtap | public | hasnt_user | name | text + pgtap | public | hasnt_type | name | text + pgtap | public | hasnt_type | name, name | text pgtap | public | hasnt_user | name, text | text - pgtap | public | hasnt_view | name | text - pgtap | public | hasnt_view | name, name | text + pgtap | public | hasnt_user | name | text pgtap | public | hasnt_view | name, name, text | text pgtap | public | hasnt_view | name, text | text + pgtap | public | hasnt_view | name | text + pgtap | public | hasnt_view | name, name | text pgtap | public | ialike | anyelement, text | text pgtap | public | ialike | anyelement, text, text | text pgtap | public | imatches | anyelement, text | text pgtap | public | imatches | anyelement, text, text | text pgtap | public | in_todo | | boolean + pgtap | public | index_is_primary | name, name, name, text | text pgtap | public | index_is_primary | name | text pgtap | public | index_is_primary | name, name | text pgtap | public | index_is_primary | name, name, name | text - pgtap | public | index_is_primary | name, name, name, text | text - pgtap | public | index_is_type | name, name | text - pgtap | public | index_is_type | name, name, name | text pgtap | public | index_is_type | name, name, name, name | text pgtap | public | index_is_type | name, name, name, name, text | text + pgtap | public | index_is_type | name, name | text + pgtap | public | index_is_type | name, name, name | text + pgtap | public | index_is_unique | name, name, name, text | text pgtap | public | index_is_unique | name | text pgtap | public | index_is_unique | name, name | text pgtap | public | index_is_unique | name, name, name | text - pgtap | public | index_is_unique | name, name, name, text | text - pgtap | public | index_owner_is | name, name, name | text + pgtap | public | index_owner_is | name, name, name, text | text pgtap | public | index_owner_is | name, name, name, name | text pgtap | public | index_owner_is | name, name, name, name, text | text - pgtap | public | index_owner_is | name, name, name, text | text + pgtap | public | index_owner_is | name, name, name | text + pgtap | public | indexes_are | name, name[], text | text pgtap | public | indexes_are | name, name, name[] | text - pgtap | public | indexes_are | name, name, name[], text | text pgtap | public | indexes_are | name, name[] | text - pgtap | public | indexes_are | name, name[], text | text - pgtap | public | is | anyelement, anyelement | text + pgtap | public | indexes_are | name, name, name[], text | text pgtap | public | is | anyelement, anyelement, text | text - pgtap | public | is_aggregate | name | text - pgtap | public | is_aggregate | name, name | text + pgtap | public | is | anyelement, anyelement | text + pgtap | public | is_aggregate | name, name[], text | text pgtap | public | is_aggregate | name, name, name[] | text - pgtap | public | is_aggregate | name, name, name[], text | text - pgtap | public | is_aggregate | name, name, text | text pgtap | public | is_aggregate | name, name[] | text - pgtap | public | is_aggregate | name, name[], text | text + pgtap | public | is_aggregate | name, name, text | text pgtap | public | is_aggregate | name, text | text - pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_aggregate | name | text + pgtap | public | is_aggregate | name, name, name[], text | text + pgtap | public | is_aggregate | name, name | text + pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text pgtap | public | is_ancestor_of | name, name, integer | text - pgtap | public | is_ancestor_of | name, name, integer, text | text pgtap | public | is_ancestor_of | name, name, name, name | text - pgtap | public | is_ancestor_of | name, name, name, name, integer | text - pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text - pgtap | public | is_ancestor_of | name, name, name, name, text | text pgtap | public | is_ancestor_of | name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, integer | text + pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_ancestor_of | name, name, integer, text | text + pgtap | public | is_clustered | name, name, name, text | text pgtap | public | is_clustered | name | text pgtap | public | is_clustered | name, name | text pgtap | public | is_clustered | name, name, name | text - pgtap | public | is_clustered | name, name, name, text | text - pgtap | public | is_definer | name | text - pgtap | public | is_definer | name, name | text + pgtap | public | is_definer | name, name[], text | text pgtap | public | is_definer | name, name, name[] | text - pgtap | public | is_definer | name, name, name[], text | text - pgtap | public | is_definer | name, name, text | text pgtap | public | is_definer | name, name[] | text - pgtap | public | is_definer | name, name[], text | text + pgtap | public | is_definer | name, name, text | text pgtap | public | is_definer | name, text | text - pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_definer | name | text + pgtap | public | is_definer | name, name, name[], text | text + pgtap | public | is_definer | name, name | text + pgtap | public | is_descendent_of | name, name, name, name, integer, text | text pgtap | public | is_descendent_of | name, name, integer | text - pgtap | public | is_descendent_of | name, name, integer, text | text pgtap | public | is_descendent_of | name, name, name, name | text - pgtap | public | is_descendent_of | name, name, name, name, integer | text - pgtap | public | is_descendent_of | name, name, name, name, integer, text | text - pgtap | public | is_descendent_of | name, name, name, name, text | text pgtap | public | is_descendent_of | name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, integer | text + pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_descendent_of | name, name, integer, text | text pgtap | public | is_empty | text | text pgtap | public | is_empty | text, text | text - pgtap | public | is_indexed | name, name | text - pgtap | public | is_indexed | name, name, name | text pgtap | public | is_indexed | name, name, name, text | text + pgtap | public | is_indexed | name, name[], text | text pgtap | public | is_indexed | name, name, name[] | text - pgtap | public | is_indexed | name, name, name[], text | text pgtap | public | is_indexed | name, name[] | text - pgtap | public | is_indexed | name, name[], text | text - pgtap | public | is_member_of | name, name | text - pgtap | public | is_member_of | name, name, text | text - pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_indexed | name, name, name[], text | text + pgtap | public | is_indexed | name, name | text + pgtap | public | is_indexed | name, name, name | text pgtap | public | is_member_of | name, name[], text | text - pgtap | public | is_normal_function | name | text - pgtap | public | is_normal_function | name, name | text + pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_member_of | name, name, text | text + pgtap | public | is_member_of | name, name | text + pgtap | public | is_normal_function | name, name[], text | text pgtap | public | is_normal_function | name, name, name[] | text - pgtap | public | is_normal_function | name, name, name[], text | text - pgtap | public | is_normal_function | name, name, text | text pgtap | public | is_normal_function | name, name[] | text - pgtap | public | is_normal_function | name, name[], text | text + pgtap | public | is_normal_function | name, name, text | text pgtap | public | is_normal_function | name, text | text - pgtap | public | is_partition_of | name, name | text + pgtap | public | is_normal_function | name | text + pgtap | public | is_normal_function | name, name, name[], text | text + pgtap | public | is_normal_function | name, name | text pgtap | public | is_partition_of | name, name, name, name | text - pgtap | public | is_partition_of | name, name, name, name, text | text pgtap | public | is_partition_of | name, name, text | text - pgtap | public | is_partitioned | name | text - pgtap | public | is_partitioned | name, name | text + pgtap | public | is_partition_of | name, name, name, name, text | text + pgtap | public | is_partition_of | name, name | text pgtap | public | is_partitioned | name, name, text | text pgtap | public | is_partitioned | name, text | text - pgtap | public | is_procedure | name | text - pgtap | public | is_procedure | name, name | text + pgtap | public | is_partitioned | name | text + pgtap | public | is_partitioned | name, name | text + pgtap | public | is_procedure | name, name[], text | text pgtap | public | is_procedure | name, name, name[] | text - pgtap | public | is_procedure | name, name, name[], text | text - pgtap | public | is_procedure | name, name, text | text pgtap | public | is_procedure | name, name[] | text - pgtap | public | is_procedure | name, name[], text | text + pgtap | public | is_procedure | name, name, text | text pgtap | public | is_procedure | name, text | text - pgtap | public | is_strict | name | text - pgtap | public | is_strict | name, name | text + pgtap | public | is_procedure | name | text + pgtap | public | is_procedure | name, name, name[], text | text + pgtap | public | is_procedure | name, name | text + pgtap | public | is_strict | name, name[], text | text pgtap | public | is_strict | name, name, name[] | text - pgtap | public | is_strict | name, name, name[], text | text - pgtap | public | is_strict | name, name, text | text pgtap | public | is_strict | name, name[] | text - pgtap | public | is_strict | name, name[], text | text + pgtap | public | is_strict | name, name, text | text pgtap | public | is_strict | name, text | text - pgtap | public | is_superuser | name | text + pgtap | public | is_strict | name | text + pgtap | public | is_strict | name, name, name[], text | text + pgtap | public | is_strict | name, name | text pgtap | public | is_superuser | name, text | text - pgtap | public | is_window | name | text - pgtap | public | is_window | name, name | text + pgtap | public | is_superuser | name | text + pgtap | public | is_window | name, name[], text | text pgtap | public | is_window | name, name, name[] | text - pgtap | public | is_window | name, name, name[], text | text - pgtap | public | is_window | name, name, text | text pgtap | public | is_window | name, name[] | text - pgtap | public | is_window | name, name[], text | text + pgtap | public | is_window | name, name, text | text pgtap | public | is_window | name, text | text + pgtap | public | is_window | name | text + pgtap | public | is_window | name, name, name[], text | text + pgtap | public | is_window | name, name | text pgtap | public | isa_ok | anyelement, regtype | text pgtap | public | isa_ok | anyelement, regtype, text | text - pgtap | public | isnt | anyelement, anyelement | text pgtap | public | isnt | anyelement, anyelement, text | text - pgtap | public | isnt_aggregate | name | text - pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt | anyelement, anyelement | text + pgtap | public | isnt_aggregate | name, name[], text | text pgtap | public | isnt_aggregate | name, name, name[] | text - pgtap | public | isnt_aggregate | name, name, name[], text | text - pgtap | public | isnt_aggregate | name, name, text | text pgtap | public | isnt_aggregate | name, name[] | text - pgtap | public | isnt_aggregate | name, name[], text | text + pgtap | public | isnt_aggregate | name, name, text | text pgtap | public | isnt_aggregate | name, text | text - pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_aggregate | name | text + pgtap | public | isnt_aggregate | name, name, name[], text | text + pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text pgtap | public | isnt_ancestor_of | name, name, integer | text - pgtap | public | isnt_ancestor_of | name, name, integer, text | text pgtap | public | isnt_ancestor_of | name, name, name, name | text - pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text - pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text - pgtap | public | isnt_ancestor_of | name, name, name, name, text | text pgtap | public | isnt_ancestor_of | name, name, text | text - pgtap | public | isnt_definer | name | text - pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_ancestor_of | name, name, integer, text | text + pgtap | public | isnt_definer | name, name[], text | text pgtap | public | isnt_definer | name, name, name[] | text - pgtap | public | isnt_definer | name, name, name[], text | text - pgtap | public | isnt_definer | name, name, text | text pgtap | public | isnt_definer | name, name[] | text - pgtap | public | isnt_definer | name, name[], text | text + pgtap | public | isnt_definer | name, name, text | text pgtap | public | isnt_definer | name, text | text - pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_definer | name | text + pgtap | public | isnt_definer | name, name, name[], text | text + pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text pgtap | public | isnt_descendent_of | name, name, integer | text - pgtap | public | isnt_descendent_of | name, name, integer, text | text pgtap | public | isnt_descendent_of | name, name, name, name | text - pgtap | public | isnt_descendent_of | name, name, name, name, integer | text - pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text - pgtap | public | isnt_descendent_of | name, name, name, name, text | text pgtap | public | isnt_descendent_of | name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer | text + pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_descendent_of | name, name, integer, text | text pgtap | public | isnt_empty | text | text pgtap | public | isnt_empty | text, text | text - pgtap | public | isnt_member_of | name, name | text - pgtap | public | isnt_member_of | name, name, text | text - pgtap | public | isnt_member_of | name, name[] | text pgtap | public | isnt_member_of | name, name[], text | text - pgtap | public | isnt_normal_function | name | text - pgtap | public | isnt_normal_function | name, name | text + pgtap | public | isnt_member_of | name, name[] | text + pgtap | public | isnt_member_of | name, name, text | text + pgtap | public | isnt_member_of | name, name | text + pgtap | public | isnt_normal_function | name, name[], text | text pgtap | public | isnt_normal_function | name, name, name[] | text - pgtap | public | isnt_normal_function | name, name, name[], text | text - pgtap | public | isnt_normal_function | name, name, text | text pgtap | public | isnt_normal_function | name, name[] | text - pgtap | public | isnt_normal_function | name, name[], text | text + pgtap | public | isnt_normal_function | name, name, text | text pgtap | public | isnt_normal_function | name, text | text - pgtap | public | isnt_partitioned | name | text - pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_normal_function | name | text + pgtap | public | isnt_normal_function | name, name, name[], text | text + pgtap | public | isnt_normal_function | name, name | text pgtap | public | isnt_partitioned | name, name, text | text pgtap | public | isnt_partitioned | name, text | text - pgtap | public | isnt_procedure | name | text - pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_partitioned | name | text + pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_procedure | name, name[], text | text pgtap | public | isnt_procedure | name, name, name[] | text - pgtap | public | isnt_procedure | name, name, name[], text | text - pgtap | public | isnt_procedure | name, name, text | text pgtap | public | isnt_procedure | name, name[] | text - pgtap | public | isnt_procedure | name, name[], text | text + pgtap | public | isnt_procedure | name, name, text | text pgtap | public | isnt_procedure | name, text | text - pgtap | public | isnt_strict | name | text - pgtap | public | isnt_strict | name, name | text + pgtap | public | isnt_procedure | name | text + pgtap | public | isnt_procedure | name, name, name[], text | text + pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_strict | name, name[], text | text pgtap | public | isnt_strict | name, name, name[] | text - pgtap | public | isnt_strict | name, name, name[], text | text - pgtap | public | isnt_strict | name, name, text | text pgtap | public | isnt_strict | name, name[] | text - pgtap | public | isnt_strict | name, name[], text | text + pgtap | public | isnt_strict | name, name, text | text pgtap | public | isnt_strict | name, text | text - pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_strict | name | text + pgtap | public | isnt_strict | name, name, name[], text | text + pgtap | public | isnt_strict | name, name | text pgtap | public | isnt_superuser | name, text | text - pgtap | public | isnt_window | name | text - pgtap | public | isnt_window | name, name | text + pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_window | name, name[], text | text pgtap | public | isnt_window | name, name, name[] | text - pgtap | public | isnt_window | name, name, name[], text | text - pgtap | public | isnt_window | name, name, text | text pgtap | public | isnt_window | name, name[] | text - pgtap | public | isnt_window | name, name[], text | text + pgtap | public | isnt_window | name, name, text | text pgtap | public | isnt_window | name, text | text - pgtap | public | language_is_trusted | name | text + pgtap | public | isnt_window | name | text + pgtap | public | isnt_window | name, name, name[], text | text + pgtap | public | isnt_window | name, name | text pgtap | public | language_is_trusted | name, text | text - pgtap | public | language_owner_is | name, name | text + pgtap | public | language_is_trusted | name | text pgtap | public | language_owner_is | name, name, text | text + pgtap | public | language_owner_is | name, name | text pgtap | public | language_privs_are | name, name, name[] | text pgtap | public | language_privs_are | name, name, name[], text | text pgtap | public | languages_are | name[] | text @@ -2907,157 +2864,157 @@ order by pgtap | public | lives_ok | text, text | text pgtap | public | matches | anyelement, text | text pgtap | public | matches | anyelement, text, text | text - pgtap | public | materialized_view_owner_is | name, name | text - pgtap | public | materialized_view_owner_is | name, name, name | text pgtap | public | materialized_view_owner_is | name, name, name, text | text pgtap | public | materialized_view_owner_is | name, name, text | text - pgtap | public | materialized_views_are | name, name[] | text - pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_view_owner_is | name, name | text + pgtap | public | materialized_view_owner_is | name, name, name | text pgtap | public | materialized_views_are | name[] | text pgtap | public | materialized_views_are | name[], text | text + pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_views_are | name, name[] | text pgtap | public | no_plan | | SETOF boolean pgtap | public | num_failed | | integer pgtap | public | ok | boolean | text pgtap | public | ok | boolean, text | text - pgtap | public | opclass_owner_is | name, name | text - pgtap | public | opclass_owner_is | name, name, name | text pgtap | public | opclass_owner_is | name, name, name, text | text pgtap | public | opclass_owner_is | name, name, text | text - pgtap | public | opclasses_are | name, name[] | text - pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclass_owner_is | name, name | text + pgtap | public | opclass_owner_is | name, name, name | text pgtap | public | opclasses_are | name[] | text pgtap | public | opclasses_are | name[], text | text + pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclasses_are | name, name[] | text pgtap | public | operators_are | name, text[] | text - pgtap | public | operators_are | name, text[], text | text pgtap | public | operators_are | text[] | text pgtap | public | operators_are | text[], text | text + pgtap | public | operators_are | name, text[], text | text pgtap | public | os_name | | text + pgtap | public | partitions_are | name, name[], text | text pgtap | public | partitions_are | name, name, name[] | text - pgtap | public | partitions_are | name, name, name[], text | text pgtap | public | partitions_are | name, name[] | text - pgtap | public | partitions_are | name, name[], text | text - pgtap | public | pass | | text + pgtap | public | partitions_are | name, name, name[], text | text pgtap | public | pass | text | text - pgtap | public | performs_ok | text, numeric | text + pgtap | public | pass | | text pgtap | public | performs_ok | text, numeric, text | text - pgtap | public | performs_within | text, numeric, numeric | text + pgtap | public | performs_ok | text, numeric | text pgtap | public | performs_within | text, numeric, numeric, integer | text + pgtap | public | performs_within | text, numeric, numeric | text pgtap | public | performs_within | text, numeric, numeric, integer, text | text pgtap | public | performs_within | text, numeric, numeric, text | text pgtap | public | pg_version | | text pgtap | public | pg_version_num | | integer pgtap | public | pgtap_version | | numeric pgtap | public | plan | integer | text + pgtap | public | policies_are | name, name[], text | text pgtap | public | policies_are | name, name, name[] | text - pgtap | public | policies_are | name, name, name[], text | text pgtap | public | policies_are | name, name[] | text - pgtap | public | policies_are | name, name[], text | text + pgtap | public | policies_are | name, name, name[], text | text pgtap | public | policy_cmd_is | name, name, name, text | text + pgtap | public | policy_cmd_is | name, name, text, text | text pgtap | public | policy_cmd_is | name, name, name, text, text | text pgtap | public | policy_cmd_is | name, name, text | text - pgtap | public | policy_cmd_is | name, name, text, text | text - pgtap | public | policy_roles_are | name, name, name, name[] | text pgtap | public | policy_roles_are | name, name, name, name[], text | text pgtap | public | policy_roles_are | name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name, name[] | text pgtap | public | policy_roles_are | name, name, name[], text | text - pgtap | public | relation_owner_is | name, name | text - pgtap | public | relation_owner_is | name, name, name | text pgtap | public | relation_owner_is | name, name, name, text | text pgtap | public | relation_owner_is | name, name, text | text + pgtap | public | relation_owner_is | name, name | text + pgtap | public | relation_owner_is | name, name, name | text + pgtap | public | results_eq | text, refcursor | text + pgtap | public | results_eq | text, anyarray, text | text + pgtap | public | results_eq | text, text | text + pgtap | public | results_eq | text, refcursor, text | text pgtap | public | results_eq | refcursor, anyarray | text pgtap | public | results_eq | refcursor, anyarray, text | text - pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_eq | text, text, text | text + pgtap | public | results_eq | text, anyarray | text pgtap | public | results_eq | refcursor, refcursor, text | text - pgtap | public | results_eq | refcursor, text | text pgtap | public | results_eq | refcursor, text, text | text - pgtap | public | results_eq | text, anyarray | text - pgtap | public | results_eq | text, anyarray, text | text - pgtap | public | results_eq | text, refcursor | text - pgtap | public | results_eq | text, refcursor, text | text - pgtap | public | results_eq | text, text | text - pgtap | public | results_eq | text, text, text | text + pgtap | public | results_eq | refcursor, text | text + pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_ne | text, refcursor | text + pgtap | public | results_ne | text, anyarray, text | text + pgtap | public | results_ne | text, text | text + pgtap | public | results_ne | text, refcursor, text | text pgtap | public | results_ne | refcursor, anyarray | text pgtap | public | results_ne | refcursor, anyarray, text | text - pgtap | public | results_ne | refcursor, refcursor | text + pgtap | public | results_ne | text, text, text | text + pgtap | public | results_ne | text, anyarray | text pgtap | public | results_ne | refcursor, refcursor, text | text - pgtap | public | results_ne | refcursor, text | text pgtap | public | results_ne | refcursor, text, text | text - pgtap | public | results_ne | text, anyarray | text - pgtap | public | results_ne | text, anyarray, text | text - pgtap | public | results_ne | text, refcursor | text - pgtap | public | results_ne | text, refcursor, text | text - pgtap | public | results_ne | text, text | text - pgtap | public | results_ne | text, text, text | text + pgtap | public | results_ne | refcursor, text | text + pgtap | public | results_ne | refcursor, refcursor | text pgtap | public | roles_are | name[] | text pgtap | public | roles_are | name[], text | text pgtap | public | row_eq | text, anyelement | text pgtap | public | row_eq | text, anyelement, text | text - pgtap | public | rule_is_instead | name, name | text - pgtap | public | rule_is_instead | name, name, name | text pgtap | public | rule_is_instead | name, name, name, text | text pgtap | public | rule_is_instead | name, name, text | text + pgtap | public | rule_is_instead | name, name | text + pgtap | public | rule_is_instead | name, name, name | text pgtap | public | rule_is_on | name, name, name, text | text + pgtap | public | rule_is_on | name, name, text, text | text pgtap | public | rule_is_on | name, name, name, text, text | text pgtap | public | rule_is_on | name, name, text | text - pgtap | public | rule_is_on | name, name, text, text | text + pgtap | public | rules_are | name, name[], text | text pgtap | public | rules_are | name, name, name[] | text - pgtap | public | rules_are | name, name, name[], text | text pgtap | public | rules_are | name, name[] | text - pgtap | public | rules_are | name, name[], text | text - pgtap | public | runtests | | SETOF text - pgtap | public | runtests | name | SETOF text - pgtap | public | runtests | name, text | SETOF text + pgtap | public | rules_are | name, name, name[], text | text pgtap | public | runtests | text | SETOF text - pgtap | public | schema_owner_is | name, name | text + pgtap | public | runtests | name, text | SETOF text + pgtap | public | runtests | name | SETOF text + pgtap | public | runtests | | SETOF text pgtap | public | schema_owner_is | name, name, text | text + pgtap | public | schema_owner_is | name, name | text pgtap | public | schema_privs_are | name, name, name[] | text pgtap | public | schema_privs_are | name, name, name[], text | text pgtap | public | schemas_are | name[] | text pgtap | public | schemas_are | name[], text | text - pgtap | public | sequence_owner_is | name, name | text - pgtap | public | sequence_owner_is | name, name, name | text pgtap | public | sequence_owner_is | name, name, name, text | text pgtap | public | sequence_owner_is | name, name, text | text - pgtap | public | sequence_privs_are | name, name, name, name[] | text + pgtap | public | sequence_owner_is | name, name | text + pgtap | public | sequence_owner_is | name, name, name | text pgtap | public | sequence_privs_are | name, name, name, name[], text | text pgtap | public | sequence_privs_are | name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name, name[] | text pgtap | public | sequence_privs_are | name, name, name[], text | text - pgtap | public | sequences_are | name, name[] | text - pgtap | public | sequences_are | name, name[], text | text pgtap | public | sequences_are | name[] | text pgtap | public | sequences_are | name[], text | text + pgtap | public | sequences_are | name, name[], text | text + pgtap | public | sequences_are | name, name[] | text pgtap | public | server_privs_are | name, name, name[] | text pgtap | public | server_privs_are | name, name, name[], text | text - pgtap | public | set_eq | text, anyarray | text pgtap | public | set_eq | text, anyarray, text | text pgtap | public | set_eq | text, text | text pgtap | public | set_eq | text, text, text | text + pgtap | public | set_eq | text, anyarray | text pgtap | public | set_has | text, text | text pgtap | public | set_has | text, text, text | text pgtap | public | set_hasnt | text, text | text pgtap | public | set_hasnt | text, text, text | text - pgtap | public | set_ne | text, anyarray | text pgtap | public | set_ne | text, anyarray, text | text pgtap | public | set_ne | text, text | text pgtap | public | set_ne | text, text, text | text + pgtap | public | set_ne | text, anyarray | text pgtap | public | skip | integer | text - pgtap | public | skip | integer, text | text pgtap | public | skip | text | text pgtap | public | skip | why text, how_many integer | text - pgtap | public | table_owner_is | name, name | text - pgtap | public | table_owner_is | name, name, name | text + pgtap | public | skip | integer, text | text pgtap | public | table_owner_is | name, name, name, text | text pgtap | public | table_owner_is | name, name, text | text - pgtap | public | table_privs_are | name, name, name, name[] | text + pgtap | public | table_owner_is | name, name | text + pgtap | public | table_owner_is | name, name, name | text pgtap | public | table_privs_are | name, name, name, name[], text | text pgtap | public | table_privs_are | name, name, name[] | text + pgtap | public | table_privs_are | name, name, name, name[] | text pgtap | public | table_privs_are | name, name, name[], text | text - pgtap | public | tables_are | name, name[] | text - pgtap | public | tables_are | name, name[], text | text pgtap | public | tables_are | name[] | text pgtap | public | tables_are | name[], text | text - pgtap | public | tablespace_owner_is | name, name | text + pgtap | public | tables_are | name, name[], text | text + pgtap | public | tables_are | name, name[] | text pgtap | public | tablespace_owner_is | name, name, text | text + pgtap | public | tablespace_owner_is | name, name | text pgtap | public | tablespace_privs_are | name, name, name[] | text pgtap | public | tablespace_privs_are | name, name, name[], text | text pgtap | public | tablespaces_are | name[] | text @@ -3071,57 +3028,57 @@ order by pgtap | public | throws_matching | text, text | text pgtap | public | throws_matching | text, text, text | text pgtap | public | throws_ok | text | text - pgtap | public | throws_ok | text, character, text, text | text pgtap | public | throws_ok | text, integer | text - pgtap | public | throws_ok | text, integer, text | text - pgtap | public | throws_ok | text, integer, text, text | text pgtap | public | throws_ok | text, text | text + pgtap | public | throws_ok | text, character, text, text | text pgtap | public | throws_ok | text, text, text | text - pgtap | public | todo | how_many integer | SETOF boolean + pgtap | public | throws_ok | text, integer, text, text | text + pgtap | public | throws_ok | text, integer, text | text pgtap | public | todo | how_many integer, why text | SETOF boolean - pgtap | public | todo | why text | SETOF boolean pgtap | public | todo | why text, how_many integer | SETOF boolean + pgtap | public | todo | why text | SETOF boolean + pgtap | public | todo | how_many integer | SETOF boolean pgtap | public | todo_end | | SETOF boolean - pgtap | public | todo_start | | SETOF boolean pgtap | public | todo_start | text | SETOF boolean - pgtap | public | trigger_is | name, name, name | text - pgtap | public | trigger_is | name, name, name, name, name | text - pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | todo_start | | SETOF boolean pgtap | public | trigger_is | name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name | text + pgtap | public | trigger_is | name, name, name | text + pgtap | public | triggers_are | name, name[], text | text pgtap | public | triggers_are | name, name, name[] | text - pgtap | public | triggers_are | name, name, name[], text | text pgtap | public | triggers_are | name, name[] | text - pgtap | public | triggers_are | name, name[], text | text - pgtap | public | type_owner_is | name, name | text - pgtap | public | type_owner_is | name, name, name | text + pgtap | public | triggers_are | name, name, name[], text | text pgtap | public | type_owner_is | name, name, name, text | text pgtap | public | type_owner_is | name, name, text | text - pgtap | public | types_are | name, name[] | text - pgtap | public | types_are | name, name[], text | text + pgtap | public | type_owner_is | name, name | text + pgtap | public | type_owner_is | name, name, name | text pgtap | public | types_are | name[] | text pgtap | public | types_are | name[], text | text + pgtap | public | types_are | name, name[], text | text + pgtap | public | types_are | name, name[] | text pgtap | public | unalike | anyelement, text | text pgtap | public | unalike | anyelement, text, text | text pgtap | public | unialike | anyelement, text | text pgtap | public | unialike | anyelement, text, text | text pgtap | public | users_are | name[] | text pgtap | public | users_are | name[], text | text - pgtap | public | view_owner_is | name, name | text - pgtap | public | view_owner_is | name, name, name | text pgtap | public | view_owner_is | name, name, name, text | text pgtap | public | view_owner_is | name, name, text | text - pgtap | public | views_are | name, name[] | text - pgtap | public | views_are | name, name[], text | text + pgtap | public | view_owner_is | name, name | text + pgtap | public | view_owner_is | name, name, name | text pgtap | public | views_are | name[] | text pgtap | public | views_are | name[], text | text - pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | views_are | name, name[], text | text + pgtap | public | views_are | name, name[] | text pgtap | public | volatility_is | name, name, name[], text, text | text - pgtap | public | volatility_is | name, name, text | text - pgtap | public | volatility_is | name, name, text, text | text pgtap | public | volatility_is | name, name[], text | text - pgtap | public | volatility_is | name, name[], text, text | text - pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, name, text, text | text + pgtap | public | volatility_is | name, name, text | text pgtap | public | volatility_is | name, text, text | text + pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | volatility_is | name, name[], text, text | text plpgsql | pg_catalog | plpgsql_call_handler | | language_handler plpgsql | pg_catalog | plpgsql_inline_handler | internal | void plpgsql | pg_catalog | plpgsql_validator | oid | void @@ -3147,8 +3104,8 @@ order by plpgsql_check | public | plpgsql_profiler_remove_fake_queryid_hook | | void plpgsql_check | public | plpgsql_profiler_reset | funcoid regprocedure | void plpgsql_check | public | plpgsql_profiler_reset_all | | void - plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) plpgsql_check | public | plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) postgis | public | _postgis_deprecate | oldname text, newname text, version text | void postgis | public | _postgis_index_extent | tbl regclass, col text | box2d postgis | public | _postgis_join_selectivity | regclass, text, regclass, text, text | double precision @@ -3165,21 +3122,21 @@ order by postgis | public | _st_bestsrid | geography, geography | integer postgis | public | _st_contains | geom1 geometry, geom2 geometry | boolean postgis | public | _st_containsproperly | geom1 geometry, geom2 geometry | boolean - postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | _st_coveredby | geom1 geometry, geom2 geometry | boolean - postgis | public | _st_covers | geog1 geography, geog2 geography | boolean + postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | _st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_covers | geog1 geography, geog2 geography | boolean postgis | public | _st_crosses | geom1 geometry, geom2 geometry | boolean postgis | public | _st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | _st_distancetree | geography, geography | double precision postgis | public | _st_distancetree | geography, geography, double precision, boolean | double precision - postgis | public | _st_distanceuncached | geography, geography | double precision - postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distancetree | geography, geography | double precision postgis | public | _st_distanceuncached | geography, geography, double precision, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography | double precision postgis | public | _st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean postgis | public | _st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean postgis | public | _st_dwithinuncached | geography, geography, double precision, boolean | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean postgis | public | _st_equals | geom1 geometry, geom2 geometry | boolean postgis | public | _st_expand | geography, double precision | geography postgis | public | _st_geomfromgml | text, integer | geometry @@ -3195,8 +3152,8 @@ order by postgis | public | _st_voronoi | g1 geometry, clip geometry, tolerance double precision, return_polygons boolean | geometry postgis | public | _st_within | geom1 geometry, geom2 geometry | boolean postgis | public | addauth | text | boolean - postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | addgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | addgeometrycolumn | table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text postgis | public | box | box3d | box postgis | public | box | geometry | box @@ -3206,8 +3163,8 @@ order by postgis | public | box2d_out | box2d | cstring postgis | public | box2df_in | cstring | box2df postgis | public | box2df_out | box2df | cstring - postgis | public | box3d | box2d | box3d postgis | public | box3d | geometry | box3d + postgis | public | box3d | box2d | box3d postgis | public | box3d_in | cstring | box3d postgis | public | box3d_out | box3d | cstring postgis | public | box3dtobox | box3d | box @@ -3216,23 +3173,23 @@ order by postgis | public | checkauth | text, text | integer postgis | public | checkauth | text, text, text | integer postgis | public | checkauthtrigger | | trigger - postgis | public | contains_2d | box2df, box2df | boolean - postgis | public | contains_2d | box2df, geometry | boolean postgis | public | contains_2d | geometry, box2df | boolean + postgis | public | contains_2d | box2df, geometry | boolean + postgis | public | contains_2d | box2df, box2df | boolean postgis | public | disablelongtransactions | | text - postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrycolumn | table_name character varying, column_name character varying | text - postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text - postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text postgis | public | dropgeometrytable | table_name character varying | text + postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text postgis | public | enablelongtransactions | | text postgis | public | equals | geom1 geometry, geom2 geometry | boolean postgis | public | find_srid | character varying, character varying, character varying | integer postgis | public | geog_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geography | bytea | geography - postgis | public | geography | geography, integer, boolean | geography postgis | public | geography | geometry | geography + postgis | public | geography | geography, integer, boolean | geography postgis | public | geography_analyze | internal | boolean postgis | public | geography_cmp | geography, geography | integer postgis | public | geography_distance_knn | geography, geography | double precision @@ -3265,15 +3222,15 @@ order by postgis | public | geom2d_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geom3d_brin_inclusion_add_value | internal, internal, internal, internal | boolean postgis | public | geom4d_brin_inclusion_add_value | internal, internal, internal, internal | boolean - postgis | public | geometry | box2d | geometry + postgis | public | geometry | geometry, integer, boolean | geometry postgis | public | geometry | box3d | geometry + postgis | public | geometry | text | geometry + postgis | public | geometry | point | geometry postgis | public | geometry | bytea | geometry postgis | public | geometry | geography | geometry - postgis | public | geometry | geometry, integer, boolean | geometry postgis | public | geometry | path | geometry - postgis | public | geometry | point | geometry postgis | public | geometry | polygon | geometry - postgis | public | geometry | text | geometry + postgis | public | geometry | box2d | geometry postgis | public | geometry_above | geom1 geometry, geom2 geometry | boolean postgis | public | geometry_analyze | internal | boolean postgis | public | geometry_below | geom1 geometry, geom2 geometry | boolean @@ -3360,29 +3317,29 @@ order by postgis | public | gserialized_gist_joinsel_nd | internal, oid, internal, smallint | double precision postgis | public | gserialized_gist_sel_2d | internal, oid, internal, integer | double precision postgis | public | gserialized_gist_sel_nd | internal, oid, internal, integer | double precision - postgis | public | is_contained_2d | box2df, box2df | boolean - postgis | public | is_contained_2d | box2df, geometry | boolean postgis | public | is_contained_2d | geometry, box2df | boolean + postgis | public | is_contained_2d | box2df, geometry | boolean + postgis | public | is_contained_2d | box2df, box2df | boolean postgis | public | json | geometry | json postgis | public | jsonb | geometry | jsonb - postgis | public | lockrow | text, text, text | integer + postgis | public | lockrow | text, text, text, timestamp without time zone | integer postgis | public | lockrow | text, text, text, text | integer + postgis | public | lockrow | text, text, text | integer postgis | public | lockrow | text, text, text, text, timestamp without time zone | integer - postgis | public | lockrow | text, text, text, timestamp without time zone | integer postgis | public | longtransactionsenabled | | boolean - postgis | public | overlaps_2d | box2df, box2df | boolean - postgis | public | overlaps_2d | box2df, geometry | boolean postgis | public | overlaps_2d | geometry, box2df | boolean + postgis | public | overlaps_2d | box2df, geometry | boolean + postgis | public | overlaps_2d | box2df, box2df | boolean + postgis | public | overlaps_geog | gidx, gidx | boolean postgis | public | overlaps_geog | geography, gidx | boolean postgis | public | overlaps_geog | gidx, geography | boolean - postgis | public | overlaps_geog | gidx, gidx | boolean + postgis | public | overlaps_nd | gidx, gidx | boolean postgis | public | overlaps_nd | geometry, gidx | boolean postgis | public | overlaps_nd | gidx, geometry | boolean - postgis | public | overlaps_nd | gidx, gidx | boolean postgis | public | path | geometry | path postgis | public | pgis_asflatgeobuf_finalfn | internal | bytea - postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean, text | internal postgis | public | pgis_asgeobuf_finalfn | internal | bytea postgis | public | pgis_asgeobuf_transfn | internal, anyelement | internal @@ -3391,13 +3348,13 @@ order by postgis | public | pgis_asmvt_deserialfn | bytea, internal | internal postgis | public | pgis_asmvt_finalfn | internal | bytea postgis | public | pgis_asmvt_serialfn | internal | bytea + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement | internal - postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer | internal - postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text, text | internal - postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision, integer | internal postgis | public | pgis_geometry_clusterintersecting_finalfn | internal | geometry[] postgis | public | pgis_geometry_clusterwithin_finalfn | internal | geometry[] @@ -3408,8 +3365,8 @@ order by postgis | public | pgis_geometry_union_parallel_deserialfn | bytea, internal | internal postgis | public | pgis_geometry_union_parallel_finalfn | internal | geometry postgis | public | pgis_geometry_union_parallel_serialfn | internal | bytea - postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal postgis | public | point | geometry | point postgis | public | polygon | geometry | polygon postgis | public | populate_geometry_columns | tbl_oid oid, use_typmod boolean | integer @@ -3463,116 +3420,116 @@ order by postgis | public | st_3dperimeter | geometry | double precision postgis | public | st_3dshortestline | geom1 geometry, geom2 geometry | geometry postgis | public | st_addmeasure | geometry, double precision, double precision | geometry - postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_addpoint | geom1 geometry, geom2 geometry, integer | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision | geometry postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision | geometry - postgis | public | st_angle | line1 geometry, line2 geometry | double precision postgis | public | st_angle | pt1 geometry, pt2 geometry, pt3 geometry, pt4 geometry | double precision + postgis | public | st_angle | line1 geometry, line2 geometry | double precision postgis | public | st_area | geog geography, use_spheroid boolean | double precision - postgis | public | st_area | geometry | double precision postgis | public | st_area | text | double precision + postgis | public | st_area | geometry | double precision postgis | public | st_area2d | geometry | double precision postgis | public | st_asbinary | geography | bytea - postgis | public | st_asbinary | geography, text | bytea - postgis | public | st_asbinary | geometry | bytea postgis | public | st_asbinary | geometry, text | bytea + postgis | public | st_asbinary | geometry | bytea + postgis | public | st_asbinary | geography, text | bytea postgis | public | st_asencodedpolyline | geom geometry, nprecision integer | text - postgis | public | st_asewkb | geometry | bytea postgis | public | st_asewkb | geometry, text | bytea - postgis | public | st_asewkt | geography | text + postgis | public | st_asewkb | geometry | bytea + postgis | public | st_asewkt | text | text postgis | public | st_asewkt | geography, integer | text - postgis | public | st_asewkt | geometry | text + postgis | public | st_asewkt | geography | text postgis | public | st_asewkt | geometry, integer | text - postgis | public | st_asewkt | text | text + postgis | public | st_asewkt | geometry | text postgis | public | st_asflatgeobuf | anyelement | bytea postgis | public | st_asflatgeobuf | anyelement, boolean | bytea postgis | public | st_asflatgeobuf | anyelement, boolean, text | bytea postgis | public | st_asgeobuf | anyelement | bytea postgis | public | st_asgeobuf | anyelement, text | bytea - postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | text | text postgis | public | st_asgeojson | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text postgis | public | st_asgeojson | r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean | text - postgis | public | st_asgeojson | text | text - postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text - postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text postgis | public | st_asgml | text | text postgis | public | st_asgml | version integer, geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text postgis | public | st_asgml | version integer, geom geometry, maxdecimaldigits integer, options integer, nprefix text, id text | text - postgis | public | st_ashexewkb | geometry | text postgis | public | st_ashexewkb | geometry, text | text - postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text - postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_ashexewkb | geometry | text postgis | public | st_askml | text | text + postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text postgis | public | st_aslatlontext | geom geometry, tmpl text | text postgis | public | st_asmarc21 | geom geometry, format text | text postgis | public | st_asmvt | anyelement | bytea - postgis | public | st_asmvt | anyelement, text | bytea + postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea postgis | public | st_asmvt | anyelement, text, integer | bytea + postgis | public | st_asmvt | anyelement, text | bytea postgis | public | st_asmvt | anyelement, text, integer, text | bytea - postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea postgis | public | st_asmvtgeom | geom geometry, bounds box2d, extent integer, buffer integer, clip_geom boolean | geometry postgis | public | st_assvg | geog geography, rel integer, maxdecimaldigits integer | text postgis | public | st_assvg | geom geometry, rel integer, maxdecimaldigits integer | text postgis | public | st_assvg | text | text - postgis | public | st_astext | geography | text + postgis | public | st_astext | text | text postgis | public | st_astext | geography, integer | text - postgis | public | st_astext | geometry | text + postgis | public | st_astext | geography | text postgis | public | st_astext | geometry, integer | text - postgis | public | st_astext | text | text - postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astext | geometry | text postgis | public | st_astwkb | geom geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea postgis | public | st_asx3d | geom geometry, maxdecimaldigits integer, options integer | text - postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision postgis | public | st_azimuth | geom1 geometry, geom2 geometry | double precision + postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision postgis | public | st_bdmpolyfromtext | text, integer | geometry postgis | public | st_bdpolyfromtext | text, integer | geometry postgis | public | st_boundary | geometry | geometry postgis | public | st_boundingdiagonal | geom geometry, fits boolean | geometry postgis | public | st_box2dfromgeohash | text, integer | box2d - postgis | public | st_buffer | geography, double precision | geography - postgis | public | st_buffer | geography, double precision, integer | geography - postgis | public | st_buffer | geography, double precision, text | geography postgis | public | st_buffer | geom geometry, radius double precision, options text | geometry + postgis | public | st_buffer | geography, double precision, text | geography + postgis | public | st_buffer | geography, double precision, integer | geography postgis | public | st_buffer | geom geometry, radius double precision, quadsegs integer | geometry - postgis | public | st_buffer | text, double precision | geometry - postgis | public | st_buffer | text, double precision, integer | geometry postgis | public | st_buffer | text, double precision, text | geometry + postgis | public | st_buffer | geography, double precision | geography + postgis | public | st_buffer | text, double precision, integer | geometry + postgis | public | st_buffer | text, double precision | geometry postgis | public | st_buildarea | geometry | geometry + postgis | public | st_centroid | text | geometry postgis | public | st_centroid | geography, use_spheroid boolean | geography postgis | public | st_centroid | geometry | geometry - postgis | public | st_centroid | text | geometry postgis | public | st_chaikinsmoothing | geometry, integer, boolean | geometry postgis | public | st_cleangeometry | geometry | geometry postgis | public | st_clipbybox2d | geom geometry, box box2d | geometry postgis | public | st_closestpoint | geom1 geometry, geom2 geometry | geometry postgis | public | st_closestpointofapproach | geometry, geometry | double precision postgis | public | st_clusterdbscan | geometry, eps double precision, minpoints integer | integer - postgis | public | st_clusterintersecting | geometry | geometry[] postgis | public | st_clusterintersecting | geometry[] | geometry[] + postgis | public | st_clusterintersecting | geometry | geometry[] postgis | public | st_clusterkmeans | geom geometry, k integer, max_radius double precision | integer - postgis | public | st_clusterwithin | geometry, double precision | geometry[] postgis | public | st_clusterwithin | geometry[], double precision | geometry[] + postgis | public | st_clusterwithin | geometry, double precision | geometry[] postgis | public | st_collect | geom1 geometry, geom2 geometry | geometry - postgis | public | st_collect | geometry | geometry postgis | public | st_collect | geometry[] | geometry - postgis | public | st_collectionextract | geometry | geometry + postgis | public | st_collect | geometry | geometry postgis | public | st_collectionextract | geometry, integer | geometry + postgis | public | st_collectionextract | geometry | geometry postgis | public | st_collectionhomogenize | geometry | geometry postgis | public | st_combinebbox | box2d, geometry | box2d - postgis | public | st_combinebbox | box3d, box3d | box3d postgis | public | st_combinebbox | box3d, geometry | box3d + postgis | public | st_combinebbox | box3d, box3d | box3d postgis | public | st_concavehull | param_geom geometry, param_pctconvex double precision, param_allow_holes boolean | geometry postgis | public | st_contains | geom1 geometry, geom2 geometry | boolean postgis | public | st_containsproperly | geom1 geometry, geom2 geometry | boolean postgis | public | st_convexhull | geometry | geometry postgis | public | st_coorddim | geometry geometry | smallint - postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | st_coveredby | geom1 geometry, geom2 geometry | boolean postgis | public | st_coveredby | text, text | boolean - postgis | public | st_covers | geog1 geography, geog2 geography | boolean + postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean postgis | public | st_covers | geom1 geometry, geom2 geometry | boolean postgis | public | st_covers | text, text | boolean + postgis | public | st_covers | geog1 geography, geog2 geography | boolean postgis | public | st_cpawithin | geometry, geometry, double precision | boolean postgis | public | st_crosses | geom1 geometry, geom2 geometry | boolean postgis | public | st_curvetoline | geom geometry, tol double precision, toltype integer, flags integer | geometry @@ -3581,33 +3538,33 @@ order by postgis | public | st_difference | geom1 geometry, geom2 geometry, gridsize double precision | geometry postgis | public | st_dimension | geometry | integer postgis | public | st_disjoint | geom1 geometry, geom2 geometry | boolean - postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision postgis | public | st_distance | geom1 geometry, geom2 geometry | double precision postgis | public | st_distance | text, text | double precision + postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision postgis | public | st_distancecpa | geometry, geometry | double precision postgis | public | st_distancesphere | geom1 geometry, geom2 geometry | double precision postgis | public | st_distancesphere | geom1 geometry, geom2 geometry, radius double precision | double precision - postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry, spheroid | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision postgis | public | st_dump | geometry | SETOF geometry_dump postgis | public | st_dumppoints | geometry | SETOF geometry_dump postgis | public | st_dumprings | geometry | SETOF geometry_dump postgis | public | st_dumpsegments | geometry | SETOF geometry_dump + postgis | public | st_dwithin | text, text, double precision | boolean postgis | public | st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean postgis | public | st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean - postgis | public | st_dwithin | text, text, double precision | boolean postgis | public | st_endpoint | geometry | geometry postgis | public | st_envelope | geometry | geometry postgis | public | st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_estimatedextent | text, text, text, boolean | box2d postgis | public | st_estimatedextent | text, text | box2d postgis | public | st_estimatedextent | text, text, text | box2d - postgis | public | st_estimatedextent | text, text, text, boolean | box2d - postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d + postgis | public | st_expand | box3d, double precision | box3d postgis | public | st_expand | box box3d, dx double precision, dy double precision, dz double precision | box3d postgis | public | st_expand | box2d, double precision | box2d - postgis | public | st_expand | box3d, double precision | box3d - postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry + postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d postgis | public | st_expand | geometry, double precision | geometry + postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry postgis | public | st_extent | geometry | box2d postgis | public | st_exteriorring | geometry | geometry postgis | public | st_filterbym | geometry, double precision, double precision, boolean | geometry @@ -3624,13 +3581,13 @@ order by postgis | public | st_forcepolygonccw | geometry | geometry postgis | public | st_forcepolygoncw | geometry | geometry postgis | public | st_forcerhr | geometry | geometry - postgis | public | st_forcesfs | geometry | geometry postgis | public | st_forcesfs | geometry, version text | geometry + postgis | public | st_forcesfs | geometry | geometry postgis | public | st_frechetdistance | geom1 geometry, geom2 geometry, double precision | double precision postgis | public | st_fromflatgeobuf | anyelement, bytea | SETOF anyelement postgis | public | st_fromflatgeobuftotable | text, text, bytea | void - postgis | public | st_generatepoints | area geometry, npoints integer | geometry postgis | public | st_generatepoints | area geometry, npoints integer, seed integer | geometry + postgis | public | st_generatepoints | area geometry, npoints integer | geometry postgis | public | st_geogfromtext | text | geography postgis | public | st_geogfromwkb | bytea | geography postgis | public | st_geographyfromtext | text | geography @@ -3638,8 +3595,8 @@ order by postgis | public | st_geohash | geom geometry, maxchars integer | text postgis | public | st_geomcollfromtext | text | geometry postgis | public | st_geomcollfromtext | text, integer | geometry - postgis | public | st_geomcollfromwkb | bytea | geometry postgis | public | st_geomcollfromwkb | bytea, integer | geometry + postgis | public | st_geomcollfromwkb | bytea | geometry postgis | public | st_geometricmedian | g geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean | geometry postgis | public | st_geometryfromtext | text | geometry postgis | public | st_geometryfromtext | text, integer | geometry @@ -3648,9 +3605,9 @@ order by postgis | public | st_geomfromewkb | bytea | geometry postgis | public | st_geomfromewkt | text | geometry postgis | public | st_geomfromgeohash | text, integer | geometry + postgis | public | st_geomfromgeojson | text | geometry postgis | public | st_geomfromgeojson | json | geometry postgis | public | st_geomfromgeojson | jsonb | geometry - postgis | public | st_geomfromgeojson | text | geometry postgis | public | st_geomfromgml | text | geometry postgis | public | st_geomfromgml | text, integer | geometry postgis | public | st_geomfromkml | text | geometry @@ -3658,8 +3615,8 @@ order by postgis | public | st_geomfromtext | text | geometry postgis | public | st_geomfromtext | text, integer | geometry postgis | public | st_geomfromtwkb | bytea | geometry - postgis | public | st_geomfromwkb | bytea | geometry postgis | public | st_geomfromwkb | bytea, integer | geometry + postgis | public | st_geomfromwkb | bytea | geometry postgis | public | st_gmltosql | text | geometry postgis | public | st_gmltosql | text, integer | geometry postgis | public | st_hasarc | geometry geometry | boolean @@ -3669,12 +3626,12 @@ order by postgis | public | st_hexagongrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record postgis | public | st_interiorringn | geometry, integer | geometry postgis | public | st_interpolatepoint | line geometry, point geometry | double precision - postgis | public | st_intersection | geography, geography | geography postgis | public | st_intersection | geom1 geometry, geom2 geometry, gridsize double precision | geometry postgis | public | st_intersection | text, text | geometry - postgis | public | st_intersects | geog1 geography, geog2 geography | boolean + postgis | public | st_intersection | geography, geography | geography postgis | public | st_intersects | geom1 geometry, geom2 geometry | boolean postgis | public | st_intersects | text, text | boolean + postgis | public | st_intersects | geog1 geography, geog2 geography | boolean postgis | public | st_isclosed | geometry | boolean postgis | public | st_iscollection | geometry | boolean postgis | public | st_isempty | geometry | boolean @@ -3682,15 +3639,15 @@ order by postgis | public | st_ispolygoncw | geometry | boolean postgis | public | st_isring | geometry | boolean postgis | public | st_issimple | geometry | boolean - postgis | public | st_isvalid | geometry | boolean postgis | public | st_isvalid | geometry, integer | boolean + postgis | public | st_isvalid | geometry | boolean postgis | public | st_isvaliddetail | geom geometry, flags integer | valid_detail - postgis | public | st_isvalidreason | geometry | text postgis | public | st_isvalidreason | geometry, integer | text + postgis | public | st_isvalidreason | geometry | text postgis | public | st_isvalidtrajectory | geometry | boolean postgis | public | st_length | geog geography, use_spheroid boolean | double precision - postgis | public | st_length | geometry | double precision postgis | public | st_length | text | double precision + postgis | public | st_length | geometry | double precision postgis | public | st_length2d | geometry | double precision postgis | public | st_length2dspheroid | geometry, spheroid | double precision postgis | public | st_lengthspheroid | geometry, spheroid | double precision @@ -3700,15 +3657,15 @@ order by postgis | public | st_linefrommultipoint | geometry | geometry postgis | public | st_linefromtext | text | geometry postgis | public | st_linefromtext | text, integer | geometry - postgis | public | st_linefromwkb | bytea | geometry postgis | public | st_linefromwkb | bytea, integer | geometry + postgis | public | st_linefromwkb | bytea | geometry postgis | public | st_lineinterpolatepoint | geometry, double precision | geometry postgis | public | st_lineinterpolatepoints | geometry, double precision, repeat boolean | geometry postgis | public | st_linelocatepoint | geom1 geometry, geom2 geometry | double precision - postgis | public | st_linemerge | geometry | geometry postgis | public | st_linemerge | geometry, boolean | geometry - postgis | public | st_linestringfromwkb | bytea | geometry + postgis | public | st_linemerge | geometry | geometry postgis | public | st_linestringfromwkb | bytea, integer | geometry + postgis | public | st_linestringfromwkb | bytea | geometry postgis | public | st_linesubstring | geometry, double precision, double precision | geometry postgis | public | st_linetocurve | geometry geometry | geometry postgis | public | st_locatealong | geometry geometry, measure double precision, leftrightoffset double precision | geometry @@ -3719,14 +3676,14 @@ order by postgis | public | st_makebox2d | geom1 geometry, geom2 geometry | box2d postgis | public | st_makeenvelope | double precision, double precision, double precision, double precision, integer | geometry postgis | public | st_makeline | geom1 geometry, geom2 geometry | geometry - postgis | public | st_makeline | geometry | geometry postgis | public | st_makeline | geometry[] | geometry + postgis | public | st_makeline | geometry | geometry + postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry postgis | public | st_makepoint | double precision, double precision | geometry postgis | public | st_makepoint | double precision, double precision, double precision | geometry - postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry postgis | public | st_makepointm | double precision, double precision, double precision | geometry - postgis | public | st_makepolygon | geometry | geometry postgis | public | st_makepolygon | geometry, geometry[] | geometry + postgis | public | st_makepolygon | geometry | geometry postgis | public | st_makevalid | geom geometry, params text | geometry postgis | public | st_makevalid | geometry | geometry postgis | public | st_maxdistance | geom1 geometry, geom2 geometry | double precision @@ -3740,25 +3697,25 @@ order by postgis | public | st_minimumclearanceline | geometry | geometry postgis | public | st_mlinefromtext | text | geometry postgis | public | st_mlinefromtext | text, integer | geometry - postgis | public | st_mlinefromwkb | bytea | geometry postgis | public | st_mlinefromwkb | bytea, integer | geometry + postgis | public | st_mlinefromwkb | bytea | geometry postgis | public | st_mpointfromtext | text | geometry postgis | public | st_mpointfromtext | text, integer | geometry - postgis | public | st_mpointfromwkb | bytea | geometry postgis | public | st_mpointfromwkb | bytea, integer | geometry + postgis | public | st_mpointfromwkb | bytea | geometry postgis | public | st_mpolyfromtext | text | geometry postgis | public | st_mpolyfromtext | text, integer | geometry - postgis | public | st_mpolyfromwkb | bytea | geometry postgis | public | st_mpolyfromwkb | bytea, integer | geometry + postgis | public | st_mpolyfromwkb | bytea | geometry postgis | public | st_multi | geometry | geometry postgis | public | st_multilinefromwkb | bytea | geometry postgis | public | st_multilinestringfromtext | text | geometry postgis | public | st_multilinestringfromtext | text, integer | geometry postgis | public | st_multipointfromtext | text | geometry - postgis | public | st_multipointfromwkb | bytea | geometry postgis | public | st_multipointfromwkb | bytea, integer | geometry - postgis | public | st_multipolyfromwkb | bytea | geometry + postgis | public | st_multipointfromwkb | bytea | geometry postgis | public | st_multipolyfromwkb | bytea, integer | geometry + postgis | public | st_multipolyfromwkb | bytea | geometry postgis | public | st_multipolygonfromtext | text | geometry postgis | public | st_multipolygonfromtext | text, integer | geometry postgis | public | st_ndims | geometry | smallint @@ -3779,13 +3736,13 @@ order by postgis | public | st_perimeter | geog geography, use_spheroid boolean | double precision postgis | public | st_perimeter | geometry | double precision postgis | public | st_perimeter2d | geometry | double precision - postgis | public | st_point | double precision, double precision | geometry postgis | public | st_point | double precision, double precision, srid integer | geometry + postgis | public | st_point | double precision, double precision | geometry postgis | public | st_pointfromgeohash | text, integer | geometry postgis | public | st_pointfromtext | text | geometry postgis | public | st_pointfromtext | text, integer | geometry - postgis | public | st_pointfromwkb | bytea | geometry postgis | public | st_pointfromwkb | bytea, integer | geometry + postgis | public | st_pointfromwkb | bytea | geometry postgis | public | st_pointinsidecircle | geometry, double precision, double precision, double precision | boolean postgis | public | st_pointm | xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer | geometry postgis | public | st_pointn | geometry, integer | geometry @@ -3795,35 +3752,35 @@ order by postgis | public | st_pointzm | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer | geometry postgis | public | st_polyfromtext | text | geometry postgis | public | st_polyfromtext | text, integer | geometry - postgis | public | st_polyfromwkb | bytea | geometry postgis | public | st_polyfromwkb | bytea, integer | geometry + postgis | public | st_polyfromwkb | bytea | geometry postgis | public | st_polygon | geometry, integer | geometry postgis | public | st_polygonfromtext | text | geometry postgis | public | st_polygonfromtext | text, integer | geometry - postgis | public | st_polygonfromwkb | bytea | geometry postgis | public | st_polygonfromwkb | bytea, integer | geometry - postgis | public | st_polygonize | geometry | geometry + postgis | public | st_polygonfromwkb | bytea | geometry postgis | public | st_polygonize | geometry[] | geometry + postgis | public | st_polygonize | geometry | geometry postgis | public | st_project | geog geography, distance double precision, azimuth double precision | geography postgis | public | st_quantizecoordinates | g geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer | geometry postgis | public | st_reduceprecision | geom geometry, gridsize double precision | geometry - postgis | public | st_relate | geom1 geometry, geom2 geometry | text postgis | public | st_relate | geom1 geometry, geom2 geometry, integer | text + postgis | public | st_relate | geom1 geometry, geom2 geometry | text postgis | public | st_relate | geom1 geometry, geom2 geometry, text | boolean postgis | public | st_relatematch | text, text | boolean postgis | public | st_removepoint | geometry, integer | geometry postgis | public | st_removerepeatedpoints | geom geometry, tolerance double precision | geometry postgis | public | st_reverse | geometry | geometry - postgis | public | st_rotate | geometry, double precision | geometry - postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry postgis | public | st_rotate | geometry, double precision, geometry | geometry + postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_rotate | geometry, double precision | geometry postgis | public | st_rotatex | geometry, double precision | geometry postgis | public | st_rotatey | geometry, double precision | geometry postgis | public | st_rotatez | geometry, double precision | geometry postgis | public | st_scale | geometry, double precision, double precision | geometry postgis | public | st_scale | geometry, double precision, double precision, double precision | geometry - postgis | public | st_scale | geometry, geometry | geometry postgis | public | st_scale | geometry, geometry, origin geometry | geometry + postgis | public | st_scale | geometry, geometry | geometry postgis | public | st_scroll | geometry, geometry | geometry postgis | public | st_segmentize | geog geography, max_segment_length double precision | geography postgis | public | st_segmentize | geometry, double precision | geometry @@ -3834,16 +3791,16 @@ order by postgis | public | st_sharedpaths | geom1 geometry, geom2 geometry | geometry postgis | public | st_shiftlongitude | geometry | geometry postgis | public | st_shortestline | geom1 geometry, geom2 geometry | geometry - postgis | public | st_simplify | geometry, double precision | geometry postgis | public | st_simplify | geometry, double precision, boolean | geometry + postgis | public | st_simplify | geometry, double precision | geometry postgis | public | st_simplifypolygonhull | geom geometry, vertex_fraction double precision, is_outer boolean | geometry postgis | public | st_simplifypreservetopology | geometry, double precision | geometry postgis | public | st_simplifyvw | geometry, double precision | geometry postgis | public | st_snap | geom1 geometry, geom2 geometry, double precision | geometry - postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry - postgis | public | st_snaptogrid | geometry, double precision | geometry postgis | public | st_snaptogrid | geometry, double precision, double precision | geometry + postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry postgis | public | st_snaptogrid | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision | geometry postgis | public | st_split | geom1 geometry, geom2 geometry | geometry postgis | public | st_square | size double precision, cell_i integer, cell_j integer, origin geometry | geometry postgis | public | st_squaregrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record @@ -3858,20 +3815,20 @@ order by postgis | public | st_symmetricdifference | geom1 geometry, geom2 geometry | geometry postgis | public | st_tileenvelope | zoom integer, x integer, y integer, bounds geometry, margin double precision | geometry postgis | public | st_touches | geom1 geometry, geom2 geometry | boolean - postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry - postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry postgis | public | st_transform | geom geometry, to_proj text | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry postgis | public | st_transform | geometry, integer | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry postgis | public | st_translate | geometry, double precision, double precision | geometry postgis | public | st_translate | geometry, double precision, double precision, double precision | geometry postgis | public | st_transscale | geometry, double precision, double precision, double precision, double precision | geometry postgis | public | st_triangulatepolygon | g1 geometry | geometry postgis | public | st_unaryunion | geometry, gridsize double precision | geometry - postgis | public | st_union | geom1 geometry, geom2 geometry | geometry postgis | public | st_union | geom1 geometry, geom2 geometry, gridsize double precision | geometry - postgis | public | st_union | geometry | geometry - postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry | geometry postgis | public | st_union | geometry[] | geometry + postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geometry | geometry postgis | public | st_voronoilines | g1 geometry, tolerance double precision, extend_to geometry | geometry postgis | public | st_voronoipolygons | g1 geometry, tolerance double precision, extend_to geometry | geometry postgis | public | st_within | geom1 geometry, geom2 geometry | boolean @@ -3948,8 +3905,8 @@ order by postgis_raster | public | _st_convertarray4ma | value double precision[] | double precision[] postgis_raster | public | _st_count | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint postgis_raster | public | _st_countagg_finalfn | agg agg_count | bigint - postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count postgis_raster | public | _st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean @@ -3959,10 +3916,10 @@ order by postgis_raster | public | _st_grayscale4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_hillshade4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_histogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, min double precision, max double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | _st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean - postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster + postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster postgis_raster | public | _st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | _st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_pixelascentroids | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) @@ -3977,38 +3934,38 @@ order by postgis_raster | public | _st_slope4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_summarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats postgis_raster | public | _st_summarystats_finalfn | internal | summarystats + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal postgis_raster | public | _st_summarystats_transfn | internal, raster, boolean, double precision | internal postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean | internal - postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal postgis_raster | public | _st_tile | rast raster, width integer, height integer, nband integer[], padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | _st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_tpi4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_tri4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | _st_union_finalfn | internal | raster - postgis_raster | public | _st_union_transfn | internal, raster | internal - postgis_raster | public | _st_union_transfn | internal, raster, integer | internal postgis_raster | public | _st_union_transfn | internal, raster, integer, text | internal + postgis_raster | public | _st_union_transfn | internal, raster | internal postgis_raster | public | _st_union_transfn | internal, raster, text | internal + postgis_raster | public | _st_union_transfn | internal, raster, integer | internal postgis_raster | public | _st_union_transfn | internal, raster, unionarg[] | internal - postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record postgis_raster | public | _st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record postgis_raster | public | _st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | _st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record postgis_raster | public | _updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_raster | public | addoverviewconstraints | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, ovfactor integer | boolean postgis_raster | public | addoverviewconstraints | ovtable name, ovcolumn name, reftable name, refcolumn name, ovfactor integer | boolean postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean - postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | box3d | raster | box3d postgis_raster | public | bytea | raster | bytea - postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean postgis_raster | public | dropoverviewconstraints | ovtable name, ovcolumn name | boolean + postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean - postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean postgis_raster | public | geometry_contained_by_raster | geometry, raster | boolean postgis_raster | public | geometry_raster_contain | geometry, raster | boolean postgis_raster | public | geometry_raster_overlap | geometry, raster | boolean @@ -4036,108 +3993,108 @@ order by postgis_raster | public | raster_overright | raster, raster | boolean postgis_raster | public | raster_right | raster, raster | boolean postgis_raster | public | raster_same | raster, raster | boolean - postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster postgis_raster | public | st_addband | rast raster, index integer, outdbfile text, outdbindex integer[], nodataval double precision | raster - postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster postgis_raster | public | st_addband | rast raster, outdbfile text, outdbindex integer[], index integer, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster postgis_raster | public | st_addband | rast raster, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster postgis_raster | public | st_addband | torast raster, fromrast raster, fromband integer, torastindex integer | raster postgis_raster | public | st_addband | torast raster, fromrasts raster[], fromband integer, torastindex integer | raster postgis_raster | public | st_approxcount | rast raster, exclude_nodata_value boolean, sample_percent double precision | bigint - postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint - postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint postgis_raster | public | st_approxcount | rast raster, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record - postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantile double precision | double precision - postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record - postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision postgis_raster | public | st_approxquantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantile double precision | double precision - postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_approxsummarystats | rast raster, exclude_nodata_value boolean, sample_percent double precision | summarystats - postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats - postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats postgis_raster | public | st_approxsummarystats | rast raster, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats postgis_raster | public | st_asbinary | raster, outasin boolean | bytea postgis_raster | public | st_asgdalraster | rast raster, format text, options text[], srid integer | bytea postgis_raster | public | st_ashexwkb | raster, outasin boolean | text - postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea - postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea + postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea postgis_raster | public | st_asjpeg | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea postgis_raster | public | st_asjpeg | rast raster, nbands integer[], quality integer | bytea - postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea postgis_raster | public | st_aspect | rast raster, nband integer, customextent raster, pixeltype text, units text, interpolate_nodata boolean | raster postgis_raster | public | st_aspect | rast raster, nband integer, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspng | rast raster, options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea postgis_raster | public | st_aspng | rast raster, nband integer, compression integer | bytea postgis_raster | public | st_aspng | rast raster, nband integer, options text[] | bytea postgis_raster | public | st_aspng | rast raster, nbands integer[], compression integer | bytea - postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea - postgis_raster | public | st_aspng | rast raster, options text[] | bytea - postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text[], value double precision[], nodataval double precision[], touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster - postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea postgis_raster | public | st_astiff | rast raster, compression text, srid integer | bytea postgis_raster | public | st_astiff | rast raster, nbands integer[], compression text, srid integer | bytea postgis_raster | public | st_astiff | rast raster, nbands integer[], options text[], srid integer | bytea - postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea postgis_raster | public | st_aswkb | raster, outasin boolean | bytea - postgis_raster | public | st_band | rast raster, nband integer | raster - postgis_raster | public | st_band | rast raster, nbands integer[] | raster postgis_raster | public | st_band | rast raster, nbands text, delimiter character | raster + postgis_raster | public | st_band | rast raster, nbands integer[] | raster + postgis_raster | public | st_band | rast raster, nband integer | raster postgis_raster | public | st_bandfilesize | rast raster, band integer | bigint postgis_raster | public | st_bandfiletimestamp | rast raster, band integer | bigint - postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean postgis_raster | public | st_bandisnodata | rast raster, forcechecking boolean | boolean + postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean postgis_raster | public | st_bandmetadata | rast raster, band integer | TABLE(pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) postgis_raster | public | st_bandmetadata | rast raster, band integer[] | TABLE(bandnum integer, pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) postgis_raster | public | st_bandnodatavalue | rast raster, band integer | double precision postgis_raster | public | st_bandpath | rast raster, band integer | text postgis_raster | public | st_bandpixeltype | rast raster, band integer | text - postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster - postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision[], crop boolean | raster - postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, nodataval double precision, crop boolean | raster postgis_raster | public | st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster postgis_raster | public | st_colormap | rast raster, colormap text, method text | raster postgis_raster | public | st_colormap | rast raster, nband integer, colormap text, method text | raster - postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_contains | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_containsproperly | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_contour | rast raster, bandnumber integer, level_interval double precision, level_base double precision, fixed_levels double precision[], polygonize boolean | TABLE(geom geometry, id integer, value double precision) postgis_raster | public | st_convexhull | raster | geometry - postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint postgis_raster | public | st_count | rast raster, nband integer, exclude_nodata_value boolean | bigint - postgis_raster | public | st_countagg | raster, boolean | bigint - postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint postgis_raster | public | st_countagg | raster, integer, boolean, double precision | bigint - postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_countagg | raster, boolean | bigint postgis_raster | public | st_coveredby | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_covers | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_createoverview | tab regclass, col name, factor integer, algo text | regclass postgis_raster | public | st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean postgis_raster | public | st_dfullywithin | rast1 raster, rast2 raster, distance double precision | boolean - postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_disjoint | rast1 raster, rast2 raster | boolean - postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_distinct4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_dumpaspolygons | rast raster, band integer, exclude_nodata_value boolean | SETOF geomval postgis_raster | public | st_dumpvalues | rast raster, nband integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_dumpvalues | rast raster, nband integer[], exclude_nodata_value boolean | TABLE(nband integer, valarray double precision[]) @@ -4148,8 +4105,8 @@ order by postgis_raster | public | st_gdaldrivers | OUT idx integer, OUT short_name text, OUT long_name text, OUT can_read boolean, OUT can_write boolean, OUT create_options text | SETOF record postgis_raster | public | st_georeference | rast raster, format text | text postgis_raster | public | st_geotransform | raster, OUT imag double precision, OUT jmag double precision, OUT theta_i double precision, OUT theta_ij double precision, OUT xoffset double precision, OUT yoffset double precision | record - postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster postgis_raster | public | st_grayscale | rastbandargset rastbandarg[], extenttype text | raster + postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster postgis_raster | public | st_hasnoband | rast raster, nband integer | boolean postgis_raster | public | st_height | raster | integer postgis_raster | public | st_hillshade | rast raster, nband integer, customextent raster, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster @@ -4159,76 +4116,76 @@ order by postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record postgis_raster | public | st_interpolateraster | geom geometry, options text, rast raster, bandnumber integer | raster - postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval - postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval - postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval - postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision | raster postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision | raster - postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster - postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster postgis_raster | public | st_intersects | rast raster, geom geometry, nband integer | boolean - postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean - postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_intersects | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean + postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean postgis_raster | public | st_invdistweight4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | st_iscoveragetile | rast raster, coverage raster, tilewidth integer, tileheight integer | boolean postgis_raster | public | st_isempty | rast raster | boolean postgis_raster | public | st_makeemptycoverage | tilewidth integer, tileheight integer, width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | SETOF raster - postgis_raster | public | st_makeemptyraster | rast raster | raster - postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster - postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster + postgis_raster | public | st_makeemptyraster | rast raster | raster + postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster postgis_raster | public | st_mapalgebra | rast raster, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebra | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster postgis_raster | public | st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster - postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster postgis_raster | public | st_mapalgebraexpr | rast raster, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebraexpr | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure | raster - postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster - postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster postgis_raster | public | st_mapalgebrafct | rast1 raster, rast2 raster, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster postgis_raster | public | st_mapalgebrafctngb | rast raster, band integer, pixeltype text, ngbwidth integer, ngbheight integer, onerastngbuserfunc regprocedure, nodatamode text, VARIADIC args text[] | raster - postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_max4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision - postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_mean4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_memsize | raster | integer postgis_raster | public | st_metadata | rast raster, OUT upperleftx double precision, OUT upperlefty double precision, OUT width integer, OUT height integer, OUT scalex double precision, OUT scaley double precision, OUT skewx double precision, OUT skewy double precision, OUT srid integer, OUT numbands integer | record - postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_min4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_minconvexhull | rast raster, nband integer | geometry postgis_raster | public | st_mindist4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision postgis_raster | public | st_minpossiblevalue | pixeltype text | double precision + postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, band integer, pt geometry, exclude_nodata_value boolean | double precision - postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision postgis_raster | public | st_nearestvalue | rast raster, pt geometry, exclude_nodata_value boolean | double precision - postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] - postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_neighborhood | rast raster, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_neighborhood | rast raster, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] postgis_raster | public | st_notsamealignmentreason | rast1 raster, rast2 raster | text postgis_raster | public | st_numbands | raster | integer - postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_overlaps | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_pixelascentroid | rast raster, x integer, y integer | geometry postgis_raster | public | st_pixelascentroids | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) postgis_raster | public | st_pixelaspoint | rast raster, x integer, y integer | geometry @@ -4237,20 +4194,20 @@ order by postgis_raster | public | st_pixelaspolygons | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) postgis_raster | public | st_pixelheight | raster | double precision postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) - postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelofvalue | rast raster, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelofvalue | rast raster, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) postgis_raster | public | st_pixelwidth | raster | double precision postgis_raster | public | st_polygon | rast raster, band integer | geometry postgis_raster | public | st_quantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, nband integer, quantile double precision | double precision - postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record postgis_raster | public | st_quantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record - postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_range4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer | double precision postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer, yr integer | double precision @@ -4259,17 +4216,17 @@ order by postgis_raster | public | st_rastfromhexwkb | text | raster postgis_raster | public | st_rastfromwkb | bytea | raster postgis_raster | public | st_reclass | rast raster, nband integer, reclassexpr text, pixeltype text, nodataval double precision | raster - postgis_raster | public | st_reclass | rast raster, reclassexpr text, pixeltype text | raster postgis_raster | public | st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster - postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster + postgis_raster | public | st_reclass | rast raster, reclassexpr text, pixeltype text | raster postgis_raster | public | st_resample | rast raster, ref raster, usescale boolean, algorithm text, maxerr double precision | raster - postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_resample | rast raster, width integer, height integer, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster - postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster postgis_raster | public | st_rescale | rast raster, scalexy double precision, algorithm text, maxerr double precision | raster - postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_resize | rast raster, width integer, height integer, algorithm text, maxerr double precision | raster postgis_raster | public | st_resize | rast raster, width text, height text, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_reskew | rast raster, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_reskew | rast raster, skewxy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_retile | tab regclass, col name, ext geometry, sfx double precision, sfy double precision, tw integer, th integer, algo text | SETOF raster @@ -4286,106 +4243,106 @@ order by postgis_raster | public | st_setbandnodatavalue | rast raster, band integer, nodatavalue double precision, forcechecking boolean | raster postgis_raster | public | st_setbandnodatavalue | rast raster, nodatavalue double precision | raster postgis_raster | public | st_setbandpath | rast raster, band integer, outdbpath text, outdbindex integer, force boolean | raster - postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster postgis_raster | public | st_setgeoreference | rast raster, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster postgis_raster | public | st_setgeotransform | rast raster, imag double precision, jmag double precision, theta_i double precision, theta_ij double precision, xoffset double precision, yoffset double precision | raster postgis_raster | public | st_setm | rast raster, geom geometry, resample text, band integer | geometry postgis_raster | public | st_setrotation | rast raster, rotation double precision | raster - postgis_raster | public | st_setscale | rast raster, scale double precision | raster postgis_raster | public | st_setscale | rast raster, scalex double precision, scaley double precision | raster - postgis_raster | public | st_setskew | rast raster, skew double precision | raster + postgis_raster | public | st_setscale | rast raster, scale double precision | raster postgis_raster | public | st_setskew | rast raster, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setskew | rast raster, skew double precision | raster postgis_raster | public | st_setsrid | rast raster, srid integer | raster postgis_raster | public | st_setupperleft | rast raster, upperleftx double precision, upperlefty double precision | raster - postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster - postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster postgis_raster | public | st_setvalue | rast raster, nband integer, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster postgis_raster | public | st_setvalue | rast raster, x integer, y integer, newvalue double precision | raster - postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster - postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster + postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster postgis_raster | public | st_setvalues | rast raster, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster postgis_raster | public | st_setz | rast raster, geom geometry, resample text, band integer | geometry postgis_raster | public | st_skewx | raster | double precision postgis_raster | public | st_skewy | raster | double precision postgis_raster | public | st_slope | rast raster, nband integer, customextent raster, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster postgis_raster | public | st_slope | rast raster, nband integer, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster - postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalexy double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_srid | raster | integer - postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_stddev4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision - postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_sum4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision postgis_raster | public | st_summary | rast raster | text - postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats postgis_raster | public | st_summarystats | rast raster, nband integer, exclude_nodata_value boolean | summarystats - postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats - postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats postgis_raster | public | st_summarystatsagg | raster, integer, boolean, double precision | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats postgis_raster | public | st_tile | rast raster, nband integer, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | st_tile | rast raster, nband integer[], width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster postgis_raster | public | st_tile | rast raster, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster - postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_touches | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_tpi | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster postgis_raster | public | st_tpi | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster - postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster postgis_raster | public | st_transform | rast raster, srid integer, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster - postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_transform | rast raster, srid integer, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster postgis_raster | public | st_tri | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster postgis_raster | public | st_tri | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster - postgis_raster | public | st_union | raster | raster postgis_raster | public | st_union | raster, integer | raster + postgis_raster | public | st_union | raster | raster + postgis_raster | public | st_union | raster, unionarg[] | raster postgis_raster | public | st_union | raster, integer, text | raster postgis_raster | public | st_union | raster, text | raster - postgis_raster | public | st_union | raster, unionarg[] | raster postgis_raster | public | st_upperleftx | raster | double precision postgis_raster | public | st_upperlefty | raster | double precision - postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision postgis_raster | public | st_value | rast raster, band integer, x integer, y integer, exclude_nodata_value boolean | double precision - postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision postgis_raster | public | st_value | rast raster, x integer, y integer, exclude_nodata_value boolean | double precision - postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision + postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rast raster, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record - postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer postgis_raster | public | st_valuepercent | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | double precision - postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | double precision postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record postgis_raster | public | st_width | raster | integer - postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_within | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean postgis_raster | public | st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record postgis_raster | public | st_worldtorastercoord | rast raster, pt geometry, OUT columnx integer, OUT rowy integer | record - postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision | integer postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision, yw double precision | integer - postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordy | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer postgis_raster | public | st_worldtorastercoordy | rast raster, yw double precision | integer - postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_raster | public | updaterastersrid | table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean postgis_sfcgal | public | postgis_sfcgal_full_version | | text postgis_sfcgal | public | postgis_sfcgal_noop | geometry | geometry postgis_sfcgal | public | postgis_sfcgal_scripts_installed | | text @@ -4424,38 +4381,38 @@ order by postgis_topology | topology | addedge | atopology character varying, aline geometry | integer postgis_topology | topology | addface | atopology character varying, apoly geometry, force_new boolean | integer postgis_topology | topology | addnode | atopology character varying, apoint geometry, allowedgesplitting boolean, setcontainingface boolean | integer - postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer postgis_topology | topology | addtopogeometrycolumn | toponame character varying, schema character varying, tbl character varying, col character varying, ltype character varying, child integer | integer + postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer postgis_topology | topology | addtosearchpath | a_schema_name character varying | text postgis_topology | topology | asgml | tg topology.topogeometry | text postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text | text - postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, vis regclass | text - postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, opts integer | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, vis regclass | text postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix_in text, precision_in integer, options_in integer, visitedtable regclass, idprefix text, gmlver integer | text - postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass, nsprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass | text postgis_topology | topology | astopojson | tg topology.topogeometry, edgemaptable regclass | text postgis_topology | topology | cleartopogeom | tg topology.topogeometry | topology.topogeometry postgis_topology | topology | copytopology | atopology character varying, newtopo character varying | integer - postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topology.topogeometry postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer, tg_objs topology.topoelementarray | topology.topogeometry + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topology.topogeometry postgis_topology | topology | createtopology | atopology character varying, srid integer, prec double precision, hasz boolean | integer - postgis_topology | topology | createtopology | character varying | integer postgis_topology | topology | createtopology | character varying, integer | integer postgis_topology | topology | createtopology | toponame character varying, srid integer, prec double precision | integer + postgis_topology | topology | createtopology | character varying | integer postgis_topology | topology | droptopogeometrycolumn | schema character varying, tbl character varying, col character varying | text postgis_topology | topology | droptopology | atopology character varying | text postgis_topology | topology | equals | tg1 topology.topogeometry, tg2 topology.topogeometry | boolean - postgis_topology | topology | findlayer | layer_table regclass, feature_column name | topology.layer - postgis_topology | topology | findlayer | schema_name name, table_name name, feature_column name | topology.layer postgis_topology | topology | findlayer | tg topology.topogeometry | topology.layer + postgis_topology | topology | findlayer | schema_name name, table_name name, feature_column name | topology.layer postgis_topology | topology | findlayer | topology_id integer, layer_id integer | topology.layer + postgis_topology | topology | findlayer | layer_table regclass, feature_column name | topology.layer postgis_topology | topology | findtopology | integer | topology.topology - postgis_topology | topology | findtopology | name, name, name | topology.topology - postgis_topology | topology | findtopology | regclass, name | topology.topology postgis_topology | topology | findtopology | text | topology.topology + postgis_topology | topology | findtopology | name, name, name | topology.topology postgis_topology | topology | findtopology | topology.topogeometry | topology.topology + postgis_topology | topology | findtopology | regclass, name | topology.topology postgis_topology | topology | geometry | topogeom topology.topogeometry | geometry postgis_topology | topology | geometrytype | tg topology.topogeometry | text postgis_topology | topology | getedgebypoint | atopology character varying, apoint geometry, tol1 double precision | integer @@ -4647,13 +4604,13 @@ order by rum | public | rum_timetz_compare_prefix | time with time zone, time with time zone, smallint, internal | integer rum | public | rum_timetz_extract_query | time with time zone, internal, smallint, internal, internal | internal rum | public | rum_timetz_extract_value | time with time zone, internal | internal - rum | public | rum_ts_distance | tsvector, rum_distance_query | real - rum | public | rum_ts_distance | tsvector, tsquery | real rum | public | rum_ts_distance | tsvector, tsquery, integer | real + rum | public | rum_ts_distance | tsvector, tsquery | real + rum | public | rum_ts_distance | tsvector, rum_distance_query | real rum | public | rum_ts_join_pos | internal, internal | bytea - rum | public | rum_ts_score | tsvector, rum_distance_query | real - rum | public | rum_ts_score | tsvector, tsquery | real rum | public | rum_ts_score | tsvector, tsquery, integer | real + rum | public | rum_ts_score | tsvector, tsquery | real + rum | public | rum_ts_score | tsvector, rum_distance_query | real rum | public | rum_tsquery_addon_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean rum | public | rum_tsquery_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean rum | public | rum_tsquery_distance | internal, smallint, tsvector, integer, internal, internal, internal, internal, internal | double precision @@ -4710,10 +4667,10 @@ order by supabase_vault | vault | _crypto_aead_det_noncegen | | bytea supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void - tablefunc | public | connectby | text, text, text, text, integer | SETOF record tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record - tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record tablefunc | public | connectby | text, text, text, text, text, integer, text | SETOF record + tablefunc | public | connectby | text, text, text, text, integer | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record tablefunc | public | crosstab | text | SETOF record tablefunc | public | crosstab | text, integer | SETOF record tablefunc | public | crosstab | text, text | SETOF record @@ -4723,8 +4680,8 @@ order by tablefunc | public | normal_rand | integer, double precision, double precision | SETOF double precision tcn | public | triggered_change_notification | | trigger tsm_system_rows | public | system_rows | internal | tsm_handler - unaccent | public | unaccent | regdictionary, text | text unaccent | public | unaccent | text | text + unaccent | public | unaccent | regdictionary, text | text unaccent | public | unaccent_init | internal | internal unaccent | public | unaccent_lexize | internal, internal, internal, internal | internal uuid-ossp | extensions | uuid_generate_v1 | | uuid @@ -4737,25 +4694,25 @@ order by uuid-ossp | extensions | uuid_ns_oid | | uuid uuid-ossp | extensions | uuid_ns_url | | uuid uuid-ossp | extensions | uuid_ns_x500 | | uuid - vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + vector | public | array_to_halfvec | real[], integer, boolean | halfvec vector | public | array_to_halfvec | integer[], integer, boolean | halfvec vector | public | array_to_halfvec | numeric[], integer, boolean | halfvec - vector | public | array_to_halfvec | real[], integer, boolean | halfvec - vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec vector | public | array_to_sparsevec | integer[], integer, boolean | sparsevec vector | public | array_to_sparsevec | numeric[], integer, boolean | sparsevec - vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec - vector | public | array_to_vector | double precision[], integer, boolean | vector + vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_vector | real[], integer, boolean | vector vector | public | array_to_vector | integer[], integer, boolean | vector vector | public | array_to_vector | numeric[], integer, boolean | vector - vector | public | array_to_vector | real[], integer, boolean | vector - vector | public | avg | halfvec | halfvec + vector | public | array_to_vector | double precision[], integer, boolean | vector vector | public | avg | vector | vector - vector | public | binary_quantize | halfvec | bit + vector | public | avg | halfvec | halfvec vector | public | binary_quantize | vector | bit + vector | public | binary_quantize | halfvec | bit + vector | public | cosine_distance | vector, vector | double precision vector | public | cosine_distance | halfvec, halfvec | double precision vector | public | cosine_distance | sparsevec, sparsevec | double precision - vector | public | cosine_distance | vector, vector | double precision vector | public | halfvec | halfvec, integer, boolean | halfvec vector | public | halfvec_accum | double precision[], halfvec | double precision[] vector | public | halfvec_add | halfvec, halfvec | halfvec @@ -4787,24 +4744,24 @@ order by vector | public | hnsw_halfvec_support | internal | internal vector | public | hnsw_sparsevec_support | internal | internal vector | public | hnswhandler | internal | index_am_handler + vector | public | inner_product | vector, vector | double precision vector | public | inner_product | halfvec, halfvec | double precision vector | public | inner_product | sparsevec, sparsevec | double precision - vector | public | inner_product | vector, vector | double precision vector | public | ivfflat_bit_support | internal | internal vector | public | ivfflat_halfvec_support | internal | internal vector | public | ivfflathandler | internal | index_am_handler vector | public | jaccard_distance | bit, bit | double precision + vector | public | l1_distance | vector, vector | double precision vector | public | l1_distance | halfvec, halfvec | double precision vector | public | l1_distance | sparsevec, sparsevec | double precision - vector | public | l1_distance | vector, vector | double precision + vector | public | l2_distance | vector, vector | double precision vector | public | l2_distance | halfvec, halfvec | double precision vector | public | l2_distance | sparsevec, sparsevec | double precision - vector | public | l2_distance | vector, vector | double precision vector | public | l2_norm | halfvec | double precision vector | public | l2_norm | sparsevec | double precision + vector | public | l2_normalize | vector | vector vector | public | l2_normalize | halfvec | halfvec vector | public | l2_normalize | sparsevec | sparsevec - vector | public | l2_normalize | vector | vector vector | public | sparsevec | sparsevec, integer, boolean | sparsevec vector | public | sparsevec_cmp | sparsevec, sparsevec | integer vector | public | sparsevec_eq | sparsevec, sparsevec | boolean @@ -4824,8 +4781,8 @@ order by vector | public | sparsevec_typmod_in | cstring[] | integer vector | public | subvector | halfvec, integer, integer | halfvec vector | public | subvector | vector, integer, integer | vector - vector | public | sum | halfvec | halfvec vector | public | sum | vector | vector + vector | public | sum | halfvec | halfvec vector | public | vector | vector, integer, boolean | vector vector | public | vector_accum | double precision[], vector | double precision[] vector | public | vector_add | vector, vector | vector @@ -4833,8 +4790,8 @@ order by vector | public | vector_cmp | vector, vector | integer vector | public | vector_combine | double precision[], double precision[] | double precision[] vector | public | vector_concat | vector, vector | vector - vector | public | vector_dims | halfvec | integer vector | public | vector_dims | vector | integer + vector | public | vector_dims | halfvec | integer vector | public | vector_eq | vector, vector | boolean vector | public | vector_ge | vector, vector | boolean vector | public | vector_gt | vector, vector | boolean @@ -4899,15 +4856,15 @@ order by xml2 | public | xpath_bool | text, text | boolean xml2 | public | xpath_list | text, text | text xml2 | public | xpath_list | text, text, text | text + xml2 | public | xpath_nodeset | text, text, text, text | text xml2 | public | xpath_nodeset | text, text | text xml2 | public | xpath_nodeset | text, text, text | text - xml2 | public | xpath_nodeset | text, text, text, text | text xml2 | public | xpath_number | text, text | real xml2 | public | xpath_string | text, text | text xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4749 rows) +(4708 rows) /* @@ -4967,26 +4924,6 @@ order by hypopg | public | hypopg_list_indexes | indexrelid hypopg | public | hypopg_list_indexes | schema_name hypopg | public | hypopg_list_indexes | table_name - orioledb | extensions | orioledb_index | datoid - orioledb | extensions | orioledb_index | description - orioledb | extensions | orioledb_index | index_relnode - orioledb | extensions | orioledb_index | index_reloid - orioledb | extensions | orioledb_index | index_type - orioledb | extensions | orioledb_index | name - orioledb | extensions | orioledb_index | table_relnode - orioledb | extensions | orioledb_index | table_reloid - orioledb | extensions | orioledb_index_descr | datoid - orioledb | extensions | orioledb_index_descr | refcnt - orioledb | extensions | orioledb_index_descr | relnode - orioledb | extensions | orioledb_index_descr | reloid - orioledb | extensions | orioledb_table | datoid - orioledb | extensions | orioledb_table | description - orioledb | extensions | orioledb_table | relnode - orioledb | extensions | orioledb_table | reloid - orioledb | extensions | orioledb_table_descr | datoid - orioledb | extensions | orioledb_table_descr | refcnt - orioledb | extensions | orioledb_table_descr | relnode - orioledb | extensions | orioledb_table_descr | reloid pg_buffercache | public | pg_buffercache | bufferid pg_buffercache | public | pg_buffercache | isdirty pg_buffercache | public | pg_buffercache | pinning_backends @@ -5348,5 +5285,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(407 rows) +(387 rows) diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out new file mode 100644 index 000000000..db2962678 --- /dev/null +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -0,0 +1,5289 @@ +/* + +The purpose of this test is to monitor the SQL interface exposed +by Postgres extensions so we have to manually review/approve any difference +that emerge as versions change. + +*/ +/* + +List all extensions that are not enabled +If a new entry shows up in this list, that means a new extension has been +added and you should `create extension ...` to enable it in ./nix/tests/prime + +*/ +select + name +from + pg_available_extensions +where + installed_version is null +order by + name asc; + name +------------------------ + pg_cron + postgis_tiger_geocoder + tsm_system_time +(3 rows) + +/* + +Monitor relocatability and config of each extension +- lesson learned from pg_cron + +*/ +select + extname as extension_name, + extrelocatable as is_relocatable +from + pg_extension +order by + extname asc; + extension_name | is_relocatable +------------------------------+---------------- + address_standardizer | t + address_standardizer_data_us | t + amcheck | t + autoinc | t + bloom | t + btree_gin | t + btree_gist | t + citext | t + cube | t + dblink | t + dict_int | t + dict_xsyn | t + earthdistance | t + file_fdw | t + fuzzystrmatch | t + hstore | t + http | f + hypopg | t + index_advisor | t + insert_username | t + intagg | t + intarray | t + isn | t + lo | t + ltree | t + moddatetime | t + pageinspect | t + pg_buffercache | t + pg_freespacemap | t + pg_graphql | f + pg_hashids | t + pg_jsonschema | f + pg_net | f + pg_prewarm | t + pg_repack | f + pg_stat_monitor | t + pg_stat_statements | t + pg_surgery | t + pg_tle | f + pg_trgm | t + pg_visibility | t + pg_walinspect | t + pgaudit | t + pgcrypto | t + pgmq | f + pgroonga | f + pgroonga_database | f + pgrouting | t + pgrowlocks | t + pgsodium | f + pgstattuple | t + pgtap | t + plpgsql | f + plpgsql_check | f + postgis | f + postgis_raster | f + postgis_sfcgal | t + postgis_topology | f + postgres_fdw | t + refint | t + rum | t + seg | t + sslinfo | t + supabase_vault | f + tablefunc | t + tcn | t + tsm_system_rows | t + unaccent | t + uuid-ossp | t + vector | t + wrappers | f + xml2 | f +(72 rows) + +/* + +Monitor extension public function interface + +*/ +select + e.extname as extension_name, + n.nspname as schema_name, + p.proname as function_name, + pg_catalog.pg_get_function_identity_arguments(p.oid) as argument_types, + pg_catalog.pg_get_function_result(p.oid) as return_type +from + pg_catalog.pg_proc p + join pg_catalog.pg_namespace n + on n.oid = p.pronamespace + join pg_catalog.pg_depend d + on d.objid = p.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid +where + d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') +order by + e.extname, + n.nspname, + p.proname, + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); + extension_name | schema_name | function_name | argument_types | return_type +----------------------+----------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record + address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr + address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr + amcheck | public | bt_index_check | index regclass | void + amcheck | public | bt_index_check | index regclass, heapallindexed boolean, checkunique boolean | void + amcheck | public | bt_index_check | index regclass, heapallindexed boolean | void + amcheck | public | bt_index_parent_check | index regclass | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean, checkunique boolean | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean | void + amcheck | public | bt_index_parent_check | index regclass, heapallindexed boolean, rootdescend boolean | void + amcheck | public | verify_heapam | relation regclass, on_error_stop boolean, check_toast boolean, skip text, startblock bigint, endblock bigint, OUT blkno bigint, OUT offnum integer, OUT attnum integer, OUT msg text | SETOF record + autoinc | public | autoinc | | trigger + bloom | public | blhandler | internal | index_am_handler + btree_gin | public | gin_btree_consistent | internal, smallint, anyelement, integer, internal, internal | boolean + btree_gin | public | gin_compare_prefix_anyenum | anyenum, anyenum, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bit | bit, bit, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bool | boolean, boolean, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bpchar | character, character, smallint, internal | integer + btree_gin | public | gin_compare_prefix_bytea | bytea, bytea, smallint, internal | integer + btree_gin | public | gin_compare_prefix_char | "char", "char", smallint, internal | integer + btree_gin | public | gin_compare_prefix_cidr | cidr, cidr, smallint, internal | integer + btree_gin | public | gin_compare_prefix_date | date, date, smallint, internal | integer + btree_gin | public | gin_compare_prefix_float4 | real, real, smallint, internal | integer + btree_gin | public | gin_compare_prefix_float8 | double precision, double precision, smallint, internal | integer + btree_gin | public | gin_compare_prefix_inet | inet, inet, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int2 | smallint, smallint, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int4 | integer, integer, smallint, internal | integer + btree_gin | public | gin_compare_prefix_int8 | bigint, bigint, smallint, internal | integer + btree_gin | public | gin_compare_prefix_interval | interval, interval, smallint, internal | integer + btree_gin | public | gin_compare_prefix_macaddr | macaddr, macaddr, smallint, internal | integer + btree_gin | public | gin_compare_prefix_macaddr8 | macaddr8, macaddr8, smallint, internal | integer + btree_gin | public | gin_compare_prefix_money | money, money, smallint, internal | integer + btree_gin | public | gin_compare_prefix_name | name, name, smallint, internal | integer + btree_gin | public | gin_compare_prefix_numeric | numeric, numeric, smallint, internal | integer + btree_gin | public | gin_compare_prefix_oid | oid, oid, smallint, internal | integer + btree_gin | public | gin_compare_prefix_text | text, text, smallint, internal | integer + btree_gin | public | gin_compare_prefix_time | time without time zone, time without time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timestamp | timestamp without time zone, timestamp without time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timestamptz | timestamp with time zone, timestamp with time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_timetz | time with time zone, time with time zone, smallint, internal | integer + btree_gin | public | gin_compare_prefix_uuid | uuid, uuid, smallint, internal | integer + btree_gin | public | gin_compare_prefix_varbit | bit varying, bit varying, smallint, internal | integer + btree_gin | public | gin_enum_cmp | anyenum, anyenum | integer + btree_gin | public | gin_extract_query_anyenum | anyenum, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bit | bit, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bool | boolean, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bpchar | character, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_bytea | bytea, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_char | "char", internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_cidr | cidr, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_date | date, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_float4 | real, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_float8 | double precision, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_inet | inet, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int2 | smallint, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int4 | integer, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_int8 | bigint, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_interval | interval, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_macaddr | macaddr, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_macaddr8 | macaddr8, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_money | money, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_name | name, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_numeric | numeric, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_oid | oid, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_text | text, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_time | time without time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timestamp | timestamp without time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timestamptz | timestamp with time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_timetz | time with time zone, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_uuid | uuid, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_query_varbit | bit varying, internal, smallint, internal, internal | internal + btree_gin | public | gin_extract_value_anyenum | anyenum, internal | internal + btree_gin | public | gin_extract_value_bit | bit, internal | internal + btree_gin | public | gin_extract_value_bool | boolean, internal | internal + btree_gin | public | gin_extract_value_bpchar | character, internal | internal + btree_gin | public | gin_extract_value_bytea | bytea, internal | internal + btree_gin | public | gin_extract_value_char | "char", internal | internal + btree_gin | public | gin_extract_value_cidr | cidr, internal | internal + btree_gin | public | gin_extract_value_date | date, internal | internal + btree_gin | public | gin_extract_value_float4 | real, internal | internal + btree_gin | public | gin_extract_value_float8 | double precision, internal | internal + btree_gin | public | gin_extract_value_inet | inet, internal | internal + btree_gin | public | gin_extract_value_int2 | smallint, internal | internal + btree_gin | public | gin_extract_value_int4 | integer, internal | internal + btree_gin | public | gin_extract_value_int8 | bigint, internal | internal + btree_gin | public | gin_extract_value_interval | interval, internal | internal + btree_gin | public | gin_extract_value_macaddr | macaddr, internal | internal + btree_gin | public | gin_extract_value_macaddr8 | macaddr8, internal | internal + btree_gin | public | gin_extract_value_money | money, internal | internal + btree_gin | public | gin_extract_value_name | name, internal | internal + btree_gin | public | gin_extract_value_numeric | numeric, internal | internal + btree_gin | public | gin_extract_value_oid | oid, internal | internal + btree_gin | public | gin_extract_value_text | text, internal | internal + btree_gin | public | gin_extract_value_time | time without time zone, internal | internal + btree_gin | public | gin_extract_value_timestamp | timestamp without time zone, internal | internal + btree_gin | public | gin_extract_value_timestamptz | timestamp with time zone, internal | internal + btree_gin | public | gin_extract_value_timetz | time with time zone, internal | internal + btree_gin | public | gin_extract_value_uuid | uuid, internal | internal + btree_gin | public | gin_extract_value_varbit | bit varying, internal | internal + btree_gin | public | gin_numeric_cmp | numeric, numeric | integer + btree_gist | public | cash_dist | money, money | money + btree_gist | public | date_dist | date, date | integer + btree_gist | public | float4_dist | real, real | real + btree_gist | public | float8_dist | double precision, double precision | double precision + btree_gist | public | gbt_bit_compress | internal | internal + btree_gist | public | gbt_bit_consistent | internal, bit, smallint, oid, internal | boolean + btree_gist | public | gbt_bit_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bit_picksplit | internal, internal | internal + btree_gist | public | gbt_bit_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_bit_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_bool_compress | internal | internal + btree_gist | public | gbt_bool_consistent | internal, boolean, smallint, oid, internal | boolean + btree_gist | public | gbt_bool_fetch | internal | internal + btree_gist | public | gbt_bool_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bool_picksplit | internal, internal | internal + btree_gist | public | gbt_bool_same | gbtreekey2, gbtreekey2, internal | internal + btree_gist | public | gbt_bool_union | internal, internal | gbtreekey2 + btree_gist | public | gbt_bpchar_compress | internal | internal + btree_gist | public | gbt_bpchar_consistent | internal, character, smallint, oid, internal | boolean + btree_gist | public | gbt_bytea_compress | internal | internal + btree_gist | public | gbt_bytea_consistent | internal, bytea, smallint, oid, internal | boolean + btree_gist | public | gbt_bytea_penalty | internal, internal, internal | internal + btree_gist | public | gbt_bytea_picksplit | internal, internal | internal + btree_gist | public | gbt_bytea_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_bytea_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_cash_compress | internal | internal + btree_gist | public | gbt_cash_consistent | internal, money, smallint, oid, internal | boolean + btree_gist | public | gbt_cash_distance | internal, money, smallint, oid, internal | double precision + btree_gist | public | gbt_cash_fetch | internal | internal + btree_gist | public | gbt_cash_penalty | internal, internal, internal | internal + btree_gist | public | gbt_cash_picksplit | internal, internal | internal + btree_gist | public | gbt_cash_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_cash_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_date_compress | internal | internal + btree_gist | public | gbt_date_consistent | internal, date, smallint, oid, internal | boolean + btree_gist | public | gbt_date_distance | internal, date, smallint, oid, internal | double precision + btree_gist | public | gbt_date_fetch | internal | internal + btree_gist | public | gbt_date_penalty | internal, internal, internal | internal + btree_gist | public | gbt_date_picksplit | internal, internal | internal + btree_gist | public | gbt_date_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_date_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_decompress | internal | internal + btree_gist | public | gbt_enum_compress | internal | internal + btree_gist | public | gbt_enum_consistent | internal, anyenum, smallint, oid, internal | boolean + btree_gist | public | gbt_enum_fetch | internal | internal + btree_gist | public | gbt_enum_penalty | internal, internal, internal | internal + btree_gist | public | gbt_enum_picksplit | internal, internal | internal + btree_gist | public | gbt_enum_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_enum_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_float4_compress | internal | internal + btree_gist | public | gbt_float4_consistent | internal, real, smallint, oid, internal | boolean + btree_gist | public | gbt_float4_distance | internal, real, smallint, oid, internal | double precision + btree_gist | public | gbt_float4_fetch | internal | internal + btree_gist | public | gbt_float4_penalty | internal, internal, internal | internal + btree_gist | public | gbt_float4_picksplit | internal, internal | internal + btree_gist | public | gbt_float4_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_float4_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_float8_compress | internal | internal + btree_gist | public | gbt_float8_consistent | internal, double precision, smallint, oid, internal | boolean + btree_gist | public | gbt_float8_distance | internal, double precision, smallint, oid, internal | double precision + btree_gist | public | gbt_float8_fetch | internal | internal + btree_gist | public | gbt_float8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_float8_picksplit | internal, internal | internal + btree_gist | public | gbt_float8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_float8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_inet_compress | internal | internal + btree_gist | public | gbt_inet_consistent | internal, inet, smallint, oid, internal | boolean + btree_gist | public | gbt_inet_penalty | internal, internal, internal | internal + btree_gist | public | gbt_inet_picksplit | internal, internal | internal + btree_gist | public | gbt_inet_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_inet_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_int2_compress | internal | internal + btree_gist | public | gbt_int2_consistent | internal, smallint, smallint, oid, internal | boolean + btree_gist | public | gbt_int2_distance | internal, smallint, smallint, oid, internal | double precision + btree_gist | public | gbt_int2_fetch | internal | internal + btree_gist | public | gbt_int2_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int2_picksplit | internal, internal | internal + btree_gist | public | gbt_int2_same | gbtreekey4, gbtreekey4, internal | internal + btree_gist | public | gbt_int2_union | internal, internal | gbtreekey4 + btree_gist | public | gbt_int4_compress | internal | internal + btree_gist | public | gbt_int4_consistent | internal, integer, smallint, oid, internal | boolean + btree_gist | public | gbt_int4_distance | internal, integer, smallint, oid, internal | double precision + btree_gist | public | gbt_int4_fetch | internal | internal + btree_gist | public | gbt_int4_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int4_picksplit | internal, internal | internal + btree_gist | public | gbt_int4_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_int4_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_int8_compress | internal | internal + btree_gist | public | gbt_int8_consistent | internal, bigint, smallint, oid, internal | boolean + btree_gist | public | gbt_int8_distance | internal, bigint, smallint, oid, internal | double precision + btree_gist | public | gbt_int8_fetch | internal | internal + btree_gist | public | gbt_int8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_int8_picksplit | internal, internal | internal + btree_gist | public | gbt_int8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_int8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_intv_compress | internal | internal + btree_gist | public | gbt_intv_consistent | internal, interval, smallint, oid, internal | boolean + btree_gist | public | gbt_intv_decompress | internal | internal + btree_gist | public | gbt_intv_distance | internal, interval, smallint, oid, internal | double precision + btree_gist | public | gbt_intv_fetch | internal | internal + btree_gist | public | gbt_intv_penalty | internal, internal, internal | internal + btree_gist | public | gbt_intv_picksplit | internal, internal | internal + btree_gist | public | gbt_intv_same | gbtreekey32, gbtreekey32, internal | internal + btree_gist | public | gbt_intv_union | internal, internal | gbtreekey32 + btree_gist | public | gbt_macad8_compress | internal | internal + btree_gist | public | gbt_macad8_consistent | internal, macaddr8, smallint, oid, internal | boolean + btree_gist | public | gbt_macad8_fetch | internal | internal + btree_gist | public | gbt_macad8_penalty | internal, internal, internal | internal + btree_gist | public | gbt_macad8_picksplit | internal, internal | internal + btree_gist | public | gbt_macad8_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_macad8_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_macad_compress | internal | internal + btree_gist | public | gbt_macad_consistent | internal, macaddr, smallint, oid, internal | boolean + btree_gist | public | gbt_macad_fetch | internal | internal + btree_gist | public | gbt_macad_penalty | internal, internal, internal | internal + btree_gist | public | gbt_macad_picksplit | internal, internal | internal + btree_gist | public | gbt_macad_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_macad_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_numeric_compress | internal | internal + btree_gist | public | gbt_numeric_consistent | internal, numeric, smallint, oid, internal | boolean + btree_gist | public | gbt_numeric_penalty | internal, internal, internal | internal + btree_gist | public | gbt_numeric_picksplit | internal, internal | internal + btree_gist | public | gbt_numeric_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_numeric_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_oid_compress | internal | internal + btree_gist | public | gbt_oid_consistent | internal, oid, smallint, oid, internal | boolean + btree_gist | public | gbt_oid_distance | internal, oid, smallint, oid, internal | double precision + btree_gist | public | gbt_oid_fetch | internal | internal + btree_gist | public | gbt_oid_penalty | internal, internal, internal | internal + btree_gist | public | gbt_oid_picksplit | internal, internal | internal + btree_gist | public | gbt_oid_same | gbtreekey8, gbtreekey8, internal | internal + btree_gist | public | gbt_oid_union | internal, internal | gbtreekey8 + btree_gist | public | gbt_text_compress | internal | internal + btree_gist | public | gbt_text_consistent | internal, text, smallint, oid, internal | boolean + btree_gist | public | gbt_text_penalty | internal, internal, internal | internal + btree_gist | public | gbt_text_picksplit | internal, internal | internal + btree_gist | public | gbt_text_same | gbtreekey_var, gbtreekey_var, internal | internal + btree_gist | public | gbt_text_union | internal, internal | gbtreekey_var + btree_gist | public | gbt_time_compress | internal | internal + btree_gist | public | gbt_time_consistent | internal, time without time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_time_distance | internal, time without time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_time_fetch | internal | internal + btree_gist | public | gbt_time_penalty | internal, internal, internal | internal + btree_gist | public | gbt_time_picksplit | internal, internal | internal + btree_gist | public | gbt_time_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_time_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_timetz_compress | internal | internal + btree_gist | public | gbt_timetz_consistent | internal, time with time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_ts_compress | internal | internal + btree_gist | public | gbt_ts_consistent | internal, timestamp without time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_ts_distance | internal, timestamp without time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_ts_fetch | internal | internal + btree_gist | public | gbt_ts_penalty | internal, internal, internal | internal + btree_gist | public | gbt_ts_picksplit | internal, internal | internal + btree_gist | public | gbt_ts_same | gbtreekey16, gbtreekey16, internal | internal + btree_gist | public | gbt_ts_union | internal, internal | gbtreekey16 + btree_gist | public | gbt_tstz_compress | internal | internal + btree_gist | public | gbt_tstz_consistent | internal, timestamp with time zone, smallint, oid, internal | boolean + btree_gist | public | gbt_tstz_distance | internal, timestamp with time zone, smallint, oid, internal | double precision + btree_gist | public | gbt_uuid_compress | internal | internal + btree_gist | public | gbt_uuid_consistent | internal, uuid, smallint, oid, internal | boolean + btree_gist | public | gbt_uuid_fetch | internal | internal + btree_gist | public | gbt_uuid_penalty | internal, internal, internal | internal + btree_gist | public | gbt_uuid_picksplit | internal, internal | internal + btree_gist | public | gbt_uuid_same | gbtreekey32, gbtreekey32, internal | internal + btree_gist | public | gbt_uuid_union | internal, internal | gbtreekey32 + btree_gist | public | gbt_var_decompress | internal | internal + btree_gist | public | gbt_var_fetch | internal | internal + btree_gist | public | gbtreekey16_in | cstring | gbtreekey16 + btree_gist | public | gbtreekey16_out | gbtreekey16 | cstring + btree_gist | public | gbtreekey2_in | cstring | gbtreekey2 + btree_gist | public | gbtreekey2_out | gbtreekey2 | cstring + btree_gist | public | gbtreekey32_in | cstring | gbtreekey32 + btree_gist | public | gbtreekey32_out | gbtreekey32 | cstring + btree_gist | public | gbtreekey4_in | cstring | gbtreekey4 + btree_gist | public | gbtreekey4_out | gbtreekey4 | cstring + btree_gist | public | gbtreekey8_in | cstring | gbtreekey8 + btree_gist | public | gbtreekey8_out | gbtreekey8 | cstring + btree_gist | public | gbtreekey_var_in | cstring | gbtreekey_var + btree_gist | public | gbtreekey_var_out | gbtreekey_var | cstring + btree_gist | public | int2_dist | smallint, smallint | smallint + btree_gist | public | int4_dist | integer, integer | integer + btree_gist | public | int8_dist | bigint, bigint | bigint + btree_gist | public | interval_dist | interval, interval | interval + btree_gist | public | oid_dist | oid, oid | oid + btree_gist | public | time_dist | time without time zone, time without time zone | interval + btree_gist | public | ts_dist | timestamp without time zone, timestamp without time zone | interval + btree_gist | public | tstz_dist | timestamp with time zone, timestamp with time zone | interval + citext | public | citext | boolean | citext + citext | public | citext | inet | citext + citext | public | citext | character | citext + citext | public | citext_cmp | citext, citext | integer + citext | public | citext_eq | citext, citext | boolean + citext | public | citext_ge | citext, citext | boolean + citext | public | citext_gt | citext, citext | boolean + citext | public | citext_hash | citext | integer + citext | public | citext_hash_extended | citext, bigint | bigint + citext | public | citext_larger | citext, citext | citext + citext | public | citext_le | citext, citext | boolean + citext | public | citext_lt | citext, citext | boolean + citext | public | citext_ne | citext, citext | boolean + citext | public | citext_pattern_cmp | citext, citext | integer + citext | public | citext_pattern_ge | citext, citext | boolean + citext | public | citext_pattern_gt | citext, citext | boolean + citext | public | citext_pattern_le | citext, citext | boolean + citext | public | citext_pattern_lt | citext, citext | boolean + citext | public | citext_smaller | citext, citext | citext + citext | public | citextin | cstring | citext + citext | public | citextout | citext | cstring + citext | public | citextrecv | internal | citext + citext | public | citextsend | citext | bytea + citext | public | max | citext | citext + citext | public | min | citext | citext + citext | public | regexp_match | citext, citext | text[] + citext | public | regexp_match | citext, citext, text | text[] + citext | public | regexp_matches | citext, citext | SETOF text[] + citext | public | regexp_matches | citext, citext, text | SETOF text[] + citext | public | regexp_replace | citext, citext, text, text | text + citext | public | regexp_replace | citext, citext, text | text + citext | public | regexp_split_to_array | citext, citext | text[] + citext | public | regexp_split_to_array | citext, citext, text | text[] + citext | public | regexp_split_to_table | citext, citext | SETOF text + citext | public | regexp_split_to_table | citext, citext, text | SETOF text + citext | public | replace | citext, citext, citext | text + citext | public | split_part | citext, citext, integer | text + citext | public | strpos | citext, citext | integer + citext | public | texticlike | citext, citext | boolean + citext | public | texticlike | citext, text | boolean + citext | public | texticnlike | citext, citext | boolean + citext | public | texticnlike | citext, text | boolean + citext | public | texticregexeq | citext, citext | boolean + citext | public | texticregexeq | citext, text | boolean + citext | public | texticregexne | citext, citext | boolean + citext | public | texticregexne | citext, text | boolean + citext | public | translate | citext, citext, text | text + cube | public | cube | cube, double precision, double precision | cube + cube | public | cube | double precision | cube + cube | public | cube | double precision[], double precision[] | cube + cube | public | cube | cube, double precision | cube + cube | public | cube | double precision, double precision | cube + cube | public | cube | double precision[] | cube + cube | public | cube_cmp | cube, cube | integer + cube | public | cube_contained | cube, cube | boolean + cube | public | cube_contains | cube, cube | boolean + cube | public | cube_coord | cube, integer | double precision + cube | public | cube_coord_llur | cube, integer | double precision + cube | public | cube_dim | cube | integer + cube | public | cube_distance | cube, cube | double precision + cube | public | cube_enlarge | cube, double precision, integer | cube + cube | public | cube_eq | cube, cube | boolean + cube | public | cube_ge | cube, cube | boolean + cube | public | cube_gt | cube, cube | boolean + cube | public | cube_in | cstring | cube + cube | public | cube_inter | cube, cube | cube + cube | public | cube_is_point | cube | boolean + cube | public | cube_le | cube, cube | boolean + cube | public | cube_ll_coord | cube, integer | double precision + cube | public | cube_lt | cube, cube | boolean + cube | public | cube_ne | cube, cube | boolean + cube | public | cube_out | cube | cstring + cube | public | cube_overlap | cube, cube | boolean + cube | public | cube_recv | internal | cube + cube | public | cube_send | cube | bytea + cube | public | cube_size | cube | double precision + cube | public | cube_subset | cube, integer[] | cube + cube | public | cube_union | cube, cube | cube + cube | public | cube_ur_coord | cube, integer | double precision + cube | public | distance_chebyshev | cube, cube | double precision + cube | public | distance_taxicab | cube, cube | double precision + cube | public | g_cube_consistent | internal, cube, smallint, oid, internal | boolean + cube | public | g_cube_distance | internal, cube, smallint, oid, internal | double precision + cube | public | g_cube_penalty | internal, internal, internal | internal + cube | public | g_cube_picksplit | internal, internal | internal + cube | public | g_cube_same | cube, cube, internal | internal + cube | public | g_cube_union | internal, internal | cube + dblink | public | dblink | text, boolean | SETOF record + dblink | public | dblink | text | SETOF record + dblink | public | dblink | text, text | SETOF record + dblink | public | dblink | text, text, boolean | SETOF record + dblink | public | dblink_build_sql_delete | text, int2vector, integer, text[] | text + dblink | public | dblink_build_sql_insert | text, int2vector, integer, text[], text[] | text + dblink | public | dblink_build_sql_update | text, int2vector, integer, text[], text[] | text + dblink | public | dblink_cancel_query | text | text + dblink | public | dblink_close | text, boolean | text + dblink | public | dblink_close | text | text + dblink | public | dblink_close | text, text | text + dblink | public | dblink_close | text, text, boolean | text + dblink | public | dblink_connect | text | text + dblink | public | dblink_connect | text, text | text + dblink | public | dblink_connect_u | text | text + dblink | public | dblink_connect_u | text, text | text + dblink | public | dblink_current_query | | text + dblink | public | dblink_disconnect | text | text + dblink | public | dblink_disconnect | | text + dblink | public | dblink_error_message | text | text + dblink | public | dblink_exec | text, boolean | text + dblink | public | dblink_exec | text | text + dblink | public | dblink_exec | text, text | text + dblink | public | dblink_exec | text, text, boolean | text + dblink | public | dblink_fdw_validator | options text[], catalog oid | void + dblink | public | dblink_fetch | text, text, integer, boolean | SETOF record + dblink | public | dblink_fetch | text, integer | SETOF record + dblink | public | dblink_fetch | text, text, integer | SETOF record + dblink | public | dblink_fetch | text, integer, boolean | SETOF record + dblink | public | dblink_get_connections | | text[] + dblink | public | dblink_get_notify | OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record + dblink | public | dblink_get_notify | conname text, OUT notify_name text, OUT be_pid integer, OUT extra text | SETOF record + dblink | public | dblink_get_pkey | text | SETOF dblink_pkey_results + dblink | public | dblink_get_result | text, boolean | SETOF record + dblink | public | dblink_get_result | text | SETOF record + dblink | public | dblink_is_busy | text | integer + dblink | public | dblink_open | text, text, text, boolean | text + dblink | public | dblink_open | text, text | text + dblink | public | dblink_open | text, text, boolean | text + dblink | public | dblink_open | text, text, text | text + dblink | public | dblink_send_query | text, text | integer + dict_int | public | dintdict_init | internal | internal + dict_int | public | dintdict_lexize | internal, internal, internal, internal | internal + dict_xsyn | public | dxsyn_init | internal | internal + dict_xsyn | public | dxsyn_lexize | internal, internal, internal, internal | internal + earthdistance | public | earth | | double precision + earthdistance | public | earth_box | earth, double precision | cube + earthdistance | public | earth_distance | earth, earth | double precision + earthdistance | public | gc_to_sec | double precision | double precision + earthdistance | public | geo_distance | point, point | double precision + earthdistance | public | latitude | earth | double precision + earthdistance | public | ll_to_earth | double precision, double precision | earth + earthdistance | public | longitude | earth | double precision + earthdistance | public | sec_to_gc | double precision | double precision + file_fdw | public | file_fdw_handler | | fdw_handler + file_fdw | public | file_fdw_validator | text[], oid | void + fuzzystrmatch | public | difference | text, text | integer + fuzzystrmatch | public | dmetaphone | text | text + fuzzystrmatch | public | dmetaphone_alt | text | text + fuzzystrmatch | public | levenshtein | text, text | integer + fuzzystrmatch | public | levenshtein | text, text, integer, integer, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer, integer, integer, integer | integer + fuzzystrmatch | public | levenshtein_less_equal | text, text, integer | integer + fuzzystrmatch | public | metaphone | text, integer | text + fuzzystrmatch | public | soundex | text | text + fuzzystrmatch | public | text_soundex | text | text + hstore | public | akeys | hstore | text[] + hstore | public | avals | hstore | text[] + hstore | public | defined | hstore, text | boolean + hstore | public | delete | hstore, text | hstore + hstore | public | delete | hstore, text[] | hstore + hstore | public | delete | hstore, hstore | hstore + hstore | public | each | hs hstore, OUT key text, OUT value text | SETOF record + hstore | public | exist | hstore, text | boolean + hstore | public | exists_all | hstore, text[] | boolean + hstore | public | exists_any | hstore, text[] | boolean + hstore | public | fetchval | hstore, text | text + hstore | public | ghstore_compress | internal | internal + hstore | public | ghstore_consistent | internal, hstore, smallint, oid, internal | boolean + hstore | public | ghstore_decompress | internal | internal + hstore | public | ghstore_in | cstring | ghstore + hstore | public | ghstore_options | internal | void + hstore | public | ghstore_out | ghstore | cstring + hstore | public | ghstore_penalty | internal, internal, internal | internal + hstore | public | ghstore_picksplit | internal, internal | internal + hstore | public | ghstore_same | ghstore, ghstore, internal | internal + hstore | public | ghstore_union | internal, internal | ghstore + hstore | public | gin_consistent_hstore | internal, smallint, hstore, integer, internal, internal | boolean + hstore | public | gin_extract_hstore | hstore, internal | internal + hstore | public | gin_extract_hstore_query | hstore, internal, smallint, internal, internal | internal + hstore | public | hs_concat | hstore, hstore | hstore + hstore | public | hs_contained | hstore, hstore | boolean + hstore | public | hs_contains | hstore, hstore | boolean + hstore | public | hstore | text[], text[] | hstore + hstore | public | hstore | text, text | hstore + hstore | public | hstore | text[] | hstore + hstore | public | hstore | record | hstore + hstore | public | hstore_cmp | hstore, hstore | integer + hstore | public | hstore_eq | hstore, hstore | boolean + hstore | public | hstore_ge | hstore, hstore | boolean + hstore | public | hstore_gt | hstore, hstore | boolean + hstore | public | hstore_hash | hstore | integer + hstore | public | hstore_hash_extended | hstore, bigint | bigint + hstore | public | hstore_in | cstring | hstore + hstore | public | hstore_le | hstore, hstore | boolean + hstore | public | hstore_lt | hstore, hstore | boolean + hstore | public | hstore_ne | hstore, hstore | boolean + hstore | public | hstore_out | hstore | cstring + hstore | public | hstore_recv | internal | hstore + hstore | public | hstore_send | hstore | bytea + hstore | public | hstore_subscript_handler | internal | internal + hstore | public | hstore_to_array | hstore | text[] + hstore | public | hstore_to_json | hstore | json + hstore | public | hstore_to_json_loose | hstore | json + hstore | public | hstore_to_jsonb | hstore | jsonb + hstore | public | hstore_to_jsonb_loose | hstore | jsonb + hstore | public | hstore_to_matrix | hstore | text[] + hstore | public | hstore_version_diag | hstore | integer + hstore | public | isdefined | hstore, text | boolean + hstore | public | isexists | hstore, text | boolean + hstore | public | populate_record | anyelement, hstore | anyelement + hstore | public | skeys | hstore | SETOF text + hstore | public | slice | hstore, text[] | hstore + hstore | public | slice_array | hstore, text[] | text[] + hstore | public | svals | hstore | SETOF text + hstore | public | tconvert | text, text | hstore + http | public | bytea_to_text | data bytea | text + http | public | http | request http_request | http_response + http | public | http_delete | uri character varying, content character varying, content_type character varying | http_response + http | public | http_delete | uri character varying | http_response + http | public | http_get | uri character varying, data jsonb | http_response + http | public | http_get | uri character varying | http_response + http | public | http_head | uri character varying | http_response + http | public | http_header | field character varying, value character varying | http_header + http | public | http_list_curlopt | | TABLE(curlopt text, value text) + http | public | http_patch | uri character varying, content character varying, content_type character varying | http_response + http | public | http_post | uri character varying, data jsonb | http_response + http | public | http_post | uri character varying, content character varying, content_type character varying | http_response + http | public | http_put | uri character varying, content character varying, content_type character varying | http_response + http | public | http_reset_curlopt | | boolean + http | public | http_set_curlopt | curlopt character varying, value character varying | boolean + http | public | text_to_bytea | data text | bytea + http | public | urlencode | data jsonb | text + http | public | urlencode | string character varying | text + http | public | urlencode | string bytea | text + hypopg | public | hypopg | OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid | SETOF record + hypopg | public | hypopg_create_index | sql_order text, OUT indexrelid oid, OUT indexname text | SETOF record + hypopg | public | hypopg_drop_index | indexid oid | boolean + hypopg | public | hypopg_get_indexdef | indexid oid | text + hypopg | public | hypopg_hidden_indexes | | TABLE(indexid oid) + hypopg | public | hypopg_hide_index | indexid oid | boolean + hypopg | public | hypopg_relation_size | indexid oid | bigint + hypopg | public | hypopg_reset | | void + hypopg | public | hypopg_reset_index | | void + hypopg | public | hypopg_unhide_all_indexes | | void + hypopg | public | hypopg_unhide_index | indexid oid | boolean + index_advisor | public | index_advisor | query text | TABLE(startup_cost_before jsonb, startup_cost_after jsonb, total_cost_before jsonb, total_cost_after jsonb, index_statements text[], errors text[]) + insert_username | public | insert_username | | trigger + intagg | public | int_agg_final_array | internal | integer[] + intagg | public | int_agg_state | internal, integer | internal + intagg | public | int_array_aggregate | integer | integer[] + intagg | public | int_array_enum | integer[] | SETOF integer + intarray | public | _int_contained | integer[], integer[] | boolean + intarray | public | _int_contained_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_contained_sel | internal, oid, internal, integer | double precision + intarray | public | _int_contains | integer[], integer[] | boolean + intarray | public | _int_contains_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_contains_sel | internal, oid, internal, integer | double precision + intarray | public | _int_different | integer[], integer[] | boolean + intarray | public | _int_inter | integer[], integer[] | integer[] + intarray | public | _int_matchsel | internal, oid, internal, integer | double precision + intarray | public | _int_overlap | integer[], integer[] | boolean + intarray | public | _int_overlap_joinsel | internal, oid, internal, smallint, internal | double precision + intarray | public | _int_overlap_sel | internal, oid, internal, integer | double precision + intarray | public | _int_same | integer[], integer[] | boolean + intarray | public | _int_union | integer[], integer[] | integer[] + intarray | public | _intbig_in | cstring | intbig_gkey + intarray | public | _intbig_out | intbig_gkey | cstring + intarray | public | boolop | integer[], query_int | boolean + intarray | public | bqarr_in | cstring | query_int + intarray | public | bqarr_out | query_int | cstring + intarray | public | g_int_compress | internal | internal + intarray | public | g_int_consistent | internal, integer[], smallint, oid, internal | boolean + intarray | public | g_int_decompress | internal | internal + intarray | public | g_int_options | internal | void + intarray | public | g_int_penalty | internal, internal, internal | internal + intarray | public | g_int_picksplit | internal, internal | internal + intarray | public | g_int_same | integer[], integer[], internal | internal + intarray | public | g_int_union | internal, internal | integer[] + intarray | public | g_intbig_compress | internal | internal + intarray | public | g_intbig_consistent | internal, integer[], smallint, oid, internal | boolean + intarray | public | g_intbig_decompress | internal | internal + intarray | public | g_intbig_options | internal | void + intarray | public | g_intbig_penalty | internal, internal, internal | internal + intarray | public | g_intbig_picksplit | internal, internal | internal + intarray | public | g_intbig_same | intbig_gkey, intbig_gkey, internal | internal + intarray | public | g_intbig_union | internal, internal | intbig_gkey + intarray | public | ginint4_consistent | internal, smallint, integer[], integer, internal, internal, internal, internal | boolean + intarray | public | ginint4_queryextract | integer[], internal, smallint, internal, internal, internal, internal | internal + intarray | public | icount | integer[] | integer + intarray | public | idx | integer[], integer | integer + intarray | public | intarray_del_elem | integer[], integer | integer[] + intarray | public | intarray_push_array | integer[], integer[] | integer[] + intarray | public | intarray_push_elem | integer[], integer | integer[] + intarray | public | intset | integer | integer[] + intarray | public | intset_subtract | integer[], integer[] | integer[] + intarray | public | intset_union_elem | integer[], integer | integer[] + intarray | public | querytree | query_int | text + intarray | public | rboolop | query_int, integer[] | boolean + intarray | public | sort | integer[] | integer[] + intarray | public | sort | integer[], text | integer[] + intarray | public | sort_asc | integer[] | integer[] + intarray | public | sort_desc | integer[] | integer[] + intarray | public | subarray | integer[], integer | integer[] + intarray | public | subarray | integer[], integer, integer | integer[] + intarray | public | uniq | integer[] | integer[] + isn | public | btean13cmp | ean13, ean13 | integer + isn | public | btean13cmp | ean13, issn | integer + isn | public | btean13cmp | ean13, upc | integer + isn | public | btean13cmp | ean13, issn13 | integer + isn | public | btean13cmp | ean13, ismn | integer + isn | public | btean13cmp | ean13, ismn13 | integer + isn | public | btean13cmp | ean13, isbn13 | integer + isn | public | btean13cmp | ean13, isbn | integer + isn | public | btisbn13cmp | isbn13, isbn13 | integer + isn | public | btisbn13cmp | isbn13, ean13 | integer + isn | public | btisbn13cmp | isbn13, isbn | integer + isn | public | btisbncmp | isbn, ean13 | integer + isn | public | btisbncmp | isbn, isbn | integer + isn | public | btisbncmp | isbn, isbn13 | integer + isn | public | btismn13cmp | ismn13, ismn13 | integer + isn | public | btismn13cmp | ismn13, ean13 | integer + isn | public | btismn13cmp | ismn13, ismn | integer + isn | public | btismncmp | ismn, ismn | integer + isn | public | btismncmp | ismn, ean13 | integer + isn | public | btismncmp | ismn, ismn13 | integer + isn | public | btissn13cmp | issn13, issn13 | integer + isn | public | btissn13cmp | issn13, ean13 | integer + isn | public | btissn13cmp | issn13, issn | integer + isn | public | btissncmp | issn, ean13 | integer + isn | public | btissncmp | issn, issn13 | integer + isn | public | btissncmp | issn, issn | integer + isn | public | btupccmp | upc, upc | integer + isn | public | btupccmp | upc, ean13 | integer + isn | public | ean13_in | cstring | ean13 + isn | public | ean13_out | isbn13 | cstring + isn | public | ean13_out | ismn13 | cstring + isn | public | ean13_out | ean13 | cstring + isn | public | ean13_out | issn13 | cstring + isn | public | hashean13 | ean13 | integer + isn | public | hashisbn | isbn | integer + isn | public | hashisbn13 | isbn13 | integer + isn | public | hashismn | ismn | integer + isn | public | hashismn13 | ismn13 | integer + isn | public | hashissn | issn | integer + isn | public | hashissn13 | issn13 | integer + isn | public | hashupc | upc | integer + isn | public | is_valid | isbn13 | boolean + isn | public | is_valid | upc | boolean + isn | public | is_valid | ismn | boolean + isn | public | is_valid | issn | boolean + isn | public | is_valid | isbn | boolean + isn | public | is_valid | ismn13 | boolean + isn | public | is_valid | ean13 | boolean + isn | public | is_valid | issn13 | boolean + isn | public | isbn | ean13 | isbn + isn | public | isbn13 | ean13 | isbn13 + isn | public | isbn13_in | cstring | isbn13 + isn | public | isbn_in | cstring | isbn + isn | public | ismn | ean13 | ismn + isn | public | ismn13 | ean13 | ismn13 + isn | public | ismn13_in | cstring | ismn13 + isn | public | ismn_in | cstring | ismn + isn | public | isn_out | upc | cstring + isn | public | isn_out | ismn | cstring + isn | public | isn_out | issn | cstring + isn | public | isn_out | isbn | cstring + isn | public | isn_weak | boolean | boolean + isn | public | isn_weak | | boolean + isn | public | isneq | ismn, ismn | boolean + isn | public | isneq | ean13, ean13 | boolean + isn | public | isneq | isbn, ean13 | boolean + isn | public | isneq | issn, ean13 | boolean + isn | public | isneq | isbn13, isbn13 | boolean + isn | public | isneq | ean13, issn | boolean + isn | public | isneq | isbn, isbn | boolean + isn | public | isneq | ean13, upc | boolean + isn | public | isneq | ean13, issn13 | boolean + isn | public | isneq | ean13, ismn | boolean + isn | public | isneq | upc, upc | boolean + isn | public | isneq | issn13, issn13 | boolean + isn | public | isneq | upc, ean13 | boolean + isn | public | isneq | ismn13, ismn13 | boolean + isn | public | isneq | issn13, ean13 | boolean + isn | public | isneq | ean13, ismn13 | boolean + isn | public | isneq | ismn13, ean13 | boolean + isn | public | isneq | issn13, issn | boolean + isn | public | isneq | ismn, ean13 | boolean + isn | public | isneq | ismn13, ismn | boolean + isn | public | isneq | ean13, isbn13 | boolean + isn | public | isneq | isbn13, ean13 | boolean + isn | public | isneq | isbn13, isbn | boolean + isn | public | isneq | isbn, isbn13 | boolean + isn | public | isneq | ismn, ismn13 | boolean + isn | public | isneq | ean13, isbn | boolean + isn | public | isneq | issn, issn13 | boolean + isn | public | isneq | issn, issn | boolean + isn | public | isnge | ismn, ismn | boolean + isn | public | isnge | ean13, ean13 | boolean + isn | public | isnge | isbn, ean13 | boolean + isn | public | isnge | issn, ean13 | boolean + isn | public | isnge | isbn13, isbn13 | boolean + isn | public | isnge | ean13, issn | boolean + isn | public | isnge | isbn, isbn | boolean + isn | public | isnge | ean13, upc | boolean + isn | public | isnge | ean13, issn13 | boolean + isn | public | isnge | ean13, ismn | boolean + isn | public | isnge | upc, upc | boolean + isn | public | isnge | issn13, issn13 | boolean + isn | public | isnge | upc, ean13 | boolean + isn | public | isnge | ismn13, ismn13 | boolean + isn | public | isnge | issn13, ean13 | boolean + isn | public | isnge | ean13, ismn13 | boolean + isn | public | isnge | ismn13, ean13 | boolean + isn | public | isnge | issn13, issn | boolean + isn | public | isnge | ismn, ean13 | boolean + isn | public | isnge | ismn13, ismn | boolean + isn | public | isnge | ean13, isbn13 | boolean + isn | public | isnge | isbn13, ean13 | boolean + isn | public | isnge | isbn13, isbn | boolean + isn | public | isnge | isbn, isbn13 | boolean + isn | public | isnge | ismn, ismn13 | boolean + isn | public | isnge | ean13, isbn | boolean + isn | public | isnge | issn, issn13 | boolean + isn | public | isnge | issn, issn | boolean + isn | public | isngt | ismn, ismn | boolean + isn | public | isngt | ean13, ean13 | boolean + isn | public | isngt | isbn, ean13 | boolean + isn | public | isngt | issn, ean13 | boolean + isn | public | isngt | isbn13, isbn13 | boolean + isn | public | isngt | ean13, issn | boolean + isn | public | isngt | isbn, isbn | boolean + isn | public | isngt | ean13, upc | boolean + isn | public | isngt | ean13, issn13 | boolean + isn | public | isngt | ean13, ismn | boolean + isn | public | isngt | upc, upc | boolean + isn | public | isngt | issn13, issn13 | boolean + isn | public | isngt | upc, ean13 | boolean + isn | public | isngt | ismn13, ismn13 | boolean + isn | public | isngt | issn13, ean13 | boolean + isn | public | isngt | ean13, ismn13 | boolean + isn | public | isngt | ismn13, ean13 | boolean + isn | public | isngt | issn13, issn | boolean + isn | public | isngt | ismn, ean13 | boolean + isn | public | isngt | ismn13, ismn | boolean + isn | public | isngt | ean13, isbn13 | boolean + isn | public | isngt | isbn13, ean13 | boolean + isn | public | isngt | isbn13, isbn | boolean + isn | public | isngt | isbn, isbn13 | boolean + isn | public | isngt | ismn, ismn13 | boolean + isn | public | isngt | ean13, isbn | boolean + isn | public | isngt | issn, issn13 | boolean + isn | public | isngt | issn, issn | boolean + isn | public | isnle | ismn, ismn | boolean + isn | public | isnle | ean13, ean13 | boolean + isn | public | isnle | isbn, ean13 | boolean + isn | public | isnle | issn, ean13 | boolean + isn | public | isnle | isbn13, isbn13 | boolean + isn | public | isnle | ean13, issn | boolean + isn | public | isnle | isbn, isbn | boolean + isn | public | isnle | ean13, upc | boolean + isn | public | isnle | ean13, issn13 | boolean + isn | public | isnle | ean13, ismn | boolean + isn | public | isnle | upc, upc | boolean + isn | public | isnle | issn13, issn13 | boolean + isn | public | isnle | upc, ean13 | boolean + isn | public | isnle | ismn13, ismn13 | boolean + isn | public | isnle | issn13, ean13 | boolean + isn | public | isnle | ean13, ismn13 | boolean + isn | public | isnle | ismn13, ean13 | boolean + isn | public | isnle | issn13, issn | boolean + isn | public | isnle | ismn, ean13 | boolean + isn | public | isnle | ismn13, ismn | boolean + isn | public | isnle | ean13, isbn13 | boolean + isn | public | isnle | isbn13, ean13 | boolean + isn | public | isnle | isbn13, isbn | boolean + isn | public | isnle | isbn, isbn13 | boolean + isn | public | isnle | ismn, ismn13 | boolean + isn | public | isnle | ean13, isbn | boolean + isn | public | isnle | issn, issn13 | boolean + isn | public | isnle | issn, issn | boolean + isn | public | isnlt | ismn, ismn | boolean + isn | public | isnlt | ean13, ean13 | boolean + isn | public | isnlt | isbn, ean13 | boolean + isn | public | isnlt | issn, ean13 | boolean + isn | public | isnlt | isbn13, isbn13 | boolean + isn | public | isnlt | ean13, issn | boolean + isn | public | isnlt | isbn, isbn | boolean + isn | public | isnlt | ean13, upc | boolean + isn | public | isnlt | ean13, issn13 | boolean + isn | public | isnlt | ean13, ismn | boolean + isn | public | isnlt | upc, upc | boolean + isn | public | isnlt | issn13, issn13 | boolean + isn | public | isnlt | upc, ean13 | boolean + isn | public | isnlt | ismn13, ismn13 | boolean + isn | public | isnlt | issn13, ean13 | boolean + isn | public | isnlt | ean13, ismn13 | boolean + isn | public | isnlt | ismn13, ean13 | boolean + isn | public | isnlt | issn13, issn | boolean + isn | public | isnlt | ismn, ean13 | boolean + isn | public | isnlt | ismn13, ismn | boolean + isn | public | isnlt | ean13, isbn13 | boolean + isn | public | isnlt | isbn13, ean13 | boolean + isn | public | isnlt | isbn13, isbn | boolean + isn | public | isnlt | isbn, isbn13 | boolean + isn | public | isnlt | ismn, ismn13 | boolean + isn | public | isnlt | ean13, isbn | boolean + isn | public | isnlt | issn, issn13 | boolean + isn | public | isnlt | issn, issn | boolean + isn | public | isnne | ismn, ismn | boolean + isn | public | isnne | ean13, ean13 | boolean + isn | public | isnne | isbn, ean13 | boolean + isn | public | isnne | issn, ean13 | boolean + isn | public | isnne | isbn13, isbn13 | boolean + isn | public | isnne | ean13, issn | boolean + isn | public | isnne | isbn, isbn | boolean + isn | public | isnne | ean13, upc | boolean + isn | public | isnne | ean13, issn13 | boolean + isn | public | isnne | ean13, ismn | boolean + isn | public | isnne | upc, upc | boolean + isn | public | isnne | issn13, issn13 | boolean + isn | public | isnne | upc, ean13 | boolean + isn | public | isnne | ismn13, ismn13 | boolean + isn | public | isnne | issn13, ean13 | boolean + isn | public | isnne | ean13, ismn13 | boolean + isn | public | isnne | ismn13, ean13 | boolean + isn | public | isnne | issn13, issn | boolean + isn | public | isnne | ismn, ean13 | boolean + isn | public | isnne | ismn13, ismn | boolean + isn | public | isnne | ean13, isbn13 | boolean + isn | public | isnne | isbn13, ean13 | boolean + isn | public | isnne | isbn13, isbn | boolean + isn | public | isnne | isbn, isbn13 | boolean + isn | public | isnne | ismn, ismn13 | boolean + isn | public | isnne | ean13, isbn | boolean + isn | public | isnne | issn, issn13 | boolean + isn | public | isnne | issn, issn | boolean + isn | public | issn | ean13 | issn + isn | public | issn13 | ean13 | issn13 + isn | public | issn13_in | cstring | issn13 + isn | public | issn_in | cstring | issn + isn | public | make_valid | isbn13 | isbn13 + isn | public | make_valid | upc | upc + isn | public | make_valid | ismn | ismn + isn | public | make_valid | issn | issn + isn | public | make_valid | isbn | isbn + isn | public | make_valid | ismn13 | ismn13 + isn | public | make_valid | ean13 | ean13 + isn | public | make_valid | issn13 | issn13 + isn | public | upc | ean13 | upc + isn | public | upc_in | cstring | upc + lo | public | lo_manage | | trigger + lo | public | lo_oid | lo | oid + ltree | public | _lt_q_regex | ltree[], lquery[] | boolean + ltree | public | _lt_q_rregex | lquery[], ltree[] | boolean + ltree | public | _ltq_extract_regex | ltree[], lquery | ltree + ltree | public | _ltq_regex | ltree[], lquery | boolean + ltree | public | _ltq_rregex | lquery, ltree[] | boolean + ltree | public | _ltree_compress | internal | internal + ltree | public | _ltree_consistent | internal, ltree[], smallint, oid, internal | boolean + ltree | public | _ltree_extract_isparent | ltree[], ltree | ltree + ltree | public | _ltree_extract_risparent | ltree[], ltree | ltree + ltree | public | _ltree_gist_options | internal | void + ltree | public | _ltree_isparent | ltree[], ltree | boolean + ltree | public | _ltree_penalty | internal, internal, internal | internal + ltree | public | _ltree_picksplit | internal, internal | internal + ltree | public | _ltree_r_isparent | ltree, ltree[] | boolean + ltree | public | _ltree_r_risparent | ltree, ltree[] | boolean + ltree | public | _ltree_risparent | ltree[], ltree | boolean + ltree | public | _ltree_same | ltree_gist, ltree_gist, internal | internal + ltree | public | _ltree_union | internal, internal | ltree_gist + ltree | public | _ltxtq_exec | ltree[], ltxtquery | boolean + ltree | public | _ltxtq_extract_exec | ltree[], ltxtquery | ltree + ltree | public | _ltxtq_rexec | ltxtquery, ltree[] | boolean + ltree | public | hash_ltree | ltree | integer + ltree | public | hash_ltree_extended | ltree, bigint | bigint + ltree | public | index | ltree, ltree | integer + ltree | public | index | ltree, ltree, integer | integer + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree[] | ltree + ltree | public | lca | ltree, ltree, ltree, ltree, ltree, ltree, ltree | ltree + ltree | public | lca | ltree, ltree, ltree, ltree | ltree + ltree | public | lquery_in | cstring | lquery + ltree | public | lquery_out | lquery | cstring + ltree | public | lquery_recv | internal | lquery + ltree | public | lquery_send | lquery | bytea + ltree | public | lt_q_regex | ltree, lquery[] | boolean + ltree | public | lt_q_rregex | lquery[], ltree | boolean + ltree | public | ltq_regex | ltree, lquery | boolean + ltree | public | ltq_rregex | lquery, ltree | boolean + ltree | public | ltree2text | ltree | text + ltree | public | ltree_addltree | ltree, ltree | ltree + ltree | public | ltree_addtext | ltree, text | ltree + ltree | public | ltree_cmp | ltree, ltree | integer + ltree | public | ltree_compress | internal | internal + ltree | public | ltree_consistent | internal, ltree, smallint, oid, internal | boolean + ltree | public | ltree_decompress | internal | internal + ltree | public | ltree_eq | ltree, ltree | boolean + ltree | public | ltree_ge | ltree, ltree | boolean + ltree | public | ltree_gist_in | cstring | ltree_gist + ltree | public | ltree_gist_options | internal | void + ltree | public | ltree_gist_out | ltree_gist | cstring + ltree | public | ltree_gt | ltree, ltree | boolean + ltree | public | ltree_in | cstring | ltree + ltree | public | ltree_isparent | ltree, ltree | boolean + ltree | public | ltree_le | ltree, ltree | boolean + ltree | public | ltree_lt | ltree, ltree | boolean + ltree | public | ltree_ne | ltree, ltree | boolean + ltree | public | ltree_out | ltree | cstring + ltree | public | ltree_penalty | internal, internal, internal | internal + ltree | public | ltree_picksplit | internal, internal | internal + ltree | public | ltree_recv | internal | ltree + ltree | public | ltree_risparent | ltree, ltree | boolean + ltree | public | ltree_same | ltree_gist, ltree_gist, internal | internal + ltree | public | ltree_send | ltree | bytea + ltree | public | ltree_textadd | text, ltree | ltree + ltree | public | ltree_union | internal, internal | ltree_gist + ltree | public | ltreeparentsel | internal, oid, internal, integer | double precision + ltree | public | ltxtq_exec | ltree, ltxtquery | boolean + ltree | public | ltxtq_in | cstring | ltxtquery + ltree | public | ltxtq_out | ltxtquery | cstring + ltree | public | ltxtq_recv | internal | ltxtquery + ltree | public | ltxtq_rexec | ltxtquery, ltree | boolean + ltree | public | ltxtq_send | ltxtquery | bytea + ltree | public | nlevel | ltree | integer + ltree | public | subltree | ltree, integer, integer | ltree + ltree | public | subpath | ltree, integer | ltree + ltree | public | subpath | ltree, integer, integer | ltree + ltree | public | text2ltree | text | ltree + moddatetime | public | moddatetime | | trigger + pageinspect | public | brin_metapage_info | page bytea, OUT magic text, OUT version integer, OUT pagesperrange integer, OUT lastrevmappage bigint | record + pageinspect | public | brin_page_type | page bytea | text + pageinspect | public | brin_revmap_data | page bytea, OUT pages tid | SETOF tid + pageinspect | public | bt_metap | relname text, OUT magic integer, OUT version integer, OUT root bigint, OUT level bigint, OUT fastroot bigint, OUT fastlevel bigint, OUT last_cleanup_num_delpages bigint, OUT last_cleanup_num_tuples double precision, OUT allequalimage boolean | record + pageinspect | public | bt_page_items | page bytea, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text, OUT dead boolean, OUT htid tid, OUT tids tid[] | SETOF record + pageinspect | public | bt_page_items | relname text, blkno bigint, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT nulls boolean, OUT vars boolean, OUT data text, OUT dead boolean, OUT htid tid, OUT tids tid[] | SETOF record + pageinspect | public | bt_page_stats | relname text, blkno bigint, OUT blkno bigint, OUT type "char", OUT live_items integer, OUT dead_items integer, OUT avg_item_size integer, OUT page_size integer, OUT free_size integer, OUT btpo_prev bigint, OUT btpo_next bigint, OUT btpo_level bigint, OUT btpo_flags integer | record + pageinspect | public | fsm_page_contents | page bytea | text + pageinspect | public | get_raw_page | text, bigint | bytea + pageinspect | public | get_raw_page | text, text, bigint | bytea + pageinspect | public | gin_leafpage_items | page bytea, OUT first_tid tid, OUT nbytes smallint, OUT tids tid[] | SETOF record + pageinspect | public | gin_metapage_info | page bytea, OUT pending_head bigint, OUT pending_tail bigint, OUT tail_free_size integer, OUT n_pending_pages bigint, OUT n_pending_tuples bigint, OUT n_total_pages bigint, OUT n_entry_pages bigint, OUT n_data_pages bigint, OUT n_entries bigint, OUT version integer | record + pageinspect | public | gin_page_opaque_info | page bytea, OUT rightlink bigint, OUT maxoff integer, OUT flags text[] | record + pageinspect | public | gist_page_items | page bytea, index_oid regclass, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT dead boolean, OUT keys text | SETOF record + pageinspect | public | gist_page_items_bytea | page bytea, OUT itemoffset smallint, OUT ctid tid, OUT itemlen smallint, OUT dead boolean, OUT key_data bytea | SETOF record + pageinspect | public | gist_page_opaque_info | page bytea, OUT lsn pg_lsn, OUT nsn pg_lsn, OUT rightlink bigint, OUT flags text[] | record + pageinspect | public | hash_bitmap_info | index_oid regclass, blkno bigint, OUT bitmapblkno bigint, OUT bitmapbit integer, OUT bitstatus boolean | SETOF record + pageinspect | public | hash_metapage_info | page bytea, OUT magic bigint, OUT version bigint, OUT ntuples double precision, OUT ffactor integer, OUT bsize integer, OUT bmsize integer, OUT bmshift integer, OUT maxbucket bigint, OUT highmask bigint, OUT lowmask bigint, OUT ovflpoint bigint, OUT firstfree bigint, OUT nmaps bigint, OUT procid oid, OUT spares bigint[], OUT mapp bigint[] | record + pageinspect | public | hash_page_items | page bytea, OUT itemoffset integer, OUT ctid tid, OUT data bigint | SETOF record + pageinspect | public | hash_page_stats | page bytea, OUT live_items integer, OUT dead_items integer, OUT page_size integer, OUT free_size integer, OUT hasho_prevblkno bigint, OUT hasho_nextblkno bigint, OUT hasho_bucket bigint, OUT hasho_flag integer, OUT hasho_page_id integer | record + pageinspect | public | hash_page_type | page bytea | text + pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record + pageinspect | public | heap_page_item_attrs | page bytea, rel_oid regclass, do_detoast boolean, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_attrs bytea[] | SETOF record + pageinspect | public | heap_page_items | page bytea, OUT lp smallint, OUT lp_off smallint, OUT lp_flags smallint, OUT lp_len smallint, OUT t_xmin xid, OUT t_xmax xid, OUT t_field3 integer, OUT t_ctid tid, OUT t_infomask2 integer, OUT t_infomask integer, OUT t_hoff smallint, OUT t_bits text, OUT t_oid oid, OUT t_data bytea | SETOF record + pageinspect | public | heap_tuple_infomask_flags | t_infomask integer, t_infomask2 integer, OUT raw_flags text[], OUT combined_flags text[] | record + pageinspect | public | page_checksum | page bytea, blkno bigint | smallint + pageinspect | public | page_header | page bytea, OUT lsn pg_lsn, OUT checksum smallint, OUT flags smallint, OUT lower integer, OUT upper integer, OUT special integer, OUT pagesize integer, OUT version smallint, OUT prune_xid xid | record + pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text | bytea[] + pageinspect | public | tuple_data_split | rel_oid oid, t_data bytea, t_infomask integer, t_infomask2 integer, t_bits text, do_detoast boolean | bytea[] + pg_buffercache | public | pg_buffercache_evict | integer | boolean + pg_buffercache | public | pg_buffercache_pages | | SETOF record + pg_freespacemap | public | pg_freespace | rel regclass, OUT blkno bigint, OUT avail smallint | SETOF record + pg_freespacemap | public | pg_freespace | regclass, bigint | smallint + pg_graphql | graphql | _internal_resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb + pg_graphql | graphql | comment_directive | comment_ text | jsonb + pg_graphql | graphql | exception | message text | text + pg_graphql | graphql | get_schema_version | | integer + pg_graphql | graphql | increment_schema_version | | event_trigger + pg_graphql | graphql | resolve | query text, variables jsonb, "operationName" text, extensions jsonb | jsonb + pg_graphql | graphql_public | graphql | "operationName" text, query text, variables jsonb, extensions jsonb | jsonb + pg_hashids | public | hash_decode | text, text, integer | integer + pg_hashids | public | hash_encode | bigint | text + pg_hashids | public | hash_encode | bigint, text | text + pg_hashids | public | hash_encode | bigint, text, integer | text + pg_hashids | public | id_decode | text | bigint[] + pg_hashids | public | id_decode | text, text | bigint[] + pg_hashids | public | id_decode | text, text, integer, text | bigint[] + pg_hashids | public | id_decode | text, text, integer | bigint[] + pg_hashids | public | id_decode_once | text | bigint + pg_hashids | public | id_decode_once | text, text | bigint + pg_hashids | public | id_decode_once | text, text, integer, text | bigint + pg_hashids | public | id_decode_once | text, text, integer | bigint + pg_hashids | public | id_encode | bigint | text + pg_hashids | public | id_encode | bigint[] | text + pg_hashids | public | id_encode | bigint[], text | text + pg_hashids | public | id_encode | bigint[], text, integer | text + pg_hashids | public | id_encode | bigint, text | text + pg_hashids | public | id_encode | bigint, text, integer | text + pg_hashids | public | id_encode | bigint, text, integer, text | text + pg_hashids | public | id_encode | bigint[], text, integer, text | text + pg_jsonschema | public | json_matches_schema | schema json, instance json | boolean + pg_jsonschema | public | jsonb_matches_schema | schema json, instance jsonb | boolean + pg_jsonschema | public | jsonschema_is_valid | schema json | boolean + pg_jsonschema | public | jsonschema_validation_errors | schema json, instance json | text[] + pg_net | net | _await_response | request_id bigint | boolean + pg_net | net | _encode_url_with_params_array | url text, params_array text[] | text + pg_net | net | _http_collect_response | request_id bigint, async boolean | net.http_response_result + pg_net | net | _urlencode_string | string character varying | text + pg_net | net | check_worker_is_up | | void + pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | worker_restart | | boolean + pg_prewarm | public | autoprewarm_dump_now | | bigint + pg_prewarm | public | autoprewarm_start_worker | | void + pg_prewarm | public | pg_prewarm | regclass, mode text, fork text, first_block bigint, last_block bigint | bigint + pg_repack | repack | conflicted_triggers | oid | SETOF name + pg_repack | repack | create_index_type | oid, oid | void + pg_repack | repack | create_log_table | oid | void + pg_repack | repack | create_table | oid, name | void + pg_repack | repack | disable_autovacuum | regclass | void + pg_repack | repack | get_alter_col_storage | oid | text + pg_repack | repack | get_assign | oid, text | text + pg_repack | repack | get_columns_for_create_as | oid | text + pg_repack | repack | get_compare_pkey | oid, text | text + pg_repack | repack | get_create_index_type | oid, name | text + pg_repack | repack | get_create_trigger | relid oid, pkid oid | text + pg_repack | repack | get_drop_columns | oid, text | text + pg_repack | repack | get_enable_trigger | relid oid | text + pg_repack | repack | get_index_columns | oid | text + pg_repack | repack | get_order_by | oid, oid | text + pg_repack | repack | get_storage_param | oid | text + pg_repack | repack | get_table_and_inheritors | regclass | regclass[] + pg_repack | repack | oid2text | oid | text + pg_repack | repack | repack_apply | sql_peek cstring, sql_insert cstring, sql_delete cstring, sql_update cstring, sql_pop cstring, count integer | integer + pg_repack | repack | repack_drop | oid, integer | void + pg_repack | repack | repack_index_swap | oid | void + pg_repack | repack | repack_indexdef | oid, oid, name, boolean | text + pg_repack | repack | repack_swap | oid | void + pg_repack | repack | repack_trigger | | trigger + pg_repack | repack | version | | text + pg_repack | repack | version_sql | | text + pg_stat_monitor | public | decode_error_level | elevel integer | text + pg_stat_monitor | public | get_cmd_type | cmd_type integer | text + pg_stat_monitor | public | get_histogram_timings | | text + pg_stat_monitor | public | histogram | _bucket integer, _quryid bigint | SETOF record + pg_stat_monitor | public | pg_stat_monitor_internal | showtext boolean, OUT bucket bigint, OUT userid oid, OUT username text, OUT dbid oid, OUT datname text, OUT client_ip bigint, OUT queryid bigint, OUT planid bigint, OUT query text, OUT query_plan text, OUT pgsm_query_id bigint, OUT top_queryid bigint, OUT top_query text, OUT application_name text, OUT relations text, OUT cmd_type integer, OUT elevel integer, OUT sqlcode text, OUT message text, OUT bucket_start_time timestamp with time zone, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT resp_calls text, OUT cpu_user_time double precision, OUT cpu_sys_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT comments text, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone, OUT toplevel boolean, OUT bucket_done boolean | SETOF record + pg_stat_monitor | public | pg_stat_monitor_reset | | void + pg_stat_monitor | public | pg_stat_monitor_version | | text + pg_stat_monitor | public | pgsm_create_11_view | | integer + pg_stat_monitor | public | pgsm_create_13_view | | integer + pg_stat_monitor | public | pgsm_create_14_view | | integer + pg_stat_monitor | public | pgsm_create_15_view | | integer + pg_stat_monitor | public | pgsm_create_17_view | | integer + pg_stat_monitor | public | pgsm_create_view | | integer + pg_stat_monitor | public | range | | text[] + pg_stat_statements | extensions | pg_stat_statements | showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone | SETOF record + pg_stat_statements | extensions | pg_stat_statements_info | OUT dealloc bigint, OUT stats_reset timestamp with time zone | record + pg_stat_statements | extensions | pg_stat_statements_reset | userid oid, dbid oid, queryid bigint, minmax_only boolean | timestamp with time zone + pg_surgery | public | heap_force_freeze | reloid regclass, tids tid[] | void + pg_surgery | public | heap_force_kill | reloid regclass, tids tid[] | void + pg_tle | pgtle | available_extension_versions | OUT name name, OUT version text, OUT superuser boolean, OUT trusted boolean, OUT relocatable boolean, OUT schema name, OUT requires name[], OUT comment text | SETOF record + pg_tle | pgtle | available_extensions | OUT name name, OUT default_version text, OUT comment text | SETOF record + pg_tle | pgtle | create_base_type | typenamespace regnamespace, typename name, infunc regprocedure, outfunc regprocedure, internallength integer, alignment text, storage text | void + pg_tle | pgtle | create_base_type_if_not_exists | typenamespace regnamespace, typename name, infunc regprocedure, outfunc regprocedure, internallength integer, alignment text, storage text | boolean + pg_tle | pgtle | create_operator_func | typenamespace regnamespace, typename name, opfunc regprocedure | void + pg_tle | pgtle | create_operator_func_if_not_exists | typenamespace regnamespace, typename name, opfunc regprocedure | boolean + pg_tle | pgtle | create_shell_type | typenamespace regnamespace, typename name | void + pg_tle | pgtle | create_shell_type_if_not_exists | typenamespace regnamespace, typename name | boolean + pg_tle | pgtle | extension_update_paths | name name, OUT source text, OUT target text, OUT path text | SETOF record + pg_tle | pgtle | install_extension | name text, version text, description text, ext text, requires text[] | boolean + pg_tle | pgtle | install_extension_version_sql | name text, version text, ext text | boolean + pg_tle | pgtle | install_update_path | name text, fromvers text, tovers text, ext text | boolean + pg_tle | pgtle | pg_tle_feature_info_sql_drop | | event_trigger + pg_tle | pgtle | register_feature | proc regproc, feature pgtle.pg_tle_features | void + pg_tle | pgtle | register_feature_if_not_exists | proc regproc, feature pgtle.pg_tle_features | boolean + pg_tle | pgtle | set_default_version | name text, version text | boolean + pg_tle | pgtle | uninstall_extension | extname text | boolean + pg_tle | pgtle | uninstall_extension | extname text, version text | boolean + pg_tle | pgtle | uninstall_extension_if_exists | extname text | boolean + pg_tle | pgtle | uninstall_update_path | extname text, fromvers text, tovers text | boolean + pg_tle | pgtle | uninstall_update_path_if_exists | extname text, fromvers text, tovers text | boolean + pg_tle | pgtle | unregister_feature | proc regproc, feature pgtle.pg_tle_features | void + pg_tle | pgtle | unregister_feature_if_exists | proc regproc, feature pgtle.pg_tle_features | boolean + pg_trgm | public | gin_extract_query_trgm | text, internal, smallint, internal, internal, internal, internal | internal + pg_trgm | public | gin_extract_value_trgm | text, internal | internal + pg_trgm | public | gin_trgm_consistent | internal, smallint, text, integer, internal, internal, internal, internal | boolean + pg_trgm | public | gin_trgm_triconsistent | internal, smallint, text, integer, internal, internal, internal | "char" + pg_trgm | public | gtrgm_compress | internal | internal + pg_trgm | public | gtrgm_consistent | internal, text, smallint, oid, internal | boolean + pg_trgm | public | gtrgm_decompress | internal | internal + pg_trgm | public | gtrgm_distance | internal, text, smallint, oid, internal | double precision + pg_trgm | public | gtrgm_in | cstring | gtrgm + pg_trgm | public | gtrgm_options | internal | void + pg_trgm | public | gtrgm_out | gtrgm | cstring + pg_trgm | public | gtrgm_penalty | internal, internal, internal | internal + pg_trgm | public | gtrgm_picksplit | internal, internal | internal + pg_trgm | public | gtrgm_same | gtrgm, gtrgm, internal | internal + pg_trgm | public | gtrgm_union | internal, internal | gtrgm + pg_trgm | public | set_limit | real | real + pg_trgm | public | show_limit | | real + pg_trgm | public | show_trgm | text | text[] + pg_trgm | public | similarity | text, text | real + pg_trgm | public | similarity_dist | text, text | real + pg_trgm | public | similarity_op | text, text | boolean + pg_trgm | public | strict_word_similarity | text, text | real + pg_trgm | public | strict_word_similarity_commutator_op | text, text | boolean + pg_trgm | public | strict_word_similarity_dist_commutator_op | text, text | real + pg_trgm | public | strict_word_similarity_dist_op | text, text | real + pg_trgm | public | strict_word_similarity_op | text, text | boolean + pg_trgm | public | word_similarity | text, text | real + pg_trgm | public | word_similarity_commutator_op | text, text | boolean + pg_trgm | public | word_similarity_dist_commutator_op | text, text | real + pg_trgm | public | word_similarity_dist_op | text, text | real + pg_trgm | public | word_similarity_op | text, text | boolean + pg_visibility | public | pg_check_frozen | regclass, OUT t_ctid tid | SETOF tid + pg_visibility | public | pg_check_visible | regclass, OUT t_ctid tid | SETOF tid + pg_visibility | public | pg_truncate_visibility_map | regclass | void + pg_visibility | public | pg_visibility | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | SETOF record + pg_visibility | public | pg_visibility | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean, OUT pd_all_visible boolean | record + pg_visibility | public | pg_visibility_map | regclass, blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | record + pg_visibility | public | pg_visibility_map | regclass, OUT blkno bigint, OUT all_visible boolean, OUT all_frozen boolean | SETOF record + pg_visibility | public | pg_visibility_map_summary | regclass, OUT all_visible bigint, OUT all_frozen bigint | record + pg_walinspect | public | pg_get_wal_record_info | in_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | record + pg_walinspect | public | pg_get_wal_records_info | start_lsn pg_lsn, end_lsn pg_lsn, OUT start_lsn pg_lsn, OUT end_lsn pg_lsn, OUT prev_lsn pg_lsn, OUT xid xid, OUT resource_manager text, OUT record_type text, OUT record_length integer, OUT main_data_length integer, OUT fpi_length integer, OUT description text, OUT block_ref text | SETOF record + pg_walinspect | public | pg_get_wal_stats | start_lsn pg_lsn, end_lsn pg_lsn, per_record boolean, OUT "resource_manager/record_type" text, OUT count bigint, OUT count_percentage double precision, OUT record_size bigint, OUT record_size_percentage double precision, OUT fpi_size bigint, OUT fpi_size_percentage double precision, OUT combined_size bigint, OUT combined_size_percentage double precision | SETOF record + pgaudit | public | pgaudit_ddl_command_end | | event_trigger + pgaudit | public | pgaudit_sql_drop | | event_trigger + pgcrypto | extensions | armor | bytea, text[], text[] | text + pgcrypto | extensions | armor | bytea | text + pgcrypto | extensions | crypt | text, text | text + pgcrypto | extensions | dearmor | text | bytea + pgcrypto | extensions | decrypt | bytea, bytea, text | bytea + pgcrypto | extensions | decrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | digest | text, text | bytea + pgcrypto | extensions | digest | bytea, text | bytea + pgcrypto | extensions | encrypt | bytea, bytea, text | bytea + pgcrypto | extensions | encrypt_iv | bytea, bytea, bytea, text | bytea + pgcrypto | extensions | gen_random_bytes | integer | bytea + pgcrypto | extensions | gen_random_uuid | | uuid + pgcrypto | extensions | gen_salt | text | text + pgcrypto | extensions | gen_salt | text, integer | text + pgcrypto | extensions | hmac | text, text, text | bytea + pgcrypto | extensions | hmac | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_armor_headers | text, OUT key text, OUT value text | SETOF record + pgcrypto | extensions | pgp_key_id | bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text, text | text + pgcrypto | extensions | pgp_pub_decrypt | bytea, bytea, text | text + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text, text | bytea + pgcrypto | extensions | pgp_pub_decrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea, text | bytea + pgcrypto | extensions | pgp_pub_encrypt | text, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea | bytea + pgcrypto | extensions | pgp_pub_encrypt_bytea | bytea, bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt | bytea, text | text + pgcrypto | extensions | pgp_sym_decrypt | bytea, text, text | text + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_decrypt_bytea | bytea, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea + pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea + pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean + pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _get_partition_col | partition_interval text | text + pgmq | pgmq | _get_pg_partman_major_version | | integer + pgmq | pgmq | _get_pg_partman_schema | | text + pgmq | pgmq | archive | queue_name text, msg_id bigint | boolean + pgmq | pgmq | archive | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | convert_archive_partitioned | table_name text, partition_interval text, retention_interval text, leading_partition integer | void + pgmq | pgmq | create | queue_name text | void + pgmq | pgmq | create_non_partitioned | queue_name text | void + pgmq | pgmq | create_partitioned | queue_name text, partition_interval text, retention_interval text | void + pgmq | pgmq | create_unlogged | queue_name text | void + pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean + pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint + pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text | boolean + pgmq | pgmq | format_table_name | queue_name text, prefix text | text + pgmq | pgmq | list_queues | | SETOF pgmq.queue_record + pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result + pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result + pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record + pgmq | pgmq | purge_queue | queue_name text | bigint + pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint + pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record + pgmq | pgmq | validate_queue_name | queue_name text | void + pgroonga | pgroonga | command | groongacommand text | text + pgroonga | pgroonga | command | groongacommand text, arguments text[] | text + pgroonga | pgroonga | command_escape_value | value text | text + pgroonga | pgroonga | contain_varchar_array | character varying[], character varying | boolean + pgroonga | pgroonga | escape | value bigint | text + pgroonga | pgroonga | escape | value double precision | text + pgroonga | pgroonga | escape | value text, special_characters text | text + pgroonga | pgroonga | escape | value timestamp without time zone | text + pgroonga | pgroonga | escape | value smallint | text + pgroonga | pgroonga | escape | value text | text + pgroonga | pgroonga | escape | value timestamp with time zone | text + pgroonga | pgroonga | escape | value real | text + pgroonga | pgroonga | escape | value boolean | text + pgroonga | pgroonga | escape | value integer | text + pgroonga | pgroonga | flush | indexname cstring | boolean + pgroonga | pgroonga | highlight_html | target text, keywords text[] | text + pgroonga | pgroonga | match_in_text | text, text[] | boolean + pgroonga | pgroonga | match_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | match_in_varchar | character varying, character varying[] | boolean + pgroonga | pgroonga | match_jsonb | jsonb, text | boolean + pgroonga | pgroonga | match_positions_byte | target text, keywords text[] | integer[] + pgroonga | pgroonga | match_positions_character | target text, keywords text[] | integer[] + pgroonga | pgroonga | match_query | text, text | boolean + pgroonga | pgroonga | match_query | character varying, character varying | boolean + pgroonga | pgroonga | match_query | text[], text | boolean + pgroonga | pgroonga | match_regexp | text, text | boolean + pgroonga | pgroonga | match_regexp | character varying, character varying | boolean + pgroonga | pgroonga | match_script_jsonb | jsonb, text | boolean + pgroonga | pgroonga | match_term | target text, term text | boolean + pgroonga | pgroonga | match_term | target text[], term text | boolean + pgroonga | pgroonga | match_term | target character varying[], term character varying | boolean + pgroonga | pgroonga | match_term | target character varying, term character varying | boolean + pgroonga | pgroonga | match_text | text, text | boolean + pgroonga | pgroonga | match_text_array | text[], text | boolean + pgroonga | pgroonga | match_varchar | character varying, character varying | boolean + pgroonga | pgroonga | prefix_in_text | text, text[] | boolean + pgroonga | pgroonga | prefix_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | prefix_rk_in_text | text, text[] | boolean + pgroonga | pgroonga | prefix_rk_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | prefix_rk_text | text, text | boolean + pgroonga | pgroonga | prefix_rk_text_array | text[], text | boolean + pgroonga | pgroonga | prefix_text | text, text | boolean + pgroonga | pgroonga | prefix_text_array | text[], text | boolean + pgroonga | pgroonga | query_escape | query text | text + pgroonga | pgroonga | query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text + pgroonga | pgroonga | query_extract_keywords | query text | text[] + pgroonga | pgroonga | query_in_text | text, text[] | boolean + pgroonga | pgroonga | query_in_text_array | text[], text[] | boolean + pgroonga | pgroonga | query_in_varchar | character varying, character varying[] | boolean + pgroonga | pgroonga | query_jsonb | jsonb, text | boolean + pgroonga | pgroonga | query_text | text, text | boolean + pgroonga | pgroonga | query_text_array | text[], text | boolean + pgroonga | pgroonga | query_varchar | character varying, character varying | boolean + pgroonga | pgroonga | regexp_text | text, text | boolean + pgroonga | pgroonga | regexp_varchar | character varying, character varying | boolean + pgroonga | pgroonga | score | "row" record | double precision + pgroonga | pgroonga | script_jsonb | jsonb, text | boolean + pgroonga | pgroonga | script_text | text, text | boolean + pgroonga | pgroonga | script_text_array | text[], text | boolean + pgroonga | pgroonga | script_varchar | character varying, character varying | boolean + pgroonga | pgroonga | similar_text | text, text | boolean + pgroonga | pgroonga | similar_text_array | text[], text | boolean + pgroonga | pgroonga | similar_varchar | character varying, character varying | boolean + pgroonga | pgroonga | snippet_html | target text, keywords text[], width integer | text[] + pgroonga | pgroonga | table_name | indexname cstring | text + pgroonga | public | pgroonga_command | groongacommand text | text + pgroonga | public | pgroonga_command | groongacommand text, arguments text[] | text + pgroonga | public | pgroonga_command_escape_value | value text | text + pgroonga | public | pgroonga_condition | query text, weights integer[], scorers text[], schema_name text, index_name text, column_name text, fuzzy_max_distance_ratio real | pgroonga_condition + pgroonga | public | pgroonga_contain_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_equal_query_text_array | targets text[], query text | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_query_varchar_array | targets character varying[], query text | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_query_varchar_array_condition | targets character varying[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_text | target text, other text | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_text_condition | target text, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_equal_varchar | target character varying, other character varying | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_equal_varchar_condition | target character varying, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_escape | value bigint | text + pgroonga | public | pgroonga_escape | value double precision | text + pgroonga | public | pgroonga_escape | value text, special_characters text | text + pgroonga | public | pgroonga_escape | value timestamp without time zone | text + pgroonga | public | pgroonga_escape | value smallint | text + pgroonga | public | pgroonga_escape | value text | text + pgroonga | public | pgroonga_escape | value timestamp with time zone | text + pgroonga | public | pgroonga_escape | value real | text + pgroonga | public | pgroonga_escape | value boolean | text + pgroonga | public | pgroonga_escape | value integer | text + pgroonga | public | pgroonga_flush | indexname cstring | boolean + pgroonga | public | pgroonga_handler | internal | index_am_handler + pgroonga | public | pgroonga_highlight_html | target text, keywords text[], indexname cstring | text + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[], indexname cstring | text[] + pgroonga | public | pgroonga_highlight_html | target text, keywords text[] | text + pgroonga | public | pgroonga_highlight_html | targets text[], keywords text[] | text[] + pgroonga | public | pgroonga_index_column_name | indexname cstring, columnindex integer | text + pgroonga | public | pgroonga_index_column_name | indexname cstring, columnname text | text + pgroonga | public | pgroonga_is_writable | | boolean + pgroonga | public | pgroonga_list_broken_indexes | | SETOF text + pgroonga | public | pgroonga_list_lagged_indexes | | SETOF text + pgroonga | public | pgroonga_match_in_text | text, text[] | boolean + pgroonga | public | pgroonga_match_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_match_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_match_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[], indexname cstring | integer[] + pgroonga | public | pgroonga_match_positions_byte | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[], indexname cstring | integer[] + pgroonga | public | pgroonga_match_positions_character | target text, keywords text[] | integer[] + pgroonga | public | pgroonga_match_query | text, text | boolean + pgroonga | public | pgroonga_match_query | character varying, character varying | boolean + pgroonga | public | pgroonga_match_query | text[], text | boolean + pgroonga | public | pgroonga_match_regexp | text, text | boolean + pgroonga | public | pgroonga_match_regexp | character varying, character varying | boolean + pgroonga | public | pgroonga_match_script_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_match_term | target text, term text | boolean + pgroonga | public | pgroonga_match_term | target text[], term text | boolean + pgroonga | public | pgroonga_match_term | target character varying[], term character varying | boolean + pgroonga | public | pgroonga_match_term | target character varying, term character varying | boolean + pgroonga | public | pgroonga_match_text | text, text | boolean + pgroonga | public | pgroonga_match_text_array | text[], text | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_array_condition | target text[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_match_text_array_condition_with_scorers | target text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_text_condition | target text, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_match_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_match_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_match_varchar_condition | target character varying, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_match_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_normalize | target text | text + pgroonga | public | pgroonga_normalize | target text, normalizername text | text + pgroonga | public | pgroonga_not_prefix_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_prefix_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_prefix_in_varchar_array | character varying[], character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_text | text, text[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_in_varchar_array | character varying[], character varying[] | boolean + pgroonga | public | pgroonga_prefix_rk_text | text, text | boolean + pgroonga | public | pgroonga_prefix_rk_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_rk_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_prefix_rk_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_text | text, text | boolean + pgroonga | public | pgroonga_prefix_text_array | text[], text | boolean + pgroonga | public | pgroonga_prefix_text_array_condition | text[], pgroonga_condition | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_text_condition | text, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_prefix_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_array | character varying[], character varying | boolean + pgroonga | public | pgroonga_prefix_varchar_array_condition | character varying[], pgroonga_condition | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_prefix_varchar_condition | target character varying, conditoin pgroonga_condition | boolean + pgroonga | public | pgroonga_query_escape | query text | text + pgroonga | public | pgroonga_query_expand | tablename cstring, termcolumnname text, synonymscolumnname text, query text | text + pgroonga | public | pgroonga_query_extract_keywords | query text, index_name text | text[] + pgroonga | public | pgroonga_query_in_text | text, text[] | boolean + pgroonga | public | pgroonga_query_in_text_array | text[], text[] | boolean + pgroonga | public | pgroonga_query_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_query_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_query_text | text, text | boolean + pgroonga | public | pgroonga_query_text_array | text[], text | boolean + pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_condition | boolean + pgroonga | public | pgroonga_query_text_array_condition | targets text[], condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_array_condition_with_scorers | targets text[], condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_text_condition | target text, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_query_text_condition_with_scorers | target text, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_query_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_full_text_search_condition | boolean + pgroonga | public | pgroonga_query_varchar_condition | target character varying, condition pgroonga_condition | boolean + pgroonga | public | pgroonga_query_varchar_condition_with_scorers | target character varying, condition pgroonga_full_text_search_condition_with_scorers | boolean + pgroonga | public | pgroonga_regexp_in_text | text, text[] | boolean + pgroonga | public | pgroonga_regexp_in_varchar | character varying, character varying[] | boolean + pgroonga | public | pgroonga_regexp_text | text, text | boolean + pgroonga | public | pgroonga_regexp_text_array | targets text[], pattern text | boolean + pgroonga | public | pgroonga_regexp_text_array_condition | targets text[], pattern pgroonga_condition | boolean + pgroonga | public | pgroonga_regexp_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_result_to_jsonb_objects | result jsonb | jsonb + pgroonga | public | pgroonga_result_to_recordset | result jsonb | SETOF record + pgroonga | public | pgroonga_score | "row" record | double precision + pgroonga | public | pgroonga_score | tableoid oid, ctid tid | double precision + pgroonga | public | pgroonga_script_jsonb | jsonb, text | boolean + pgroonga | public | pgroonga_script_text | text, text | boolean + pgroonga | public | pgroonga_script_text_array | text[], text | boolean + pgroonga | public | pgroonga_script_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_set_writable | newwritable boolean | boolean + pgroonga | public | pgroonga_similar_text | text, text | boolean + pgroonga | public | pgroonga_similar_text_array | text[], text | boolean + pgroonga | public | pgroonga_similar_varchar | character varying, character varying | boolean + pgroonga | public | pgroonga_snippet_html | target text, keywords text[], width integer | text[] + pgroonga | public | pgroonga_table_name | indexname cstring | text + pgroonga | public | pgroonga_tokenize | target text, VARIADIC options text[] | json[] + pgroonga | public | pgroonga_vacuum | | boolean + pgroonga | public | pgroonga_wal_apply | indexname cstring | bigint + pgroonga | public | pgroonga_wal_apply | | bigint + pgroonga | public | pgroonga_wal_set_applied_position | block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring, block bigint, "offset" bigint | boolean + pgroonga | public | pgroonga_wal_set_applied_position | indexname cstring | boolean + pgroonga | public | pgroonga_wal_set_applied_position | | boolean + pgroonga | public | pgroonga_wal_status | | TABLE(name text, oid oid, current_block bigint, current_offset bigint, current_size bigint, last_block bigint, last_offset bigint, last_size bigint) + pgroonga | public | pgroonga_wal_truncate | indexname cstring | bigint + pgroonga | public | pgroonga_wal_truncate | | bigint + pgroonga_database | public | pgroonga_database_remove | | boolean + pgrouting | public | _pgr_alphashape | text, alpha double precision, OUT seq1 bigint, OUT textgeom text | SETOF record + pgrouting | public | _pgr_array_reverse | anyarray | anyarray + pgrouting | public | _pgr_articulationpoints | edges_sql text, OUT seq integer, OUT node bigint | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_astar | edges_sql text, combinations_sql text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bddijkstra | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bddijkstra | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bellmanford | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_biconnectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record + pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_binarybreadthfirstsearch | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bipartite | edges_sql text, OUT node bigint, OUT color bigint | SETOF record + pgrouting | public | _pgr_boost_version | | text + pgrouting | public | _pgr_breadthfirstsearch | edges_sql text, from_vids anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_bridges | edges_sql text, OUT seq integer, OUT edge bigint | SETOF record + pgrouting | public | _pgr_build_type | | text + pgrouting | public | _pgr_checkcolumn | text, text, text, is_optional boolean, dryrun boolean | boolean + pgrouting | public | _pgr_checkquery | text | text + pgrouting | public | _pgr_checkverttab | vertname text, columnsarr text[], reporterrs integer, fnname text, OUT sname text, OUT vname text | record + pgrouting | public | _pgr_chinesepostman | edges_sql text, only_cost boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_compilation_date | | text + pgrouting | public | _pgr_compiler_version | | text + pgrouting | public | _pgr_connectedcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_contraction | edges_sql text, contraction_order bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record + pgrouting | public | _pgr_createindex | tabname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_createindex | sname text, tname text, colname text, indext text, reporterrs integer, fnname text | void + pgrouting | public | _pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_dagshortestpath | text, anyarray, anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dagshortestpath | text, text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_depthfirstsearch | edges_sql text, root_vids anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstra | edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, anyarray, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, anyarray, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstranear | text, bigint, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_dijkstravia | edges_sql text, via_vids anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_drivingdistance | edges_sql text, start_vids anyarray, distance double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgecoloring | edges_sql text, OUT edge_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edwardmoore | edges_sql text, combinations_sql text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_edwardmoore | edges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_endpoint | g geometry | geometry + pgrouting | public | _pgr_floydwarshall | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_get_statement | o_sql text | text + pgrouting | public | _pgr_getcolumnname | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumnname | sname text, tname text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | tab text, col text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_getcolumntype | sname text, tname text, cname text, reporterrs integer, fnname text | text + pgrouting | public | _pgr_gettablename | tab text, reporterrs integer, fnname text, OUT sname text, OUT tname text | record + pgrouting | public | _pgr_git_hash | | text + pgrouting | public | _pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_iscolumnindexed | tab text, col text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnindexed | sname text, tname text, cname text, reporterrs integer, fnname text | boolean + pgrouting | public | _pgr_iscolumnintable | tab text, col text | boolean + pgrouting | public | _pgr_isplanar | text | boolean + pgrouting | public | _pgr_johnson | edges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_kruskal | text, anyarray, fn_suffix text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_ksp | edges_sql text, start_vid bigint, end_vid bigint, k integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_lengauertarjandominatortree | edges_sql text, root_vid bigint, OUT seq integer, OUT vid bigint, OUT idom bigint | SETOF record + pgrouting | public | _pgr_lib_version | | text + pgrouting | public | _pgr_linegraph | text, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision | SETOF record + pgrouting | public | _pgr_linegraphfull | text, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint | SETOF record + pgrouting | public | _pgr_makeconnected | text, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint | SETOF record + pgrouting | public | _pgr_maxcardinalitymatch | edges_sql text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record + pgrouting | public | _pgr_maxflow | edges_sql text, combinations_sql text, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | _pgr_maxflow | edges_sql text, sources anyarray, targets anyarray, algorithm integer, only_flow boolean, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, sources anyarray, targets anyarray, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_maxflowmincost | edges_sql text, combinations_sql text, only_cost boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_msg | msgkind integer, fnname text, msg text | void + pgrouting | public | _pgr_onerror | errcond boolean, reporterrs integer, fnname text, msgerr text, hinto text, msgok text | void + pgrouting | public | _pgr_operating_system | | text + pgrouting | public | _pgr_parameter_check | fn text, sql text, big boolean | boolean + pgrouting | public | _pgr_pgsql_version | | text + pgrouting | public | _pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_pointtoid | point geometry, tolerance double precision, vertname text, srid integer | bigint + pgrouting | public | _pgr_prim | text, anyarray, order_by text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_quote_ident | idname text | text + pgrouting | public | _pgr_sequentialvertexcoloring | edges_sql text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | _pgr_startpoint | g geometry | geometry + pgrouting | public | _pgr_stoerwagner | edges_sql text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record + pgrouting | public | _pgr_strongcomponents | edges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | _pgr_topologicalsort | edges_sql text, OUT seq integer, OUT sorted_v bigint | SETOF record + pgrouting | public | _pgr_transitiveclosure | edges_sql text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | _pgr_trsp | sql text, source_eid integer, source_pos double precision, target_eid integer, target_pos double precision, directed boolean, has_reverse_cost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspvia | text, text, anyarray, boolean, boolean, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspvia_withpoints | text, text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_trspviavertices | sql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | _pgr_tsp | matrix_row_sql text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_tspeuclidean | coordinates_sql text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_versionless | v1 text, v2 text | boolean + pgrouting | public | _pgr_vrponedepot | text, text, text, integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | _pgr_withpoints | edges_sql text, points_sql text, combinations_sql text, directed boolean, driving_side character, details boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpoints | edges_sql text, points_sql text, start_pids anyarray, end_pids anyarray, directed boolean, driving_side character, details boolean, only_cost boolean, normal boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsdd | edges_sql text, points_sql text, start_pid anyarray, distance double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsksp | edges_sql text, points_sql text, start_pid bigint, end_pid bigint, k integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsvia | sql text, via_edges bigint[], fraction double precision[], directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _pgr_withpointsvia | text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | _trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | _v4trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_alphashape | geometry, alpha double precision | geometry + pgrouting | public | pgr_analyzegraph | text, double precision, the_geom text, id text, source text, target text, rows_where text | character varying + pgrouting | public | pgr_analyzeoneway | text, text[], text[], text[], text[], two_way_if_null boolean, oneway text, source text, target text | text + pgrouting | public | pgr_articulationpoints | text, OUT node bigint | SETOF bigint + pgrouting | public | pgr_astar | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astar | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, text, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcost | text, bigint, bigint, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_astarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor double precision, epsilon double precision, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastar | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, anyarray, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, anyarray, bigint, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, bigint, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcost | text, text, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bdastarcostmatrix | text, anyarray, directed boolean, heuristic integer, factor numeric, epsilon numeric, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bddijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bellmanford | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_biconnectedcomponents | text, OUT seq bigint, OUT component bigint, OUT edge bigint | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_binarybreadthfirstsearch | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bipartite | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_boykovkolmogorov | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_breadthfirstsearch | text, anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_breadthfirstsearch | text, bigint, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_bridges | text, OUT edge bigint | SETOF bigint + pgrouting | public | pgr_chinesepostman | text, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_chinesepostmancost | text | double precision + pgrouting | public | pgr_connectedcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_contraction | text, bigint[], max_cycles integer, forbidden_vertices bigint[], directed boolean, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_createtopology | text, double precision, the_geom text, id text, source text, target text, rows_where text, clean boolean | character varying + pgrouting | public | pgr_createverticestable | text, the_geom text, source text, target text, rows_where text | text + pgrouting | public | pgr_cuthillmckeeordering | text, OUT seq bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, anyarray, bigint, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, text, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dagshortestpath | text, bigint, anyarray, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_degree | text, text, dryrun boolean, OUT node bigint, OUT degree bigint | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, bigint, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_depthfirstsearch | text, anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstra | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, bigint, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, anyarray, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracost | text, bigint, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstracostmatrix | text, anyarray, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, bigint, anyarray, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, bigint, directed boolean, cap bigint, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranear | text, text, directed boolean, cap bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, text, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, anyarray, directed boolean, cap bigint, global boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, bigint, anyarray, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstranearcost | text, anyarray, bigint, directed boolean, cap bigint, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_dijkstravia | text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, bigint, double precision, directed boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_drivingdistance | text, anyarray, double precision, directed boolean, equicost boolean, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgecoloring | text, OUT edge_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edgedisjointpaths | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edmondskarp | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_edwardmoore | text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_extractvertices | text, dryrun boolean, OUT id bigint, OUT in_edges bigint[], OUT out_edges bigint[], OUT x double precision, OUT y double precision, OUT geom geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry[], double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_findcloseedges | text, geometry, double precision, cap integer, partial boolean, dryrun boolean, OUT edge_id bigint, OUT fraction double precision, OUT side character, OUT distance double precision, OUT geom geometry, OUT edge geometry | SETOF record + pgrouting | public | pgr_floydwarshall | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_full_version | OUT version text, OUT build_type text, OUT compile_date text, OUT library text, OUT system text, OUT postgresql text, OUT compiler text, OUT boost text, OUT hash text | record + pgrouting | public | pgr_hawickcircuits | text, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_isplanar | text | boolean + pgrouting | public | pgr_johnson | text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskal | text, OUT edge bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_kruskalbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskalbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_kruskaldfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_ksp | text, bigint, bigint, integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_lengauertarjandominatortree | text, bigint, OUT seq integer, OUT vertex_id bigint, OUT idom bigint | SETOF record + pgrouting | public | pgr_linegraph | text, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision | SETOF record + pgrouting | public | pgr_linegraphfull | text, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint | SETOF record + pgrouting | public | pgr_makeconnected | text, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint | SETOF record + pgrouting | public | pgr_maxcardinalitymatch | text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint | SETOF record + pgrouting | public | pgr_maxcardinalitymatch | text, OUT edge bigint | SETOF bigint + pgrouting | public | pgr_maxflow | text, anyarray, anyarray | bigint + pgrouting | public | pgr_maxflow | text, text | bigint + pgrouting | public | pgr_maxflow | text, bigint, anyarray | bigint + pgrouting | public | pgr_maxflow | text, anyarray, bigint | bigint + pgrouting | public | pgr_maxflow | text, bigint, bigint | bigint + pgrouting | public | pgr_maxflowmincost | text, text, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, text | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, bigint, anyarray | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, anyarray, bigint | double precision + pgrouting | public | pgr_maxflowmincost_cost | text, bigint, bigint | double precision + pgrouting | public | pgr_nodenetwork | text, double precision, id text, the_geom text, table_ending text, rows_where text, outall boolean | text + pgrouting | public | pgr_pickdeliver | text, text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | pgr_pickdelivereuclidean | text, text, factor double precision, max_cycles integer, initial_sol integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision | SETOF record + pgrouting | public | pgr_prim | text, OUT edge bigint, OUT cost double precision | SETOF record + pgrouting | public | pgr_primbfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primbfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, bigint, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, bigint, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdd | text, anyarray, numeric, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdfs | text, anyarray, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_primdfs | text, bigint, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, text, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, bigint, anyarray, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, bigint, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_pushrelabel | text, anyarray, bigint, OUT seq integer, OUT edge bigint, OUT start_vid bigint, OUT end_vid bigint, OUT flow bigint, OUT residual_capacity bigint | SETOF record + pgrouting | public | pgr_sequentialvertexcoloring | text, OUT vertex_id bigint, OUT color_id bigint | SETOF record + pgrouting | public | pgr_stoerwagner | text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision | SETOF record + pgrouting | public | pgr_strongcomponents | text, OUT seq bigint, OUT component bigint, OUT node bigint | SETOF record + pgrouting | public | pgr_topologicalsort | text, OUT seq integer, OUT sorted_v bigint | SETOF record + pgrouting | public | pgr_transitiveclosure | text, OUT seq integer, OUT vid bigint, OUT target_array bigint[] | SETOF record + pgrouting | public | pgr_trsp | text, text, text, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, bigint, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, integer, double precision, integer, double precision, boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, integer, integer, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trsp | text, text, anyarray, bigint, directed boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trsp_withpoints | text, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_trspvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_trspvia_withpoints | text, text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrouting | public | pgr_trspviaedges | text, integer[], double precision[], boolean, boolean, turn_restrict_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_trspviavertices | text, anyarray, boolean, boolean, restrictions_sql text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision | SETOF record + pgrouting | public | pgr_tsp | text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_tspeuclidean | text, start_id bigint, end_id bigint, max_processing_time double precision, tries_per_temperature integer, max_changes_per_temperature integer, max_consecutive_non_changes integer, initial_temperature double precision, final_temperature double precision, cooling_factor double precision, randomize boolean, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_turnrestrictedpath | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_version | | text + pgrouting | public | pgr_vrponedepot | text, text, text, integer, OUT oid integer, OUT opos integer, OUT vid integer, OUT tarrival integer, OUT tdepart integer | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, bigint, bigint, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpoints | text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, text, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, anyarray, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, anyarray, bigint, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscost | text, text, bigint, anyarray, directed boolean, driving_side character, OUT start_pid bigint, OUT end_pid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointscostmatrix | text, text, anyarray, directed boolean, driving_side character, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, bigint, double precision, directed boolean, driving_side character, details boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsdd | text, text, anyarray, double precision, directed boolean, driving_side character, details boolean, equicost boolean, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsksp | text, text, bigint, bigint, integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision | SETOF record + pgrouting | public | pgr_withpointsvia | text, text, anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision | SETOF record + pgrowlocks | public | pgrowlocks | relname text, OUT locked_row tid, OUT locker xid, OUT multi boolean, OUT xids xid[], OUT modes text[], OUT pids integer[] | SETOF record + pgsodium | pgsodium | create_key | key_type pgsodium.key_type, name text, raw_key bytea, raw_key_nonce bytea, parent_key uuid, key_context bytea, expires timestamp with time zone, associated_data text | pgsodium.valid_key + pgsodium | pgsodium | create_mask_view | relid oid, debug boolean | void + pgsodium | pgsodium | create_mask_view | relid oid, subid integer, debug boolean | void + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | message bytea, additional bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_det_decrypt | ciphertext bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_det_encrypt | message bytea, additional bytea, key bytea, nonce bytea | bytea + pgsodium | pgsodium | crypto_aead_det_keygen | | bytea + pgsodium | pgsodium | crypto_aead_det_noncegen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_decrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_encrypt | message bytea, additional bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_aead_ietf_keygen | | bytea + pgsodium | pgsodium | crypto_aead_ietf_noncegen | | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256 | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_keygen | | bytea + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_hmacsha256_verify | hash bytea, message bytea, secret bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512 | message bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512_keygen | | bytea + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | signature bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_hmacsha512_verify | hash bytea, message bytea, secret bytea | boolean + pgsodium | pgsodium | crypto_auth_keygen | | bytea + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_uuid uuid | boolean + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key bytea | boolean + pgsodium | pgsodium | crypto_auth_verify | mac bytea, message bytea, key_id bigint, context bytea | boolean + pgsodium | pgsodium | crypto_box | message bytea, nonce bytea, public bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_box_new_keypair | | pgsodium.crypto_box_keypair + pgsodium | pgsodium | crypto_box_new_seed | | bytea + pgsodium | pgsodium | crypto_box_noncegen | | bytea + pgsodium | pgsodium | crypto_box_open | ciphertext bytea, nonce bytea, public bytea, secret bytea | bytea + pgsodium | pgsodium | crypto_box_seal | message bytea, public_key bytea | bytea + pgsodium | pgsodium | crypto_box_seal_open | ciphertext bytea, public_key bytea, secret_key bytea | bytea + pgsodium | pgsodium | crypto_box_seed_new_keypair | seed bytea | pgsodium.crypto_box_keypair + pgsodium | pgsodium | crypto_cmp | text, text | boolean + pgsodium | pgsodium | crypto_generichash | message bytea, key bigint, context bytea | bytea + pgsodium | pgsodium | crypto_generichash | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_generichash | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_generichash_keygen | | bytea + pgsodium | pgsodium | crypto_hash_sha256 | message bytea | bytea + pgsodium | pgsodium | crypto_hash_sha512 | message bytea | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size integer, subkey_id bigint, context bytea, primary_key uuid | bytea + pgsodium | pgsodium | crypto_kdf_derive_from_key | subkey_size bigint, subkey_id bigint, context bytea, primary_key bytea | bytea + pgsodium | pgsodium | crypto_kdf_keygen | | bytea + pgsodium | pgsodium | crypto_kx_client_session_keys | client_pk bytea, client_sk bytea, server_pk bytea | pgsodium.crypto_kx_session + pgsodium | pgsodium | crypto_kx_new_keypair | | pgsodium.crypto_kx_keypair + pgsodium | pgsodium | crypto_kx_new_seed | | bytea + pgsodium | pgsodium | crypto_kx_seed_new_keypair | seed bytea | pgsodium.crypto_kx_keypair + pgsodium | pgsodium | crypto_kx_server_session_keys | server_pk bytea, server_sk bytea, client_pk bytea | pgsodium.crypto_kx_session + pgsodium | pgsodium | crypto_pwhash | password bytea, salt bytea | bytea + pgsodium | pgsodium | crypto_pwhash_saltgen | | bytea + pgsodium | pgsodium | crypto_pwhash_str | password bytea | bytea + pgsodium | pgsodium | crypto_pwhash_str_verify | hashed_password bytea, password bytea | boolean + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretbox | message bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_secretbox_keygen | | bytea + pgsodium | pgsodium | crypto_secretbox_noncegen | | bytea + pgsodium | pgsodium | crypto_secretbox_open | ciphertext bytea, nonce bytea, key bytea | bytea + pgsodium | pgsodium | crypto_secretbox_open | message bytea, nonce bytea, key_id bigint, context bytea | bytea + pgsodium | pgsodium | crypto_secretbox_open | message bytea, nonce bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_secretstream_keygen | | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key bigint, context bytea | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_shorthash | message bytea, key_uuid uuid | bytea + pgsodium | pgsodium | crypto_shorthash_keygen | | bytea + pgsodium | pgsodium | crypto_sign | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_detached | message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_final_create | state bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_final_verify | state bytea, signature bytea, key bytea | boolean + pgsodium | pgsodium | crypto_sign_init | | bytea + pgsodium | pgsodium | crypto_sign_new_keypair | | pgsodium.crypto_sign_keypair + pgsodium | pgsodium | crypto_sign_new_seed | | bytea + pgsodium | pgsodium | crypto_sign_open | signed_message bytea, key bytea | bytea + pgsodium | pgsodium | crypto_sign_seed_new_keypair | seed bytea | pgsodium.crypto_sign_keypair + pgsodium | pgsodium | crypto_sign_update | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg | message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg1 | state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_update_agg2 | cur_state bytea, initial_state bytea, message bytea | bytea + pgsodium | pgsodium | crypto_sign_verify_detached | sig bytea, message bytea, key bytea | boolean + pgsodium | pgsodium | crypto_signcrypt_new_keypair | | pgsodium.crypto_signcrypt_keypair + pgsodium | pgsodium | crypto_signcrypt_sign_after | state bytea, sender_sk bytea, ciphertext bytea | bytea + pgsodium | pgsodium | crypto_signcrypt_sign_before | sender bytea, recipient bytea, sender_sk bytea, recipient_pk bytea, additional bytea | pgsodium.crypto_signcrypt_state_key + pgsodium | pgsodium | crypto_signcrypt_verify_after | state bytea, signature bytea, sender_pk bytea, ciphertext bytea | boolean + pgsodium | pgsodium | crypto_signcrypt_verify_before | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, recipient_sk bytea | pgsodium.crypto_signcrypt_state_key + pgsodium | pgsodium | crypto_signcrypt_verify_public | signature bytea, sender bytea, recipient bytea, additional bytea, sender_pk bytea, ciphertext bytea | boolean + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20 | bigint, bytea, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_keygen | | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_noncegen | | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor | bytea, bytea, bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor_ic | bytea, bytea, bigint, bigint, context bytea | bytea + pgsodium | pgsodium | crypto_stream_xchacha20_xor_ic | bytea, bytea, bigint, bytea | bytea + pgsodium | pgsodium | decrypted_columns | relid oid | text + pgsodium | pgsodium | derive_key | key_id bigint, key_len integer, context bytea | bytea + pgsodium | pgsodium | disable_security_label_trigger | | void + pgsodium | pgsodium | enable_security_label_trigger | | void + pgsodium | pgsodium | encrypted_column | relid oid, m record | text + pgsodium | pgsodium | encrypted_columns | relid oid | text + pgsodium | pgsodium | get_key_by_id | uuid | pgsodium.valid_key + pgsodium | pgsodium | get_key_by_name | text | pgsodium.valid_key + pgsodium | pgsodium | get_named_keys | filter text | SETOF pgsodium.valid_key + pgsodium | pgsodium | has_mask | role regrole, source_name text | boolean + pgsodium | pgsodium | key_encrypt_secret_raw_key | | trigger + pgsodium | pgsodium | mask_columns | source_relid oid | TABLE(attname name, key_id text, key_id_column text, associated_column text, nonce_column text, format_type text) + pgsodium | pgsodium | mask_role | masked_role regrole, source_name text, view_name text | void + pgsodium | pgsodium | pgsodium_derive | key_id bigint, key_len integer, context bytea | bytea + pgsodium | pgsodium | quote_assoc | text, boolean | text + pgsodium | pgsodium | randombytes_buf | size integer | bytea + pgsodium | pgsodium | randombytes_buf_deterministic | size integer, seed bytea | bytea + pgsodium | pgsodium | randombytes_new_seed | | bytea + pgsodium | pgsodium | randombytes_random | | integer + pgsodium | pgsodium | randombytes_uniform | upper_bound integer | integer + pgsodium | pgsodium | sodium_base642bin | base64 text | bytea + pgsodium | pgsodium | sodium_bin2base64 | bin bytea | text + pgsodium | pgsodium | trg_mask_update | | event_trigger + pgsodium | pgsodium | update_mask | target oid, debug boolean | void + pgsodium | pgsodium | update_masks | debug boolean | void + pgsodium | pgsodium | version | | text + pgstattuple | public | pg_relpages | relname text | bigint + pgstattuple | public | pg_relpages | relname regclass | bigint + pgstattuple | public | pgstatginindex | relname regclass, OUT version integer, OUT pending_pages integer, OUT pending_tuples bigint | record + pgstattuple | public | pgstathashindex | relname regclass, OUT version integer, OUT bucket_pages bigint, OUT overflow_pages bigint, OUT bitmap_pages bigint, OUT unused_pages bigint, OUT live_items bigint, OUT dead_items bigint, OUT free_percent double precision | record + pgstattuple | public | pgstatindex | relname regclass, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record + pgstattuple | public | pgstatindex | relname text, OUT version integer, OUT tree_level integer, OUT index_size bigint, OUT root_block_no bigint, OUT internal_pages bigint, OUT leaf_pages bigint, OUT empty_pages bigint, OUT deleted_pages bigint, OUT avg_leaf_density double precision, OUT leaf_fragmentation double precision | record + pgstattuple | public | pgstattuple | reloid regclass, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple | relname text, OUT table_len bigint, OUT tuple_count bigint, OUT tuple_len bigint, OUT tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT free_space bigint, OUT free_percent double precision | record + pgstattuple | public | pgstattuple_approx | reloid regclass, OUT table_len bigint, OUT scanned_percent double precision, OUT approx_tuple_count bigint, OUT approx_tuple_len bigint, OUT approx_tuple_percent double precision, OUT dead_tuple_count bigint, OUT dead_tuple_len bigint, OUT dead_tuple_percent double precision, OUT approx_free_space bigint, OUT approx_free_percent double precision | record + pgtap | public | _add | text, integer | integer + pgtap | public | _add | text, integer, text | integer + pgtap | public | _alike | boolean, anyelement, text, text | text + pgtap | public | _ancestor_of | name, name, integer | boolean + pgtap | public | _ancestor_of | name, name, name, name, integer | boolean + pgtap | public | _are | text, name[], name[], text | text + pgtap | public | _areni | text, text[], text[], text | text + pgtap | public | _array_to_sorted_string | name[], text | text + pgtap | public | _assets_are | text, text[], text[], text | text + pgtap | public | _cast_exists | name, name, name, name | boolean + pgtap | public | _cast_exists | name, name | boolean + pgtap | public | _cast_exists | name, name, name | boolean + pgtap | public | _cdi | name, name, anyelement | text + pgtap | public | _cdi | name, name, anyelement, text | text + pgtap | public | _cdi | name, name, name, anyelement, text | text + pgtap | public | _cexists | name, name | boolean + pgtap | public | _cexists | name, name, name | boolean + pgtap | public | _ckeys | name, character | name[] + pgtap | public | _ckeys | name, name, character | name[] + pgtap | public | _cleanup | | boolean + pgtap | public | _cmp_types | oid, name | boolean + pgtap | public | _col_is_null | name, name, name, text, boolean | text + pgtap | public | _col_is_null | name, name, text, boolean | text + pgtap | public | _constraint | name, character, name[], text, text | text + pgtap | public | _constraint | name, name, character, name[], text, text | text + pgtap | public | _contract_on | text | "char" + pgtap | public | _currtest | | integer + pgtap | public | _db_privs | | name[] + pgtap | public | _def_is | text, text, anyelement, text | text + pgtap | public | _definer | name, name, name[] | boolean + pgtap | public | _definer | name, name[] | boolean + pgtap | public | _definer | name | boolean + pgtap | public | _definer | name, name | boolean + pgtap | public | _dexists | name | boolean + pgtap | public | _dexists | name, name | boolean + pgtap | public | _do_ne | text, text, text, text | text + pgtap | public | _docomp | text, text, text, text | text + pgtap | public | _error_diag | text, text, text, text, text, text, text, text, text, text | text + pgtap | public | _expand_context | character | text + pgtap | public | _expand_on | character | text + pgtap | public | _expand_vol | character | text + pgtap | public | _ext_exists | name | boolean + pgtap | public | _ext_exists | name, name | boolean + pgtap | public | _extensions | name | SETOF name + pgtap | public | _extensions | | SETOF name + pgtap | public | _extras | character, name, name[] | name[] + pgtap | public | _extras | character[], name[] | name[] + pgtap | public | _extras | character, name[] | name[] + pgtap | public | _extras | character[], name, name[] | name[] + pgtap | public | _finish | integer, integer, integer, boolean | SETOF text + pgtap | public | _fkexists | name, name, name[] | boolean + pgtap | public | _fkexists | name, name[] | boolean + pgtap | public | _fprivs_are | text, name, name[], text | text + pgtap | public | _func_compare | name, name, boolean, text | text + pgtap | public | _func_compare | name, name, name[], anyelement, anyelement, text | text + pgtap | public | _func_compare | name, name, name[], boolean, text | text + pgtap | public | _func_compare | name, name, anyelement, anyelement, text | text + pgtap | public | _funkargs | name[] | text + pgtap | public | _get | text | integer + pgtap | public | _get_ac_privs | name, text | text[] + pgtap | public | _get_col_ns_type | name, name, name | text + pgtap | public | _get_col_privs | name, text, name | text[] + pgtap | public | _get_col_type | name, name | text + pgtap | public | _get_col_type | name, name, name | text + pgtap | public | _get_context | name, name | "char" + pgtap | public | _get_db_owner | name | name + pgtap | public | _get_db_privs | name, text | text[] + pgtap | public | _get_dtype | name, text, boolean | text + pgtap | public | _get_dtype | name | text + pgtap | public | _get_fdw_privs | name, text | text[] + pgtap | public | _get_func_owner | name, name, name[] | name + pgtap | public | _get_func_owner | name, name[] | name + pgtap | public | _get_func_privs | text, text | text[] + pgtap | public | _get_index_owner | name, name | name + pgtap | public | _get_index_owner | name, name, name | name + pgtap | public | _get_lang_privs | name, text | text[] + pgtap | public | _get_language_owner | name | name + pgtap | public | _get_latest | text | integer[] + pgtap | public | _get_latest | text, integer | integer + pgtap | public | _get_note | integer | text + pgtap | public | _get_note | text | text + pgtap | public | _get_opclass_owner | name | name + pgtap | public | _get_opclass_owner | name, name | name + pgtap | public | _get_rel_owner | character[], name, name | name + pgtap | public | _get_rel_owner | character, name | name + pgtap | public | _get_rel_owner | name | name + pgtap | public | _get_rel_owner | name, name | name + pgtap | public | _get_rel_owner | character[], name | name + pgtap | public | _get_rel_owner | character, name, name | name + pgtap | public | _get_schema_owner | name | name + pgtap | public | _get_schema_privs | name, text | text[] + pgtap | public | _get_sequence_privs | name, text | text[] + pgtap | public | _get_server_privs | name, text | text[] + pgtap | public | _get_table_privs | name, text | text[] + pgtap | public | _get_tablespace_owner | name | name + pgtap | public | _get_tablespaceprivs | name, text | text[] + pgtap | public | _get_type_owner | name | name + pgtap | public | _get_type_owner | name, name | name + pgtap | public | _got_func | name, name, name[] | boolean + pgtap | public | _got_func | name, name[] | boolean + pgtap | public | _got_func | name | boolean + pgtap | public | _got_func | name, name | boolean + pgtap | public | _grolist | name | oid[] + pgtap | public | _has_def | name, name | boolean + pgtap | public | _has_def | name, name, name | boolean + pgtap | public | _has_group | name | boolean + pgtap | public | _has_role | name | boolean + pgtap | public | _has_type | name, name, character[] | boolean + pgtap | public | _has_type | name, character[] | boolean + pgtap | public | _has_user | name | boolean + pgtap | public | _hasc | name, character | boolean + pgtap | public | _hasc | name, name, character | boolean + pgtap | public | _have_index | name, name | boolean + pgtap | public | _have_index | name, name, name | boolean + pgtap | public | _ident_array_to_sorted_string | name[], text | text + pgtap | public | _ident_array_to_string | name[], text | text + pgtap | public | _ikeys | name, name | text[] + pgtap | public | _ikeys | name, name, name | text[] + pgtap | public | _inherited | name | boolean + pgtap | public | _inherited | name, name | boolean + pgtap | public | _is_indexed | name, name, text[] | boolean + pgtap | public | _is_instead | name, name | boolean + pgtap | public | _is_instead | name, name, name | boolean + pgtap | public | _is_schema | name | boolean + pgtap | public | _is_super | name | boolean + pgtap | public | _is_trusted | name | boolean + pgtap | public | _is_verbose | | boolean + pgtap | public | _keys | name, character | SETOF name[] + pgtap | public | _keys | name, name, character | SETOF name[] + pgtap | public | _lang | name, name, name[] | name + pgtap | public | _lang | name, name[] | name + pgtap | public | _lang | name | name + pgtap | public | _lang | name, name | name + pgtap | public | _missing | character, name, name[] | name[] + pgtap | public | _missing | character[], name[] | name[] + pgtap | public | _missing | character, name[] | name[] + pgtap | public | _missing | character[], name, name[] | name[] + pgtap | public | _nosuch | name, name, name[] | text + pgtap | public | _op_exists | name, name, name, name | boolean + pgtap | public | _op_exists | name, name, name, name, name | boolean + pgtap | public | _op_exists | name, name, name | boolean + pgtap | public | _opc_exists | name | boolean + pgtap | public | _opc_exists | name, name | boolean + pgtap | public | _partof | name, name, name, name | boolean + pgtap | public | _partof | name, name | boolean + pgtap | public | _parts | name | SETOF name + pgtap | public | _parts | name, name | SETOF name + pgtap | public | _pg_sv_column_array | oid, smallint[] | name[] + pgtap | public | _pg_sv_table_accessible | oid, oid | boolean + pgtap | public | _pg_sv_type_array | oid[] | name[] + pgtap | public | _prokind | p_oid oid | "char" + pgtap | public | _query | text | text + pgtap | public | _quote_ident_like | text, text | text + pgtap | public | _refine_vol | text | text + pgtap | public | _relcomp | text, text, text, text, text | text + pgtap | public | _relcomp | text, text, text, text | text + pgtap | public | _relcomp | text, anyarray, text, text | text + pgtap | public | _relexists | name | boolean + pgtap | public | _relexists | name, name | boolean + pgtap | public | _relne | text, text, text, text | text + pgtap | public | _relne | text, anyarray, text, text | text + pgtap | public | _returns | name, name, name[] | text + pgtap | public | _returns | name, name[] | text + pgtap | public | _returns | name | text + pgtap | public | _returns | name, name | text + pgtap | public | _rexists | character[], name, name | boolean + pgtap | public | _rexists | character, name | boolean + pgtap | public | _rexists | character[], name | boolean + pgtap | public | _rexists | character, name, name | boolean + pgtap | public | _rule_on | name, name | "char" + pgtap | public | _rule_on | name, name, name | "char" + pgtap | public | _runem | text[], boolean | SETOF text + pgtap | public | _runner | text[], text[], text[], text[], text[] | SETOF text + pgtap | public | _set | text, integer | integer + pgtap | public | _set | integer, integer | integer + pgtap | public | _set | text, integer, text | integer + pgtap | public | _strict | name, name, name[] | boolean + pgtap | public | _strict | name, name[] | boolean + pgtap | public | _strict | name | boolean + pgtap | public | _strict | name, name | boolean + pgtap | public | _table_privs | | name[] + pgtap | public | _temptable | text, text | text + pgtap | public | _temptable | anyarray, text | text + pgtap | public | _temptypes | text | text + pgtap | public | _time_trials | text, integer, numeric | SETOF _time_trial_type + pgtap | public | _tlike | boolean, text, text, text | text + pgtap | public | _todo | | text + pgtap | public | _trig | name, name | boolean + pgtap | public | _trig | name, name, name | boolean + pgtap | public | _type_func | "char", name | boolean + pgtap | public | _type_func | "char", name, name, name[] | boolean + pgtap | public | _type_func | "char", name, name[] | boolean + pgtap | public | _type_func | "char", name, name | boolean + pgtap | public | _types_are | name, name[], text, character[] | text + pgtap | public | _types_are | name[], text, character[] | text + pgtap | public | _unalike | boolean, anyelement, text, text | text + pgtap | public | _vol | name, name, name[] | text + pgtap | public | _vol | name, name[] | text + pgtap | public | _vol | name | text + pgtap | public | _vol | name, name | text + pgtap | public | add_result | boolean, boolean, text, text, text | integer + pgtap | public | alike | anyelement, text | text + pgtap | public | alike | anyelement, text, text | text + pgtap | public | any_column_privs_are | name, name, name, name[], text | text + pgtap | public | any_column_privs_are | name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name, name[] | text + pgtap | public | any_column_privs_are | name, name, name[], text | text + pgtap | public | bag_eq | text, anyarray, text | text + pgtap | public | bag_eq | text, text | text + pgtap | public | bag_eq | text, text, text | text + pgtap | public | bag_eq | text, anyarray | text + pgtap | public | bag_has | text, text | text + pgtap | public | bag_has | text, text, text | text + pgtap | public | bag_hasnt | text, text | text + pgtap | public | bag_hasnt | text, text, text | text + pgtap | public | bag_ne | text, anyarray, text | text + pgtap | public | bag_ne | text, text | text + pgtap | public | bag_ne | text, text, text | text + pgtap | public | bag_ne | text, anyarray | text + pgtap | public | can | name[] | text + pgtap | public | can | name[], text | text + pgtap | public | can | name, name[], text | text + pgtap | public | can | name, name[] | text + pgtap | public | cast_context_is | name, name, text, text | text + pgtap | public | cast_context_is | name, name, text | text + pgtap | public | casts_are | text[] | text + pgtap | public | casts_are | text[], text | text + pgtap | public | check_test | text, boolean | SETOF text + pgtap | public | check_test | text, boolean, text, text, text, boolean | SETOF text + pgtap | public | check_test | text, boolean, text, text | SETOF text + pgtap | public | check_test | text, boolean, text | SETOF text + pgtap | public | check_test | text, boolean, text, text, text | SETOF text + pgtap | public | cmp_ok | anyelement, text, anyelement | text + pgtap | public | cmp_ok | anyelement, text, anyelement, text | text + pgtap | public | col_default_is | name, name, anyelement | text + pgtap | public | col_default_is | name, name, text, text | text + pgtap | public | col_default_is | name, name, name, text, text | text + pgtap | public | col_default_is | name, name, text | text + pgtap | public | col_default_is | name, name, anyelement, text | text + pgtap | public | col_default_is | name, name, name, anyelement, text | text + pgtap | public | col_has_check | name, name, name, text | text + pgtap | public | col_has_check | name, name[], text | text + pgtap | public | col_has_check | name, name[] | text + pgtap | public | col_has_check | name, name, text | text + pgtap | public | col_has_check | name, name, name[], text | text + pgtap | public | col_has_check | name, name | text + pgtap | public | col_has_default | name, name, name, text | text + pgtap | public | col_has_default | name, name, text | text + pgtap | public | col_has_default | name, name | text + pgtap | public | col_hasnt_default | name, name, name, text | text + pgtap | public | col_hasnt_default | name, name, text | text + pgtap | public | col_hasnt_default | name, name | text + pgtap | public | col_is_fk | name, name, name, text | text + pgtap | public | col_is_fk | name, name[], text | text + pgtap | public | col_is_fk | name, name[] | text + pgtap | public | col_is_fk | name, name, text | text + pgtap | public | col_is_fk | name, name, name[], text | text + pgtap | public | col_is_fk | name, name | text + pgtap | public | col_is_null | table_name name, column_name name, description text | text + pgtap | public | col_is_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_is_pk | name, name, name, text | text + pgtap | public | col_is_pk | name, name[], text | text + pgtap | public | col_is_pk | name, name[] | text + pgtap | public | col_is_pk | name, name, text | text + pgtap | public | col_is_pk | name, name, name[], text | text + pgtap | public | col_is_pk | name, name | text + pgtap | public | col_is_unique | name, name, name, text | text + pgtap | public | col_is_unique | name, name[], text | text + pgtap | public | col_is_unique | name, name, name[] | text + pgtap | public | col_is_unique | name, name[] | text + pgtap | public | col_is_unique | name, name, text | text + pgtap | public | col_is_unique | name, name, name[], text | text + pgtap | public | col_is_unique | name, name | text + pgtap | public | col_is_unique | name, name, name | text + pgtap | public | col_isnt_fk | name, name, name, text | text + pgtap | public | col_isnt_fk | name, name[], text | text + pgtap | public | col_isnt_fk | name, name[] | text + pgtap | public | col_isnt_fk | name, name, text | text + pgtap | public | col_isnt_fk | name, name, name[], text | text + pgtap | public | col_isnt_fk | name, name | text + pgtap | public | col_isnt_pk | name, name, name, text | text + pgtap | public | col_isnt_pk | name, name[], text | text + pgtap | public | col_isnt_pk | name, name[] | text + pgtap | public | col_isnt_pk | name, name, text | text + pgtap | public | col_isnt_pk | name, name, name[], text | text + pgtap | public | col_isnt_pk | name, name | text + pgtap | public | col_not_null | table_name name, column_name name, description text | text + pgtap | public | col_not_null | schema_name name, table_name name, column_name name, description text | text + pgtap | public | col_type_is | name, name, name, text | text + pgtap | public | col_type_is | name, name, text, text | text + pgtap | public | col_type_is | name, name, name, text, text | text + pgtap | public | col_type_is | name, name, name, name, text, text | text + pgtap | public | col_type_is | name, name, text | text + pgtap | public | col_type_is | name, name, name, name, text | text + pgtap | public | collect_tap | VARIADIC text[] | text + pgtap | public | collect_tap | character varying[] | text + pgtap | public | column_privs_are | name, name, name, name[], text | text + pgtap | public | column_privs_are | name, name, name, name, name[] | text + pgtap | public | column_privs_are | name, name, name, name[] | text + pgtap | public | column_privs_are | name, name, name, name, name[], text | text + pgtap | public | columns_are | name, name[], text | text + pgtap | public | columns_are | name, name, name[] | text + pgtap | public | columns_are | name, name[] | text + pgtap | public | columns_are | name, name, name[], text | text + pgtap | public | composite_owner_is | name, name, name, text | text + pgtap | public | composite_owner_is | name, name, text | text + pgtap | public | composite_owner_is | name, name | text + pgtap | public | composite_owner_is | name, name, name | text + pgtap | public | database_privs_are | name, name, name[] | text + pgtap | public | database_privs_are | name, name, name[], text | text + pgtap | public | db_owner_is | name, name, text | text + pgtap | public | db_owner_is | name, name | text + pgtap | public | diag | msg text | text + pgtap | public | diag | VARIADIC text[] | text + pgtap | public | diag | VARIADIC anyarray | text + pgtap | public | diag | msg anyelement | text + pgtap | public | diag_test_name | text | text + pgtap | public | display_oper | name, oid | text + pgtap | public | do_tap | text | SETOF text + pgtap | public | do_tap | name, text | SETOF text + pgtap | public | do_tap | name | SETOF text + pgtap | public | do_tap | | SETOF text + pgtap | public | doesnt_imatch | anyelement, text | text + pgtap | public | doesnt_imatch | anyelement, text, text | text + pgtap | public | doesnt_match | anyelement, text | text + pgtap | public | doesnt_match | anyelement, text, text | text + pgtap | public | domain_type_is | name, text, name, text, text | text + pgtap | public | domain_type_is | text, text | text + pgtap | public | domain_type_is | name, text, text, text | text + pgtap | public | domain_type_is | name, text, text | text + pgtap | public | domain_type_is | text, text, text | text + pgtap | public | domain_type_is | name, text, name, text | text + pgtap | public | domain_type_isnt | name, text, name, text, text | text + pgtap | public | domain_type_isnt | text, text | text + pgtap | public | domain_type_isnt | name, text, text, text | text + pgtap | public | domain_type_isnt | name, text, text | text + pgtap | public | domain_type_isnt | text, text, text | text + pgtap | public | domain_type_isnt | name, text, name, text | text + pgtap | public | domains_are | name[] | text + pgtap | public | domains_are | name[], text | text + pgtap | public | domains_are | name, name[], text | text + pgtap | public | domains_are | name, name[] | text + pgtap | public | enum_has_labels | name, name[], text | text + pgtap | public | enum_has_labels | name, name, name[] | text + pgtap | public | enum_has_labels | name, name[] | text + pgtap | public | enum_has_labels | name, name, name[], text | text + pgtap | public | enums_are | name[] | text + pgtap | public | enums_are | name[], text | text + pgtap | public | enums_are | name, name[], text | text + pgtap | public | enums_are | name, name[] | text + pgtap | public | extensions_are | name[] | text + pgtap | public | extensions_are | name[], text | text + pgtap | public | extensions_are | name, name[], text | text + pgtap | public | extensions_are | name, name[] | text + pgtap | public | fail | text | text + pgtap | public | fail | | text + pgtap | public | fdw_privs_are | name, name, name[] | text + pgtap | public | fdw_privs_are | name, name, name[], text | text + pgtap | public | findfuncs | text | text[] + pgtap | public | findfuncs | text, text | text[] + pgtap | public | findfuncs | name, text, text | text[] + pgtap | public | findfuncs | name, text | text[] + pgtap | public | finish | exception_on_failure boolean | SETOF text + pgtap | public | fk_ok | name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name, name | text + pgtap | public | fk_ok | name, name, name, name, text | text + pgtap | public | fk_ok | name, name, name[], name, name, name[], text | text + pgtap | public | fk_ok | name, name, name[], name, name, name[] | text + pgtap | public | fk_ok | name, name[], name, name[] | text + pgtap | public | fk_ok | name, name[], name, name[], text | text + pgtap | public | foreign_table_owner_is | name, name, name, text | text + pgtap | public | foreign_table_owner_is | name, name, text | text + pgtap | public | foreign_table_owner_is | name, name | text + pgtap | public | foreign_table_owner_is | name, name, name | text + pgtap | public | foreign_tables_are | name[] | text + pgtap | public | foreign_tables_are | name[], text | text + pgtap | public | foreign_tables_are | name, name[], text | text + pgtap | public | foreign_tables_are | name, name[] | text + pgtap | public | function_lang_is | name, name, name, text | text + pgtap | public | function_lang_is | name, name, text | text + pgtap | public | function_lang_is | name, name[], name, text | text + pgtap | public | function_lang_is | name, name, name[], name | text + pgtap | public | function_lang_is | name, name | text + pgtap | public | function_lang_is | name, name, name | text + pgtap | public | function_lang_is | name, name[], name | text + pgtap | public | function_lang_is | name, name, name[], name, text | text + pgtap | public | function_owner_is | name, name[], name, text | text + pgtap | public | function_owner_is | name, name, name[], name | text + pgtap | public | function_owner_is | name, name[], name | text + pgtap | public | function_owner_is | name, name, name[], name, text | text + pgtap | public | function_privs_are | name, name, name[], name, name[], text | text + pgtap | public | function_privs_are | name, name[], name, name[] | text + pgtap | public | function_privs_are | name, name[], name, name[], text | text + pgtap | public | function_privs_are | name, name, name[], name, name[] | text + pgtap | public | function_returns | name, name, name[], text, text | text + pgtap | public | function_returns | name, name[], text | text + pgtap | public | function_returns | name, name, text, text | text + pgtap | public | function_returns | name, name, text | text + pgtap | public | function_returns | name, text, text | text + pgtap | public | function_returns | name, text | text + pgtap | public | function_returns | name, name, name[], text | text + pgtap | public | function_returns | name, name[], text, text | text + pgtap | public | functions_are | name[] | text + pgtap | public | functions_are | name[], text | text + pgtap | public | functions_are | name, name[], text | text + pgtap | public | functions_are | name, name[] | text + pgtap | public | groups_are | name[] | text + pgtap | public | groups_are | name[], text | text + pgtap | public | has_cast | name, name, name, text | text + pgtap | public | has_cast | name, name, name, name | text + pgtap | public | has_cast | name, name, text | text + pgtap | public | has_cast | name, name, name, name, text | text + pgtap | public | has_cast | name, name | text + pgtap | public | has_cast | name, name, name | text + pgtap | public | has_check | name, name, text | text + pgtap | public | has_check | name, text | text + pgtap | public | has_check | name | text + pgtap | public | has_column | name, name, name, text | text + pgtap | public | has_column | name, name, text | text + pgtap | public | has_column | name, name | text + pgtap | public | has_composite | name, name, text | text + pgtap | public | has_composite | name, text | text + pgtap | public | has_composite | name | text + pgtap | public | has_domain | name, name, text | text + pgtap | public | has_domain | name, text | text + pgtap | public | has_domain | name | text + pgtap | public | has_domain | name, name | text + pgtap | public | has_enum | name, name, text | text + pgtap | public | has_enum | name, text | text + pgtap | public | has_enum | name | text + pgtap | public | has_enum | name, name | text + pgtap | public | has_extension | name, name, text | text + pgtap | public | has_extension | name, text | text + pgtap | public | has_extension | name | text + pgtap | public | has_extension | name, name | text + pgtap | public | has_fk | name, name, text | text + pgtap | public | has_fk | name, text | text + pgtap | public | has_fk | name | text + pgtap | public | has_foreign_table | name, name, text | text + pgtap | public | has_foreign_table | name, text | text + pgtap | public | has_foreign_table | name | text + pgtap | public | has_foreign_table | name, name | text + pgtap | public | has_function | name, name[], text | text + pgtap | public | has_function | name, name, name[] | text + pgtap | public | has_function | name, name[] | text + pgtap | public | has_function | name, name, text | text + pgtap | public | has_function | name, text | text + pgtap | public | has_function | name | text + pgtap | public | has_function | name, name, name[], text | text + pgtap | public | has_function | name, name | text + pgtap | public | has_group | name, text | text + pgtap | public | has_group | name | text + pgtap | public | has_index | name, name, name, text | text + pgtap | public | has_index | name, name, name, name[], text | text + pgtap | public | has_index | name, name, name[] | text + pgtap | public | has_index | name, name, name, name | text + pgtap | public | has_index | name, name, text | text + pgtap | public | has_index | name, name, name, name[] | text + pgtap | public | has_index | name, name, name, name, text | text + pgtap | public | has_index | name, name, name[], text | text + pgtap | public | has_index | name, name | text + pgtap | public | has_index | name, name, name | text + pgtap | public | has_inherited_tables | name, name, text | text + pgtap | public | has_inherited_tables | name, text | text + pgtap | public | has_inherited_tables | name | text + pgtap | public | has_inherited_tables | name, name | text + pgtap | public | has_language | name, text | text + pgtap | public | has_language | name | text + pgtap | public | has_leftop | name, name, name, text | text + pgtap | public | has_leftop | name, name, name, name | text + pgtap | public | has_leftop | name, name, text | text + pgtap | public | has_leftop | name, name, name, name, text | text + pgtap | public | has_leftop | name, name | text + pgtap | public | has_leftop | name, name, name | text + pgtap | public | has_materialized_view | name, name, text | text + pgtap | public | has_materialized_view | name, text | text + pgtap | public | has_materialized_view | name | text + pgtap | public | has_opclass | name, name, text | text + pgtap | public | has_opclass | name, text | text + pgtap | public | has_opclass | name | text + pgtap | public | has_opclass | name, name | text + pgtap | public | has_operator | name, name, name, text | text + pgtap | public | has_operator | name, name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, name | text + pgtap | public | has_operator | name, name, name, name, text | text + pgtap | public | has_operator | name, name, name, name, name | text + pgtap | public | has_operator | name, name, name | text + pgtap | public | has_pk | name, name, text | text + pgtap | public | has_pk | name, text | text + pgtap | public | has_pk | name | text + pgtap | public | has_relation | name, name, text | text + pgtap | public | has_relation | name, text | text + pgtap | public | has_relation | name | text + pgtap | public | has_rightop | name, name, name, text | text + pgtap | public | has_rightop | name, name, name, name | text + pgtap | public | has_rightop | name, name, text | text + pgtap | public | has_rightop | name, name, name, name, text | text + pgtap | public | has_rightop | name, name | text + pgtap | public | has_rightop | name, name, name | text + pgtap | public | has_role | name, text | text + pgtap | public | has_role | name | text + pgtap | public | has_rule | name, name, name, text | text + pgtap | public | has_rule | name, name, text | text + pgtap | public | has_rule | name, name | text + pgtap | public | has_rule | name, name, name | text + pgtap | public | has_schema | name, text | text + pgtap | public | has_schema | name | text + pgtap | public | has_sequence | name, name, text | text + pgtap | public | has_sequence | name, text | text + pgtap | public | has_sequence | name | text + pgtap | public | has_sequence | name, name | text + pgtap | public | has_table | name, name, text | text + pgtap | public | has_table | name, text | text + pgtap | public | has_table | name | text + pgtap | public | has_table | name, name | text + pgtap | public | has_tablespace | name, text, text | text + pgtap | public | has_tablespace | name, text | text + pgtap | public | has_tablespace | name | text + pgtap | public | has_trigger | name, name, name, text | text + pgtap | public | has_trigger | name, name, text | text + pgtap | public | has_trigger | name, name | text + pgtap | public | has_trigger | name, name, name | text + pgtap | public | has_type | name, name, text | text + pgtap | public | has_type | name, text | text + pgtap | public | has_type | name | text + pgtap | public | has_type | name, name | text + pgtap | public | has_unique | text | text + pgtap | public | has_unique | text, text | text + pgtap | public | has_unique | text, text, text | text + pgtap | public | has_user | name, text | text + pgtap | public | has_user | name | text + pgtap | public | has_view | name, name, text | text + pgtap | public | has_view | name, text | text + pgtap | public | has_view | name | text + pgtap | public | has_view | name, name | text + pgtap | public | hasnt_cast | name, name, name, text | text + pgtap | public | hasnt_cast | name, name, name, name | text + pgtap | public | hasnt_cast | name, name, text | text + pgtap | public | hasnt_cast | name, name, name, name, text | text + pgtap | public | hasnt_cast | name, name | text + pgtap | public | hasnt_cast | name, name, name | text + pgtap | public | hasnt_column | name, name, name, text | text + pgtap | public | hasnt_column | name, name, text | text + pgtap | public | hasnt_column | name, name | text + pgtap | public | hasnt_composite | name, name, text | text + pgtap | public | hasnt_composite | name, text | text + pgtap | public | hasnt_composite | name | text + pgtap | public | hasnt_domain | name, name, text | text + pgtap | public | hasnt_domain | name, text | text + pgtap | public | hasnt_domain | name | text + pgtap | public | hasnt_domain | name, name | text + pgtap | public | hasnt_enum | name, name, text | text + pgtap | public | hasnt_enum | name, text | text + pgtap | public | hasnt_enum | name | text + pgtap | public | hasnt_enum | name, name | text + pgtap | public | hasnt_extension | name, name, text | text + pgtap | public | hasnt_extension | name, text | text + pgtap | public | hasnt_extension | name | text + pgtap | public | hasnt_extension | name, name | text + pgtap | public | hasnt_fk | name, name, text | text + pgtap | public | hasnt_fk | name, text | text + pgtap | public | hasnt_fk | name | text + pgtap | public | hasnt_foreign_table | name, name, text | text + pgtap | public | hasnt_foreign_table | name, text | text + pgtap | public | hasnt_foreign_table | name | text + pgtap | public | hasnt_foreign_table | name, name | text + pgtap | public | hasnt_function | name, name[], text | text + pgtap | public | hasnt_function | name, name, name[] | text + pgtap | public | hasnt_function | name, name[] | text + pgtap | public | hasnt_function | name, name, text | text + pgtap | public | hasnt_function | name, text | text + pgtap | public | hasnt_function | name | text + pgtap | public | hasnt_function | name, name, name[], text | text + pgtap | public | hasnt_function | name, name | text + pgtap | public | hasnt_group | name, text | text + pgtap | public | hasnt_group | name | text + pgtap | public | hasnt_index | name, name, name, text | text + pgtap | public | hasnt_index | name, name, text | text + pgtap | public | hasnt_index | name, name | text + pgtap | public | hasnt_index | name, name, name | text + pgtap | public | hasnt_inherited_tables | name, name, text | text + pgtap | public | hasnt_inherited_tables | name, text | text + pgtap | public | hasnt_inherited_tables | name | text + pgtap | public | hasnt_inherited_tables | name, name | text + pgtap | public | hasnt_language | name, text | text + pgtap | public | hasnt_language | name | text + pgtap | public | hasnt_leftop | name, name, name, text | text + pgtap | public | hasnt_leftop | name, name, name, name | text + pgtap | public | hasnt_leftop | name, name, text | text + pgtap | public | hasnt_leftop | name, name, name, name, text | text + pgtap | public | hasnt_leftop | name, name | text + pgtap | public | hasnt_leftop | name, name, name | text + pgtap | public | hasnt_materialized_view | name, name, text | text + pgtap | public | hasnt_materialized_view | name, text | text + pgtap | public | hasnt_materialized_view | name | text + pgtap | public | hasnt_opclass | name, name, text | text + pgtap | public | hasnt_opclass | name, text | text + pgtap | public | hasnt_opclass | name | text + pgtap | public | hasnt_opclass | name, name | text + pgtap | public | hasnt_operator | name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name, name, text | text + pgtap | public | hasnt_operator | name, name, name, name, name | text + pgtap | public | hasnt_operator | name, name, name | text + pgtap | public | hasnt_pk | name, name, text | text + pgtap | public | hasnt_pk | name, text | text + pgtap | public | hasnt_pk | name | text + pgtap | public | hasnt_relation | name, name, text | text + pgtap | public | hasnt_relation | name, text | text + pgtap | public | hasnt_relation | name | text + pgtap | public | hasnt_rightop | name, name, name, text | text + pgtap | public | hasnt_rightop | name, name, name, name | text + pgtap | public | hasnt_rightop | name, name, text | text + pgtap | public | hasnt_rightop | name, name, name, name, text | text + pgtap | public | hasnt_rightop | name, name | text + pgtap | public | hasnt_rightop | name, name, name | text + pgtap | public | hasnt_role | name, text | text + pgtap | public | hasnt_role | name | text + pgtap | public | hasnt_rule | name, name, name, text | text + pgtap | public | hasnt_rule | name, name, text | text + pgtap | public | hasnt_rule | name, name | text + pgtap | public | hasnt_rule | name, name, name | text + pgtap | public | hasnt_schema | name, text | text + pgtap | public | hasnt_schema | name | text + pgtap | public | hasnt_sequence | name, name, text | text + pgtap | public | hasnt_sequence | name, text | text + pgtap | public | hasnt_sequence | name | text + pgtap | public | hasnt_table | name, name, text | text + pgtap | public | hasnt_table | name, text | text + pgtap | public | hasnt_table | name | text + pgtap | public | hasnt_table | name, name | text + pgtap | public | hasnt_tablespace | name, text | text + pgtap | public | hasnt_tablespace | name | text + pgtap | public | hasnt_trigger | name, name, name, text | text + pgtap | public | hasnt_trigger | name, name, text | text + pgtap | public | hasnt_trigger | name, name | text + pgtap | public | hasnt_trigger | name, name, name | text + pgtap | public | hasnt_type | name, name, text | text + pgtap | public | hasnt_type | name, text | text + pgtap | public | hasnt_type | name | text + pgtap | public | hasnt_type | name, name | text + pgtap | public | hasnt_user | name, text | text + pgtap | public | hasnt_user | name | text + pgtap | public | hasnt_view | name, name, text | text + pgtap | public | hasnt_view | name, text | text + pgtap | public | hasnt_view | name | text + pgtap | public | hasnt_view | name, name | text + pgtap | public | ialike | anyelement, text | text + pgtap | public | ialike | anyelement, text, text | text + pgtap | public | imatches | anyelement, text | text + pgtap | public | imatches | anyelement, text, text | text + pgtap | public | in_todo | | boolean + pgtap | public | index_is_primary | name, name, name, text | text + pgtap | public | index_is_primary | name | text + pgtap | public | index_is_primary | name, name | text + pgtap | public | index_is_primary | name, name, name | text + pgtap | public | index_is_type | name, name, name, name | text + pgtap | public | index_is_type | name, name, name, name, text | text + pgtap | public | index_is_type | name, name | text + pgtap | public | index_is_type | name, name, name | text + pgtap | public | index_is_unique | name, name, name, text | text + pgtap | public | index_is_unique | name | text + pgtap | public | index_is_unique | name, name | text + pgtap | public | index_is_unique | name, name, name | text + pgtap | public | index_owner_is | name, name, name, text | text + pgtap | public | index_owner_is | name, name, name, name | text + pgtap | public | index_owner_is | name, name, name, name, text | text + pgtap | public | index_owner_is | name, name, name | text + pgtap | public | indexes_are | name, name[], text | text + pgtap | public | indexes_are | name, name, name[] | text + pgtap | public | indexes_are | name, name[] | text + pgtap | public | indexes_are | name, name, name[], text | text + pgtap | public | is | anyelement, anyelement, text | text + pgtap | public | is | anyelement, anyelement | text + pgtap | public | is_aggregate | name, name[], text | text + pgtap | public | is_aggregate | name, name, name[] | text + pgtap | public | is_aggregate | name, name[] | text + pgtap | public | is_aggregate | name, name, text | text + pgtap | public | is_aggregate | name, text | text + pgtap | public | is_aggregate | name | text + pgtap | public | is_aggregate | name, name, name[], text | text + pgtap | public | is_aggregate | name, name | text + pgtap | public | is_ancestor_of | name, name, name, name, integer, text | text + pgtap | public | is_ancestor_of | name, name, integer | text + pgtap | public | is_ancestor_of | name, name, name, name | text + pgtap | public | is_ancestor_of | name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, text | text + pgtap | public | is_ancestor_of | name, name, name, name, integer | text + pgtap | public | is_ancestor_of | name, name | text + pgtap | public | is_ancestor_of | name, name, integer, text | text + pgtap | public | is_clustered | name, name, name, text | text + pgtap | public | is_clustered | name | text + pgtap | public | is_clustered | name, name | text + pgtap | public | is_clustered | name, name, name | text + pgtap | public | is_definer | name, name[], text | text + pgtap | public | is_definer | name, name, name[] | text + pgtap | public | is_definer | name, name[] | text + pgtap | public | is_definer | name, name, text | text + pgtap | public | is_definer | name, text | text + pgtap | public | is_definer | name | text + pgtap | public | is_definer | name, name, name[], text | text + pgtap | public | is_definer | name, name | text + pgtap | public | is_descendent_of | name, name, name, name, integer, text | text + pgtap | public | is_descendent_of | name, name, integer | text + pgtap | public | is_descendent_of | name, name, name, name | text + pgtap | public | is_descendent_of | name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, text | text + pgtap | public | is_descendent_of | name, name, name, name, integer | text + pgtap | public | is_descendent_of | name, name | text + pgtap | public | is_descendent_of | name, name, integer, text | text + pgtap | public | is_empty | text | text + pgtap | public | is_empty | text, text | text + pgtap | public | is_indexed | name, name, name, text | text + pgtap | public | is_indexed | name, name[], text | text + pgtap | public | is_indexed | name, name, name[] | text + pgtap | public | is_indexed | name, name[] | text + pgtap | public | is_indexed | name, name, name[], text | text + pgtap | public | is_indexed | name, name | text + pgtap | public | is_indexed | name, name, name | text + pgtap | public | is_member_of | name, name[], text | text + pgtap | public | is_member_of | name, name[] | text + pgtap | public | is_member_of | name, name, text | text + pgtap | public | is_member_of | name, name | text + pgtap | public | is_normal_function | name, name[], text | text + pgtap | public | is_normal_function | name, name, name[] | text + pgtap | public | is_normal_function | name, name[] | text + pgtap | public | is_normal_function | name, name, text | text + pgtap | public | is_normal_function | name, text | text + pgtap | public | is_normal_function | name | text + pgtap | public | is_normal_function | name, name, name[], text | text + pgtap | public | is_normal_function | name, name | text + pgtap | public | is_partition_of | name, name, name, name | text + pgtap | public | is_partition_of | name, name, text | text + pgtap | public | is_partition_of | name, name, name, name, text | text + pgtap | public | is_partition_of | name, name | text + pgtap | public | is_partitioned | name, name, text | text + pgtap | public | is_partitioned | name, text | text + pgtap | public | is_partitioned | name | text + pgtap | public | is_partitioned | name, name | text + pgtap | public | is_procedure | name, name[], text | text + pgtap | public | is_procedure | name, name, name[] | text + pgtap | public | is_procedure | name, name[] | text + pgtap | public | is_procedure | name, name, text | text + pgtap | public | is_procedure | name, text | text + pgtap | public | is_procedure | name | text + pgtap | public | is_procedure | name, name, name[], text | text + pgtap | public | is_procedure | name, name | text + pgtap | public | is_strict | name, name[], text | text + pgtap | public | is_strict | name, name, name[] | text + pgtap | public | is_strict | name, name[] | text + pgtap | public | is_strict | name, name, text | text + pgtap | public | is_strict | name, text | text + pgtap | public | is_strict | name | text + pgtap | public | is_strict | name, name, name[], text | text + pgtap | public | is_strict | name, name | text + pgtap | public | is_superuser | name, text | text + pgtap | public | is_superuser | name | text + pgtap | public | is_window | name, name[], text | text + pgtap | public | is_window | name, name, name[] | text + pgtap | public | is_window | name, name[] | text + pgtap | public | is_window | name, name, text | text + pgtap | public | is_window | name, text | text + pgtap | public | is_window | name | text + pgtap | public | is_window | name, name, name[], text | text + pgtap | public | is_window | name, name | text + pgtap | public | isa_ok | anyelement, regtype | text + pgtap | public | isa_ok | anyelement, regtype, text | text + pgtap | public | isnt | anyelement, anyelement, text | text + pgtap | public | isnt | anyelement, anyelement | text + pgtap | public | isnt_aggregate | name, name[], text | text + pgtap | public | isnt_aggregate | name, name, name[] | text + pgtap | public | isnt_aggregate | name, name[] | text + pgtap | public | isnt_aggregate | name, name, text | text + pgtap | public | isnt_aggregate | name, text | text + pgtap | public | isnt_aggregate | name | text + pgtap | public | isnt_aggregate | name, name, name[], text | text + pgtap | public | isnt_aggregate | name, name | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer, text | text + pgtap | public | isnt_ancestor_of | name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name, name, name | text + pgtap | public | isnt_ancestor_of | name, name, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name, text | text + pgtap | public | isnt_ancestor_of | name, name, name, name, integer | text + pgtap | public | isnt_ancestor_of | name, name | text + pgtap | public | isnt_ancestor_of | name, name, integer, text | text + pgtap | public | isnt_definer | name, name[], text | text + pgtap | public | isnt_definer | name, name, name[] | text + pgtap | public | isnt_definer | name, name[] | text + pgtap | public | isnt_definer | name, name, text | text + pgtap | public | isnt_definer | name, text | text + pgtap | public | isnt_definer | name | text + pgtap | public | isnt_definer | name, name, name[], text | text + pgtap | public | isnt_definer | name, name | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer, text | text + pgtap | public | isnt_descendent_of | name, name, integer | text + pgtap | public | isnt_descendent_of | name, name, name, name | text + pgtap | public | isnt_descendent_of | name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, text | text + pgtap | public | isnt_descendent_of | name, name, name, name, integer | text + pgtap | public | isnt_descendent_of | name, name | text + pgtap | public | isnt_descendent_of | name, name, integer, text | text + pgtap | public | isnt_empty | text | text + pgtap | public | isnt_empty | text, text | text + pgtap | public | isnt_member_of | name, name[], text | text + pgtap | public | isnt_member_of | name, name[] | text + pgtap | public | isnt_member_of | name, name, text | text + pgtap | public | isnt_member_of | name, name | text + pgtap | public | isnt_normal_function | name, name[], text | text + pgtap | public | isnt_normal_function | name, name, name[] | text + pgtap | public | isnt_normal_function | name, name[] | text + pgtap | public | isnt_normal_function | name, name, text | text + pgtap | public | isnt_normal_function | name, text | text + pgtap | public | isnt_normal_function | name | text + pgtap | public | isnt_normal_function | name, name, name[], text | text + pgtap | public | isnt_normal_function | name, name | text + pgtap | public | isnt_partitioned | name, name, text | text + pgtap | public | isnt_partitioned | name, text | text + pgtap | public | isnt_partitioned | name | text + pgtap | public | isnt_partitioned | name, name | text + pgtap | public | isnt_procedure | name, name[], text | text + pgtap | public | isnt_procedure | name, name, name[] | text + pgtap | public | isnt_procedure | name, name[] | text + pgtap | public | isnt_procedure | name, name, text | text + pgtap | public | isnt_procedure | name, text | text + pgtap | public | isnt_procedure | name | text + pgtap | public | isnt_procedure | name, name, name[], text | text + pgtap | public | isnt_procedure | name, name | text + pgtap | public | isnt_strict | name, name[], text | text + pgtap | public | isnt_strict | name, name, name[] | text + pgtap | public | isnt_strict | name, name[] | text + pgtap | public | isnt_strict | name, name, text | text + pgtap | public | isnt_strict | name, text | text + pgtap | public | isnt_strict | name | text + pgtap | public | isnt_strict | name, name, name[], text | text + pgtap | public | isnt_strict | name, name | text + pgtap | public | isnt_superuser | name, text | text + pgtap | public | isnt_superuser | name | text + pgtap | public | isnt_window | name, name[], text | text + pgtap | public | isnt_window | name, name, name[] | text + pgtap | public | isnt_window | name, name[] | text + pgtap | public | isnt_window | name, name, text | text + pgtap | public | isnt_window | name, text | text + pgtap | public | isnt_window | name | text + pgtap | public | isnt_window | name, name, name[], text | text + pgtap | public | isnt_window | name, name | text + pgtap | public | language_is_trusted | name, text | text + pgtap | public | language_is_trusted | name | text + pgtap | public | language_owner_is | name, name, text | text + pgtap | public | language_owner_is | name, name | text + pgtap | public | language_privs_are | name, name, name[] | text + pgtap | public | language_privs_are | name, name, name[], text | text + pgtap | public | languages_are | name[] | text + pgtap | public | languages_are | name[], text | text + pgtap | public | lives_ok | text | text + pgtap | public | lives_ok | text, text | text + pgtap | public | matches | anyelement, text | text + pgtap | public | matches | anyelement, text, text | text + pgtap | public | materialized_view_owner_is | name, name, name, text | text + pgtap | public | materialized_view_owner_is | name, name, text | text + pgtap | public | materialized_view_owner_is | name, name | text + pgtap | public | materialized_view_owner_is | name, name, name | text + pgtap | public | materialized_views_are | name[] | text + pgtap | public | materialized_views_are | name[], text | text + pgtap | public | materialized_views_are | name, name[], text | text + pgtap | public | materialized_views_are | name, name[] | text + pgtap | public | no_plan | | SETOF boolean + pgtap | public | num_failed | | integer + pgtap | public | ok | boolean | text + pgtap | public | ok | boolean, text | text + pgtap | public | opclass_owner_is | name, name, name, text | text + pgtap | public | opclass_owner_is | name, name, text | text + pgtap | public | opclass_owner_is | name, name | text + pgtap | public | opclass_owner_is | name, name, name | text + pgtap | public | opclasses_are | name[] | text + pgtap | public | opclasses_are | name[], text | text + pgtap | public | opclasses_are | name, name[], text | text + pgtap | public | opclasses_are | name, name[] | text + pgtap | public | operators_are | name, text[] | text + pgtap | public | operators_are | text[] | text + pgtap | public | operators_are | text[], text | text + pgtap | public | operators_are | name, text[], text | text + pgtap | public | os_name | | text + pgtap | public | partitions_are | name, name[], text | text + pgtap | public | partitions_are | name, name, name[] | text + pgtap | public | partitions_are | name, name[] | text + pgtap | public | partitions_are | name, name, name[], text | text + pgtap | public | pass | text | text + pgtap | public | pass | | text + pgtap | public | performs_ok | text, numeric, text | text + pgtap | public | performs_ok | text, numeric | text + pgtap | public | performs_within | text, numeric, numeric, integer | text + pgtap | public | performs_within | text, numeric, numeric | text + pgtap | public | performs_within | text, numeric, numeric, integer, text | text + pgtap | public | performs_within | text, numeric, numeric, text | text + pgtap | public | pg_version | | text + pgtap | public | pg_version_num | | integer + pgtap | public | pgtap_version | | numeric + pgtap | public | plan | integer | text + pgtap | public | policies_are | name, name[], text | text + pgtap | public | policies_are | name, name, name[] | text + pgtap | public | policies_are | name, name[] | text + pgtap | public | policies_are | name, name, name[], text | text + pgtap | public | policy_cmd_is | name, name, name, text | text + pgtap | public | policy_cmd_is | name, name, text, text | text + pgtap | public | policy_cmd_is | name, name, name, text, text | text + pgtap | public | policy_cmd_is | name, name, text | text + pgtap | public | policy_roles_are | name, name, name, name[], text | text + pgtap | public | policy_roles_are | name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name, name[] | text + pgtap | public | policy_roles_are | name, name, name[], text | text + pgtap | public | relation_owner_is | name, name, name, text | text + pgtap | public | relation_owner_is | name, name, text | text + pgtap | public | relation_owner_is | name, name | text + pgtap | public | relation_owner_is | name, name, name | text + pgtap | public | results_eq | text, refcursor | text + pgtap | public | results_eq | text, anyarray, text | text + pgtap | public | results_eq | text, text | text + pgtap | public | results_eq | text, refcursor, text | text + pgtap | public | results_eq | refcursor, anyarray | text + pgtap | public | results_eq | refcursor, anyarray, text | text + pgtap | public | results_eq | text, text, text | text + pgtap | public | results_eq | text, anyarray | text + pgtap | public | results_eq | refcursor, refcursor, text | text + pgtap | public | results_eq | refcursor, text, text | text + pgtap | public | results_eq | refcursor, text | text + pgtap | public | results_eq | refcursor, refcursor | text + pgtap | public | results_ne | text, refcursor | text + pgtap | public | results_ne | text, anyarray, text | text + pgtap | public | results_ne | text, text | text + pgtap | public | results_ne | text, refcursor, text | text + pgtap | public | results_ne | refcursor, anyarray | text + pgtap | public | results_ne | refcursor, anyarray, text | text + pgtap | public | results_ne | text, text, text | text + pgtap | public | results_ne | text, anyarray | text + pgtap | public | results_ne | refcursor, refcursor, text | text + pgtap | public | results_ne | refcursor, text, text | text + pgtap | public | results_ne | refcursor, text | text + pgtap | public | results_ne | refcursor, refcursor | text + pgtap | public | roles_are | name[] | text + pgtap | public | roles_are | name[], text | text + pgtap | public | row_eq | text, anyelement | text + pgtap | public | row_eq | text, anyelement, text | text + pgtap | public | rule_is_instead | name, name, name, text | text + pgtap | public | rule_is_instead | name, name, text | text + pgtap | public | rule_is_instead | name, name | text + pgtap | public | rule_is_instead | name, name, name | text + pgtap | public | rule_is_on | name, name, name, text | text + pgtap | public | rule_is_on | name, name, text, text | text + pgtap | public | rule_is_on | name, name, name, text, text | text + pgtap | public | rule_is_on | name, name, text | text + pgtap | public | rules_are | name, name[], text | text + pgtap | public | rules_are | name, name, name[] | text + pgtap | public | rules_are | name, name[] | text + pgtap | public | rules_are | name, name, name[], text | text + pgtap | public | runtests | text | SETOF text + pgtap | public | runtests | name, text | SETOF text + pgtap | public | runtests | name | SETOF text + pgtap | public | runtests | | SETOF text + pgtap | public | schema_owner_is | name, name, text | text + pgtap | public | schema_owner_is | name, name | text + pgtap | public | schema_privs_are | name, name, name[] | text + pgtap | public | schema_privs_are | name, name, name[], text | text + pgtap | public | schemas_are | name[] | text + pgtap | public | schemas_are | name[], text | text + pgtap | public | sequence_owner_is | name, name, name, text | text + pgtap | public | sequence_owner_is | name, name, text | text + pgtap | public | sequence_owner_is | name, name | text + pgtap | public | sequence_owner_is | name, name, name | text + pgtap | public | sequence_privs_are | name, name, name, name[], text | text + pgtap | public | sequence_privs_are | name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name, name[] | text + pgtap | public | sequence_privs_are | name, name, name[], text | text + pgtap | public | sequences_are | name[] | text + pgtap | public | sequences_are | name[], text | text + pgtap | public | sequences_are | name, name[], text | text + pgtap | public | sequences_are | name, name[] | text + pgtap | public | server_privs_are | name, name, name[] | text + pgtap | public | server_privs_are | name, name, name[], text | text + pgtap | public | set_eq | text, anyarray, text | text + pgtap | public | set_eq | text, text | text + pgtap | public | set_eq | text, text, text | text + pgtap | public | set_eq | text, anyarray | text + pgtap | public | set_has | text, text | text + pgtap | public | set_has | text, text, text | text + pgtap | public | set_hasnt | text, text | text + pgtap | public | set_hasnt | text, text, text | text + pgtap | public | set_ne | text, anyarray, text | text + pgtap | public | set_ne | text, text | text + pgtap | public | set_ne | text, text, text | text + pgtap | public | set_ne | text, anyarray | text + pgtap | public | skip | integer | text + pgtap | public | skip | text | text + pgtap | public | skip | why text, how_many integer | text + pgtap | public | skip | integer, text | text + pgtap | public | table_owner_is | name, name, name, text | text + pgtap | public | table_owner_is | name, name, text | text + pgtap | public | table_owner_is | name, name | text + pgtap | public | table_owner_is | name, name, name | text + pgtap | public | table_privs_are | name, name, name, name[], text | text + pgtap | public | table_privs_are | name, name, name[] | text + pgtap | public | table_privs_are | name, name, name, name[] | text + pgtap | public | table_privs_are | name, name, name[], text | text + pgtap | public | tables_are | name[] | text + pgtap | public | tables_are | name[], text | text + pgtap | public | tables_are | name, name[], text | text + pgtap | public | tables_are | name, name[] | text + pgtap | public | tablespace_owner_is | name, name, text | text + pgtap | public | tablespace_owner_is | name, name | text + pgtap | public | tablespace_privs_are | name, name, name[] | text + pgtap | public | tablespace_privs_are | name, name, name[], text | text + pgtap | public | tablespaces_are | name[] | text + pgtap | public | tablespaces_are | name[], text | text + pgtap | public | throws_ilike | text, text | text + pgtap | public | throws_ilike | text, text, text | text + pgtap | public | throws_imatching | text, text | text + pgtap | public | throws_imatching | text, text, text | text + pgtap | public | throws_like | text, text | text + pgtap | public | throws_like | text, text, text | text + pgtap | public | throws_matching | text, text | text + pgtap | public | throws_matching | text, text, text | text + pgtap | public | throws_ok | text | text + pgtap | public | throws_ok | text, integer | text + pgtap | public | throws_ok | text, text | text + pgtap | public | throws_ok | text, character, text, text | text + pgtap | public | throws_ok | text, text, text | text + pgtap | public | throws_ok | text, integer, text, text | text + pgtap | public | throws_ok | text, integer, text | text + pgtap | public | todo | how_many integer, why text | SETOF boolean + pgtap | public | todo | why text, how_many integer | SETOF boolean + pgtap | public | todo | why text | SETOF boolean + pgtap | public | todo | how_many integer | SETOF boolean + pgtap | public | todo_end | | SETOF boolean + pgtap | public | todo_start | text | SETOF boolean + pgtap | public | todo_start | | SETOF boolean + pgtap | public | trigger_is | name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name, text | text + pgtap | public | trigger_is | name, name, name, name, name | text + pgtap | public | trigger_is | name, name, name | text + pgtap | public | triggers_are | name, name[], text | text + pgtap | public | triggers_are | name, name, name[] | text + pgtap | public | triggers_are | name, name[] | text + pgtap | public | triggers_are | name, name, name[], text | text + pgtap | public | type_owner_is | name, name, name, text | text + pgtap | public | type_owner_is | name, name, text | text + pgtap | public | type_owner_is | name, name | text + pgtap | public | type_owner_is | name, name, name | text + pgtap | public | types_are | name[] | text + pgtap | public | types_are | name[], text | text + pgtap | public | types_are | name, name[], text | text + pgtap | public | types_are | name, name[] | text + pgtap | public | unalike | anyelement, text | text + pgtap | public | unalike | anyelement, text, text | text + pgtap | public | unialike | anyelement, text | text + pgtap | public | unialike | anyelement, text, text | text + pgtap | public | users_are | name[] | text + pgtap | public | users_are | name[], text | text + pgtap | public | view_owner_is | name, name, name, text | text + pgtap | public | view_owner_is | name, name, text | text + pgtap | public | view_owner_is | name, name | text + pgtap | public | view_owner_is | name, name, name | text + pgtap | public | views_are | name[] | text + pgtap | public | views_are | name[], text | text + pgtap | public | views_are | name, name[], text | text + pgtap | public | views_are | name, name[] | text + pgtap | public | volatility_is | name, name, name[], text, text | text + pgtap | public | volatility_is | name, name[], text | text + pgtap | public | volatility_is | name, name, text, text | text + pgtap | public | volatility_is | name, name, text | text + pgtap | public | volatility_is | name, text, text | text + pgtap | public | volatility_is | name, text | text + pgtap | public | volatility_is | name, name, name[], text | text + pgtap | public | volatility_is | name, name[], text, text | text + plpgsql | pg_catalog | plpgsql_call_handler | | language_handler + plpgsql | pg_catalog | plpgsql_inline_handler | internal | void + plpgsql | pg_catalog | plpgsql_validator | oid | void + plpgsql_check | public | __plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | __plpgsql_show_dependency_tb | name text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_check_function | funcoid regprocedure, relid regclass, format text, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | SETOF text + plpgsql_check | public | plpgsql_check_function | name text, relid regclass, format text, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | SETOF text + plpgsql_check | public | plpgsql_check_function_tb | funcoid regprocedure, relid regclass, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | TABLE(functionid regproc, lineno integer, statement text, sqlstate text, message text, detail text, hint text, level text, "position" integer, query text, context text) + plpgsql_check | public | plpgsql_check_function_tb | name text, relid regclass, fatal_errors boolean, other_warnings boolean, performance_warnings boolean, extra_warnings boolean, security_warnings boolean, compatibility_warnings boolean, oldtable name, newtable name, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype, without_warnings boolean, all_warnings boolean, use_incomment_options boolean, incomment_options_usage_warning boolean, constant_tracing boolean | TABLE(functionid regproc, lineno integer, statement text, sqlstate text, message text, detail text, hint text, level text, "position" integer, query text, context text) + plpgsql_check | public | plpgsql_check_pragma | VARIADIC name text[] | integer + plpgsql_check | public | plpgsql_check_profiler | enable boolean | boolean + plpgsql_check | public | plpgsql_check_tracer | enable boolean, verbosity text | boolean + plpgsql_check | public | plpgsql_coverage_branches | funcoid regprocedure | double precision + plpgsql_check | public | plpgsql_coverage_branches | name text | double precision + plpgsql_check | public | plpgsql_coverage_statements | funcoid regprocedure | double precision + plpgsql_check | public | plpgsql_coverage_statements | name text | double precision + plpgsql_check | public | plpgsql_profiler_function_statements_tb | funcoid regprocedure | TABLE(stmtid integer, parent_stmtid integer, parent_note text, block_num integer, lineno integer, queryid bigint, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision, processed_rows bigint, stmtname text) + plpgsql_check | public | plpgsql_profiler_function_statements_tb | name text | TABLE(stmtid integer, parent_stmtid integer, parent_note text, block_num integer, lineno integer, queryid bigint, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision, processed_rows bigint, stmtname text) + plpgsql_check | public | plpgsql_profiler_function_tb | funcoid regprocedure | TABLE(lineno integer, stmt_lineno integer, queryids bigint[], cmds_on_row integer, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision[], processed_rows bigint[], source text) + plpgsql_check | public | plpgsql_profiler_function_tb | name text | TABLE(lineno integer, stmt_lineno integer, queryids bigint[], cmds_on_row integer, exec_stmts bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, max_time double precision[], processed_rows bigint[], source text) + plpgsql_check | public | plpgsql_profiler_functions_all | | TABLE(funcoid regprocedure, exec_count bigint, exec_stmts_err bigint, total_time double precision, avg_time double precision, stddev_time double precision, min_time double precision, max_time double precision) + plpgsql_check | public | plpgsql_profiler_install_fake_queryid_hook | | void + plpgsql_check | public | plpgsql_profiler_remove_fake_queryid_hook | | void + plpgsql_check | public | plpgsql_profiler_reset | funcoid regprocedure | void + plpgsql_check | public | plpgsql_profiler_reset_all | | void + plpgsql_check | public | plpgsql_show_dependency_tb | funcoid regprocedure, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + plpgsql_check | public | plpgsql_show_dependency_tb | fnname text, relid regclass, anyelememttype regtype, anyenumtype regtype, anyrangetype regtype, anycompatibletype regtype, anycompatiblerangetype regtype | TABLE(type text, oid oid, schema text, name text, params text) + postgis | public | _postgis_deprecate | oldname text, newname text, version text | void + postgis | public | _postgis_index_extent | tbl regclass, col text | box2d + postgis | public | _postgis_join_selectivity | regclass, text, regclass, text, text | double precision + postgis | public | _postgis_pgsql_version | | text + postgis | public | _postgis_scripts_pgsql_version | | text + postgis | public | _postgis_selectivity | tbl regclass, att_name text, geom geometry, mode text | double precision + postgis | public | _postgis_stats | tbl regclass, att_name text, text | text + postgis | public | _st_3ddfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_3ddwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_3dintersects | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_asgml | integer, geometry, integer, integer, text, text | text + postgis | public | _st_asx3d | integer, geometry, integer, integer, text | text + postgis | public | _st_bestsrid | geography | integer + postgis | public | _st_bestsrid | geography, geography | integer + postgis | public | _st_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_containsproperly | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_coveredby | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_coveredby | geog1 geography, geog2 geography | boolean + postgis | public | _st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_covers | geog1 geography, geog2 geography | boolean + postgis | public | _st_crosses | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_distancetree | geography, geography, double precision, boolean | double precision + postgis | public | _st_distancetree | geography, geography | double precision + postgis | public | _st_distanceuncached | geography, geography, double precision, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography, boolean | double precision + postgis | public | _st_distanceuncached | geography, geography | double precision + postgis | public | _st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean + postgis | public | _st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision, boolean | boolean + postgis | public | _st_dwithinuncached | geography, geography, double precision | boolean + postgis | public | _st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_expand | geography, double precision | geography + postgis | public | _st_geomfromgml | text, integer | geometry + postgis | public | _st_intersects | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_linecrossingdirection | line1 geometry, line2 geometry | integer + postgis | public | _st_longestline | geom1 geometry, geom2 geometry | geometry + postgis | public | _st_maxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | _st_orderingequals | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_pointoutside | geography | geography + postgis | public | _st_sortablehash | geom geometry | bigint + postgis | public | _st_touches | geom1 geometry, geom2 geometry | boolean + postgis | public | _st_voronoi | g1 geometry, clip geometry, tolerance double precision, return_polygons boolean | geometry + postgis | public | _st_within | geom1 geometry, geom2 geometry | boolean + postgis | public | addauth | text | boolean + postgis | public | addgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | addgeometrycolumn | table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean | text + postgis | public | box | box3d | box + postgis | public | box | geometry | box + postgis | public | box2d | box3d | box2d + postgis | public | box2d | geometry | box2d + postgis | public | box2d_in | cstring | box2d + postgis | public | box2d_out | box2d | cstring + postgis | public | box2df_in | cstring | box2df + postgis | public | box2df_out | box2df | cstring + postgis | public | box3d | geometry | box3d + postgis | public | box3d | box2d | box3d + postgis | public | box3d_in | cstring | box3d + postgis | public | box3d_out | box3d | cstring + postgis | public | box3dtobox | box3d | box + postgis | public | bytea | geography | bytea + postgis | public | bytea | geometry | bytea + postgis | public | checkauth | text, text | integer + postgis | public | checkauth | text, text, text | integer + postgis | public | checkauthtrigger | | trigger + postgis | public | contains_2d | geometry, box2df | boolean + postgis | public | contains_2d | box2df, geometry | boolean + postgis | public | contains_2d | box2df, box2df | boolean + postgis | public | disablelongtransactions | | text + postgis | public | dropgeometrycolumn | schema_name character varying, table_name character varying, column_name character varying | text + postgis | public | dropgeometrycolumn | table_name character varying, column_name character varying | text + postgis | public | dropgeometrycolumn | catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying | text + postgis | public | dropgeometrytable | table_name character varying | text + postgis | public | dropgeometrytable | schema_name character varying, table_name character varying | text + postgis | public | dropgeometrytable | catalog_name character varying, schema_name character varying, table_name character varying | text + postgis | public | enablelongtransactions | | text + postgis | public | equals | geom1 geometry, geom2 geometry | boolean + postgis | public | find_srid | character varying, character varying, character varying | integer + postgis | public | geog_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geography | bytea | geography + postgis | public | geography | geometry | geography + postgis | public | geography | geography, integer, boolean | geography + postgis | public | geography_analyze | internal | boolean + postgis | public | geography_cmp | geography, geography | integer + postgis | public | geography_distance_knn | geography, geography | double precision + postgis | public | geography_eq | geography, geography | boolean + postgis | public | geography_ge | geography, geography | boolean + postgis | public | geography_gist_compress | internal | internal + postgis | public | geography_gist_consistent | internal, geography, integer | boolean + postgis | public | geography_gist_decompress | internal | internal + postgis | public | geography_gist_distance | internal, geography, integer | double precision + postgis | public | geography_gist_penalty | internal, internal, internal | internal + postgis | public | geography_gist_picksplit | internal, internal | internal + postgis | public | geography_gist_same | box2d, box2d, internal | internal + postgis | public | geography_gist_union | bytea, internal | internal + postgis | public | geography_gt | geography, geography | boolean + postgis | public | geography_in | cstring, oid, integer | geography + postgis | public | geography_le | geography, geography | boolean + postgis | public | geography_lt | geography, geography | boolean + postgis | public | geography_out | geography | cstring + postgis | public | geography_overlaps | geography, geography | boolean + postgis | public | geography_recv | internal, oid, integer | geography + postgis | public | geography_send | geography | bytea + postgis | public | geography_spgist_choose_nd | internal, internal | void + postgis | public | geography_spgist_compress_nd | internal | internal + postgis | public | geography_spgist_config_nd | internal, internal | void + postgis | public | geography_spgist_inner_consistent_nd | internal, internal | void + postgis | public | geography_spgist_leaf_consistent_nd | internal, internal | boolean + postgis | public | geography_spgist_picksplit_nd | internal, internal | void + postgis | public | geography_typmod_in | cstring[] | integer + postgis | public | geography_typmod_out | integer | cstring + postgis | public | geom2d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geom3d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geom4d_brin_inclusion_add_value | internal, internal, internal, internal | boolean + postgis | public | geometry | geometry, integer, boolean | geometry + postgis | public | geometry | box3d | geometry + postgis | public | geometry | text | geometry + postgis | public | geometry | point | geometry + postgis | public | geometry | bytea | geometry + postgis | public | geometry | geography | geometry + postgis | public | geometry | path | geometry + postgis | public | geometry | polygon | geometry + postgis | public | geometry | box2d | geometry + postgis | public | geometry_above | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_analyze | internal | boolean + postgis | public | geometry_below | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_cmp | geom1 geometry, geom2 geometry | integer + postgis | public | geometry_contained_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_contains_nd | geometry, geometry | boolean + postgis | public | geometry_distance_box | geom1 geometry, geom2 geometry | double precision + postgis | public | geometry_distance_centroid | geom1 geometry, geom2 geometry | double precision + postgis | public | geometry_distance_centroid_nd | geometry, geometry | double precision + postgis | public | geometry_distance_cpa | geometry, geometry | double precision + postgis | public | geometry_eq | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_ge | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_gist_compress_2d | internal | internal + postgis | public | geometry_gist_compress_nd | internal | internal + postgis | public | geometry_gist_consistent_2d | internal, geometry, integer | boolean + postgis | public | geometry_gist_consistent_nd | internal, geometry, integer | boolean + postgis | public | geometry_gist_decompress_2d | internal | internal + postgis | public | geometry_gist_decompress_nd | internal | internal + postgis | public | geometry_gist_distance_2d | internal, geometry, integer | double precision + postgis | public | geometry_gist_distance_nd | internal, geometry, integer | double precision + postgis | public | geometry_gist_penalty_2d | internal, internal, internal | internal + postgis | public | geometry_gist_penalty_nd | internal, internal, internal | internal + postgis | public | geometry_gist_picksplit_2d | internal, internal | internal + postgis | public | geometry_gist_picksplit_nd | internal, internal | internal + postgis | public | geometry_gist_same_2d | geom1 geometry, geom2 geometry, internal | internal + postgis | public | geometry_gist_same_nd | geometry, geometry, internal | internal + postgis | public | geometry_gist_sortsupport_2d | internal | void + postgis | public | geometry_gist_union_2d | bytea, internal | internal + postgis | public | geometry_gist_union_nd | bytea, internal | internal + postgis | public | geometry_gt | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_hash | geometry | integer + postgis | public | geometry_in | cstring | geometry + postgis | public | geometry_le | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_left | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_lt | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_out | geometry | cstring + postgis | public | geometry_overabove | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overbelow | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overlaps_nd | geometry, geometry | boolean + postgis | public | geometry_overleft | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_overright | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_recv | internal | geometry + postgis | public | geometry_right | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same_3d | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_same_nd | geometry, geometry | boolean + postgis | public | geometry_send | geometry | bytea + postgis | public | geometry_sortsupport | internal | void + postgis | public | geometry_spgist_choose_2d | internal, internal | void + postgis | public | geometry_spgist_choose_3d | internal, internal | void + postgis | public | geometry_spgist_choose_nd | internal, internal | void + postgis | public | geometry_spgist_compress_2d | internal | internal + postgis | public | geometry_spgist_compress_3d | internal | internal + postgis | public | geometry_spgist_compress_nd | internal | internal + postgis | public | geometry_spgist_config_2d | internal, internal | void + postgis | public | geometry_spgist_config_3d | internal, internal | void + postgis | public | geometry_spgist_config_nd | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_2d | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_3d | internal, internal | void + postgis | public | geometry_spgist_inner_consistent_nd | internal, internal | void + postgis | public | geometry_spgist_leaf_consistent_2d | internal, internal | boolean + postgis | public | geometry_spgist_leaf_consistent_3d | internal, internal | boolean + postgis | public | geometry_spgist_leaf_consistent_nd | internal, internal | boolean + postgis | public | geometry_spgist_picksplit_2d | internal, internal | void + postgis | public | geometry_spgist_picksplit_3d | internal, internal | void + postgis | public | geometry_spgist_picksplit_nd | internal, internal | void + postgis | public | geometry_typmod_in | cstring[] | integer + postgis | public | geometry_typmod_out | integer | cstring + postgis | public | geometry_within | geom1 geometry, geom2 geometry | boolean + postgis | public | geometry_within_nd | geometry, geometry | boolean + postgis | public | geometrytype | geography | text + postgis | public | geometrytype | geometry | text + postgis | public | geomfromewkb | bytea | geometry + postgis | public | geomfromewkt | text | geometry + postgis | public | get_proj4_from_srid | integer | text + postgis | public | gettransactionid | | xid + postgis | public | gidx_in | cstring | gidx + postgis | public | gidx_out | gidx | cstring + postgis | public | gserialized_gist_joinsel_2d | internal, oid, internal, smallint | double precision + postgis | public | gserialized_gist_joinsel_nd | internal, oid, internal, smallint | double precision + postgis | public | gserialized_gist_sel_2d | internal, oid, internal, integer | double precision + postgis | public | gserialized_gist_sel_nd | internal, oid, internal, integer | double precision + postgis | public | is_contained_2d | geometry, box2df | boolean + postgis | public | is_contained_2d | box2df, geometry | boolean + postgis | public | is_contained_2d | box2df, box2df | boolean + postgis | public | json | geometry | json + postgis | public | jsonb | geometry | jsonb + postgis | public | lockrow | text, text, text, timestamp without time zone | integer + postgis | public | lockrow | text, text, text, text | integer + postgis | public | lockrow | text, text, text | integer + postgis | public | lockrow | text, text, text, text, timestamp without time zone | integer + postgis | public | longtransactionsenabled | | boolean + postgis | public | overlaps_2d | geometry, box2df | boolean + postgis | public | overlaps_2d | box2df, geometry | boolean + postgis | public | overlaps_2d | box2df, box2df | boolean + postgis | public | overlaps_geog | gidx, gidx | boolean + postgis | public | overlaps_geog | geography, gidx | boolean + postgis | public | overlaps_geog | gidx, geography | boolean + postgis | public | overlaps_nd | gidx, gidx | boolean + postgis | public | overlaps_nd | geometry, gidx | boolean + postgis | public | overlaps_nd | gidx, geometry | boolean + postgis | public | path | geometry | path + postgis | public | pgis_asflatgeobuf_finalfn | internal | bytea + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement | internal + postgis | public | pgis_asflatgeobuf_transfn | internal, anyelement, boolean, text | internal + postgis | public | pgis_asgeobuf_finalfn | internal | bytea + postgis | public | pgis_asgeobuf_transfn | internal, anyelement | internal + postgis | public | pgis_asgeobuf_transfn | internal, anyelement, text | internal + postgis | public | pgis_asmvt_combinefn | internal, internal | internal + postgis | public | pgis_asmvt_deserialfn | bytea, internal | internal + postgis | public | pgis_asmvt_finalfn | internal | bytea + postgis | public | pgis_asmvt_serialfn | internal | bytea + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text | internal + postgis | public | pgis_asmvt_transfn | internal, anyelement, text, integer, text, text | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry | internal + postgis | public | pgis_geometry_accum_transfn | internal, geometry, double precision, integer | internal + postgis | public | pgis_geometry_clusterintersecting_finalfn | internal | geometry[] + postgis | public | pgis_geometry_clusterwithin_finalfn | internal | geometry[] + postgis | public | pgis_geometry_collect_finalfn | internal | geometry + postgis | public | pgis_geometry_makeline_finalfn | internal | geometry + postgis | public | pgis_geometry_polygonize_finalfn | internal | geometry + postgis | public | pgis_geometry_union_parallel_combinefn | internal, internal | internal + postgis | public | pgis_geometry_union_parallel_deserialfn | bytea, internal | internal + postgis | public | pgis_geometry_union_parallel_finalfn | internal | geometry + postgis | public | pgis_geometry_union_parallel_serialfn | internal | bytea + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry, double precision | internal + postgis | public | pgis_geometry_union_parallel_transfn | internal, geometry | internal + postgis | public | point | geometry | point + postgis | public | polygon | geometry | polygon + postgis | public | populate_geometry_columns | tbl_oid oid, use_typmod boolean | integer + postgis | public | populate_geometry_columns | use_typmod boolean | text + postgis | public | postgis_addbbox | geometry | geometry + postgis | public | postgis_cache_bbox | | trigger + postgis | public | postgis_constraint_dims | geomschema text, geomtable text, geomcolumn text | integer + postgis | public | postgis_constraint_srid | geomschema text, geomtable text, geomcolumn text | integer + postgis | public | postgis_constraint_type | geomschema text, geomtable text, geomcolumn text | character varying + postgis | public | postgis_dropbbox | geometry | geometry + postgis | public | postgis_extensions_upgrade | | text + postgis | public | postgis_full_version | | text + postgis | public | postgis_geos_noop | geometry | geometry + postgis | public | postgis_geos_version | | text + postgis | public | postgis_getbbox | geometry | box2d + postgis | public | postgis_hasbbox | geometry | boolean + postgis | public | postgis_index_supportfn | internal | internal + postgis | public | postgis_lib_build_date | | text + postgis | public | postgis_lib_revision | | text + postgis | public | postgis_lib_version | | text + postgis | public | postgis_libjson_version | | text + postgis | public | postgis_liblwgeom_version | | text + postgis | public | postgis_libprotobuf_version | | text + postgis | public | postgis_libxml_version | | text + postgis | public | postgis_noop | geometry | geometry + postgis | public | postgis_proj_version | | text + postgis | public | postgis_scripts_build_date | | text + postgis | public | postgis_scripts_installed | | text + postgis | public | postgis_scripts_released | | text + postgis | public | postgis_svn_version | | text + postgis | public | postgis_transform_geometry | geom geometry, text, text, integer | geometry + postgis | public | postgis_type_name | geomname character varying, coord_dimension integer, use_new_name boolean | character varying + postgis | public | postgis_typmod_dims | integer | integer + postgis | public | postgis_typmod_srid | integer | integer + postgis | public | postgis_typmod_type | integer | text + postgis | public | postgis_version | | text + postgis | public | postgis_wagyu_version | | text + postgis | public | spheroid_in | cstring | spheroid + postgis | public | spheroid_out | spheroid | cstring + postgis | public | st_3dclosestpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_3ddfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_3ddistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_3ddwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_3dextent | geometry | box3d + postgis | public | st_3dintersects | geom1 geometry, geom2 geometry | boolean + postgis | public | st_3dlength | geometry | double precision + postgis | public | st_3dlineinterpolatepoint | geometry, double precision | geometry + postgis | public | st_3dlongestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_3dmakebox | geom1 geometry, geom2 geometry | box3d + postgis | public | st_3dmaxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_3dperimeter | geometry | double precision + postgis | public | st_3dshortestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_addmeasure | geometry, double precision, double precision | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry, integer | geometry + postgis | public | st_addpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision | geometry + postgis | public | st_affine | geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision | geometry + postgis | public | st_angle | pt1 geometry, pt2 geometry, pt3 geometry, pt4 geometry | double precision + postgis | public | st_angle | line1 geometry, line2 geometry | double precision + postgis | public | st_area | geog geography, use_spheroid boolean | double precision + postgis | public | st_area | text | double precision + postgis | public | st_area | geometry | double precision + postgis | public | st_area2d | geometry | double precision + postgis | public | st_asbinary | geography | bytea + postgis | public | st_asbinary | geometry, text | bytea + postgis | public | st_asbinary | geometry | bytea + postgis | public | st_asbinary | geography, text | bytea + postgis | public | st_asencodedpolyline | geom geometry, nprecision integer | text + postgis | public | st_asewkb | geometry, text | bytea + postgis | public | st_asewkb | geometry | bytea + postgis | public | st_asewkt | text | text + postgis | public | st_asewkt | geography, integer | text + postgis | public | st_asewkt | geography | text + postgis | public | st_asewkt | geometry, integer | text + postgis | public | st_asewkt | geometry | text + postgis | public | st_asflatgeobuf | anyelement | bytea + postgis | public | st_asflatgeobuf | anyelement, boolean | bytea + postgis | public | st_asflatgeobuf | anyelement, boolean, text | bytea + postgis | public | st_asgeobuf | anyelement | bytea + postgis | public | st_asgeobuf | anyelement, text | bytea + postgis | public | st_asgeojson | text | text + postgis | public | st_asgeojson | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | geog geography, maxdecimaldigits integer, options integer | text + postgis | public | st_asgeojson | r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean | text + postgis | public | st_asgml | text | text + postgis | public | st_asgml | version integer, geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geog geography, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_asgml | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_asgml | version integer, geom geometry, maxdecimaldigits integer, options integer, nprefix text, id text | text + postgis | public | st_ashexewkb | geometry, text | text + postgis | public | st_ashexewkb | geometry | text + postgis | public | st_askml | text | text + postgis | public | st_askml | geom geometry, maxdecimaldigits integer, nprefix text | text + postgis | public | st_askml | geog geography, maxdecimaldigits integer, nprefix text | text + postgis | public | st_aslatlontext | geom geometry, tmpl text | text + postgis | public | st_asmarc21 | geom geometry, format text | text + postgis | public | st_asmvt | anyelement | bytea + postgis | public | st_asmvt | anyelement, text, integer, text, text | bytea + postgis | public | st_asmvt | anyelement, text, integer | bytea + postgis | public | st_asmvt | anyelement, text | bytea + postgis | public | st_asmvt | anyelement, text, integer, text | bytea + postgis | public | st_asmvtgeom | geom geometry, bounds box2d, extent integer, buffer integer, clip_geom boolean | geometry + postgis | public | st_assvg | geog geography, rel integer, maxdecimaldigits integer | text + postgis | public | st_assvg | geom geometry, rel integer, maxdecimaldigits integer | text + postgis | public | st_assvg | text | text + postgis | public | st_astext | text | text + postgis | public | st_astext | geography, integer | text + postgis | public | st_astext | geography | text + postgis | public | st_astext | geometry, integer | text + postgis | public | st_astext | geometry | text + postgis | public | st_astwkb | geom geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_astwkb | geom geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean | bytea + postgis | public | st_asx3d | geom geometry, maxdecimaldigits integer, options integer | text + postgis | public | st_azimuth | geom1 geometry, geom2 geometry | double precision + postgis | public | st_azimuth | geog1 geography, geog2 geography | double precision + postgis | public | st_bdmpolyfromtext | text, integer | geometry + postgis | public | st_bdpolyfromtext | text, integer | geometry + postgis | public | st_boundary | geometry | geometry + postgis | public | st_boundingdiagonal | geom geometry, fits boolean | geometry + postgis | public | st_box2dfromgeohash | text, integer | box2d + postgis | public | st_buffer | geom geometry, radius double precision, options text | geometry + postgis | public | st_buffer | geography, double precision, text | geography + postgis | public | st_buffer | geography, double precision, integer | geography + postgis | public | st_buffer | geom geometry, radius double precision, quadsegs integer | geometry + postgis | public | st_buffer | text, double precision, text | geometry + postgis | public | st_buffer | geography, double precision | geography + postgis | public | st_buffer | text, double precision, integer | geometry + postgis | public | st_buffer | text, double precision | geometry + postgis | public | st_buildarea | geometry | geometry + postgis | public | st_centroid | text | geometry + postgis | public | st_centroid | geography, use_spheroid boolean | geography + postgis | public | st_centroid | geometry | geometry + postgis | public | st_chaikinsmoothing | geometry, integer, boolean | geometry + postgis | public | st_cleangeometry | geometry | geometry + postgis | public | st_clipbybox2d | geom geometry, box box2d | geometry + postgis | public | st_closestpoint | geom1 geometry, geom2 geometry | geometry + postgis | public | st_closestpointofapproach | geometry, geometry | double precision + postgis | public | st_clusterdbscan | geometry, eps double precision, minpoints integer | integer + postgis | public | st_clusterintersecting | geometry[] | geometry[] + postgis | public | st_clusterintersecting | geometry | geometry[] + postgis | public | st_clusterkmeans | geom geometry, k integer, max_radius double precision | integer + postgis | public | st_clusterwithin | geometry[], double precision | geometry[] + postgis | public | st_clusterwithin | geometry, double precision | geometry[] + postgis | public | st_collect | geom1 geometry, geom2 geometry | geometry + postgis | public | st_collect | geometry[] | geometry + postgis | public | st_collect | geometry | geometry + postgis | public | st_collectionextract | geometry, integer | geometry + postgis | public | st_collectionextract | geometry | geometry + postgis | public | st_collectionhomogenize | geometry | geometry + postgis | public | st_combinebbox | box2d, geometry | box2d + postgis | public | st_combinebbox | box3d, geometry | box3d + postgis | public | st_combinebbox | box3d, box3d | box3d + postgis | public | st_concavehull | param_geom geometry, param_pctconvex double precision, param_allow_holes boolean | geometry + postgis | public | st_contains | geom1 geometry, geom2 geometry | boolean + postgis | public | st_containsproperly | geom1 geometry, geom2 geometry | boolean + postgis | public | st_convexhull | geometry | geometry + postgis | public | st_coorddim | geometry geometry | smallint + postgis | public | st_coveredby | geom1 geometry, geom2 geometry | boolean + postgis | public | st_coveredby | text, text | boolean + postgis | public | st_coveredby | geog1 geography, geog2 geography | boolean + postgis | public | st_covers | geom1 geometry, geom2 geometry | boolean + postgis | public | st_covers | text, text | boolean + postgis | public | st_covers | geog1 geography, geog2 geography | boolean + postgis | public | st_cpawithin | geometry, geometry, double precision | boolean + postgis | public | st_crosses | geom1 geometry, geom2 geometry | boolean + postgis | public | st_curvetoline | geom geometry, tol double precision, toltype integer, flags integer | geometry + postgis | public | st_delaunaytriangles | g1 geometry, tolerance double precision, flags integer | geometry + postgis | public | st_dfullywithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_difference | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_dimension | geometry | integer + postgis | public | st_disjoint | geom1 geometry, geom2 geometry | boolean + postgis | public | st_distance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_distance | text, text | double precision + postgis | public | st_distance | geog1 geography, geog2 geography, use_spheroid boolean | double precision + postgis | public | st_distancecpa | geometry, geometry | double precision + postgis | public | st_distancesphere | geom1 geometry, geom2 geometry | double precision + postgis | public | st_distancesphere | geom1 geometry, geom2 geometry, radius double precision | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry, spheroid | double precision + postgis | public | st_distancespheroid | geom1 geometry, geom2 geometry | double precision + postgis | public | st_dump | geometry | SETOF geometry_dump + postgis | public | st_dumppoints | geometry | SETOF geometry_dump + postgis | public | st_dumprings | geometry | SETOF geometry_dump + postgis | public | st_dumpsegments | geometry | SETOF geometry_dump + postgis | public | st_dwithin | text, text, double precision | boolean + postgis | public | st_dwithin | geog1 geography, geog2 geography, tolerance double precision, use_spheroid boolean | boolean + postgis | public | st_dwithin | geom1 geometry, geom2 geometry, double precision | boolean + postgis | public | st_endpoint | geometry | geometry + postgis | public | st_envelope | geometry | geometry + postgis | public | st_equals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_estimatedextent | text, text, text, boolean | box2d + postgis | public | st_estimatedextent | text, text | box2d + postgis | public | st_estimatedextent | text, text, text | box2d + postgis | public | st_expand | box3d, double precision | box3d + postgis | public | st_expand | box box3d, dx double precision, dy double precision, dz double precision | box3d + postgis | public | st_expand | box2d, double precision | box2d + postgis | public | st_expand | box box2d, dx double precision, dy double precision | box2d + postgis | public | st_expand | geometry, double precision | geometry + postgis | public | st_expand | geom geometry, dx double precision, dy double precision, dz double precision, dm double precision | geometry + postgis | public | st_extent | geometry | box2d + postgis | public | st_exteriorring | geometry | geometry + postgis | public | st_filterbym | geometry, double precision, double precision, boolean | geometry + postgis | public | st_findextent | text, text | box2d + postgis | public | st_findextent | text, text, text | box2d + postgis | public | st_flipcoordinates | geometry | geometry + postgis | public | st_force2d | geometry | geometry + postgis | public | st_force3d | geom geometry, zvalue double precision | geometry + postgis | public | st_force3dm | geom geometry, mvalue double precision | geometry + postgis | public | st_force3dz | geom geometry, zvalue double precision | geometry + postgis | public | st_force4d | geom geometry, zvalue double precision, mvalue double precision | geometry + postgis | public | st_forcecollection | geometry | geometry + postgis | public | st_forcecurve | geometry | geometry + postgis | public | st_forcepolygonccw | geometry | geometry + postgis | public | st_forcepolygoncw | geometry | geometry + postgis | public | st_forcerhr | geometry | geometry + postgis | public | st_forcesfs | geometry, version text | geometry + postgis | public | st_forcesfs | geometry | geometry + postgis | public | st_frechetdistance | geom1 geometry, geom2 geometry, double precision | double precision + postgis | public | st_fromflatgeobuf | anyelement, bytea | SETOF anyelement + postgis | public | st_fromflatgeobuftotable | text, text, bytea | void + postgis | public | st_generatepoints | area geometry, npoints integer, seed integer | geometry + postgis | public | st_generatepoints | area geometry, npoints integer | geometry + postgis | public | st_geogfromtext | text | geography + postgis | public | st_geogfromwkb | bytea | geography + postgis | public | st_geographyfromtext | text | geography + postgis | public | st_geohash | geog geography, maxchars integer | text + postgis | public | st_geohash | geom geometry, maxchars integer | text + postgis | public | st_geomcollfromtext | text | geometry + postgis | public | st_geomcollfromtext | text, integer | geometry + postgis | public | st_geomcollfromwkb | bytea, integer | geometry + postgis | public | st_geomcollfromwkb | bytea | geometry + postgis | public | st_geometricmedian | g geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean | geometry + postgis | public | st_geometryfromtext | text | geometry + postgis | public | st_geometryfromtext | text, integer | geometry + postgis | public | st_geometryn | geometry, integer | geometry + postgis | public | st_geometrytype | geometry | text + postgis | public | st_geomfromewkb | bytea | geometry + postgis | public | st_geomfromewkt | text | geometry + postgis | public | st_geomfromgeohash | text, integer | geometry + postgis | public | st_geomfromgeojson | text | geometry + postgis | public | st_geomfromgeojson | json | geometry + postgis | public | st_geomfromgeojson | jsonb | geometry + postgis | public | st_geomfromgml | text | geometry + postgis | public | st_geomfromgml | text, integer | geometry + postgis | public | st_geomfromkml | text | geometry + postgis | public | st_geomfrommarc21 | marc21xml text | geometry + postgis | public | st_geomfromtext | text | geometry + postgis | public | st_geomfromtext | text, integer | geometry + postgis | public | st_geomfromtwkb | bytea | geometry + postgis | public | st_geomfromwkb | bytea, integer | geometry + postgis | public | st_geomfromwkb | bytea | geometry + postgis | public | st_gmltosql | text | geometry + postgis | public | st_gmltosql | text, integer | geometry + postgis | public | st_hasarc | geometry geometry | boolean + postgis | public | st_hausdorffdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_hausdorffdistance | geom1 geometry, geom2 geometry, double precision | double precision + postgis | public | st_hexagon | size double precision, cell_i integer, cell_j integer, origin geometry | geometry + postgis | public | st_hexagongrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record + postgis | public | st_interiorringn | geometry, integer | geometry + postgis | public | st_interpolatepoint | line geometry, point geometry | double precision + postgis | public | st_intersection | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_intersection | text, text | geometry + postgis | public | st_intersection | geography, geography | geography + postgis | public | st_intersects | geom1 geometry, geom2 geometry | boolean + postgis | public | st_intersects | text, text | boolean + postgis | public | st_intersects | geog1 geography, geog2 geography | boolean + postgis | public | st_isclosed | geometry | boolean + postgis | public | st_iscollection | geometry | boolean + postgis | public | st_isempty | geometry | boolean + postgis | public | st_ispolygonccw | geometry | boolean + postgis | public | st_ispolygoncw | geometry | boolean + postgis | public | st_isring | geometry | boolean + postgis | public | st_issimple | geometry | boolean + postgis | public | st_isvalid | geometry, integer | boolean + postgis | public | st_isvalid | geometry | boolean + postgis | public | st_isvaliddetail | geom geometry, flags integer | valid_detail + postgis | public | st_isvalidreason | geometry, integer | text + postgis | public | st_isvalidreason | geometry | text + postgis | public | st_isvalidtrajectory | geometry | boolean + postgis | public | st_length | geog geography, use_spheroid boolean | double precision + postgis | public | st_length | text | double precision + postgis | public | st_length | geometry | double precision + postgis | public | st_length2d | geometry | double precision + postgis | public | st_length2dspheroid | geometry, spheroid | double precision + postgis | public | st_lengthspheroid | geometry, spheroid | double precision + postgis | public | st_letters | letters text, font json | geometry + postgis | public | st_linecrossingdirection | line1 geometry, line2 geometry | integer + postgis | public | st_linefromencodedpolyline | txtin text, nprecision integer | geometry + postgis | public | st_linefrommultipoint | geometry | geometry + postgis | public | st_linefromtext | text | geometry + postgis | public | st_linefromtext | text, integer | geometry + postgis | public | st_linefromwkb | bytea, integer | geometry + postgis | public | st_linefromwkb | bytea | geometry + postgis | public | st_lineinterpolatepoint | geometry, double precision | geometry + postgis | public | st_lineinterpolatepoints | geometry, double precision, repeat boolean | geometry + postgis | public | st_linelocatepoint | geom1 geometry, geom2 geometry | double precision + postgis | public | st_linemerge | geometry, boolean | geometry + postgis | public | st_linemerge | geometry | geometry + postgis | public | st_linestringfromwkb | bytea, integer | geometry + postgis | public | st_linestringfromwkb | bytea | geometry + postgis | public | st_linesubstring | geometry, double precision, double precision | geometry + postgis | public | st_linetocurve | geometry geometry | geometry + postgis | public | st_locatealong | geometry geometry, measure double precision, leftrightoffset double precision | geometry + postgis | public | st_locatebetween | geometry geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision | geometry + postgis | public | st_locatebetweenelevations | geometry geometry, fromelevation double precision, toelevation double precision | geometry + postgis | public | st_longestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_m | geometry | double precision + postgis | public | st_makebox2d | geom1 geometry, geom2 geometry | box2d + postgis | public | st_makeenvelope | double precision, double precision, double precision, double precision, integer | geometry + postgis | public | st_makeline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_makeline | geometry[] | geometry + postgis | public | st_makeline | geometry | geometry + postgis | public | st_makepoint | double precision, double precision, double precision, double precision | geometry + postgis | public | st_makepoint | double precision, double precision | geometry + postgis | public | st_makepoint | double precision, double precision, double precision | geometry + postgis | public | st_makepointm | double precision, double precision, double precision | geometry + postgis | public | st_makepolygon | geometry, geometry[] | geometry + postgis | public | st_makepolygon | geometry | geometry + postgis | public | st_makevalid | geom geometry, params text | geometry + postgis | public | st_makevalid | geometry | geometry + postgis | public | st_maxdistance | geom1 geometry, geom2 geometry | double precision + postgis | public | st_maximuminscribedcircle | geometry, OUT center geometry, OUT nearest geometry, OUT radius double precision | record + postgis | public | st_memcollect | geometry | geometry + postgis | public | st_memsize | geometry | integer + postgis | public | st_memunion | geometry | geometry + postgis | public | st_minimumboundingcircle | inputgeom geometry, segs_per_quarter integer | geometry + postgis | public | st_minimumboundingradius | geometry, OUT center geometry, OUT radius double precision | record + postgis | public | st_minimumclearance | geometry | double precision + postgis | public | st_minimumclearanceline | geometry | geometry + postgis | public | st_mlinefromtext | text | geometry + postgis | public | st_mlinefromtext | text, integer | geometry + postgis | public | st_mlinefromwkb | bytea, integer | geometry + postgis | public | st_mlinefromwkb | bytea | geometry + postgis | public | st_mpointfromtext | text | geometry + postgis | public | st_mpointfromtext | text, integer | geometry + postgis | public | st_mpointfromwkb | bytea, integer | geometry + postgis | public | st_mpointfromwkb | bytea | geometry + postgis | public | st_mpolyfromtext | text | geometry + postgis | public | st_mpolyfromtext | text, integer | geometry + postgis | public | st_mpolyfromwkb | bytea, integer | geometry + postgis | public | st_mpolyfromwkb | bytea | geometry + postgis | public | st_multi | geometry | geometry + postgis | public | st_multilinefromwkb | bytea | geometry + postgis | public | st_multilinestringfromtext | text | geometry + postgis | public | st_multilinestringfromtext | text, integer | geometry + postgis | public | st_multipointfromtext | text | geometry + postgis | public | st_multipointfromwkb | bytea, integer | geometry + postgis | public | st_multipointfromwkb | bytea | geometry + postgis | public | st_multipolyfromwkb | bytea, integer | geometry + postgis | public | st_multipolyfromwkb | bytea | geometry + postgis | public | st_multipolygonfromtext | text | geometry + postgis | public | st_multipolygonfromtext | text, integer | geometry + postgis | public | st_ndims | geometry | smallint + postgis | public | st_node | g geometry | geometry + postgis | public | st_normalize | geom geometry | geometry + postgis | public | st_npoints | geometry | integer + postgis | public | st_nrings | geometry | integer + postgis | public | st_numgeometries | geometry | integer + postgis | public | st_numinteriorring | geometry | integer + postgis | public | st_numinteriorrings | geometry | integer + postgis | public | st_numpatches | geometry | integer + postgis | public | st_numpoints | geometry | integer + postgis | public | st_offsetcurve | line geometry, distance double precision, params text | geometry + postgis | public | st_orderingequals | geom1 geometry, geom2 geometry | boolean + postgis | public | st_orientedenvelope | geometry | geometry + postgis | public | st_overlaps | geom1 geometry, geom2 geometry | boolean + postgis | public | st_patchn | geometry, integer | geometry + postgis | public | st_perimeter | geog geography, use_spheroid boolean | double precision + postgis | public | st_perimeter | geometry | double precision + postgis | public | st_perimeter2d | geometry | double precision + postgis | public | st_point | double precision, double precision, srid integer | geometry + postgis | public | st_point | double precision, double precision | geometry + postgis | public | st_pointfromgeohash | text, integer | geometry + postgis | public | st_pointfromtext | text | geometry + postgis | public | st_pointfromtext | text, integer | geometry + postgis | public | st_pointfromwkb | bytea, integer | geometry + postgis | public | st_pointfromwkb | bytea | geometry + postgis | public | st_pointinsidecircle | geometry, double precision, double precision, double precision | boolean + postgis | public | st_pointm | xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer | geometry + postgis | public | st_pointn | geometry, integer | geometry + postgis | public | st_pointonsurface | geometry | geometry + postgis | public | st_points | geometry | geometry + postgis | public | st_pointz | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer | geometry + postgis | public | st_pointzm | xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer | geometry + postgis | public | st_polyfromtext | text | geometry + postgis | public | st_polyfromtext | text, integer | geometry + postgis | public | st_polyfromwkb | bytea, integer | geometry + postgis | public | st_polyfromwkb | bytea | geometry + postgis | public | st_polygon | geometry, integer | geometry + postgis | public | st_polygonfromtext | text | geometry + postgis | public | st_polygonfromtext | text, integer | geometry + postgis | public | st_polygonfromwkb | bytea, integer | geometry + postgis | public | st_polygonfromwkb | bytea | geometry + postgis | public | st_polygonize | geometry[] | geometry + postgis | public | st_polygonize | geometry | geometry + postgis | public | st_project | geog geography, distance double precision, azimuth double precision | geography + postgis | public | st_quantizecoordinates | g geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer | geometry + postgis | public | st_reduceprecision | geom geometry, gridsize double precision | geometry + postgis | public | st_relate | geom1 geometry, geom2 geometry, integer | text + postgis | public | st_relate | geom1 geometry, geom2 geometry | text + postgis | public | st_relate | geom1 geometry, geom2 geometry, text | boolean + postgis | public | st_relatematch | text, text | boolean + postgis | public | st_removepoint | geometry, integer | geometry + postgis | public | st_removerepeatedpoints | geom geometry, tolerance double precision | geometry + postgis | public | st_reverse | geometry | geometry + postgis | public | st_rotate | geometry, double precision, geometry | geometry + postgis | public | st_rotate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_rotate | geometry, double precision | geometry + postgis | public | st_rotatex | geometry, double precision | geometry + postgis | public | st_rotatey | geometry, double precision | geometry + postgis | public | st_rotatez | geometry, double precision | geometry + postgis | public | st_scale | geometry, double precision, double precision | geometry + postgis | public | st_scale | geometry, double precision, double precision, double precision | geometry + postgis | public | st_scale | geometry, geometry, origin geometry | geometry + postgis | public | st_scale | geometry, geometry | geometry + postgis | public | st_scroll | geometry, geometry | geometry + postgis | public | st_segmentize | geog geography, max_segment_length double precision | geography + postgis | public | st_segmentize | geometry, double precision | geometry + postgis | public | st_seteffectivearea | geometry, double precision, integer | geometry + postgis | public | st_setpoint | geometry, integer, geometry | geometry + postgis | public | st_setsrid | geog geography, srid integer | geography + postgis | public | st_setsrid | geom geometry, srid integer | geometry + postgis | public | st_sharedpaths | geom1 geometry, geom2 geometry | geometry + postgis | public | st_shiftlongitude | geometry | geometry + postgis | public | st_shortestline | geom1 geometry, geom2 geometry | geometry + postgis | public | st_simplify | geometry, double precision, boolean | geometry + postgis | public | st_simplify | geometry, double precision | geometry + postgis | public | st_simplifypolygonhull | geom geometry, vertex_fraction double precision, is_outer boolean | geometry + postgis | public | st_simplifypreservetopology | geometry, double precision | geometry + postgis | public | st_simplifyvw | geometry, double precision | geometry + postgis | public | st_snap | geom1 geometry, geom2 geometry, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision, double precision | geometry + postgis | public | st_snaptogrid | geom1 geometry, geom2 geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_snaptogrid | geometry, double precision | geometry + postgis | public | st_split | geom1 geometry, geom2 geometry | geometry + postgis | public | st_square | size double precision, cell_i integer, cell_j integer, origin geometry | geometry + postgis | public | st_squaregrid | size double precision, bounds geometry, OUT geom geometry, OUT i integer, OUT j integer | SETOF record + postgis | public | st_srid | geog geography | integer + postgis | public | st_srid | geom geometry | integer + postgis | public | st_startpoint | geometry | geometry + postgis | public | st_subdivide | geom geometry, maxvertices integer, gridsize double precision | SETOF geometry + postgis | public | st_summary | geography | text + postgis | public | st_summary | geometry | text + postgis | public | st_swapordinates | geom geometry, ords cstring | geometry + postgis | public | st_symdifference | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_symmetricdifference | geom1 geometry, geom2 geometry | geometry + postgis | public | st_tileenvelope | zoom integer, x integer, y integer, bounds geometry, margin double precision | geometry + postgis | public | st_touches | geom1 geometry, geom2 geometry | boolean + postgis | public | st_transform | geom geometry, to_proj text | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_srid integer | geometry + postgis | public | st_transform | geometry, integer | geometry + postgis | public | st_transform | geom geometry, from_proj text, to_proj text | geometry + postgis | public | st_translate | geometry, double precision, double precision | geometry + postgis | public | st_translate | geometry, double precision, double precision, double precision | geometry + postgis | public | st_transscale | geometry, double precision, double precision, double precision, double precision | geometry + postgis | public | st_triangulatepolygon | g1 geometry | geometry + postgis | public | st_unaryunion | geometry, gridsize double precision | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry, gridsize double precision | geometry + postgis | public | st_union | geom1 geometry, geom2 geometry | geometry + postgis | public | st_union | geometry[] | geometry + postgis | public | st_union | geometry, gridsize double precision | geometry + postgis | public | st_union | geometry | geometry + postgis | public | st_voronoilines | g1 geometry, tolerance double precision, extend_to geometry | geometry + postgis | public | st_voronoipolygons | g1 geometry, tolerance double precision, extend_to geometry | geometry + postgis | public | st_within | geom1 geometry, geom2 geometry | boolean + postgis | public | st_wkbtosql | wkb bytea | geometry + postgis | public | st_wkttosql | text | geometry + postgis | public | st_wrapx | geom geometry, wrap double precision, move double precision | geometry + postgis | public | st_x | geometry | double precision + postgis | public | st_xmax | box3d | double precision + postgis | public | st_xmin | box3d | double precision + postgis | public | st_y | geometry | double precision + postgis | public | st_ymax | box3d | double precision + postgis | public | st_ymin | box3d | double precision + postgis | public | st_z | geometry | double precision + postgis | public | st_zmax | box3d | double precision + postgis | public | st_zmflag | geometry | smallint + postgis | public | st_zmin | box3d | double precision + postgis | public | text | geometry | text + postgis | public | unlockrows | text | integer + postgis | public | updategeometrysrid | catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer | text + postgis | public | updategeometrysrid | character varying, character varying, character varying, integer | text + postgis | public | updategeometrysrid | character varying, character varying, integer | text + postgis_raster | public | __st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count + postgis_raster | public | _add_overview_constraint | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, factor integer | boolean + postgis_raster | public | _add_raster_constraint | cn name, sql text | boolean + postgis_raster | public | _add_raster_constraint_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | boolean + postgis_raster | public | _add_raster_constraint_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_extent | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_nodata_values | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_num_bands | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_out_db | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_pixel_types | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_scale | rastschema name, rasttable name, rastcolumn name, axis character | boolean + postgis_raster | public | _add_raster_constraint_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _add_raster_constraint_srid | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_overview_constraint | ovschema name, ovtable name, ovcolumn name | boolean + postgis_raster | public | _drop_raster_constraint | rastschema name, rasttable name, cn name | boolean + postgis_raster | public | _drop_raster_constraint_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | boolean + postgis_raster | public | _drop_raster_constraint_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_extent | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_nodata_values | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_num_bands | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_out_db | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_pixel_types | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_regular_blocking | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_scale | rastschema name, rasttable name, rastcolumn name, axis character | boolean + postgis_raster | public | _drop_raster_constraint_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _drop_raster_constraint_srid | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _overview_constraint | ov raster, factor integer, refschema name, reftable name, refcolumn name | boolean + postgis_raster | public | _overview_constraint_info | ovschema name, ovtable name, ovcolumn name, OUT refschema name, OUT reftable name, OUT refcolumn name, OUT factor integer | record + postgis_raster | public | _raster_constraint_info_alignment | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_blocksize | rastschema name, rasttable name, rastcolumn name, axis text | integer + postgis_raster | public | _raster_constraint_info_coverage_tile | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_extent | rastschema name, rasttable name, rastcolumn name | geometry + postgis_raster | public | _raster_constraint_info_index | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_nodata_values | rastschema name, rasttable name, rastcolumn name | double precision[] + postgis_raster | public | _raster_constraint_info_num_bands | rastschema name, rasttable name, rastcolumn name | integer + postgis_raster | public | _raster_constraint_info_out_db | rastschema name, rasttable name, rastcolumn name | boolean[] + postgis_raster | public | _raster_constraint_info_pixel_types | rastschema name, rasttable name, rastcolumn name | text[] + postgis_raster | public | _raster_constraint_info_regular_blocking | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_scale | rastschema name, rasttable name, rastcolumn name, axis character | double precision + postgis_raster | public | _raster_constraint_info_spatially_unique | rastschema name, rasttable name, rastcolumn name | boolean + postgis_raster | public | _raster_constraint_info_srid | rastschema name, rasttable name, rastcolumn name | integer + postgis_raster | public | _raster_constraint_nodata_values | rast raster | numeric[] + postgis_raster | public | _raster_constraint_out_db | rast raster | boolean[] + postgis_raster | public | _raster_constraint_pixel_types | rast raster | text[] + postgis_raster | public | _st_aspect4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_asraster | geom geometry, scalex double precision, scaley double precision, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | _st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | _st_colormap | rast raster, nband integer, colormap text, method text | raster + postgis_raster | public | _st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_convertarray4ma | value double precision[] | double precision[] + postgis_raster | public | _st_count | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | _st_countagg_finalfn | agg agg_count | bigint + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, exclude_nodata_value boolean | agg_count + postgis_raster | public | _st_countagg_transfn | agg agg_count, rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | agg_count + postgis_raster | public | _st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | _st_dwithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | _st_gdalwarp | rast raster, algorithm text, maxerr double precision, srid integer, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, width integer, height integer | raster + postgis_raster | public | _st_grayscale4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_hillshade4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_histogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, min double precision, max double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | _st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | _st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, distancex integer, distancey integer, extenttype text, customextent raster, mask double precision[], weighted boolean, VARIADIC userargs text[] | raster + postgis_raster | public | _st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | _st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_pixelascentroids | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | _st_pixelaspolygons | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | _st_quantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | _st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record + postgis_raster | public | _st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster + postgis_raster | public | _st_roughness4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_samealignment_finalfn | agg agg_samealignment | boolean + postgis_raster | public | _st_samealignment_transfn | agg agg_samealignment, rast raster | agg_samealignment + postgis_raster | public | _st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], hasnosetvalue boolean, nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | _st_slope4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_summarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | _st_summarystats_finalfn | internal | summarystats + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean, double precision | internal + postgis_raster | public | _st_summarystats_transfn | internal, raster, boolean, double precision | internal + postgis_raster | public | _st_summarystats_transfn | internal, raster, integer, boolean | internal + postgis_raster | public | _st_tile | rast raster, width integer, height integer, nband integer[], padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | _st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_tpi4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_tri4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | _st_union_finalfn | internal | raster + postgis_raster | public | _st_union_transfn | internal, raster, integer, text | internal + postgis_raster | public | _st_union_transfn | internal, raster | internal + postgis_raster | public | _st_union_transfn | internal, raster, text | internal + postgis_raster | public | _st_union_transfn | internal, raster, integer | internal + postgis_raster | public | _st_union_transfn | internal, raster, unionarg[] | internal + postgis_raster | public | _st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer, OUT percent double precision | SETOF record + postgis_raster | public | _st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | _st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | _updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | addoverviewconstraints | ovschema name, ovtable name, ovcolumn name, refschema name, reftable name, refcolumn name, ovfactor integer | boolean + postgis_raster | public | addoverviewconstraints | ovtable name, ovcolumn name, reftable name, refcolumn name, ovfactor integer | boolean + postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | addrasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | addrasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | box3d | raster | box3d + postgis_raster | public | bytea | raster | bytea + postgis_raster | public | dropoverviewconstraints | ovtable name, ovcolumn name | boolean + postgis_raster | public | dropoverviewconstraints | ovschema name, ovtable name, ovcolumn name | boolean + postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | droprasterconstraints | rastschema name, rasttable name, rastcolumn name, VARIADIC constraints text[] | boolean + postgis_raster | public | droprasterconstraints | rasttable name, rastcolumn name, srid boolean, scale_x boolean, scale_y boolean, blocksize_x boolean, blocksize_y boolean, same_alignment boolean, regular_blocking boolean, num_bands boolean, pixel_types boolean, nodata_values boolean, out_db boolean, extent boolean | boolean + postgis_raster | public | geometry_contained_by_raster | geometry, raster | boolean + postgis_raster | public | geometry_raster_contain | geometry, raster | boolean + postgis_raster | public | geometry_raster_overlap | geometry, raster | boolean + postgis_raster | public | postgis_gdal_version | | text + postgis_raster | public | postgis_noop | raster | geometry + postgis_raster | public | postgis_raster_lib_build_date | | text + postgis_raster | public | postgis_raster_lib_version | | text + postgis_raster | public | postgis_raster_scripts_installed | | text + postgis_raster | public | raster_above | raster, raster | boolean + postgis_raster | public | raster_below | raster, raster | boolean + postgis_raster | public | raster_contain | raster, raster | boolean + postgis_raster | public | raster_contained | raster, raster | boolean + postgis_raster | public | raster_contained_by_geometry | raster, geometry | boolean + postgis_raster | public | raster_eq | raster, raster | boolean + postgis_raster | public | raster_geometry_contain | raster, geometry | boolean + postgis_raster | public | raster_geometry_overlap | raster, geometry | boolean + postgis_raster | public | raster_hash | raster | integer + postgis_raster | public | raster_in | cstring | raster + postgis_raster | public | raster_left | raster, raster | boolean + postgis_raster | public | raster_out | raster | cstring + postgis_raster | public | raster_overabove | raster, raster | boolean + postgis_raster | public | raster_overbelow | raster, raster | boolean + postgis_raster | public | raster_overlap | raster, raster | boolean + postgis_raster | public | raster_overleft | raster, raster | boolean + postgis_raster | public | raster_overright | raster, raster | boolean + postgis_raster | public | raster_right | raster, raster | boolean + postgis_raster | public | raster_same | raster, raster | boolean + postgis_raster | public | st_addband | rast raster, index integer, outdbfile text, outdbindex integer[], nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, outdbfile text, outdbindex integer[], index integer, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, addbandargset addbandarg[] | raster + postgis_raster | public | st_addband | rast raster, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | rast raster, index integer, pixeltype text, initialvalue double precision, nodataval double precision | raster + postgis_raster | public | st_addband | torast raster, fromrast raster, fromband integer, torastindex integer | raster + postgis_raster | public | st_addband | torast raster, fromrasts raster[], fromband integer, torastindex integer | raster + postgis_raster | public | st_approxcount | rast raster, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, sample_percent double precision | bigint + postgis_raster | public | st_approxcount | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | bigint + postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxhistogram | rast raster, nband integer, sample_percent double precision, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, nband integer, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxquantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_approxquantile | rast raster, sample_percent double precision, quantile double precision | double precision + postgis_raster | public | st_approxsummarystats | rast raster, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, sample_percent double precision | summarystats + postgis_raster | public | st_approxsummarystats | rast raster, nband integer, exclude_nodata_value boolean, sample_percent double precision | summarystats + postgis_raster | public | st_asbinary | raster, outasin boolean | bytea + postgis_raster | public | st_asgdalraster | rast raster, format text, options text[], srid integer | bytea + postgis_raster | public | st_ashexwkb | raster, outasin boolean | text + postgis_raster | public | st_asjpeg | rast raster, options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, options text[] | bytea + postgis_raster | public | st_asjpeg | rast raster, nbands integer[], quality integer | bytea + postgis_raster | public | st_asjpeg | rast raster, nband integer, quality integer | bytea + postgis_raster | public | st_aspect | rast raster, nband integer, customextent raster, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspect | rast raster, nband integer, pixeltype text, units text, interpolate_nodata boolean | raster + postgis_raster | public | st_aspng | rast raster, options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nband integer, compression integer | bytea + postgis_raster | public | st_aspng | rast raster, nband integer, options text[] | bytea + postgis_raster | public | st_aspng | rast raster, nbands integer[], compression integer | bytea + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text[], value double precision[], nodataval double precision[], touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, ref raster, pixeltype text, value double precision, nodataval double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, gridx double precision, gridy double precision, pixeltype text, value double precision, nodataval double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, gridx double precision, gridy double precision, pixeltype text[], value double precision[], nodataval double precision[], skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, width integer, height integer, pixeltype text, value double precision, nodataval double precision, upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_asraster | geom geometry, scalex double precision, scaley double precision, pixeltype text[], value double precision[], nodataval double precision[], upperleftx double precision, upperlefty double precision, skewx double precision, skewy double precision, touched boolean | raster + postgis_raster | public | st_astiff | rast raster, options text[], srid integer | bytea + postgis_raster | public | st_astiff | rast raster, compression text, srid integer | bytea + postgis_raster | public | st_astiff | rast raster, nbands integer[], compression text, srid integer | bytea + postgis_raster | public | st_astiff | rast raster, nbands integer[], options text[], srid integer | bytea + postgis_raster | public | st_aswkb | raster, outasin boolean | bytea + postgis_raster | public | st_band | rast raster, nbands text, delimiter character | raster + postgis_raster | public | st_band | rast raster, nbands integer[] | raster + postgis_raster | public | st_band | rast raster, nband integer | raster + postgis_raster | public | st_bandfilesize | rast raster, band integer | bigint + postgis_raster | public | st_bandfiletimestamp | rast raster, band integer | bigint + postgis_raster | public | st_bandisnodata | rast raster, forcechecking boolean | boolean + postgis_raster | public | st_bandisnodata | rast raster, band integer, forcechecking boolean | boolean + postgis_raster | public | st_bandmetadata | rast raster, band integer | TABLE(pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) + postgis_raster | public | st_bandmetadata | rast raster, band integer[] | TABLE(bandnum integer, pixeltype text, nodatavalue double precision, isoutdb boolean, path text, outdbbandnum integer, filesize bigint, filetimestamp bigint) + postgis_raster | public | st_bandnodatavalue | rast raster, band integer | double precision + postgis_raster | public | st_bandpath | rast raster, band integer | text + postgis_raster | public | st_bandpixeltype | rast raster, band integer | text + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, nodataval double precision, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, nodataval double precision, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer[], geom geometry, nodataval double precision[], crop boolean | raster + postgis_raster | public | st_clip | rast raster, geom geometry, crop boolean | raster + postgis_raster | public | st_clip | rast raster, nband integer, geom geometry, crop boolean | raster + postgis_raster | public | st_colormap | rast raster, colormap text, method text | raster + postgis_raster | public | st_colormap | rast raster, nband integer, colormap text, method text | raster + postgis_raster | public | st_contains | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_contains | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_containsproperly | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_containsproperly | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_contour | rast raster, bandnumber integer, level_interval double precision, level_base double precision, fixed_levels double precision[], polygonize boolean | TABLE(geom geometry, id integer, value double precision) + postgis_raster | public | st_convexhull | raster | geometry + postgis_raster | public | st_count | rast raster, nband integer, exclude_nodata_value boolean | bigint + postgis_raster | public | st_count | rast raster, exclude_nodata_value boolean | bigint + postgis_raster | public | st_countagg | raster, integer, boolean, double precision | bigint + postgis_raster | public | st_countagg | raster, integer, boolean | bigint + postgis_raster | public | st_countagg | raster, boolean | bigint + postgis_raster | public | st_coveredby | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_coveredby | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_covers | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_covers | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_createoverview | tab regclass, col name, factor integer, algo text | regclass + postgis_raster | public | st_dfullywithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | st_dfullywithin | rast1 raster, rast2 raster, distance double precision | boolean + postgis_raster | public | st_disjoint | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_disjoint | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_distinct4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_distinct4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_dumpaspolygons | rast raster, band integer, exclude_nodata_value boolean | SETOF geomval + postgis_raster | public | st_dumpvalues | rast raster, nband integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_dumpvalues | rast raster, nband integer[], exclude_nodata_value boolean | TABLE(nband integer, valarray double precision[]) + postgis_raster | public | st_dwithin | rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision | boolean + postgis_raster | public | st_dwithin | rast1 raster, rast2 raster, distance double precision | boolean + postgis_raster | public | st_envelope | raster | geometry + postgis_raster | public | st_fromgdalraster | gdaldata bytea, srid integer | raster + postgis_raster | public | st_gdaldrivers | OUT idx integer, OUT short_name text, OUT long_name text, OUT can_read boolean, OUT can_write boolean, OUT create_options text | SETOF record + postgis_raster | public | st_georeference | rast raster, format text | text + postgis_raster | public | st_geotransform | raster, OUT imag double precision, OUT jmag double precision, OUT theta_i double precision, OUT theta_ij double precision, OUT xoffset double precision, OUT yoffset double precision | record + postgis_raster | public | st_grayscale | rastbandargset rastbandarg[], extenttype text | raster + postgis_raster | public | st_grayscale | rast raster, redband integer, greenband integer, blueband integer, extenttype text | raster + postgis_raster | public | st_hasnoband | rast raster, nband integer | boolean + postgis_raster | public | st_height | raster | integer + postgis_raster | public | st_hillshade | rast raster, nband integer, customextent raster, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_hillshade | rast raster, nband integer, pixeltype text, azimuth double precision, altitude double precision, max_bright double precision, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_histogram | rast raster, nband integer, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_histogram | rast raster, nband integer, exclude_nodata_value boolean, bins integer, width double precision[], "right" boolean, OUT min double precision, OUT max double precision, OUT count bigint, OUT percent double precision | SETOF record + postgis_raster | public | st_interpolateraster | geom geometry, options text, rast raster, bandnumber integer | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision[] | raster + postgis_raster | public | st_intersection | geomin geometry, rast raster, band integer | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision | raster + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, returnband text, nodataval double precision | raster + postgis_raster | public | st_intersection | rast raster, band integer, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[] | raster + postgis_raster | public | st_intersection | rast raster, geomin geometry | SETOF geomval + postgis_raster | public | st_intersection | rast1 raster, rast2 raster, nodataval double precision[] | raster + postgis_raster | public | st_intersects | rast raster, geom geometry, nband integer | boolean + postgis_raster | public | st_intersects | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_intersects | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_intersects | rast raster, nband integer, geom geometry | boolean + postgis_raster | public | st_intersects | geom geometry, rast raster, nband integer | boolean + postgis_raster | public | st_invdistweight4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_iscoveragetile | rast raster, coverage raster, tilewidth integer, tileheight integer | boolean + postgis_raster | public | st_isempty | rast raster | boolean + postgis_raster | public | st_makeemptycoverage | tilewidth integer, tileheight integer, width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | SETOF raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision, srid integer | raster + postgis_raster | public | st_makeemptyraster | width integer, height integer, upperleftx double precision, upperlefty double precision, pixelsize double precision | raster + postgis_raster | public | st_makeemptyraster | rast raster | raster + postgis_raster | public | st_mapalgebra | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast raster, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, mask double precision[], weighted boolean, pixeltype text, extenttype text, customextent raster, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rastbandargset rastbandarg[], callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast1 raster, nband1 integer, rast2 raster, nband2 integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, callbackfunc regprocedure, pixeltype text, extenttype text, customextent raster, distancex integer, distancey integer, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebra | rast raster, nband integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, rast2 raster, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast1 raster, band1 integer, rast2 raster, band2 integer, expression text, pixeltype text, extenttype text, nodata1expr text, nodata2expr text, nodatanodataval double precision | raster + postgis_raster | public | st_mapalgebraexpr | rast raster, band integer, pixeltype text, expression text, nodataval double precision | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, band1 integer, rast2 raster, band2 integer, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast raster, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafct | rast1 raster, rast2 raster, tworastuserfunc regprocedure, pixeltype text, extenttype text, VARIADIC userargs text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, pixeltype text, onerastuserfunc regprocedure, VARIADIC args text[] | raster + postgis_raster | public | st_mapalgebrafct | rast raster, band integer, onerastuserfunc regprocedure | raster + postgis_raster | public | st_mapalgebrafctngb | rast raster, band integer, pixeltype text, ngbwidth integer, ngbheight integer, onerastngbuserfunc regprocedure, nodatamode text, VARIADIC args text[] | raster + postgis_raster | public | st_max4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_max4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_mean4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_mean4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_memsize | raster | integer + postgis_raster | public | st_metadata | rast raster, OUT upperleftx double precision, OUT upperlefty double precision, OUT width integer, OUT height integer, OUT scalex double precision, OUT scaley double precision, OUT skewx double precision, OUT skewy double precision, OUT srid integer, OUT numbands integer | record + postgis_raster | public | st_min4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_min4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_minconvexhull | rast raster, nband integer | geometry + postgis_raster | public | st_mindist4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_minpossiblevalue | pixeltype text | double precision + postgis_raster | public | st_nearestvalue | rast raster, columnx integer, rowy integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, band integer, columnx integer, rowy integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, band integer, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_nearestvalue | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_neighborhood | rast raster, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, band integer, columnx integer, rowy integer, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_neighborhood | rast raster, pt geometry, distancex integer, distancey integer, exclude_nodata_value boolean | double precision[] + postgis_raster | public | st_notsamealignmentreason | rast1 raster, rast2 raster | text + postgis_raster | public | st_numbands | raster | integer + postgis_raster | public | st_overlaps | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_overlaps | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_pixelascentroid | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelascentroids | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelaspoint | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelaspoints | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelaspolygon | rast raster, x integer, y integer | geometry + postgis_raster | public | st_pixelaspolygons | rast raster, band integer, exclude_nodata_value boolean | TABLE(geom geometry, val double precision, x integer, y integer) + postgis_raster | public | st_pixelheight | raster | double precision + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, search double precision, exclude_nodata_value boolean | TABLE(x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, nband integer, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) + postgis_raster | public | st_pixelofvalue | rast raster, search double precision[], exclude_nodata_value boolean | TABLE(val double precision, x integer, y integer) + postgis_raster | public | st_pixelwidth | raster | double precision + postgis_raster | public | st_polygon | rast raster, band integer | geometry + postgis_raster | public | st_quantile | rast raster, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, exclude_nodata_value boolean, quantile double precision | double precision + postgis_raster | public | st_quantile | rast raster, nband integer, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_quantile | rast raster, quantiles double precision[], OUT quantile double precision, OUT value double precision | SETOF record + postgis_raster | public | st_range4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_range4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_rastertoworldcoord | rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision | record + postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer | double precision + postgis_raster | public | st_rastertoworldcoordx | rast raster, xr integer, yr integer | double precision + postgis_raster | public | st_rastertoworldcoordy | rast raster, xr integer, yr integer | double precision + postgis_raster | public | st_rastertoworldcoordy | rast raster, yr integer | double precision + postgis_raster | public | st_rastfromhexwkb | text | raster + postgis_raster | public | st_rastfromwkb | bytea | raster + postgis_raster | public | st_reclass | rast raster, nband integer, reclassexpr text, pixeltype text, nodataval double precision | raster + postgis_raster | public | st_reclass | rast raster, VARIADIC reclassargset reclassarg[] | raster + postgis_raster | public | st_reclass | rast raster, reclassexpr text, pixeltype text | raster + postgis_raster | public | st_resample | rast raster, ref raster, usescale boolean, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, width integer, height integer, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, scalex double precision, scaley double precision, gridx double precision, gridy double precision, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resample | rast raster, ref raster, algorithm text, maxerr double precision, usescale boolean | raster + postgis_raster | public | st_rescale | rast raster, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_rescale | rast raster, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, width integer, height integer, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, width text, height text, algorithm text, maxerr double precision | raster + postgis_raster | public | st_resize | rast raster, percentwidth double precision, percentheight double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_reskew | rast raster, skewx double precision, skewy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_reskew | rast raster, skewxy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_retile | tab regclass, col name, ext geometry, sfx double precision, sfy double precision, tw integer, th integer, algo text | SETOF raster + postgis_raster | public | st_rotation | raster | double precision + postgis_raster | public | st_roughness | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_roughness | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_samealignment | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_samealignment | raster | boolean + postgis_raster | public | st_samealignment | ulx1 double precision, uly1 double precision, scalex1 double precision, scaley1 double precision, skewx1 double precision, skewy1 double precision, ulx2 double precision, uly2 double precision, scalex2 double precision, scaley2 double precision, skewx2 double precision, skewy2 double precision | boolean + postgis_raster | public | st_scalex | raster | double precision + postgis_raster | public | st_scaley | raster | double precision + postgis_raster | public | st_setbandindex | rast raster, band integer, outdbindex integer, force boolean | raster + postgis_raster | public | st_setbandisnodata | rast raster, band integer | raster + postgis_raster | public | st_setbandnodatavalue | rast raster, band integer, nodatavalue double precision, forcechecking boolean | raster + postgis_raster | public | st_setbandnodatavalue | rast raster, nodatavalue double precision | raster + postgis_raster | public | st_setbandpath | rast raster, band integer, outdbpath text, outdbindex integer, force boolean | raster + postgis_raster | public | st_setgeoreference | rast raster, upperleftx double precision, upperlefty double precision, scalex double precision, scaley double precision, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setgeoreference | rast raster, georef text, format text | raster + postgis_raster | public | st_setgeotransform | rast raster, imag double precision, jmag double precision, theta_i double precision, theta_ij double precision, xoffset double precision, yoffset double precision | raster + postgis_raster | public | st_setm | rast raster, geom geometry, resample text, band integer | geometry + postgis_raster | public | st_setrotation | rast raster, rotation double precision | raster + postgis_raster | public | st_setscale | rast raster, scalex double precision, scaley double precision | raster + postgis_raster | public | st_setscale | rast raster, scale double precision | raster + postgis_raster | public | st_setskew | rast raster, skewx double precision, skewy double precision | raster + postgis_raster | public | st_setskew | rast raster, skew double precision | raster + postgis_raster | public | st_setsrid | rast raster, srid integer | raster + postgis_raster | public | st_setupperleft | rast raster, upperleftx double precision, upperlefty double precision | raster + postgis_raster | public | st_setvalue | rast raster, nband integer, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, geom geometry, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, x integer, y integer, newvalue double precision | raster + postgis_raster | public | st_setvalue | rast raster, band integer, x integer, y integer, newvalue double precision | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], nosetvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, newvalueset double precision[], noset boolean[], keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, x integer, y integer, width integer, height integer, newvalue double precision, keepnodata boolean | raster + postgis_raster | public | st_setvalues | rast raster, nband integer, geomvalset geomval[], keepnodata boolean | raster + postgis_raster | public | st_setz | rast raster, geom geometry, resample text, band integer | geometry + postgis_raster | public | st_skewx | raster | double precision + postgis_raster | public | st_skewy | raster | double precision + postgis_raster | public | st_slope | rast raster, nband integer, customextent raster, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_slope | rast raster, nband integer, pixeltype text, units text, scale double precision, interpolate_nodata boolean | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster + postgis_raster | public | st_snaptogrid | rast raster, gridx double precision, gridy double precision, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_srid | raster | integer + postgis_raster | public | st_stddev4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_stddev4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_sum4ma | value double precision[], pos integer[], VARIADIC userargs text[] | double precision + postgis_raster | public | st_sum4ma | matrix double precision[], nodatamode text, VARIADIC args text[] | double precision + postgis_raster | public | st_summary | rast raster | text + postgis_raster | public | st_summarystats | rast raster, nband integer, exclude_nodata_value boolean | summarystats + postgis_raster | public | st_summarystats | rast raster, exclude_nodata_value boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean, double precision | summarystats + postgis_raster | public | st_summarystatsagg | raster, integer, boolean | summarystats + postgis_raster | public | st_summarystatsagg | raster, boolean, double precision | summarystats + postgis_raster | public | st_tile | rast raster, nband integer, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_tile | rast raster, nband integer[], width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_tile | rast raster, width integer, height integer, padwithnodata boolean, nodataval double precision | SETOF raster + postgis_raster | public | st_touches | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_touches | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_tpi | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_tpi | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_transform | rast raster, srid integer, algorithm text, maxerr double precision, scalex double precision, scaley double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalexy double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, alignto raster, algorithm text, maxerr double precision | raster + postgis_raster | public | st_transform | rast raster, srid integer, scalex double precision, scaley double precision, algorithm text, maxerr double precision | raster + postgis_raster | public | st_tri | rast raster, nband integer, customextent raster, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_tri | rast raster, nband integer, pixeltype text, interpolate_nodata boolean | raster + postgis_raster | public | st_union | raster, integer | raster + postgis_raster | public | st_union | raster | raster + postgis_raster | public | st_union | raster, unionarg[] | raster + postgis_raster | public | st_union | raster, integer, text | raster + postgis_raster | public | st_union | raster, text | raster + postgis_raster | public | st_upperleftx | raster | double precision + postgis_raster | public | st_upperlefty | raster | double precision + postgis_raster | public | st_value | rast raster, band integer, x integer, y integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_value | rast raster, x integer, y integer, exclude_nodata_value boolean | double precision + postgis_raster | public | st_value | rast raster, band integer, pt geometry, exclude_nodata_value boolean, resample text | double precision + postgis_raster | public | st_value | rast raster, pt geometry, exclude_nodata_value boolean | double precision + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuecount | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT count integer | SETOF record + postgis_raster | public | st_valuecount | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | integer + postgis_raster | public | st_valuepercent | rast raster, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalue double precision, roundto double precision | double precision + postgis_raster | public | st_valuepercent | rast raster, nband integer, exclude_nodata_value boolean, searchvalues double precision[], roundto double precision, OUT value double precision, OUT percent double precision | SETOF record + postgis_raster | public | st_width | raster | integer + postgis_raster | public | st_within | rast1 raster, rast2 raster | boolean + postgis_raster | public | st_within | rast1 raster, nband1 integer, rast2 raster, nband2 integer | boolean + postgis_raster | public | st_worldtorastercoord | rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | st_worldtorastercoord | rast raster, pt geometry, OUT columnx integer, OUT rowy integer | record + postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordx | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, xw double precision, yw double precision | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, pt geometry | integer + postgis_raster | public | st_worldtorastercoordy | rast raster, yw double precision | integer + postgis_raster | public | updaterastersrid | table_name name, column_name name, new_srid integer | boolean + postgis_raster | public | updaterastersrid | schema_name name, table_name name, column_name name, new_srid integer | boolean + postgis_sfcgal | public | postgis_sfcgal_full_version | | text + postgis_sfcgal | public | postgis_sfcgal_noop | geometry | geometry + postgis_sfcgal | public | postgis_sfcgal_scripts_installed | | text + postgis_sfcgal | public | postgis_sfcgal_version | | text + postgis_sfcgal | public | st_3darea | geometry | double precision + postgis_sfcgal | public | st_3dconvexhull | geometry | geometry + postgis_sfcgal | public | st_3ddifference | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dintersection | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dunion | geom1 geometry, geom2 geometry | geometry + postgis_sfcgal | public | st_3dunion | geometry | geometry + postgis_sfcgal | public | st_alphashape | g1 geometry, alpha double precision, allow_holes boolean | geometry + postgis_sfcgal | public | st_approximatemedialaxis | geometry | geometry + postgis_sfcgal | public | st_constraineddelaunaytriangles | geometry | geometry + postgis_sfcgal | public | st_extrude | geometry, double precision, double precision, double precision | geometry + postgis_sfcgal | public | st_forcelhr | geometry | geometry + postgis_sfcgal | public | st_isplanar | geometry | boolean + postgis_sfcgal | public | st_issolid | geometry | boolean + postgis_sfcgal | public | st_makesolid | geometry | geometry + postgis_sfcgal | public | st_minkowskisum | geometry, geometry | geometry + postgis_sfcgal | public | st_optimalalphashape | g1 geometry, allow_holes boolean, nb_components integer | geometry + postgis_sfcgal | public | st_orientation | geometry | integer + postgis_sfcgal | public | st_straightskeleton | geometry | geometry + postgis_sfcgal | public | st_tesselate | geometry | geometry + postgis_sfcgal | public | st_volume | geometry | double precision + postgis_topology | topology | _asgmledge | edge_id integer, start_node integer, end_node integer, line geometry, visitedtable regclass, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _asgmlface | toponame text, face_id integer, visitedtable regclass, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _asgmlnode | id integer, point geometry, nsprefix_in text, prec integer, options integer, idprefix text, gmlver integer | text + postgis_topology | topology | _checkedgelinking | curedge_edge_id integer, prevedge_edge_id integer, prevedge_next_left_edge integer, prevedge_next_right_edge integer | topology.validatetopology_returntype + postgis_topology | topology | _st_adjacentedges | atopology character varying, anode integer, anedge integer | integer[] + postgis_topology | topology | _st_mintolerance | ageom geometry | double precision + postgis_topology | topology | _st_mintolerance | atopology character varying, ageom geometry | double precision + postgis_topology | topology | _validatetopologyedgelinking | bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | _validatetopologygetfaceshellmaximaledgering | atopology character varying, aface integer | geometry + postgis_topology | topology | _validatetopologygetringedges | starting_edge integer | integer[] + postgis_topology | topology | _validatetopologyrings | bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | addedge | atopology character varying, aline geometry | integer + postgis_topology | topology | addface | atopology character varying, apoly geometry, force_new boolean | integer + postgis_topology | topology | addnode | atopology character varying, apoint geometry, allowedgesplitting boolean, setcontainingface boolean | integer + postgis_topology | topology | addtopogeometrycolumn | toponame character varying, schema character varying, tbl character varying, col character varying, ltype character varying, child integer | integer + postgis_topology | topology | addtopogeometrycolumn | character varying, character varying, character varying, character varying, character varying | integer + postgis_topology | topology | addtosearchpath | a_schema_name character varying | text + postgis_topology | topology | asgml | tg topology.topogeometry | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, opts integer | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, vis regclass | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix_in text, precision_in integer, options_in integer, visitedtable regclass, idprefix text, gmlver integer | text + postgis_topology | topology | asgml | tg topology.topogeometry, nsprefix text, prec integer, options integer, visitedtable regclass, idprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass, nsprefix text | text + postgis_topology | topology | asgml | tg topology.topogeometry, visitedtable regclass | text + postgis_topology | topology | astopojson | tg topology.topogeometry, edgemaptable regclass | text + postgis_topology | topology | cleartopogeom | tg topology.topogeometry | topology.topogeometry + postgis_topology | topology | copytopology | atopology character varying, newtopo character varying | integer + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer, tg_objs topology.topoelementarray | topology.topogeometry + postgis_topology | topology | createtopogeom | toponame character varying, tg_type integer, layer_id integer | topology.topogeometry + postgis_topology | topology | createtopology | atopology character varying, srid integer, prec double precision, hasz boolean | integer + postgis_topology | topology | createtopology | character varying, integer | integer + postgis_topology | topology | createtopology | toponame character varying, srid integer, prec double precision | integer + postgis_topology | topology | createtopology | character varying | integer + postgis_topology | topology | droptopogeometrycolumn | schema character varying, tbl character varying, col character varying | text + postgis_topology | topology | droptopology | atopology character varying | text + postgis_topology | topology | equals | tg1 topology.topogeometry, tg2 topology.topogeometry | boolean + postgis_topology | topology | findlayer | tg topology.topogeometry | topology.layer + postgis_topology | topology | findlayer | schema_name name, table_name name, feature_column name | topology.layer + postgis_topology | topology | findlayer | topology_id integer, layer_id integer | topology.layer + postgis_topology | topology | findlayer | layer_table regclass, feature_column name | topology.layer + postgis_topology | topology | findtopology | integer | topology.topology + postgis_topology | topology | findtopology | text | topology.topology + postgis_topology | topology | findtopology | name, name, name | topology.topology + postgis_topology | topology | findtopology | topology.topogeometry | topology.topology + postgis_topology | topology | findtopology | regclass, name | topology.topology + postgis_topology | topology | geometry | topogeom topology.topogeometry | geometry + postgis_topology | topology | geometrytype | tg topology.topogeometry | text + postgis_topology | topology | getedgebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getfacebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getfacecontainingpoint | atopology text, apoint geometry | integer + postgis_topology | topology | getnodebypoint | atopology character varying, apoint geometry, tol1 double precision | integer + postgis_topology | topology | getnodeedges | atopology character varying, anode integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | getringedges | atopology character varying, anedge integer, maxedges integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | gettopogeomelementarray | tg topology.topogeometry | topology.topoelementarray + postgis_topology | topology | gettopogeomelementarray | toponame character varying, layer_id integer, tgid integer | topology.topoelementarray + postgis_topology | topology | gettopogeomelements | tg topology.topogeometry | SETOF topology.topoelement + postgis_topology | topology | gettopogeomelements | toponame character varying, layerid integer, tgid integer | SETOF topology.topoelement + postgis_topology | topology | gettopologyid | toponame character varying | integer + postgis_topology | topology | gettopologyname | topoid integer | character varying + postgis_topology | topology | gettopologysrid | toponame character varying | integer + postgis_topology | topology | intersects | tg1 topology.topogeometry, tg2 topology.topogeometry | boolean + postgis_topology | topology | layertrigger | | trigger + postgis_topology | topology | polygonize | toponame character varying | text + postgis_topology | topology | populate_topology_layer | | TABLE(schema_name text, table_name text, feature_column text) + postgis_topology | topology | postgis_topology_scripts_installed | | text + postgis_topology | topology | relationtrigger | | trigger + postgis_topology | topology | removeunusedprimitives | atopology text, bbox geometry | integer + postgis_topology | topology | st_addedgemodface | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addedgenewfaces | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addisoedge | atopology character varying, anode integer, anothernode integer, acurve geometry | integer + postgis_topology | topology | st_addisonode | atopology character varying, aface integer, apoint geometry | integer + postgis_topology | topology | st_changeedgegeom | atopology character varying, anedge integer, acurve geometry | text + postgis_topology | topology | st_createtopogeo | atopology character varying, acollection geometry | text + postgis_topology | topology | st_geometrytype | tg topology.topogeometry | text + postgis_topology | topology | st_getfaceedges | toponame character varying, face_id integer | SETOF topology.getfaceedges_returntype + postgis_topology | topology | st_getfacegeometry | toponame character varying, aface integer | geometry + postgis_topology | topology | st_inittopogeo | atopology character varying | text + postgis_topology | topology | st_modedgeheal | toponame character varying, e1id integer, e2id integer | integer + postgis_topology | topology | st_modedgesplit | atopology character varying, anedge integer, apoint geometry | integer + postgis_topology | topology | st_moveisonode | atopology character varying, anode integer, apoint geometry | text + postgis_topology | topology | st_newedgeheal | toponame character varying, e1id integer, e2id integer | integer + postgis_topology | topology | st_newedgessplit | atopology character varying, anedge integer, apoint geometry | integer + postgis_topology | topology | st_remedgemodface | toponame character varying, e1id integer | integer + postgis_topology | topology | st_remedgenewface | toponame character varying, e1id integer | integer + postgis_topology | topology | st_remisonode | character varying, integer | text + postgis_topology | topology | st_removeisoedge | atopology character varying, anedge integer | text + postgis_topology | topology | st_removeisonode | atopology character varying, anode integer | text + postgis_topology | topology | st_simplify | tg topology.topogeometry, tolerance double precision | geometry + postgis_topology | topology | st_srid | tg topology.topogeometry | integer + postgis_topology | topology | topoelementarray_agg | topology.topoelement | topology.topoelementarray + postgis_topology | topology | topoelementarray_append | topology.topoelementarray, topology.topoelement | topology.topoelementarray + postgis_topology | topology | topogeo_addgeometry | atopology character varying, ageom geometry, tolerance double precision | void + postgis_topology | topology | topogeo_addlinestring | atopology character varying, aline geometry, tolerance double precision | SETOF integer + postgis_topology | topology | topogeo_addpoint | atopology character varying, apoint geometry, tolerance double precision | integer + postgis_topology | topology | topogeo_addpolygon | atopology character varying, apoly geometry, tolerance double precision | SETOF integer + postgis_topology | topology | topogeom_addelement | tg topology.topogeometry, el topology.topoelement | topology.topogeometry + postgis_topology | topology | topogeom_addtopogeom | tgt topology.topogeometry, src topology.topogeometry | topology.topogeometry + postgis_topology | topology | topogeom_remelement | tg topology.topogeometry, el topology.topoelement | topology.topogeometry + postgis_topology | topology | topologysummary | atopology character varying | text + postgis_topology | topology | totopogeom | ageom geometry, atopology character varying, alayer integer, atolerance double precision | topology.topogeometry + postgis_topology | topology | totopogeom | ageom geometry, tg topology.topogeometry, atolerance double precision | topology.topogeometry + postgis_topology | topology | validatetopology | toponame character varying, bbox geometry | SETOF topology.validatetopology_returntype + postgis_topology | topology | validatetopologyrelation | toponame character varying | TABLE(error text, layer_id integer, topogeo_id integer, element_id integer) + postgres_fdw | public | postgres_fdw_disconnect | text | boolean + postgres_fdw | public | postgres_fdw_disconnect_all | | boolean + postgres_fdw | public | postgres_fdw_get_connections | OUT server_name text, OUT valid boolean | SETOF record + postgres_fdw | public | postgres_fdw_handler | | fdw_handler + postgres_fdw | public | postgres_fdw_validator | text[], oid | void + refint | public | check_foreign_key | | trigger + refint | public | check_primary_key | | trigger + rum | public | rum_anyarray_config | internal | void + rum | public | rum_anyarray_consistent | internal, smallint, anyarray, integer, internal, internal, internal, internal | boolean + rum | public | rum_anyarray_distance | anyarray, anyarray | double precision + rum | public | rum_anyarray_ordering | internal, smallint, anyarray, integer, internal, internal, internal, internal, internal | double precision + rum | public | rum_anyarray_similar | anyarray, anyarray | boolean + rum | public | rum_bit_compare_prefix | bit, bit, smallint, internal | integer + rum | public | rum_bit_extract_query | bit, internal, smallint, internal, internal | internal + rum | public | rum_bit_extract_value | bit, internal | internal + rum | public | rum_btree_consistent | internal, smallint, internal, integer, internal, internal, internal, internal | boolean + rum | public | rum_bytea_compare_prefix | bytea, bytea, smallint, internal | integer + rum | public | rum_bytea_extract_query | bytea, internal, smallint, internal, internal | internal + rum | public | rum_bytea_extract_value | bytea, internal | internal + rum | public | rum_char_compare_prefix | "char", "char", smallint, internal | integer + rum | public | rum_char_extract_query | "char", internal, smallint, internal, internal | internal + rum | public | rum_char_extract_value | "char", internal | internal + rum | public | rum_cidr_compare_prefix | cidr, cidr, smallint, internal | integer + rum | public | rum_cidr_extract_query | cidr, internal, smallint, internal, internal | internal + rum | public | rum_cidr_extract_value | cidr, internal | internal + rum | public | rum_date_compare_prefix | date, date, smallint, internal | integer + rum | public | rum_date_extract_query | date, internal, smallint, internal, internal | internal + rum | public | rum_date_extract_value | date, internal | internal + rum | public | rum_extract_anyarray | anyarray, internal, internal, internal, internal | internal + rum | public | rum_extract_anyarray_query | anyarray, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsquery | tsquery, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsquery_hash | tsquery, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_extract_tsvector | tsvector, internal, internal, internal, internal | internal + rum | public | rum_extract_tsvector_hash | tsvector, internal, internal, internal, internal | internal + rum | public | rum_float4_compare_prefix | real, real, smallint, internal | integer + rum | public | rum_float4_config | internal | void + rum | public | rum_float4_distance | real, real | double precision + rum | public | rum_float4_extract_query | real, internal, smallint, internal, internal | internal + rum | public | rum_float4_extract_value | real, internal | internal + rum | public | rum_float4_key_distance | real, real, smallint | double precision + rum | public | rum_float4_left_distance | real, real | double precision + rum | public | rum_float4_outer_distance | real, real, smallint | double precision + rum | public | rum_float4_right_distance | real, real | double precision + rum | public | rum_float8_compare_prefix | double precision, double precision, smallint, internal | integer + rum | public | rum_float8_config | internal | void + rum | public | rum_float8_distance | double precision, double precision | double precision + rum | public | rum_float8_extract_query | double precision, internal, smallint, internal, internal | internal + rum | public | rum_float8_extract_value | double precision, internal | internal + rum | public | rum_float8_key_distance | double precision, double precision, smallint | double precision + rum | public | rum_float8_left_distance | double precision, double precision | double precision + rum | public | rum_float8_outer_distance | double precision, double precision, smallint | double precision + rum | public | rum_float8_right_distance | double precision, double precision | double precision + rum | public | rum_inet_compare_prefix | inet, inet, smallint, internal | integer + rum | public | rum_inet_extract_query | inet, internal, smallint, internal, internal | internal + rum | public | rum_inet_extract_value | inet, internal | internal + rum | public | rum_int2_compare_prefix | smallint, smallint, smallint, internal | integer + rum | public | rum_int2_config | internal | void + rum | public | rum_int2_distance | smallint, smallint | double precision + rum | public | rum_int2_extract_query | smallint, internal, smallint, internal, internal | internal + rum | public | rum_int2_extract_value | smallint, internal | internal + rum | public | rum_int2_key_distance | smallint, smallint, smallint | double precision + rum | public | rum_int2_left_distance | smallint, smallint | double precision + rum | public | rum_int2_outer_distance | smallint, smallint, smallint | double precision + rum | public | rum_int2_right_distance | smallint, smallint | double precision + rum | public | rum_int4_compare_prefix | integer, integer, smallint, internal | integer + rum | public | rum_int4_config | internal | void + rum | public | rum_int4_distance | integer, integer | double precision + rum | public | rum_int4_extract_query | integer, internal, smallint, internal, internal | internal + rum | public | rum_int4_extract_value | integer, internal | internal + rum | public | rum_int4_key_distance | integer, integer, smallint | double precision + rum | public | rum_int4_left_distance | integer, integer | double precision + rum | public | rum_int4_outer_distance | integer, integer, smallint | double precision + rum | public | rum_int4_right_distance | integer, integer | double precision + rum | public | rum_int8_compare_prefix | bigint, bigint, smallint, internal | integer + rum | public | rum_int8_config | internal | void + rum | public | rum_int8_distance | bigint, bigint | double precision + rum | public | rum_int8_extract_query | bigint, internal, smallint, internal, internal | internal + rum | public | rum_int8_extract_value | bigint, internal | internal + rum | public | rum_int8_key_distance | bigint, bigint, smallint | double precision + rum | public | rum_int8_left_distance | bigint, bigint | double precision + rum | public | rum_int8_outer_distance | bigint, bigint, smallint | double precision + rum | public | rum_int8_right_distance | bigint, bigint | double precision + rum | public | rum_interval_compare_prefix | interval, interval, smallint, internal | integer + rum | public | rum_interval_extract_query | interval, internal, smallint, internal, internal | internal + rum | public | rum_interval_extract_value | interval, internal | internal + rum | public | rum_macaddr_compare_prefix | macaddr, macaddr, smallint, internal | integer + rum | public | rum_macaddr_extract_query | macaddr, internal, smallint, internal, internal | internal + rum | public | rum_macaddr_extract_value | macaddr, internal | internal + rum | public | rum_money_compare_prefix | money, money, smallint, internal | integer + rum | public | rum_money_config | internal | void + rum | public | rum_money_distance | money, money | double precision + rum | public | rum_money_extract_query | money, internal, smallint, internal, internal | internal + rum | public | rum_money_extract_value | money, internal | internal + rum | public | rum_money_key_distance | money, money, smallint | double precision + rum | public | rum_money_left_distance | money, money | double precision + rum | public | rum_money_outer_distance | money, money, smallint | double precision + rum | public | rum_money_right_distance | money, money | double precision + rum | public | rum_numeric_cmp | numeric, numeric | integer + rum | public | rum_numeric_compare_prefix | numeric, numeric, smallint, internal | integer + rum | public | rum_numeric_extract_query | numeric, internal, smallint, internal, internal | internal + rum | public | rum_numeric_extract_value | numeric, internal | internal + rum | public | rum_oid_compare_prefix | oid, oid, smallint, internal | integer + rum | public | rum_oid_config | internal | void + rum | public | rum_oid_distance | oid, oid | double precision + rum | public | rum_oid_extract_query | oid, internal, smallint, internal, internal | internal + rum | public | rum_oid_extract_value | oid, internal | internal + rum | public | rum_oid_key_distance | oid, oid, smallint | double precision + rum | public | rum_oid_left_distance | oid, oid | double precision + rum | public | rum_oid_outer_distance | oid, oid, smallint | double precision + rum | public | rum_oid_right_distance | oid, oid | double precision + rum | public | rum_text_compare_prefix | text, text, smallint, internal | integer + rum | public | rum_text_extract_query | text, internal, smallint, internal, internal | internal + rum | public | rum_text_extract_value | text, internal | internal + rum | public | rum_time_compare_prefix | time without time zone, time without time zone, smallint, internal | integer + rum | public | rum_time_extract_query | time without time zone, internal, smallint, internal, internal | internal + rum | public | rum_time_extract_value | time without time zone, internal | internal + rum | public | rum_timestamp_compare_prefix | timestamp without time zone, timestamp without time zone, smallint, internal | integer + rum | public | rum_timestamp_config | internal | void + rum | public | rum_timestamp_consistent | internal, smallint, timestamp without time zone, integer, internal, internal, internal, internal | boolean + rum | public | rum_timestamp_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamp_extract_query | timestamp without time zone, internal, smallint, internal, internal, internal, internal | internal + rum | public | rum_timestamp_extract_value | timestamp without time zone, internal, internal, internal, internal | internal + rum | public | rum_timestamp_key_distance | timestamp without time zone, timestamp without time zone, smallint | double precision + rum | public | rum_timestamp_left_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamp_outer_distance | timestamp without time zone, timestamp without time zone, smallint | double precision + rum | public | rum_timestamp_right_distance | timestamp without time zone, timestamp without time zone | double precision + rum | public | rum_timestamptz_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timestamptz_key_distance | timestamp with time zone, timestamp with time zone, smallint | double precision + rum | public | rum_timestamptz_left_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timestamptz_right_distance | timestamp with time zone, timestamp with time zone | double precision + rum | public | rum_timetz_compare_prefix | time with time zone, time with time zone, smallint, internal | integer + rum | public | rum_timetz_extract_query | time with time zone, internal, smallint, internal, internal | internal + rum | public | rum_timetz_extract_value | time with time zone, internal | internal + rum | public | rum_ts_distance | tsvector, tsquery, integer | real + rum | public | rum_ts_distance | tsvector, tsquery | real + rum | public | rum_ts_distance | tsvector, rum_distance_query | real + rum | public | rum_ts_join_pos | internal, internal | bytea + rum | public | rum_ts_score | tsvector, tsquery, integer | real + rum | public | rum_ts_score | tsvector, tsquery | real + rum | public | rum_ts_score | tsvector, rum_distance_query | real + rum | public | rum_tsquery_addon_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsquery_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsquery_distance | internal, smallint, tsvector, integer, internal, internal, internal, internal, internal | double precision + rum | public | rum_tsquery_pre_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | rum_tsvector_config | internal | void + rum | public | rum_varbit_compare_prefix | bit varying, bit varying, smallint, internal | integer + rum | public | rum_varbit_extract_query | bit varying, internal, smallint, internal, internal | internal + rum | public | rum_varbit_extract_value | bit varying, internal | internal + rum | public | rumhandler | internal | index_am_handler + rum | public | ruminv_extract_tsquery | tsquery, internal, internal, internal, internal | internal + rum | public | ruminv_extract_tsvector | tsvector, internal, smallint, internal, internal, internal, internal | internal + rum | public | ruminv_tsquery_config | internal | void + rum | public | ruminv_tsvector_consistent | internal, smallint, tsvector, integer, internal, internal, internal, internal | boolean + rum | public | tsquery_to_distance_query | tsquery | rum_distance_query + seg | public | gseg_consistent | internal, seg, smallint, oid, internal | boolean + seg | public | gseg_penalty | internal, internal, internal | internal + seg | public | gseg_picksplit | internal, internal | internal + seg | public | gseg_same | seg, seg, internal | internal + seg | public | gseg_union | internal, internal | seg + seg | public | seg_center | seg | real + seg | public | seg_cmp | seg, seg | integer + seg | public | seg_contained | seg, seg | boolean + seg | public | seg_contains | seg, seg | boolean + seg | public | seg_different | seg, seg | boolean + seg | public | seg_ge | seg, seg | boolean + seg | public | seg_gt | seg, seg | boolean + seg | public | seg_in | cstring | seg + seg | public | seg_inter | seg, seg | seg + seg | public | seg_le | seg, seg | boolean + seg | public | seg_left | seg, seg | boolean + seg | public | seg_lower | seg | real + seg | public | seg_lt | seg, seg | boolean + seg | public | seg_out | seg | cstring + seg | public | seg_over_left | seg, seg | boolean + seg | public | seg_over_right | seg, seg | boolean + seg | public | seg_overlap | seg, seg | boolean + seg | public | seg_right | seg, seg | boolean + seg | public | seg_same | seg, seg | boolean + seg | public | seg_size | seg | real + seg | public | seg_union | seg, seg | seg + seg | public | seg_upper | seg | real + sslinfo | public | ssl_cipher | | text + sslinfo | public | ssl_client_cert_present | | boolean + sslinfo | public | ssl_client_dn | | text + sslinfo | public | ssl_client_dn_field | text | text + sslinfo | public | ssl_client_serial | | numeric + sslinfo | public | ssl_extension_info | OUT name text, OUT value text, OUT critical boolean | SETOF record + sslinfo | public | ssl_is_used | | boolean + sslinfo | public | ssl_issuer_dn | | text + sslinfo | public | ssl_issuer_field | text | text + sslinfo | public | ssl_version | | text + supabase_vault | vault | _crypto_aead_det_decrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_encrypt | message bytea, additional bytea, key_id bigint, context bytea, nonce bytea | bytea + supabase_vault | vault | _crypto_aead_det_noncegen | | bytea + supabase_vault | vault | create_secret | new_secret text, new_name text, new_description text, new_key_id uuid | uuid + supabase_vault | vault | update_secret | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid | void + tablefunc | public | connectby | text, text, text, text, integer, text | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer, text | SETOF record + tablefunc | public | connectby | text, text, text, text, integer | SETOF record + tablefunc | public | connectby | text, text, text, text, text, integer | SETOF record + tablefunc | public | crosstab | text | SETOF record + tablefunc | public | crosstab | text, integer | SETOF record + tablefunc | public | crosstab | text, text | SETOF record + tablefunc | public | crosstab2 | text | SETOF tablefunc_crosstab_2 + tablefunc | public | crosstab3 | text | SETOF tablefunc_crosstab_3 + tablefunc | public | crosstab4 | text | SETOF tablefunc_crosstab_4 + tablefunc | public | normal_rand | integer, double precision, double precision | SETOF double precision + tcn | public | triggered_change_notification | | trigger + tsm_system_rows | public | system_rows | internal | tsm_handler + unaccent | public | unaccent | text | text + unaccent | public | unaccent | regdictionary, text | text + unaccent | public | unaccent_init | internal | internal + unaccent | public | unaccent_lexize | internal, internal, internal, internal | internal + uuid-ossp | extensions | uuid_generate_v1 | | uuid + uuid-ossp | extensions | uuid_generate_v1mc | | uuid + uuid-ossp | extensions | uuid_generate_v3 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_generate_v4 | | uuid + uuid-ossp | extensions | uuid_generate_v5 | namespace uuid, name text | uuid + uuid-ossp | extensions | uuid_nil | | uuid + uuid-ossp | extensions | uuid_ns_dns | | uuid + uuid-ossp | extensions | uuid_ns_oid | | uuid + uuid-ossp | extensions | uuid_ns_url | | uuid + uuid-ossp | extensions | uuid_ns_x500 | | uuid + vector | public | array_to_halfvec | real[], integer, boolean | halfvec + vector | public | array_to_halfvec | integer[], integer, boolean | halfvec + vector | public | array_to_halfvec | numeric[], integer, boolean | halfvec + vector | public | array_to_halfvec | double precision[], integer, boolean | halfvec + vector | public | array_to_sparsevec | real[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | integer[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | numeric[], integer, boolean | sparsevec + vector | public | array_to_sparsevec | double precision[], integer, boolean | sparsevec + vector | public | array_to_vector | real[], integer, boolean | vector + vector | public | array_to_vector | integer[], integer, boolean | vector + vector | public | array_to_vector | numeric[], integer, boolean | vector + vector | public | array_to_vector | double precision[], integer, boolean | vector + vector | public | avg | vector | vector + vector | public | avg | halfvec | halfvec + vector | public | binary_quantize | vector | bit + vector | public | binary_quantize | halfvec | bit + vector | public | cosine_distance | vector, vector | double precision + vector | public | cosine_distance | halfvec, halfvec | double precision + vector | public | cosine_distance | sparsevec, sparsevec | double precision + vector | public | halfvec | halfvec, integer, boolean | halfvec + vector | public | halfvec_accum | double precision[], halfvec | double precision[] + vector | public | halfvec_add | halfvec, halfvec | halfvec + vector | public | halfvec_avg | double precision[] | halfvec + vector | public | halfvec_cmp | halfvec, halfvec | integer + vector | public | halfvec_combine | double precision[], double precision[] | double precision[] + vector | public | halfvec_concat | halfvec, halfvec | halfvec + vector | public | halfvec_eq | halfvec, halfvec | boolean + vector | public | halfvec_ge | halfvec, halfvec | boolean + vector | public | halfvec_gt | halfvec, halfvec | boolean + vector | public | halfvec_in | cstring, oid, integer | halfvec + vector | public | halfvec_l2_squared_distance | halfvec, halfvec | double precision + vector | public | halfvec_le | halfvec, halfvec | boolean + vector | public | halfvec_lt | halfvec, halfvec | boolean + vector | public | halfvec_mul | halfvec, halfvec | halfvec + vector | public | halfvec_ne | halfvec, halfvec | boolean + vector | public | halfvec_negative_inner_product | halfvec, halfvec | double precision + vector | public | halfvec_out | halfvec | cstring + vector | public | halfvec_recv | internal, oid, integer | halfvec + vector | public | halfvec_send | halfvec | bytea + vector | public | halfvec_spherical_distance | halfvec, halfvec | double precision + vector | public | halfvec_sub | halfvec, halfvec | halfvec + vector | public | halfvec_to_float4 | halfvec, integer, boolean | real[] + vector | public | halfvec_to_sparsevec | halfvec, integer, boolean | sparsevec + vector | public | halfvec_to_vector | halfvec, integer, boolean | vector + vector | public | halfvec_typmod_in | cstring[] | integer + vector | public | hamming_distance | bit, bit | double precision + vector | public | hnsw_bit_support | internal | internal + vector | public | hnsw_halfvec_support | internal | internal + vector | public | hnsw_sparsevec_support | internal | internal + vector | public | hnswhandler | internal | index_am_handler + vector | public | inner_product | vector, vector | double precision + vector | public | inner_product | halfvec, halfvec | double precision + vector | public | inner_product | sparsevec, sparsevec | double precision + vector | public | ivfflat_bit_support | internal | internal + vector | public | ivfflat_halfvec_support | internal | internal + vector | public | ivfflathandler | internal | index_am_handler + vector | public | jaccard_distance | bit, bit | double precision + vector | public | l1_distance | vector, vector | double precision + vector | public | l1_distance | halfvec, halfvec | double precision + vector | public | l1_distance | sparsevec, sparsevec | double precision + vector | public | l2_distance | vector, vector | double precision + vector | public | l2_distance | halfvec, halfvec | double precision + vector | public | l2_distance | sparsevec, sparsevec | double precision + vector | public | l2_norm | halfvec | double precision + vector | public | l2_norm | sparsevec | double precision + vector | public | l2_normalize | vector | vector + vector | public | l2_normalize | halfvec | halfvec + vector | public | l2_normalize | sparsevec | sparsevec + vector | public | sparsevec | sparsevec, integer, boolean | sparsevec + vector | public | sparsevec_cmp | sparsevec, sparsevec | integer + vector | public | sparsevec_eq | sparsevec, sparsevec | boolean + vector | public | sparsevec_ge | sparsevec, sparsevec | boolean + vector | public | sparsevec_gt | sparsevec, sparsevec | boolean + vector | public | sparsevec_in | cstring, oid, integer | sparsevec + vector | public | sparsevec_l2_squared_distance | sparsevec, sparsevec | double precision + vector | public | sparsevec_le | sparsevec, sparsevec | boolean + vector | public | sparsevec_lt | sparsevec, sparsevec | boolean + vector | public | sparsevec_ne | sparsevec, sparsevec | boolean + vector | public | sparsevec_negative_inner_product | sparsevec, sparsevec | double precision + vector | public | sparsevec_out | sparsevec | cstring + vector | public | sparsevec_recv | internal, oid, integer | sparsevec + vector | public | sparsevec_send | sparsevec | bytea + vector | public | sparsevec_to_halfvec | sparsevec, integer, boolean | halfvec + vector | public | sparsevec_to_vector | sparsevec, integer, boolean | vector + vector | public | sparsevec_typmod_in | cstring[] | integer + vector | public | subvector | halfvec, integer, integer | halfvec + vector | public | subvector | vector, integer, integer | vector + vector | public | sum | vector | vector + vector | public | sum | halfvec | halfvec + vector | public | vector | vector, integer, boolean | vector + vector | public | vector_accum | double precision[], vector | double precision[] + vector | public | vector_add | vector, vector | vector + vector | public | vector_avg | double precision[] | vector + vector | public | vector_cmp | vector, vector | integer + vector | public | vector_combine | double precision[], double precision[] | double precision[] + vector | public | vector_concat | vector, vector | vector + vector | public | vector_dims | vector | integer + vector | public | vector_dims | halfvec | integer + vector | public | vector_eq | vector, vector | boolean + vector | public | vector_ge | vector, vector | boolean + vector | public | vector_gt | vector, vector | boolean + vector | public | vector_in | cstring, oid, integer | vector + vector | public | vector_l2_squared_distance | vector, vector | double precision + vector | public | vector_le | vector, vector | boolean + vector | public | vector_lt | vector, vector | boolean + vector | public | vector_mul | vector, vector | vector + vector | public | vector_ne | vector, vector | boolean + vector | public | vector_negative_inner_product | vector, vector | double precision + vector | public | vector_norm | vector | double precision + vector | public | vector_out | vector | cstring + vector | public | vector_recv | internal, oid, integer | vector + vector | public | vector_send | vector | bytea + vector | public | vector_spherical_distance | vector, vector | double precision + vector | public | vector_sub | vector, vector | vector + vector | public | vector_to_float4 | vector, integer, boolean | real[] + vector | public | vector_to_halfvec | vector, integer, boolean | halfvec + vector | public | vector_to_sparsevec | vector, integer, boolean | sparsevec + vector | public | vector_typmod_in | cstring[] | integer + wrappers | public | airtable_fdw_handler | | fdw_handler + wrappers | public | airtable_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | airtable_fdw_validator | options text[], catalog oid | void + wrappers | public | auth0_fdw_handler | | fdw_handler + wrappers | public | auth0_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | auth0_fdw_validator | options text[], catalog oid | void + wrappers | public | big_query_fdw_handler | | fdw_handler + wrappers | public | big_query_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | big_query_fdw_validator | options text[], catalog oid | void + wrappers | public | click_house_fdw_handler | | fdw_handler + wrappers | public | click_house_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | click_house_fdw_validator | options text[], catalog oid | void + wrappers | public | cognito_fdw_handler | | fdw_handler + wrappers | public | cognito_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | cognito_fdw_validator | options text[], catalog oid | void + wrappers | public | firebase_fdw_handler | | fdw_handler + wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | firebase_fdw_validator | options text[], catalog oid | void + wrappers | public | hello_world_fdw_handler | | fdw_handler + wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void + wrappers | public | logflare_fdw_handler | | fdw_handler + wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | logflare_fdw_validator | options text[], catalog oid | void + wrappers | public | mssql_fdw_handler | | fdw_handler + wrappers | public | mssql_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | mssql_fdw_validator | options text[], catalog oid | void + wrappers | public | redis_fdw_handler | | fdw_handler + wrappers | public | redis_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | redis_fdw_validator | options text[], catalog oid | void + wrappers | public | s3_fdw_handler | | fdw_handler + wrappers | public | s3_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | s3_fdw_validator | options text[], catalog oid | void + wrappers | public | stripe_fdw_handler | | fdw_handler + wrappers | public | stripe_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | stripe_fdw_validator | options text[], catalog oid | void + wrappers | public | wasm_fdw_handler | | fdw_handler + wrappers | public | wasm_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | wasm_fdw_validator | options text[], catalog oid | void + xml2 | public | xml_encode_special_chars | text | text + xml2 | public | xml_valid | text | boolean + xml2 | public | xpath_bool | text, text | boolean + xml2 | public | xpath_list | text, text | text + xml2 | public | xpath_list | text, text, text | text + xml2 | public | xpath_nodeset | text, text, text, text | text + xml2 | public | xpath_nodeset | text, text | text + xml2 | public | xpath_nodeset | text, text, text | text + xml2 | public | xpath_number | text, text | real + xml2 | public | xpath_string | text, text | text + xml2 | public | xpath_table | text, text, text, text, text | SETOF record + xml2 | public | xslt_process | text, text | text + xml2 | public | xslt_process | text, text, text | text +(4708 rows) + +/* + +Monitor extension public table/view/matview/index interface + +*/ +select + e.extname as extension_name, + n.nspname as schema_name, + pc.relname as entity_name, + pa.attname +from + pg_catalog.pg_class pc + join pg_catalog.pg_namespace n + on n.oid = pc.relnamespace + join pg_catalog.pg_depend d + on d.objid = pc.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid + left join pg_catalog.pg_attribute pa + on pa.attrelid = pc.oid + and pa.attnum > 0 + and not pa.attisdropped +where + d.deptype = 'e' + and pc.relkind in ('r', 'v', 'm', 'i') +order by + e.extname, + n.nspname, + pc.relname, + pa.attname; + extension_name | schema_name | entity_name | attname +------------------------------+-------------+-------------------------+------------------------ + address_standardizer_data_us | public | us_gaz | id + address_standardizer_data_us | public | us_gaz | is_custom + address_standardizer_data_us | public | us_gaz | seq + address_standardizer_data_us | public | us_gaz | stdword + address_standardizer_data_us | public | us_gaz | token + address_standardizer_data_us | public | us_gaz | word + address_standardizer_data_us | public | us_lex | id + address_standardizer_data_us | public | us_lex | is_custom + address_standardizer_data_us | public | us_lex | seq + address_standardizer_data_us | public | us_lex | stdword + address_standardizer_data_us | public | us_lex | token + address_standardizer_data_us | public | us_lex | word + address_standardizer_data_us | public | us_rules | id + address_standardizer_data_us | public | us_rules | is_custom + address_standardizer_data_us | public | us_rules | rule + hypopg | public | hypopg_hidden_indexes | am_name + hypopg | public | hypopg_hidden_indexes | index_name + hypopg | public | hypopg_hidden_indexes | indexrelid + hypopg | public | hypopg_hidden_indexes | is_hypo + hypopg | public | hypopg_hidden_indexes | schema_name + hypopg | public | hypopg_hidden_indexes | table_name + hypopg | public | hypopg_list_indexes | am_name + hypopg | public | hypopg_list_indexes | index_name + hypopg | public | hypopg_list_indexes | indexrelid + hypopg | public | hypopg_list_indexes | schema_name + hypopg | public | hypopg_list_indexes | table_name + pg_buffercache | public | pg_buffercache | bufferid + pg_buffercache | public | pg_buffercache | isdirty + pg_buffercache | public | pg_buffercache | pinning_backends + pg_buffercache | public | pg_buffercache | relblocknumber + pg_buffercache | public | pg_buffercache | reldatabase + pg_buffercache | public | pg_buffercache | relfilenode + pg_buffercache | public | pg_buffercache | relforknumber + pg_buffercache | public | pg_buffercache | reltablespace + pg_buffercache | public | pg_buffercache | usagecount + pg_net | net | _http_response | content + pg_net | net | _http_response | content_type + pg_net | net | _http_response | created + pg_net | net | _http_response | error_msg + pg_net | net | _http_response | headers + pg_net | net | _http_response | id + pg_net | net | _http_response | status_code + pg_net | net | _http_response | timed_out + pg_net | net | http_request_queue | body + pg_net | net | http_request_queue | headers + pg_net | net | http_request_queue | id + pg_net | net | http_request_queue | method + pg_net | net | http_request_queue | timeout_milliseconds + pg_net | net | http_request_queue | url + pg_repack | repack | primary_keys | indexrelid + pg_repack | repack | primary_keys | indrelid + pg_repack | repack | tables | alter_col_storage + pg_repack | repack | tables | ckey + pg_repack | repack | tables | ckid + pg_repack | repack | tables | copy_data + pg_repack | repack | tables | create_log + pg_repack | repack | tables | create_pktype + pg_repack | repack | tables | create_table + pg_repack | repack | tables | create_trigger + pg_repack | repack | tables | delete_log + pg_repack | repack | tables | drop_columns + pg_repack | repack | tables | enable_trigger + pg_repack | repack | tables | lock_table + pg_repack | repack | tables | pkid + pg_repack | repack | tables | relid + pg_repack | repack | tables | relname + pg_repack | repack | tables | reltoastidxid + pg_repack | repack | tables | reltoastrelid + pg_repack | repack | tables | schemaname + pg_repack | repack | tables | sql_delete + pg_repack | repack | tables | sql_insert + pg_repack | repack | tables | sql_peek + pg_repack | repack | tables | sql_pop + pg_repack | repack | tables | sql_update + pg_repack | repack | tables | tablespace_orig + pg_stat_monitor | public | pg_stat_monitor | application_name + pg_stat_monitor | public | pg_stat_monitor | bucket + pg_stat_monitor | public | pg_stat_monitor | bucket_done + pg_stat_monitor | public | pg_stat_monitor | bucket_start_time + pg_stat_monitor | public | pg_stat_monitor | calls + pg_stat_monitor | public | pg_stat_monitor | client_ip + pg_stat_monitor | public | pg_stat_monitor | cmd_type + pg_stat_monitor | public | pg_stat_monitor | cmd_type_text + pg_stat_monitor | public | pg_stat_monitor | comments + pg_stat_monitor | public | pg_stat_monitor | cpu_sys_time + pg_stat_monitor | public | pg_stat_monitor | cpu_user_time + pg_stat_monitor | public | pg_stat_monitor | datname + pg_stat_monitor | public | pg_stat_monitor | dbid + pg_stat_monitor | public | pg_stat_monitor | elevel + pg_stat_monitor | public | pg_stat_monitor | jit_deform_count + pg_stat_monitor | public | pg_stat_monitor | jit_deform_time + pg_stat_monitor | public | pg_stat_monitor | jit_emission_count + pg_stat_monitor | public | pg_stat_monitor | jit_emission_time + pg_stat_monitor | public | pg_stat_monitor | jit_functions + pg_stat_monitor | public | pg_stat_monitor | jit_generation_time + pg_stat_monitor | public | pg_stat_monitor | jit_inlining_count + pg_stat_monitor | public | pg_stat_monitor | jit_inlining_time + pg_stat_monitor | public | pg_stat_monitor | jit_optimization_count + pg_stat_monitor | public | pg_stat_monitor | jit_optimization_time + pg_stat_monitor | public | pg_stat_monitor | local_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | local_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | local_blks_dirtied + pg_stat_monitor | public | pg_stat_monitor | local_blks_hit + pg_stat_monitor | public | pg_stat_monitor | local_blks_read + pg_stat_monitor | public | pg_stat_monitor | local_blks_written + pg_stat_monitor | public | pg_stat_monitor | max_exec_time + pg_stat_monitor | public | pg_stat_monitor | max_plan_time + pg_stat_monitor | public | pg_stat_monitor | mean_exec_time + pg_stat_monitor | public | pg_stat_monitor | mean_plan_time + pg_stat_monitor | public | pg_stat_monitor | message + pg_stat_monitor | public | pg_stat_monitor | min_exec_time + pg_stat_monitor | public | pg_stat_monitor | min_plan_time + pg_stat_monitor | public | pg_stat_monitor | minmax_stats_since + pg_stat_monitor | public | pg_stat_monitor | pgsm_query_id + pg_stat_monitor | public | pg_stat_monitor | planid + pg_stat_monitor | public | pg_stat_monitor | plans + pg_stat_monitor | public | pg_stat_monitor | query + pg_stat_monitor | public | pg_stat_monitor | query_plan + pg_stat_monitor | public | pg_stat_monitor | queryid + pg_stat_monitor | public | pg_stat_monitor | relations + pg_stat_monitor | public | pg_stat_monitor | resp_calls + pg_stat_monitor | public | pg_stat_monitor | rows + pg_stat_monitor | public | pg_stat_monitor | shared_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | shared_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | shared_blks_dirtied + pg_stat_monitor | public | pg_stat_monitor | shared_blks_hit + pg_stat_monitor | public | pg_stat_monitor | shared_blks_read + pg_stat_monitor | public | pg_stat_monitor | shared_blks_written + pg_stat_monitor | public | pg_stat_monitor | sqlcode + pg_stat_monitor | public | pg_stat_monitor | stats_since + pg_stat_monitor | public | pg_stat_monitor | stddev_exec_time + pg_stat_monitor | public | pg_stat_monitor | stddev_plan_time + pg_stat_monitor | public | pg_stat_monitor | temp_blk_read_time + pg_stat_monitor | public | pg_stat_monitor | temp_blk_write_time + pg_stat_monitor | public | pg_stat_monitor | temp_blks_read + pg_stat_monitor | public | pg_stat_monitor | temp_blks_written + pg_stat_monitor | public | pg_stat_monitor | top_query + pg_stat_monitor | public | pg_stat_monitor | top_queryid + pg_stat_monitor | public | pg_stat_monitor | toplevel + pg_stat_monitor | public | pg_stat_monitor | total_exec_time + pg_stat_monitor | public | pg_stat_monitor | total_plan_time + pg_stat_monitor | public | pg_stat_monitor | userid + pg_stat_monitor | public | pg_stat_monitor | username + pg_stat_monitor | public | pg_stat_monitor | wal_bytes + pg_stat_monitor | public | pg_stat_monitor | wal_fpi + pg_stat_monitor | public | pg_stat_monitor | wal_records + pg_stat_statements | extensions | pg_stat_statements | calls + pg_stat_statements | extensions | pg_stat_statements | dbid + pg_stat_statements | extensions | pg_stat_statements | jit_deform_count + pg_stat_statements | extensions | pg_stat_statements | jit_deform_time + pg_stat_statements | extensions | pg_stat_statements | jit_emission_count + pg_stat_statements | extensions | pg_stat_statements | jit_emission_time + pg_stat_statements | extensions | pg_stat_statements | jit_functions + pg_stat_statements | extensions | pg_stat_statements | jit_generation_time + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_count + pg_stat_statements | extensions | pg_stat_statements | jit_inlining_time + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_count + pg_stat_statements | extensions | pg_stat_statements | jit_optimization_time + pg_stat_statements | extensions | pg_stat_statements | local_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | local_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | local_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | local_blks_hit + pg_stat_statements | extensions | pg_stat_statements | local_blks_read + pg_stat_statements | extensions | pg_stat_statements | local_blks_written + pg_stat_statements | extensions | pg_stat_statements | max_exec_time + pg_stat_statements | extensions | pg_stat_statements | max_plan_time + pg_stat_statements | extensions | pg_stat_statements | mean_exec_time + pg_stat_statements | extensions | pg_stat_statements | mean_plan_time + pg_stat_statements | extensions | pg_stat_statements | min_exec_time + pg_stat_statements | extensions | pg_stat_statements | min_plan_time + pg_stat_statements | extensions | pg_stat_statements | minmax_stats_since + pg_stat_statements | extensions | pg_stat_statements | plans + pg_stat_statements | extensions | pg_stat_statements | query + pg_stat_statements | extensions | pg_stat_statements | queryid + pg_stat_statements | extensions | pg_stat_statements | rows + pg_stat_statements | extensions | pg_stat_statements | shared_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | shared_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | shared_blks_dirtied + pg_stat_statements | extensions | pg_stat_statements | shared_blks_hit + pg_stat_statements | extensions | pg_stat_statements | shared_blks_read + pg_stat_statements | extensions | pg_stat_statements | shared_blks_written + pg_stat_statements | extensions | pg_stat_statements | stats_since + pg_stat_statements | extensions | pg_stat_statements | stddev_exec_time + pg_stat_statements | extensions | pg_stat_statements | stddev_plan_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_read_time + pg_stat_statements | extensions | pg_stat_statements | temp_blk_write_time + pg_stat_statements | extensions | pg_stat_statements | temp_blks_read + pg_stat_statements | extensions | pg_stat_statements | temp_blks_written + pg_stat_statements | extensions | pg_stat_statements | toplevel + pg_stat_statements | extensions | pg_stat_statements | total_exec_time + pg_stat_statements | extensions | pg_stat_statements | total_plan_time + pg_stat_statements | extensions | pg_stat_statements | userid + pg_stat_statements | extensions | pg_stat_statements | wal_bytes + pg_stat_statements | extensions | pg_stat_statements | wal_fpi + pg_stat_statements | extensions | pg_stat_statements | wal_records + pg_stat_statements | extensions | pg_stat_statements_info | dealloc + pg_stat_statements | extensions | pg_stat_statements_info | stats_reset + pg_tle | pgtle | feature_info | feature + pg_tle | pgtle | feature_info | obj_identity + pg_tle | pgtle | feature_info | proname + pg_tle | pgtle | feature_info | schema_name + pgmq | pgmq | a_foo | archived_at + pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | message + pgmq | pgmq | a_foo | msg_id + pgmq | pgmq | a_foo | read_ct + pgmq | pgmq | a_foo | vt + pgmq | pgmq | meta | created_at + pgmq | pgmq | meta | is_partitioned + pgmq | pgmq | meta | is_unlogged + pgmq | pgmq | meta | queue_name + pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | message + pgmq | pgmq | q_foo | msg_id + pgmq | pgmq | q_foo | read_ct + pgmq | pgmq | q_foo | vt + pgsodium | pgsodium | decrypted_key | associated_data + pgsodium | pgsodium | decrypted_key | comment + pgsodium | pgsodium | decrypted_key | created + pgsodium | pgsodium | decrypted_key | decrypted_raw_key + pgsodium | pgsodium | decrypted_key | expires + pgsodium | pgsodium | decrypted_key | id + pgsodium | pgsodium | decrypted_key | key_context + pgsodium | pgsodium | decrypted_key | key_id + pgsodium | pgsodium | decrypted_key | key_type + pgsodium | pgsodium | decrypted_key | name + pgsodium | pgsodium | decrypted_key | parent_key + pgsodium | pgsodium | decrypted_key | raw_key + pgsodium | pgsodium | decrypted_key | raw_key_nonce + pgsodium | pgsodium | decrypted_key | status + pgsodium | pgsodium | key | associated_data + pgsodium | pgsodium | key | comment + pgsodium | pgsodium | key | created + pgsodium | pgsodium | key | expires + pgsodium | pgsodium | key | id + pgsodium | pgsodium | key | key_context + pgsodium | pgsodium | key | key_id + pgsodium | pgsodium | key | key_type + pgsodium | pgsodium | key | name + pgsodium | pgsodium | key | parent_key + pgsodium | pgsodium | key | raw_key + pgsodium | pgsodium | key | raw_key_nonce + pgsodium | pgsodium | key | status + pgsodium | pgsodium | key | user_data + pgsodium | pgsodium | mask_columns | associated_columns + pgsodium | pgsodium | mask_columns | attname + pgsodium | pgsodium | mask_columns | attrelid + pgsodium | pgsodium | mask_columns | format_type + pgsodium | pgsodium | mask_columns | key_id + pgsodium | pgsodium | mask_columns | key_id_column + pgsodium | pgsodium | mask_columns | nonce_column + pgsodium | pgsodium | masking_rule | associated_columns + pgsodium | pgsodium | masking_rule | attname + pgsodium | pgsodium | masking_rule | attnum + pgsodium | pgsodium | masking_rule | attrelid + pgsodium | pgsodium | masking_rule | col_description + pgsodium | pgsodium | masking_rule | format_type + pgsodium | pgsodium | masking_rule | key_id + pgsodium | pgsodium | masking_rule | key_id_column + pgsodium | pgsodium | masking_rule | nonce_column + pgsodium | pgsodium | masking_rule | priority + pgsodium | pgsodium | masking_rule | relname + pgsodium | pgsodium | masking_rule | relnamespace + pgsodium | pgsodium | masking_rule | security_invoker + pgsodium | pgsodium | masking_rule | view_name + pgsodium | pgsodium | valid_key | associated_data + pgsodium | pgsodium | valid_key | created + pgsodium | pgsodium | valid_key | expires + pgsodium | pgsodium | valid_key | id + pgsodium | pgsodium | valid_key | key_context + pgsodium | pgsodium | valid_key | key_id + pgsodium | pgsodium | valid_key | key_type + pgsodium | pgsodium | valid_key | name + pgsodium | pgsodium | valid_key | status + pgtap | public | pg_all_foreign_keys | fk_columns + pgtap | public | pg_all_foreign_keys | fk_constraint_name + pgtap | public | pg_all_foreign_keys | fk_schema_name + pgtap | public | pg_all_foreign_keys | fk_table_name + pgtap | public | pg_all_foreign_keys | fk_table_oid + pgtap | public | pg_all_foreign_keys | is_deferrable + pgtap | public | pg_all_foreign_keys | is_deferred + pgtap | public | pg_all_foreign_keys | match_type + pgtap | public | pg_all_foreign_keys | on_delete + pgtap | public | pg_all_foreign_keys | on_update + pgtap | public | pg_all_foreign_keys | pk_columns + pgtap | public | pg_all_foreign_keys | pk_constraint_name + pgtap | public | pg_all_foreign_keys | pk_index_name + pgtap | public | pg_all_foreign_keys | pk_schema_name + pgtap | public | pg_all_foreign_keys | pk_table_name + pgtap | public | pg_all_foreign_keys | pk_table_oid + pgtap | public | tap_funky | args + pgtap | public | tap_funky | is_definer + pgtap | public | tap_funky | is_strict + pgtap | public | tap_funky | is_visible + pgtap | public | tap_funky | kind + pgtap | public | tap_funky | langoid + pgtap | public | tap_funky | name + pgtap | public | tap_funky | oid + pgtap | public | tap_funky | owner + pgtap | public | tap_funky | returns + pgtap | public | tap_funky | returns_set + pgtap | public | tap_funky | schema + pgtap | public | tap_funky | volatility + postgis | public | geography_columns | coord_dimension + postgis | public | geography_columns | f_geography_column + postgis | public | geography_columns | f_table_catalog + postgis | public | geography_columns | f_table_name + postgis | public | geography_columns | f_table_schema + postgis | public | geography_columns | srid + postgis | public | geography_columns | type + postgis | public | geometry_columns | coord_dimension + postgis | public | geometry_columns | f_geometry_column + postgis | public | geometry_columns | f_table_catalog + postgis | public | geometry_columns | f_table_name + postgis | public | geometry_columns | f_table_schema + postgis | public | geometry_columns | srid + postgis | public | geometry_columns | type + postgis | public | spatial_ref_sys | auth_name + postgis | public | spatial_ref_sys | auth_srid + postgis | public | spatial_ref_sys | proj4text + postgis | public | spatial_ref_sys | srid + postgis | public | spatial_ref_sys | srtext + postgis_raster | public | raster_columns | blocksize_x + postgis_raster | public | raster_columns | blocksize_y + postgis_raster | public | raster_columns | extent + postgis_raster | public | raster_columns | nodata_values + postgis_raster | public | raster_columns | num_bands + postgis_raster | public | raster_columns | out_db + postgis_raster | public | raster_columns | pixel_types + postgis_raster | public | raster_columns | r_raster_column + postgis_raster | public | raster_columns | r_table_catalog + postgis_raster | public | raster_columns | r_table_name + postgis_raster | public | raster_columns | r_table_schema + postgis_raster | public | raster_columns | regular_blocking + postgis_raster | public | raster_columns | same_alignment + postgis_raster | public | raster_columns | scale_x + postgis_raster | public | raster_columns | scale_y + postgis_raster | public | raster_columns | spatial_index + postgis_raster | public | raster_columns | srid + postgis_raster | public | raster_overviews | o_raster_column + postgis_raster | public | raster_overviews | o_table_catalog + postgis_raster | public | raster_overviews | o_table_name + postgis_raster | public | raster_overviews | o_table_schema + postgis_raster | public | raster_overviews | overview_factor + postgis_raster | public | raster_overviews | r_raster_column + postgis_raster | public | raster_overviews | r_table_catalog + postgis_raster | public | raster_overviews | r_table_name + postgis_raster | public | raster_overviews | r_table_schema + postgis_topology | topology | layer | child_id + postgis_topology | topology | layer | feature_column + postgis_topology | topology | layer | feature_type + postgis_topology | topology | layer | layer_id + postgis_topology | topology | layer | level + postgis_topology | topology | layer | schema_name + postgis_topology | topology | layer | table_name + postgis_topology | topology | layer | topology_id + postgis_topology | topology | topology | hasz + postgis_topology | topology | topology | id + postgis_topology | topology | topology | name + postgis_topology | topology | topology | precision + postgis_topology | topology | topology | srid + supabase_vault | vault | decrypted_secrets | created_at + supabase_vault | vault | decrypted_secrets | decrypted_secret + supabase_vault | vault | decrypted_secrets | description + supabase_vault | vault | decrypted_secrets | id + supabase_vault | vault | decrypted_secrets | key_id + supabase_vault | vault | decrypted_secrets | name + supabase_vault | vault | decrypted_secrets | nonce + supabase_vault | vault | decrypted_secrets | secret + supabase_vault | vault | decrypted_secrets | updated_at + supabase_vault | vault | secrets | created_at + supabase_vault | vault | secrets | description + supabase_vault | vault | secrets | id + supabase_vault | vault | secrets | key_id + supabase_vault | vault | secrets | name + supabase_vault | vault | secrets | nonce + supabase_vault | vault | secrets | secret + supabase_vault | vault | secrets | updated_at + wrappers | public | wrappers_fdw_stats | bytes_in + wrappers | public | wrappers_fdw_stats | bytes_out + wrappers | public | wrappers_fdw_stats | create_times + wrappers | public | wrappers_fdw_stats | created_at + wrappers | public | wrappers_fdw_stats | fdw_name + wrappers | public | wrappers_fdw_stats | metadata + wrappers | public | wrappers_fdw_stats | rows_in + wrappers | public | wrappers_fdw_stats | rows_out + wrappers | public | wrappers_fdw_stats | updated_at +(387 rows) + diff --git a/nix/tests/expected/z_orioledb-17_pg_stat_monitor.out b/nix/tests/expected/z_orioledb-17_pg_stat_monitor.out new file mode 100644 index 000000000..8b90c12fc --- /dev/null +++ b/nix/tests/expected/z_orioledb-17_pg_stat_monitor.out @@ -0,0 +1,10 @@ +select + * +from + pg_stat_monitor +where + false; + bucket | bucket_start_time | userid | username | dbid | datname | client_ip | pgsm_query_id | queryid | toplevel | top_queryid | query | comments | planid | query_plan | top_query | application_name | relations | cmd_type | cmd_type_text | elevel | sqlcode | message | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | shared_blk_read_time | shared_blk_write_time | local_blk_read_time | local_blk_write_time | temp_blk_read_time | temp_blk_write_time | resp_calls | cpu_user_time | cpu_sys_time | wal_records | wal_fpi | wal_bytes | bucket_done | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time | jit_deform_count | jit_deform_time | stats_since | minmax_stats_since +--------+-------------------+--------+----------+------+---------+-----------+---------------+---------+----------+-------------+-------+----------+--------+------------+-----------+------------------+-----------+----------+---------------+--------+---------+---------+-------+-----------------+---------------+---------------+----------------+------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+----------------------+-----------------------+---------------------+----------------------+--------------------+---------------------+------------+---------------+--------------+-------------+---------+-----------+-------------+-------+-----------------+---------------+---------------+----------------+------------------+---------------+---------------------+--------------------+-------------------+------------------------+-----------------------+--------------------+-------------------+------------------+-----------------+-------------+-------------------- +(0 rows) + diff --git a/nix/tests/expected/z_orioledb-17_pgvector.out b/nix/tests/expected/z_orioledb-17_pgvector.out new file mode 100644 index 000000000..2c1cb1007 --- /dev/null +++ b/nix/tests/expected/z_orioledb-17_pgvector.out @@ -0,0 +1,59 @@ +/* +This test excludes indexes shipped with pgvector because orioledb doesn't support them yet +*/ +create schema v; +create table v.items( + id serial primary key, + embedding vector(3), + half_embedding halfvec(3), + bit_embedding bit(3), + sparse_embedding sparsevec(3) +); +-- Populate some records +insert into v.items( + embedding, + half_embedding, + bit_embedding, + sparse_embedding +) +values + ('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'), + ('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3'); +-- Test op types +select + * +from + v.items +order by + embedding <-> '[2,3,5]', + embedding <=> '[2,3,5]', + embedding <+> '[2,3,5]', + embedding <#> '[2,3,5]', + half_embedding <-> '[2,3,5]', + half_embedding <=> '[2,3,5]', + half_embedding <+> '[2,3,5]', + half_embedding <#> '[2,3,5]', + sparse_embedding <-> '{2:4,3:1}/3', + sparse_embedding <=> '{2:4,3:1}/3', + sparse_embedding <+> '{2:4,3:1}/3', + sparse_embedding <#> '{2:4,3:1}/3', + bit_embedding <~> '011'; + id | embedding | half_embedding | bit_embedding | sparse_embedding +----+-----------+----------------+---------------+------------------ + 2 | [2,3,4] | [2,3,4] | 010 | {1:7}/3 + 1 | [1,2,3] | [1,2,3] | 101 | {1:4}/3 +(2 rows) + +select + avg(embedding), + avg(half_embedding) +from + v.items; + avg | avg +---------------+--------------- + [1.5,2.5,3.5] | [1.5,2.5,3.5] +(1 row) + +-- Cleanup +drop schema v cascade; +NOTICE: drop cascades to table v.items diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index d043945ee..918ba3d81 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -1,6 +1,8 @@ -- disable notice messages becuase they differ between 15 and 17 set client_min_messages = warning; - +-- CREATE ROLE anon; +-- CREATE ROLE authenticated; +-- CREATE ROLE service_role; create extension if not exists address_standardizer; create extension if not exists address_standardizer_data_us; create extension if not exists amcheck; @@ -55,7 +57,14 @@ create extension if not exists pg_walinspect; create extension if not exists pgaudit; create extension if not exists pgcrypto; create extension if not exists pgtap; -create extension if not exists pgjwt; +do $$ +begin + if exists (select 1 from pg_available_extensions where name = 'pgjwt') then + if not exists (select 1 from pg_extension where extname = 'pgjwt') then + create extension if not exists pgjwt; + end if; + end if; +end $$; create extension if not exists pgroonga; create extension if not exists pgroonga_database; create extension if not exists pgsodium; diff --git a/nix/tests/sql/pgjwt.sql b/nix/tests/sql/z_15_pgjwt.sql similarity index 100% rename from nix/tests/sql/pgjwt.sql rename to nix/tests/sql/z_15_pgjwt.sql diff --git a/nix/tests/sql/z_17_ext_interface.sql b/nix/tests/sql/z_17_ext_interface.sql index ad0f63ed8..a9d44c2ab 100644 --- a/nix/tests/sql/z_17_ext_interface.sql +++ b/nix/tests/sql/z_17_ext_interface.sql @@ -79,7 +79,7 @@ order by e.extname, n.nspname, p.proname, - pg_catalog.pg_get_function_identity_arguments(p.oid); + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); /* diff --git a/nix/tests/sql/z_orioledb-17_ext_interface.sql b/nix/tests/sql/z_orioledb-17_ext_interface.sql new file mode 100644 index 000000000..a9d44c2ab --- /dev/null +++ b/nix/tests/sql/z_orioledb-17_ext_interface.sql @@ -0,0 +1,114 @@ +/* + +The purpose of this test is to monitor the SQL interface exposed +by Postgres extensions so we have to manually review/approve any difference +that emerge as versions change. + +*/ + + +/* + +List all extensions that are not enabled +If a new entry shows up in this list, that means a new extension has been +added and you should `create extension ...` to enable it in ./nix/tests/prime + +*/ + +select + name +from + pg_available_extensions +where + installed_version is null +order by + name asc; + + +/* + +Monitor relocatability and config of each extension +- lesson learned from pg_cron + +*/ + +select + extname as extension_name, + extrelocatable as is_relocatable +from + pg_extension +order by + extname asc; + + +/* + +Monitor extension public function interface + +*/ + +select + e.extname as extension_name, + n.nspname as schema_name, + p.proname as function_name, + pg_catalog.pg_get_function_identity_arguments(p.oid) as argument_types, + pg_catalog.pg_get_function_result(p.oid) as return_type +from + pg_catalog.pg_proc p + join pg_catalog.pg_namespace n + on n.oid = p.pronamespace + join pg_catalog.pg_depend d + on d.objid = p.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid +where + d.deptype = 'e' + -- Filter out changes between pg15 and pg16 from extensions that ship with postgres + -- new in pg16 + and not (e.extname = 'fuzzystrmatch' and p.proname = 'daitch_mokotoff') + and not (e.extname = 'pageinspect' and p.proname = 'bt_multi_page_stats') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_summary') + and not (e.extname = 'pg_buffercache' and p.proname = 'pg_buffercache_usage_counts') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_block_info') + -- removed in pg16 + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_records_info_till_end_of_wal') + and not (e.extname = 'pg_walinspect' and p.proname = 'pg_get_wal_stats_till_end_of_wal') + -- changed in pg16 - output signature added a column + and not (e.extname = 'pageinspect' and p.proname = 'brin_page_items') +order by + e.extname, + n.nspname, + p.proname, + md5(pg_catalog.pg_get_function_identity_arguments(p.oid)); + +/* + +Monitor extension public table/view/matview/index interface + +*/ + +select + e.extname as extension_name, + n.nspname as schema_name, + pc.relname as entity_name, + pa.attname +from + pg_catalog.pg_class pc + join pg_catalog.pg_namespace n + on n.oid = pc.relnamespace + join pg_catalog.pg_depend d + on d.objid = pc.oid + join pg_catalog.pg_extension e + on e.oid = d.refobjid + left join pg_catalog.pg_attribute pa + on pa.attrelid = pc.oid + and pa.attnum > 0 + and not pa.attisdropped +where + d.deptype = 'e' + and pc.relkind in ('r', 'v', 'm', 'i') +order by + e.extname, + n.nspname, + pc.relname, + pa.attname; diff --git a/nix/tests/sql/z_orioledb-17_pg_stat_monitor.sql b/nix/tests/sql/z_orioledb-17_pg_stat_monitor.sql new file mode 100644 index 000000000..69d996be8 --- /dev/null +++ b/nix/tests/sql/z_orioledb-17_pg_stat_monitor.sql @@ -0,0 +1,6 @@ +select + * +from + pg_stat_monitor +where + false; diff --git a/nix/tests/sql/z_orioledb-17_pgvector.sql b/nix/tests/sql/z_orioledb-17_pgvector.sql new file mode 100644 index 000000000..c90219ca5 --- /dev/null +++ b/nix/tests/sql/z_orioledb-17_pgvector.sql @@ -0,0 +1,52 @@ +/* +This test excludes indexes shipped with pgvector because orioledb doesn't support them yet +*/ +create schema v; + +create table v.items( + id serial primary key, + embedding vector(3), + half_embedding halfvec(3), + bit_embedding bit(3), + sparse_embedding sparsevec(3) +); + +-- Populate some records +insert into v.items( + embedding, + half_embedding, + bit_embedding, + sparse_embedding +) +values + ('[1,2,3]', '[1,2,3]', '101', '{1:4}/3'), + ('[2,3,4]', '[2,3,4]', '010', '{1:7,3:0}/3'); + +-- Test op types +select + * +from + v.items +order by + embedding <-> '[2,3,5]', + embedding <=> '[2,3,5]', + embedding <+> '[2,3,5]', + embedding <#> '[2,3,5]', + half_embedding <-> '[2,3,5]', + half_embedding <=> '[2,3,5]', + half_embedding <+> '[2,3,5]', + half_embedding <#> '[2,3,5]', + sparse_embedding <-> '{2:4,3:1}/3', + sparse_embedding <=> '{2:4,3:1}/3', + sparse_embedding <+> '{2:4,3:1}/3', + sparse_embedding <#> '{2:4,3:1}/3', + bit_embedding <~> '011'; + +select + avg(embedding), + avg(half_embedding) +from + v.items; + +-- Cleanup +drop schema v cascade; diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 1197228af..fe3f524b7 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -61,7 +61,7 @@ print_help() { echo "Usage: nix run .#dbmate-tool -- [options]" echo echo "Options:" - echo " -v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" + echo " -v, --version [15|17|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)" echo " -p, --port PORT Specify the port number to use (default: 5435)" echo " -h, --help Show this help message" echo " -f, --flake-url URL Specify the flake URL to use (default: github:supabase/postgres)" @@ -215,6 +215,7 @@ migrate_version() { # Wait for PostgreSQL to be ready to accept connections if ! wait_for_postgres; then echo "Failed to connect to PostgreSQL server" + cleanup exit 1 fi diff --git a/nix/tools/run-client.sh.in b/nix/tools/run-client.sh.in index 5c1b78341..6acb4d6c0 100644 --- a/nix/tools/run-client.sh.in +++ b/nix/tools/run-client.sh.in @@ -85,16 +85,16 @@ if [ "$PSQL_VERSION" == "15" ]; then echo "Starting client for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" -elif [ "$PSQL_VERSION" == "16" ]; then - echo "Starting client for PSQL 16" - PSQL16=@PSQL16_BINDIR@ - BINDIR="$PSQL16" +elif [ "$PSQL_VERSION" == "17" ]; then + echo "Starting client for PSQL 17" + PSQL17=@PSQL17_BINDIR@ + BINDIR="$PSQL17" elif [ "$PSQL_VERSION" == "orioledb-17" ]; then echo "Starting client for PSQL ORIOLEDB 17" - PSQLORIOLEDB16=@PSQLORIOLEDB17_BINDIR@ - BINDIR="$PSQLORIOLEDB16" + PSQLORIOLEDB17=@PSQLORIOLEDB17_BINDIR@ + BINDIR="$PSQLORIOLEDB17" else - echo "Please provide a valid Postgres version (15, 16, or orioledb-16)" + echo "Please provide a valid Postgres version (15, 17, or orioledb-17)" exit 1 fi diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 0586e010b..227e1b7be 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -145,12 +145,16 @@ if [ "$VERSION" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" +elif [ "$VERSION" == "17" ]; then + echo "Starting server for PSQL 17" + PSQL17=@PSQL17_BINDIR@ + BINDIR="$PSQL17" elif [ "$VERSION" == "orioledb-17" ]; then echo "Starting server for PSQL ORIOLEDB 17" PSQLORIOLEDB17=@PSQLORIOLEDB17_BINDIR@ BINDIR="$PSQLORIOLEDB17" else - echo "Please provide a valid Postgres version (15, orioledb-17)" + echo "Please provide a valid Postgres version (15, 17, orioledb-17)" exit 1 fi @@ -241,7 +245,7 @@ orioledb_config_items() { echo "non-macos oriole conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf" echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then @@ -255,12 +259,21 @@ orioledb_config_items() { perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf" - perl -pi -e 's/ postgis,//g' "$DATDIR/supautils.conf" - perl -pi -e 's/ pgrouting,//g' "$DATDIR/supautils.conf" - + perl -pi -e 's/ pgjwt,//g' "$DATDIR/supautils.conf" perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf" echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" + elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then + echo "non-macos pg 17 conf" + sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" + sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" + elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then + perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" + perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" + perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf" + perl -pi -e 's/ pgjwt,//g;' "$DATDIR/supautils.conf" fi } From 21e8b06b84c4c9894d523c8f8780bc8b7143d7b1 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 27 Mar 2025 12:51:05 -0500 Subject: [PATCH 176/271] chore: run regress tests before migration tests This is to get more valuable feedback earlier in case of failure --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 9f2171f44..a0a347760 100644 --- a/flake.nix +++ b/flake.nix @@ -845,9 +845,6 @@ exit 1 fi - echo "Running migrations tests" - pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql - mkdir -p $out/regression_output if ! pg_regress \ --use-existing \ @@ -863,6 +860,9 @@ exit 1 fi + echo "Running migrations tests" + pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do cp "$logfile" $out/postgresql.log From 196e3aded12c26e4d23d387bd21f27e47382d8a8 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 31 Mar 2025 13:52:52 -0500 Subject: [PATCH 177/271] test: output default event triggers --- nix/tests/expected/evtrigs.out | 25 +++++++++++++++++++++++++ nix/tests/sql/evtrigs.sql | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 nix/tests/expected/evtrigs.out create mode 100644 nix/tests/sql/evtrigs.sql diff --git a/nix/tests/expected/evtrigs.out b/nix/tests/expected/evtrigs.out new file mode 100644 index 000000000..c3b642701 --- /dev/null +++ b/nix/tests/expected/evtrigs.out @@ -0,0 +1,25 @@ +SELECT + e.evtname, + e.evtowner::regrole AS evtowner, + e.evtfoid::regproc AS evtfunction, + p.proowner::regrole AS function_owner +FROM pg_event_trigger e +JOIN pg_proc p + ON e.evtfoid = p.oid +WHERE p.prorettype = 'event_trigger'::regtype; + evtname | evtowner | evtfunction | function_owner +----------------------------------------+----------------+------------------------------------+---------------- + issue_pg_net_access | postgres | grant_pg_net_access | postgres + issue_pg_graphql_access | supabase_admin | grant_pg_graphql_access | supabase_admin + issue_graphql_placeholder | supabase_admin | set_graphql_placeholder | supabase_admin + pgrst_ddl_watch | supabase_admin | pgrst_ddl_watch | supabase_admin + pgrst_drop_watch | supabase_admin | pgrst_drop_watch | supabase_admin + graphql_watch_ddl | supabase_admin | graphql.increment_schema_version | supabase_admin + graphql_watch_drop | supabase_admin | graphql.increment_schema_version | supabase_admin + issue_pg_cron_access | supabase_admin | grant_pg_cron_access | postgres + pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle.pg_tle_feature_info_sql_drop | supabase_admin + pgaudit_ddl_command_end | supabase_admin | pgaudit_ddl_command_end | supabase_admin + pgaudit_sql_drop | supabase_admin | pgaudit_sql_drop | supabase_admin + pgsodium_trg_mask_update | supabase_admin | pgsodium.trg_mask_update | supabase_admin +(12 rows) + diff --git a/nix/tests/sql/evtrigs.sql b/nix/tests/sql/evtrigs.sql new file mode 100644 index 000000000..f482dd7ed --- /dev/null +++ b/nix/tests/sql/evtrigs.sql @@ -0,0 +1,9 @@ +SELECT + e.evtname, + e.evtowner::regrole AS evtowner, + e.evtfoid::regproc AS evtfunction, + p.proowner::regrole AS function_owner +FROM pg_event_trigger e +JOIN pg_proc p + ON e.evtfoid = p.oid +WHERE p.prorettype = 'event_trigger'::regtype; From afc507c98eeb0caafff1a091fea578f30c4d51a3 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 1 Apr 2025 09:39:24 +0800 Subject: [PATCH 178/271] chore(qemu): ship the initialized data dir at a different location The reason for not shipping it originally was to avoid any possibility of the server starting up off a datadir on ephemeral storage. The initdb process itself is decently heavy though. We can tread the middle ground between the two by shipping the datadir at a secondary location, which the server never gets configured to run off. This datadir can be moved to the appropriate place on persistent storage prior to server startup. The simpler operation of copying the files over should be faster than the initdb routine. --- ansible/vars.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 3d8a05ec9..8d0100be4 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,7 +9,7 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.54-orioledb" + postgresorioledb-17: "17.0.1.55-orioledb" postgres17: "17.4.1.004" postgres15: "15.8.1.061" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 2f72c5f70..bdef92da0 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -144,6 +144,7 @@ function clean_system { install_nix execute_stage2_playbook # we do not want to ship an initialized DB as this is performed as needed -rm -rf /data/pgdata +mkdir -p /db/template +mv /data/pgdata /db/template clean_system cloud-init clean --logs From 9fcad09dc44f019f1d4a172b81504d4cab0f837d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 31 Mar 2025 22:54:37 -0400 Subject: [PATCH 179/271] chore: all versions need bump for release to succeed --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 8d0100be4..a63b20e4e 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,8 +10,8 @@ postgres_major: # Full version strings for each major version postgres_release: postgresorioledb-17: "17.0.1.55-orioledb" - postgres17: "17.4.1.004" - postgres15: "15.8.1.061" + postgres17: "17.4.1.005" + postgres15: "15.8.1.062" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 4b44f865368876c22519545d5a316f26bf36063e Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 1 Apr 2025 17:20:46 +0800 Subject: [PATCH 180/271] fix: change oriole builds to use pg_ctl instead of initdb initdb binary seems to be not on the path on the qemu builds, and there doesn't seem to be a reason to use it directly vs using pg_ctl, which we already do for pg15. --- ansible/tasks/setup-postgres.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 29527d335..349c0d517 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -239,12 +239,12 @@ become: yes become_user: postgres shell: > - source /var/lib/postgresql/.bashrc && initdb -D /var/lib/postgresql/data - --allow-group-access - --username=supabase_admin - --locale-provider=icu - --encoding=UTF-8 - --icu-locale=en_US.UTF-8 + source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb + -o "--allow-group-access" + -o "--username=supabase_admin" + -o "--locale-provider=icu" + -o "--encoding=UTF-8" + -o "--icu-locale=en_US.UTF-8" args: executable: /bin/bash environment: From ca3a691cb1bf63418f7d7944f9124cbd312115c0 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 2 Apr 2025 09:28:52 +0800 Subject: [PATCH 181/271] chore: no longer ship kong in the qemu artifact --- ansible/vars.yml | 6 +++--- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a63b20e4e..a833ef9de 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.55-orioledb" - postgres17: "17.4.1.005" - postgres15: "15.8.1.062" + postgresorioledb-17: "17.0.1.56-orioledb" + postgres17: "17.4.1.006" + postgres15: "15.8.1.063" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index bdef92da0..1d7a172cf 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -104,6 +104,13 @@ EOF --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" } +function clean_legacy_things { + # removes things that are bundled for legacy reasons, but we can start without for our newer artifacts + apt-get unmark zlib1g* # TODO (darora): need to make sure that there aren't other things that still need this + apt-get -y purge kong + apt-get autoremove -y +} + function clean_system { # Copy cleanup scripts chmod +x /tmp/ansible-playbook/scripts/90-cleanup-qemu.sh @@ -146,5 +153,6 @@ execute_stage2_playbook # we do not want to ship an initialized DB as this is performed as needed mkdir -p /db/template mv /data/pgdata /db/template +clean_legacy_things clean_system cloud-init clean --logs From b9abe56755f7104163c54bd7f78e7397c27f332b Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 2 Apr 2025 15:03:10 +0800 Subject: [PATCH 182/271] fix: change qemu build to oriole The array we grab the version from was re-ordered as PG17 non-oriole was introduced. A more robust mechanism can be added later but this array is rarely adjusted, so this is likely good enough for now. Also moves up some fixes from the init-scripts, and removes Kong from the qemu artifact. --- .github/workflows/qemu-image-build.yml | 2 +- ansible/tasks/setup-postgres.yml | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 373026425..8d929ee55 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -26,7 +26,7 @@ jobs: - name: Set PostgreSQL versions - only builds pg17 atm id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[2]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 349c0d517..a1b7e6c7f 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -255,7 +255,7 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive vars: ansible_command_timeout: 60 - when: stage2_nix and is_psql_oriole or is_psql_17 + when: stage2_nix and (is_psql_oriole or is_psql_17) - name: copy PG systemd unit template: diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 1d7a172cf..5ec8c70b2 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -106,7 +106,7 @@ EOF function clean_legacy_things { # removes things that are bundled for legacy reasons, but we can start without for our newer artifacts - apt-get unmark zlib1g* # TODO (darora): need to make sure that there aren't other things that still need this + apt-mark auto zlib1g* # TODO (darora): need to make sure that there aren't other things that still need this apt-get -y purge kong apt-get autoremove -y } @@ -135,7 +135,12 @@ function clean_system { mkdir /var/log/sysstat chown -R postgres:postgres /var/log/wal-g - chmod -R 0300 /var/log/wal-g + # moving up fixes from init scripts + chmod -R 0310 /var/log/wal-g + chmod 0340 /var/log/wal-g/pitr.log + + chmod 0600 /etc/vector/vector.yaml + chown vector:vector /etc/vector/vector.yaml # # audit logs directory for apparmor mkdir /var/log/audit From 21431e8f04597606605dd2fa70fbfafe5af2cb8d Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 2 Apr 2025 17:23:44 +0800 Subject: [PATCH 183/271] fix: remove ref to non-existent file --- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 5ec8c70b2..9fe35fa90 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -139,9 +139,6 @@ function clean_system { chmod -R 0310 /var/log/wal-g chmod 0340 /var/log/wal-g/pitr.log - chmod 0600 /etc/vector/vector.yaml - chown vector:vector /etc/vector/vector.yaml - # # audit logs directory for apparmor mkdir /var/log/audit From fa8add9b7f839bc3d82c4b338b5cd34f337e70eb Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 1 Apr 2025 20:50:23 -0500 Subject: [PATCH 184/271] test: regression for auth schema tests the following aspects: * auth schema * auth tables with owners * auth functions with owners * auth indexes with owners * roles which have USAGE and CREATE on the auth schema * attributes of the supabase_auth_admin role --- nix/tests/expected/auth.out | 174 ++++++++++++++++++++++++++++++++++++ nix/tests/sql/auth.sql | 115 ++++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 nix/tests/expected/auth.out create mode 100644 nix/tests/sql/auth.sql diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out new file mode 100644 index 000000000..7e35c1b33 --- /dev/null +++ b/nix/tests/expected/auth.out @@ -0,0 +1,174 @@ +-- auth schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'auth'; + schema_name | owner +-------------+---------------- + auth | supabase_admin +(1 row) + +-- attributes of the supabase_auth_admin +select + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where r.rolname = 'supabase_auth_admin'; + rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil +---------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- + t | t | f | f | f | f | -1 | f | +(1 row) + +select + rolconfig +from pg_roles r +where r.rolname = 'supabase_auth_admin'; + rolconfig +--------------------------------------------------------------------------------- + {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} +(1 row) + +-- auth schema tables with owners +select + n.nspname as schema_name, + c.relname as table_name, + r.rolname as owner +from + pg_class c +join + pg_namespace n on c.relnamespace = n.oid +join + pg_roles r on c.relowner = r.oid +where + c.relkind in ('r') -- 'r' for regular tables + and n.nspname = 'auth' +order by + c.relname; + schema_name | table_name | owner +-------------+-------------------+--------------------- + auth | audit_log_entries | supabase_auth_admin + auth | instances | supabase_auth_admin + auth | refresh_tokens | supabase_auth_admin + auth | schema_migrations | supabase_auth_admin + auth | users | supabase_auth_admin +(5 rows) + +-- auth indexes with owners +select + ns.nspname as table_schema, + t.relname as table_name, + i.relname as index_name, + r.rolname as index_owner +from + pg_class t +join + pg_namespace ns on t.relnamespace = ns.oid +join + pg_index idx on t.oid = idx.indrelid +join + pg_class i on idx.indexrelid = i.oid +join + pg_roles r on i.relowner = r.oid +where + ns.nspname = 'auth' +order by + t.relname, i.relname; + table_schema | table_name | index_name | index_owner +--------------+-------------------+----------------------------------------+--------------------- + auth | audit_log_entries | audit_log_entries_pkey | supabase_auth_admin + auth | audit_log_entries | audit_logs_instance_id_idx | supabase_auth_admin + auth | instances | instances_pkey | supabase_auth_admin + auth | refresh_tokens | refresh_tokens_instance_id_idx | supabase_auth_admin + auth | refresh_tokens | refresh_tokens_instance_id_user_id_idx | supabase_auth_admin + auth | refresh_tokens | refresh_tokens_pkey | supabase_auth_admin + auth | refresh_tokens | refresh_tokens_token_idx | supabase_auth_admin + auth | schema_migrations | schema_migrations_pkey | supabase_auth_admin + auth | users | users_email_key | supabase_auth_admin + auth | users | users_instance_id_email_idx | supabase_auth_admin + auth | users | users_instance_id_idx | supabase_auth_admin + auth | users | users_pkey | supabase_auth_admin +(12 rows) + +-- auth schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'auth' +order by + p.proname; + schema_name | function_name | owner +-------------+---------------+--------------------- + auth | email | supabase_auth_admin + auth | role | supabase_auth_admin + auth | uid | supabase_auth_admin +(3 rows) + +-- roles which have USAGE on the auth schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'auth' + and a.privilege_type = 'USAGE' +order by + r.rolname; + schema_name | role_name | privilege_type +-------------+---------------------+---------------- + auth | anon | USAGE + auth | authenticated | USAGE + auth | dashboard_user | USAGE + auth | postgres | USAGE + auth | service_role | USAGE + auth | supabase_admin | USAGE + auth | supabase_auth_admin | USAGE +(7 rows) + +-- roles which have CREATE on the auth schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'auth' + and a.privilege_type = 'CREATE' +order by + r.rolname; + schema_name | role_name | privilege_type +-------------+---------------------+---------------- + auth | dashboard_user | CREATE + auth | postgres | CREATE + auth | supabase_admin | CREATE + auth | supabase_auth_admin | CREATE +(4 rows) + diff --git a/nix/tests/sql/auth.sql b/nix/tests/sql/auth.sql new file mode 100644 index 000000000..26916c0b4 --- /dev/null +++ b/nix/tests/sql/auth.sql @@ -0,0 +1,115 @@ +-- auth schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'auth'; + +-- attributes of the supabase_auth_admin +select + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where r.rolname = 'supabase_auth_admin'; + +select + rolconfig +from pg_roles r +where r.rolname = 'supabase_auth_admin'; + +-- auth schema tables with owners +select + n.nspname as schema_name, + c.relname as table_name, + r.rolname as owner +from + pg_class c +join + pg_namespace n on c.relnamespace = n.oid +join + pg_roles r on c.relowner = r.oid +where + c.relkind in ('r') -- 'r' for regular tables + and n.nspname = 'auth' +order by + c.relname; + +-- auth indexes with owners +select + ns.nspname as table_schema, + t.relname as table_name, + i.relname as index_name, + r.rolname as index_owner +from + pg_class t +join + pg_namespace ns on t.relnamespace = ns.oid +join + pg_index idx on t.oid = idx.indrelid +join + pg_class i on idx.indexrelid = i.oid +join + pg_roles r on i.relowner = r.oid +where + ns.nspname = 'auth' +order by + t.relname, i.relname; + +-- auth schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'auth' +order by + p.proname; + +-- roles which have USAGE on the auth schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'auth' + and a.privilege_type = 'USAGE' +order by + r.rolname; + +-- roles which have CREATE on the auth schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'auth' + and a.privilege_type = 'CREATE' +order by + r.rolname; From bf0f554ffe6b378039387610ec97d58696230c85 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:12:34 +0100 Subject: [PATCH 185/271] feat: release new adminapi and admin-mgr for physical backup pausing (#1516) * feat: release new adminapi and admin-mgr for physical backup pausing * chore: bump pg versions for new adminapi and admin-mgr release --- ansible/vars.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a833ef9de..68a82dc5b 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.56-orioledb" - postgres17: "17.4.1.006" - postgres15: "15.8.1.063" + postgresorioledb-17: "17.0.1.57-orioledb" + postgres17: "17.4.1.007" + postgres15: "15.8.1.064" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -47,14 +47,13 @@ kong_deb_checksum: sha1:2086f6ccf8454fe64435252fea4d29d736d7ec61 nginx_release: 1.22.0 nginx_release_checksum: sha1:419efb77b80f165666e2ee406ad8ae9b845aba93 - postgres_exporter_release: "0.15.0" postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.76.0 -adminmgr_release: 0.24.1 +adminapi_release: 0.77.0 +adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" From f13a462508bc744eddb8c6e6e71a583774bd7f9d Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 2 Apr 2025 16:56:13 -0500 Subject: [PATCH 186/271] test: regress policies on auth tables --- nix/tests/expected/auth.out | 32 +++++++++++++++++++------------- nix/tests/sql/auth.sql | 18 ++++++++++++------ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out index 7e35c1b33..d3277513a 100644 --- a/nix/tests/expected/auth.out +++ b/nix/tests/expected/auth.out @@ -40,29 +40,35 @@ where r.rolname = 'supabase_auth_admin'; {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} (1 row) --- auth schema tables with owners +-- auth schema tables with owners and rls policies select - n.nspname as schema_name, + ns.nspname as schema_name, c.relname as table_name, - r.rolname as owner + r.rolname as owner, + c.relrowsecurity as rls_enabled, + string_agg(p.polname, ', ' order by p.polname) as rls_policies from pg_class c join - pg_namespace n on c.relnamespace = n.oid + pg_namespace ns on c.relnamespace = ns.oid join pg_roles r on c.relowner = r.oid +left join + pg_policy p on p.polrelid = c.oid where - c.relkind in ('r') -- 'r' for regular tables - and n.nspname = 'auth' + ns.nspname = 'auth' + and c.relkind = 'r' +group by + ns.nspname, c.relname, r.rolname, c.relrowsecurity order by c.relname; - schema_name | table_name | owner --------------+-------------------+--------------------- - auth | audit_log_entries | supabase_auth_admin - auth | instances | supabase_auth_admin - auth | refresh_tokens | supabase_auth_admin - auth | schema_migrations | supabase_auth_admin - auth | users | supabase_auth_admin + schema_name | table_name | owner | rls_enabled | rls_policies +-------------+-------------------+---------------------+-------------+-------------- + auth | audit_log_entries | supabase_auth_admin | f | + auth | instances | supabase_auth_admin | f | + auth | refresh_tokens | supabase_auth_admin | f | + auth | schema_migrations | supabase_auth_admin | f | + auth | users | supabase_auth_admin | f | (5 rows) -- auth indexes with owners diff --git a/nix/tests/sql/auth.sql b/nix/tests/sql/auth.sql index 26916c0b4..47e2931ae 100644 --- a/nix/tests/sql/auth.sql +++ b/nix/tests/sql/auth.sql @@ -28,20 +28,26 @@ select from pg_roles r where r.rolname = 'supabase_auth_admin'; --- auth schema tables with owners +-- auth schema tables with owners and rls policies select - n.nspname as schema_name, + ns.nspname as schema_name, c.relname as table_name, - r.rolname as owner + r.rolname as owner, + c.relrowsecurity as rls_enabled, + string_agg(p.polname, ', ' order by p.polname) as rls_policies from pg_class c join - pg_namespace n on c.relnamespace = n.oid + pg_namespace ns on c.relnamespace = ns.oid join pg_roles r on c.relowner = r.oid +left join + pg_policy p on p.polrelid = c.oid where - c.relkind in ('r') -- 'r' for regular tables - and n.nspname = 'auth' + ns.nspname = 'auth' + and c.relkind = 'r' +group by + ns.nspname, c.relname, r.rolname, c.relrowsecurity order by c.relname; From e653fddf814669f629d462447090534f32ad5021 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 2 Apr 2025 17:03:50 -0500 Subject: [PATCH 187/271] test: regression for storage schema tests the following aspects: * storage schema owner * storage tables with owners and rls policies * storage functions with owners * storage indexes with owners * roles which have USAGE and CREATE on the storage schema * attributes of the supabase_storage_admin role --- nix/tests/expected/storage.out | 174 +++++++++++++++++++++++++++++++++ nix/tests/sql/storage.sql | 121 +++++++++++++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 nix/tests/expected/storage.out create mode 100644 nix/tests/sql/storage.sql diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out new file mode 100644 index 000000000..755e6c516 --- /dev/null +++ b/nix/tests/expected/storage.out @@ -0,0 +1,174 @@ +-- storage schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'storage'; + schema_name | owner +-------------+---------------- + storage | supabase_admin +(1 row) + +-- attributes of the supabase_storage_admin +select + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where r.rolname = 'supabase_storage_admin'; + rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil +---------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- + t | t | f | f | f | f | -1 | f | +(1 row) + +select + rolconfig +from pg_roles r +where r.rolname = 'supabase_storage_admin'; + rolconfig +------------------------------------------ + {search_path=storage,log_statement=none} +(1 row) + +-- storage schema tables with owners and rls policies +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as owner, + c.relrowsecurity as rls_enabled, + string_agg(p.polname, ', ' order by p.polname) as rls_policies +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +join + pg_roles r on c.relowner = r.oid +left join + pg_policy p on p.polrelid = c.oid +where + ns.nspname = 'storage' + and c.relkind = 'r' +group by + ns.nspname, c.relname, r.rolname, c.relrowsecurity +order by + c.relname; + schema_name | table_name | owner | rls_enabled | rls_policies +-------------+------------+------------------------+-------------+-------------- + storage | buckets | supabase_storage_admin | f | + storage | migrations | supabase_storage_admin | f | + storage | objects | supabase_storage_admin | t | +(3 rows) + +-- storage indexes with owners +select + ns.nspname as table_schema, + t.relname as table_name, + i.relname as index_name, + r.rolname as index_owner +from + pg_class t +join + pg_namespace ns on t.relnamespace = ns.oid +join + pg_index idx on t.oid = idx.indrelid +join + pg_class i on idx.indexrelid = i.oid +join + pg_roles r on i.relowner = r.oid +where + ns.nspname = 'storage' +order by + t.relname, i.relname; + table_schema | table_name | index_name | index_owner +--------------+------------+---------------------+------------------------ + storage | buckets | bname | supabase_storage_admin + storage | buckets | buckets_pkey | supabase_storage_admin + storage | migrations | migrations_name_key | supabase_storage_admin + storage | migrations | migrations_pkey | supabase_storage_admin + storage | objects | bucketid_objname | supabase_storage_admin + storage | objects | name_prefix_search | supabase_storage_admin + storage | objects | objects_pkey | supabase_storage_admin +(7 rows) + +-- storage schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'storage' +order by + p.proname; + schema_name | function_name | owner +-------------+---------------+------------------------ + storage | extension | supabase_storage_admin + storage | filename | supabase_storage_admin + storage | foldername | supabase_storage_admin + storage | search | supabase_storage_admin +(4 rows) + +-- roles which have USAGE on the storage schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'storage' + and a.privilege_type = 'USAGE' +order by + r.rolname; + schema_name | role_name | privilege_type +-------------+------------------------+---------------- + storage | anon | USAGE + storage | authenticated | USAGE + storage | dashboard_user | USAGE + storage | postgres | USAGE + storage | service_role | USAGE + storage | supabase_admin | USAGE + storage | supabase_storage_admin | USAGE +(7 rows) + +-- roles which have CREATE on the storage schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'storage' + and a.privilege_type = 'CREATE' +order by + r.rolname; + schema_name | role_name | privilege_type +-------------+------------------------+---------------- + storage | dashboard_user | CREATE + storage | postgres | CREATE + storage | supabase_admin | CREATE + storage | supabase_storage_admin | CREATE +(4 rows) + diff --git a/nix/tests/sql/storage.sql b/nix/tests/sql/storage.sql new file mode 100644 index 000000000..5dfd5f0bb --- /dev/null +++ b/nix/tests/sql/storage.sql @@ -0,0 +1,121 @@ +-- storage schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'storage'; + +-- attributes of the supabase_storage_admin +select + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where r.rolname = 'supabase_storage_admin'; + +select + rolconfig +from pg_roles r +where r.rolname = 'supabase_storage_admin'; + +-- storage schema tables with owners and rls policies +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as owner, + c.relrowsecurity as rls_enabled, + string_agg(p.polname, ', ' order by p.polname) as rls_policies +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +join + pg_roles r on c.relowner = r.oid +left join + pg_policy p on p.polrelid = c.oid +where + ns.nspname = 'storage' + and c.relkind = 'r' +group by + ns.nspname, c.relname, r.rolname, c.relrowsecurity +order by + c.relname; + +-- storage indexes with owners +select + ns.nspname as table_schema, + t.relname as table_name, + i.relname as index_name, + r.rolname as index_owner +from + pg_class t +join + pg_namespace ns on t.relnamespace = ns.oid +join + pg_index idx on t.oid = idx.indrelid +join + pg_class i on idx.indexrelid = i.oid +join + pg_roles r on i.relowner = r.oid +where + ns.nspname = 'storage' +order by + t.relname, i.relname; + +-- storage schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'storage' +order by + p.proname; + +-- roles which have USAGE on the storage schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'storage' + and a.privilege_type = 'USAGE' +order by + r.rolname; + +-- roles which have CREATE on the storage schema +select + n.nspname as schema_name, + r.rolname as role_name, + a.privilege_type +from + pg_namespace n +cross join lateral aclexplode(n.nspacl) as a +join + pg_roles r on a.grantee = r.oid +where + n.nspname = 'storage' + and a.privilege_type = 'CREATE' +order by + r.rolname; From ddb91b4746b8078254938a134371eaebd02427ab Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 3 Apr 2025 11:40:42 +0800 Subject: [PATCH 188/271] fix: skip installing ndisc issue resolver in qemu mode The issue was caused by very frequent RAs in ec2 when operating in IPv6 mode. The qemu artifact gets configured with a static IP instead, so this service should no longer be needed. Additionally, fixes the build process to correctly define qemu_mode for both ansible calls. --- ansible/playbook.yml | 2 +- ansible/vars.yml | 6 +++--- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 5c8a9f70e..806079aa9 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -82,7 +82,7 @@ import_tasks: tasks/fix_ipv6_ndisc.yml tags: - install-supabase-internal - when: debpkg_mode or nixpkg_mode + when: (debpkg_mode or nixpkg_mode) and (qemu_mode is undefined) - name: Start Postgres Database without Systemd become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index 68a82dc5b..a246c866e 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.57-orioledb" - postgres17: "17.4.1.007" - postgres15: "15.8.1.064" + postgresorioledb-17: "17.0.1.58-orioledb" + postgres17: "17.4.1.008" + postgres15: "15.8.1.065" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 9fe35fa90..ad5c2744c 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -35,7 +35,7 @@ callbacks_enabled = timer, profile_tasks, profile_roles EOF # Run Ansible playbook export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp - ansible-playbook ./ansible/playbook.yml --extra-vars '{"nixpkg_mode": true, "debpkg_mode": false, "stage2_nix": false}' \ + ansible-playbook ./ansible/playbook.yml --extra-vars '{"nixpkg_mode": true, "debpkg_mode": false, "stage2_nix": false, "qemu_mode": true}' \ --extra-vars "postgresql_version=postgresql_${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \ From e25f220d588304619bf7bad46dc63499fdd90f9c Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 3 Apr 2025 11:49:38 +0800 Subject: [PATCH 189/271] fix: update adminapi service for qemu builds --- ansible/files/adminapi.service.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/files/adminapi.service.j2 b/ansible/files/adminapi.service.j2 index 6078f3d1a..3b2821984 100644 --- a/ansible/files/adminapi.service.j2 +++ b/ansible/files/adminapi.service.j2 @@ -8,6 +8,9 @@ User=adminapi Restart=always RestartSec=3 Environment="AWS_USE_DUALSTACK_ENDPOINT=true" +{% if qemu_mode is defined and qemu_mode %} +Environment="AWS_SDK_LOAD_CONFIG=true" +{% endif %} [Install] WantedBy=multi-user.target From 8510360417d1ecd6f3542ccc877802de8bd55f71 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 3 Apr 2025 14:42:28 -0400 Subject: [PATCH 190/271] feat: update oriole to latest release, add testing suffix (#1507) * feat: update oriole to latest release, add testing suffix * chore: bump versions to release --- ansible/vars.yml | 6 +++--- nix/ext/orioledb.nix | 8 ++++---- nix/postgresql/orioledb-17.nix | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a246c866e..630bdee62 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.58-orioledb" - postgres17: "17.4.1.008" - postgres15: "15.8.1.065" + postgresorioledb-17: "17.0.1.59-orioledb" + postgres17: "17.4.1.009" + postgres15: "15.8.1.066" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 0e0ae9cdc..96e70e308 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -6,12 +6,12 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "beta9"; - sha256 = "sha256-z2EHWsY+hhtnYzAxOl2PWjqfyJ+wp9SCau5LKPT2ec0="; + rev = "beta10"; + sha256 = "sha256-O4OTi8ickylVXE9FURm5R++A+l15Z22YLna7OVzVMjc="; }; - version = "beta9"; + version = "beta10"; buildInputs = [ curl libkrb5 postgresql python3 openssl ]; - buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=5"; + buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=6"; installPhase = '' runHook preInstall diff --git a/nix/postgresql/orioledb-17.nix b/nix/postgresql/orioledb-17.nix index b79052e20..b8e5bc374 100644 --- a/nix/postgresql/orioledb-17.nix +++ b/nix/postgresql/orioledb-17.nix @@ -1,4 +1,4 @@ import ./generic.nix { - version = "17_5"; - hash = "sha256-OgXLpFanNp+ngPFKyCEDUFvIEWQ9nK/1csUO9lVTXaQ="; + version = "17_6"; + hash = "sha256-HbuTcXNanFOl9YfvlSzQJon8CfAhc8TFwo/y7jXy51w="; } From 9ae28f15e2ccf8184e3c922ae7d7dcf7c4eee0d8 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Fri, 4 Apr 2025 16:57:30 +1300 Subject: [PATCH 191/271] ci: explicit permission and quote user definable input in actions --- .github/workflows/ami-release-nix.yml | 12 +++++------ .github/workflows/check-shellscripts.yml | 3 +++ .github/workflows/ci.yml | 3 +++ .../workflows/dockerhub-release-matrix.yml | 10 +++++++++- .github/workflows/manual-docker-release.yml | 8 ++++++++ .github/workflows/mirror-postgrest.yml | 3 +++ .github/workflows/mirror.yml | 3 +++ ...ublish-nix-pgupgrade-bin-flake-version.yml | 20 +++++++++---------- .../publish-nix-pgupgrade-scripts.yml | 12 +++++------ .github/workflows/qemu-image-build.yml | 10 +++++++--- .github/workflows/test.yml | 7 ++++++- .github/workflows/testinfra-nix.yml | 6 +++++- 12 files changed, 69 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 1d57ea23b..31089218d 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -11,6 +11,10 @@ on: - 'ansible/vars.yml' workflow_dispatch: +permissions: + contents: read + id-token: write + jobs: prepare: runs-on: ubuntu-latest @@ -41,10 +45,6 @@ jobs: mcpu: neoverse-n1 runs-on: ${{ matrix.runner }} timeout-minutes: 150 - permissions: - contents: write - packages: write - id-token: write steps: - name: Checkout Repo @@ -56,7 +56,7 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' }} run: | SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') - if [[ -z $SUFFIX ]] ; then + if [[ -z "$SUFFIX" ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 fi @@ -67,7 +67,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file echo "" >> common-nix.vars.pkr.hcl diff --git a/.github/workflows/check-shellscripts.yml b/.github/workflows/check-shellscripts.yml index b796bdb90..ab0f59b87 100644 --- a/.github/workflows/check-shellscripts.yml +++ b/.github/workflows/check-shellscripts.yml @@ -7,6 +7,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 510de7be6..93a2afdc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,9 @@ name: Check merge requirements on: pull_request: +permissions: + contents: read + jobs: check-release-version: timeout-minutes: 5 diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index 72116abd1..ed7075d1d 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -9,7 +9,11 @@ on: - ".github/workflows/dockerhub-release-matrix.yml" - "ansible/vars.yml" workflow_dispatch: - + +permissions: + contents: read + id-token: write + jobs: prepare: runs-on: ubuntu-latest @@ -233,6 +237,10 @@ jobs: matrix: ${{ steps.combine.outputs.matrix }} publish: needs: combine_results + permissions: + contents: read + packages: write + id-token: write strategy: matrix: ${{ fromJson(needs.combine_results.outputs.matrix) }} uses: ./.github/workflows/mirror.yml diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml index b9b66b305..8948324db 100644 --- a/.github/workflows/manual-docker-release.yml +++ b/.github/workflows/manual-docker-release.yml @@ -7,6 +7,10 @@ on: description: 'Optional. Postgres version to publish against, i.e. 15.1.1.78' required: false +permissions: + id-token: write + contents: read + jobs: prepare: runs-on: ubuntu-latest @@ -241,6 +245,10 @@ jobs: outputs: matrix: ${{ steps.combine.outputs.matrix }} publish: + permissions: + contents: read + packages: write + id-token: write needs: combine_results strategy: matrix: ${{ fromJson(needs.combine_results.outputs.matrix) }} diff --git a/.github/workflows/mirror-postgrest.yml b/.github/workflows/mirror-postgrest.yml index c84647c85..1658730f7 100644 --- a/.github/workflows/mirror-postgrest.yml +++ b/.github/workflows/mirror-postgrest.yml @@ -8,6 +8,9 @@ on: - ".github/workflows/mirror-postgrest.yml" - "common.vars*" +permissions: + contents: read + jobs: version: runs-on: ubuntu-latest diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 9f53e7fd7..28a068277 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -13,6 +13,9 @@ on: required: true type: string +permissions: + contents: read + jobs: mirror: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index 09e1663ce..bec85166e 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -44,9 +44,9 @@ jobs: id: process_release_version run: | VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo "$VERSION" | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then - VERSION=${{ inputs.postgresVersion }} + VERSION="${{ inputs.postgresVersion }}" fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT" @@ -54,9 +54,9 @@ jobs: - name: Create a tarball containing the latest nix flake version working-directory: /tmp/ run: | - mkdir -p ${{ steps.process_release_version.outputs.major_version }} - echo $GITHUB_SHA > ${{ steps.process_release_version.outputs.major_version }}/nix_flake_version - tar -czvf pg_upgrade_bin.tar.gz ${{ steps.process_release_version.outputs.major_version }} + mkdir -p "${{ steps.process_release_version.outputs.major_version }}" + echo "$GITHUB_SHA" > "${{ steps.process_release_version.outputs.major_version }}/nix_flake_version" + tar -czvf pg_upgrade_bin.tar.gz "${{ steps.process_release_version.outputs.major_version }}" - name: configure aws credentials - staging uses: aws-actions/configure-aws-credentials@v1 @@ -66,7 +66,7 @@ jobs: - name: Upload pg_upgrade scripts to s3 staging run: | - aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz "s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz" - name: Slack Notification on Failure if: ${{ failure() }} @@ -101,9 +101,9 @@ jobs: - name: Create a tarball containing the latest nix flake version working-directory: /tmp/ run: | - mkdir -p ${{ steps.process_release_version.outputs.major_version }} - echo $GITHUB_SHA > ${{ steps.process_release_version.outputs.major_version }}/nix_flake_version - tar -czvf pg_upgrade_bin.tar.gz ${{ steps.process_release_version.outputs.major_version }} + mkdir -p "${{ steps.process_release_version.outputs.major_version }}" + echo "$GITHUB_SHA" > "${{ steps.process_release_version.outputs.major_version }}/nix_flake_version" + tar -czvf pg_upgrade_bin.tar.gz "${{ steps.process_release_version.outputs.major_version }}" - name: configure aws credentials - prod uses: aws-actions/configure-aws-credentials@v1 @@ -113,7 +113,7 @@ jobs: - name: Upload pg_upgrade scripts to s3 prod run: | - aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz "s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz" - name: Slack Notification on Failure if: ${{ failure() }} diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index ac18fa7ab..ece3e5966 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -51,9 +51,9 @@ jobs: id: process_release_version run: | VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo "$VERSION" | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then - VERSION=${{ inputs.postgresVersion }} + VERSION="${{ inputs.postgresVersion }}" fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" @@ -71,7 +71,7 @@ jobs: - name: Upload pg_upgrade scripts to s3 staging run: | - aws s3 cp /tmp/pg_upgrade_scripts.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz + aws s3 cp /tmp/pg_upgrade_scripts.tar.gz "s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz" - name: Slack Notification on Failure if: ${{ failure() }} @@ -102,9 +102,9 @@ jobs: id: process_release_version run: | VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes + VERSION=$(echo "$VERSION" | tr -d '"') # Remove any surrounding quotes if [[ "${{ inputs.postgresVersion }}" != "" ]]; then - VERSION=${{ inputs.postgresVersion }} + VERSION="${{ inputs.postgresVersion }}" fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" @@ -122,7 +122,7 @@ jobs: - name: Upload pg_upgrade scripts to s3 prod run: | - aws s3 cp /tmp/pg_upgrade_scripts.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz + aws s3 cp /tmp/pg_upgrade_scripts.tar.gz "s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz" - name: Slack Notification on Failure if: ${{ failure() }} diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 8d929ee55..a2fd4b000 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -12,6 +12,10 @@ on: - 'ansible/vars.yml' workflow_dispatch: +permissions: + contents: read + id-token: write + jobs: prepare: runs-on: ubuntu-latest @@ -68,7 +72,7 @@ jobs: run: | curl -L https://github.com/mikefarah/yq/releases/download/v4.45.1/yq_linux_arm64 -o yq && chmod +x yq PG_VERSION=$(./yq '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl echo 'postgres-major-version = "'$POSTGRES_MAJOR_VERSION'"' >> common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file @@ -122,8 +126,8 @@ jobs: REPOSITORY: postgres-vm-image IMAGE_TAG: ${{ steps.process_release_version.outputs.version }} run: | - docker build -f Dockerfile-kubernetes -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG . - docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG + docker build -f Dockerfile-kubernetes -t "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" . + docker push "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" # - name: Upload software manifest to s3 staging # run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dc194684..a218ef882 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,11 @@ on: - develop pull_request: workflow_dispatch: + +permissions: + contents: read + id-token: write + jobs: prepare: runs-on: ubuntu-latest @@ -57,7 +62,7 @@ jobs: run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Strip quotes from pg major and set env var run: | - stripped_version=$(echo ${{ matrix.postgres_version }} | sed 's/^"\(.*\)"$/\1/') + stripped_version=$(echo "${{ matrix.postgres_version }}" | sed 's/^"\(.*\)"$/\1/') echo "PGMAJOR=$stripped_version" >> $GITHUB_ENV - name: Generate common-nix.vars.pkr.hcl run: | diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-nix.yml index 14db4a7f2..c486dfc34 100644 --- a/.github/workflows/testinfra-nix.yml +++ b/.github/workflows/testinfra-nix.yml @@ -4,6 +4,10 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + id-token: write + jobs: prepare: runs-on: ubuntu-latest @@ -66,7 +70,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) - PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes + PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file echo "" >> common-nix.vars.pkr.hcl From 3cd7173732b32d354153678fd35bc7d0846839fb Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Fri, 4 Apr 2025 17:38:23 +0530 Subject: [PATCH 192/271] fix: restart always pgbouncer service (#1523) --- ansible/files/pgbouncer_config/pgbouncer.service.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/files/pgbouncer_config/pgbouncer.service.j2 b/ansible/files/pgbouncer_config/pgbouncer.service.j2 index 1ec5ea378..7fcc9acbe 100644 --- a/ansible/files/pgbouncer_config/pgbouncer.service.j2 +++ b/ansible/files/pgbouncer_config/pgbouncer.service.j2 @@ -15,6 +15,8 @@ ExecStart=/usr/local/bin/pgbouncer /etc/pgbouncer/pgbouncer.ini ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGINT LimitNOFILE=65536 +Restart=always +RestartSec=5 [Install] WantedBy=multi-user.target From 1772a43e063d4c763b868fbcf88e95eeaf9c2d6b Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 3 Apr 2025 16:06:49 -0500 Subject: [PATCH 193/271] test: roles privileges, memberships, attributes regress the following aspects: * roles attributes * roles memberships * roles privileges on schemas * centralizes all role tests in roles.sql + Removes redundant checks in auth test + Removes redundant checks in storage test --- migrations/db/init-scripts/README.md | 7 + nix/tests/expected/auth.out | 76 ---- nix/tests/expected/default_privs.out | 12 - nix/tests/expected/roles.out | 580 +++++++++++++++++++++++++++ nix/tests/expected/storage.out | 76 ---- nix/tests/sql/auth.sql | 51 --- nix/tests/sql/default_privs.sql | 2 - nix/tests/sql/roles.sql | 77 ++++ nix/tests/sql/storage.sql | 51 --- 9 files changed, 664 insertions(+), 268 deletions(-) create mode 100644 migrations/db/init-scripts/README.md delete mode 100644 nix/tests/expected/default_privs.out create mode 100644 nix/tests/expected/roles.out delete mode 100644 nix/tests/sql/default_privs.sql create mode 100644 nix/tests/sql/roles.sql diff --git a/migrations/db/init-scripts/README.md b/migrations/db/init-scripts/README.md new file mode 100644 index 000000000..c12fe3b8f --- /dev/null +++ b/migrations/db/init-scripts/README.md @@ -0,0 +1,7 @@ + +The effects of these migrations are tested on: + +- [nix/tests/sql/auth.out](../../../nix/tests/expected/auth.out) +- [nix/tests/sql/storage.out](../../../nix/tests/expected/storage.out) +- [nix/tests/sql/roles.out](../../../nix/tests/expected/roles.out) +- [nix/tests/sql/evtrigs.out](../../../nix/tests/expected/evtrigs.out) diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out index d3277513a..22c983c00 100644 --- a/nix/tests/expected/auth.out +++ b/nix/tests/expected/auth.out @@ -13,33 +13,6 @@ where auth | supabase_admin (1 row) --- attributes of the supabase_auth_admin -select - rolcreaterole , - rolcanlogin , - rolsuper , - rolinherit , - rolcreatedb , - rolreplication , - rolconnlimit , - rolbypassrls , - rolvaliduntil -from pg_roles r -where r.rolname = 'supabase_auth_admin'; - rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil ----------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- - t | t | f | f | f | f | -1 | f | -(1 row) - -select - rolconfig -from pg_roles r -where r.rolname = 'supabase_auth_admin'; - rolconfig ---------------------------------------------------------------------------------- - {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} -(1 row) - -- auth schema tables with owners and rls policies select ns.nspname as schema_name, @@ -129,52 +102,3 @@ order by auth | uid | supabase_auth_admin (3 rows) --- roles which have USAGE on the auth schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'auth' - and a.privilege_type = 'USAGE' -order by - r.rolname; - schema_name | role_name | privilege_type --------------+---------------------+---------------- - auth | anon | USAGE - auth | authenticated | USAGE - auth | dashboard_user | USAGE - auth | postgres | USAGE - auth | service_role | USAGE - auth | supabase_admin | USAGE - auth | supabase_auth_admin | USAGE -(7 rows) - --- roles which have CREATE on the auth schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'auth' - and a.privilege_type = 'CREATE' -order by - r.rolname; - schema_name | role_name | privilege_type --------------+---------------------+---------------- - auth | dashboard_user | CREATE - auth | postgres | CREATE - auth | supabase_admin | CREATE - auth | supabase_auth_admin | CREATE -(4 rows) - diff --git a/nix/tests/expected/default_privs.out b/nix/tests/expected/default_privs.out deleted file mode 100644 index 862d10087..000000000 --- a/nix/tests/expected/default_privs.out +++ /dev/null @@ -1,12 +0,0 @@ --- this tests the outcome of doing ALTER DEFAULT PRIVILEGES.. -select defaclrole::regrole, defaclnamespace::regnamespace, defaclobjtype from pg_default_acl where defaclnamespace = 'public'::regnamespace::oid order by defaclrole::regrole, defaclobjtype; - defaclrole | defaclnamespace | defaclobjtype -----------------+-----------------+--------------- - supabase_admin | public | S - supabase_admin | public | f - supabase_admin | public | r - postgres | public | S - postgres | public | f - postgres | public | r -(6 rows) - diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out new file mode 100644 index 000000000..b4188512b --- /dev/null +++ b/nix/tests/expected/roles.out @@ -0,0 +1,580 @@ +-- all roles and attributes +select + rolname, + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + rolname | rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil +----------------------------+---------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- + anon | f | f | f | t | f | f | -1 | f | + authenticated | f | f | f | t | f | f | -1 | f | + authenticator | f | t | f | f | f | f | -1 | f | + dashboard_user | t | f | f | t | t | t | -1 | f | + pg_checkpoint | f | f | f | t | f | f | -1 | f | + pg_database_owner | f | f | f | t | f | f | -1 | f | + pg_execute_server_program | f | f | f | t | f | f | -1 | f | + pg_monitor | f | f | f | t | f | f | -1 | f | + pg_read_all_data | f | f | f | t | f | f | -1 | f | + pg_read_all_settings | f | f | f | t | f | f | -1 | f | + pg_read_all_stats | f | f | f | t | f | f | -1 | f | + pg_read_server_files | f | f | f | t | f | f | -1 | f | + pg_signal_backend | f | f | f | t | f | f | -1 | f | + pg_stat_scan_tables | f | f | f | t | f | f | -1 | f | + pg_write_all_data | f | f | f | t | f | f | -1 | f | + pg_write_server_files | f | f | f | t | f | f | -1 | f | + pgbouncer | f | t | f | t | f | f | -1 | f | + pgsodium_keyholder | f | f | f | t | f | f | -1 | f | + pgsodium_keyiduser | f | f | f | t | f | f | -1 | f | + pgsodium_keymaker | f | f | f | t | f | f | -1 | f | + pgtle_admin | f | f | f | t | f | f | -1 | f | + postgres | t | t | f | t | t | t | -1 | t | + service_role | f | f | f | t | f | f | -1 | t | + supabase_admin | t | t | t | t | t | t | -1 | t | + supabase_auth_admin | t | t | f | f | f | f | -1 | f | + supabase_functions_admin | t | t | f | f | f | f | -1 | f | + supabase_read_only_user | f | t | f | t | f | f | -1 | t | + supabase_replication_admin | f | t | f | t | f | t | -1 | f | + supabase_storage_admin | t | t | f | f | f | f | -1 | f | +(29 rows) + +select + rolname, + rolconfig +from pg_roles r +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + rolname | rolconfig +----------------------------+--------------------------------------------------------------------------------- + anon | {statement_timeout=3s} + authenticated | {statement_timeout=8s} + authenticator | {session_preload_libraries=safeupdate,statement_timeout=8s,lock_timeout=8s} + dashboard_user | + pg_checkpoint | + pg_database_owner | + pg_execute_server_program | + pg_monitor | + pg_read_all_data | + pg_read_all_settings | + pg_read_all_stats | + pg_read_server_files | + pg_signal_backend | + pg_stat_scan_tables | + pg_write_all_data | + pg_write_server_files | + pgbouncer | + pgsodium_keyholder | + pgsodium_keyiduser | + pgsodium_keymaker | + pgtle_admin | + postgres | {"search_path=\"\\$user\", public, extensions"} + service_role | + supabase_admin | {"search_path=\"$user\", public, auth, extensions",log_statement=none} + supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} + supabase_functions_admin | + supabase_read_only_user | + supabase_replication_admin | + supabase_storage_admin | {search_path=storage,log_statement=none} +(29 rows) + +-- all role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; + member | member_of (can become) | admin_option +----------------------------+------------------------+-------------- + anon | | + authenticated | | + authenticator | anon | f + authenticator | authenticated | f + authenticator | service_role | f + dashboard_user | | + pg_checkpoint | | + pg_database_owner | | + pg_execute_server_program | | + pg_monitor | pg_read_all_settings | f + pg_monitor | pg_read_all_stats | f + pg_monitor | pg_stat_scan_tables | f + pg_read_all_data | | + pg_read_all_settings | | + pg_read_all_stats | | + pg_read_server_files | | + pg_signal_backend | | + pg_stat_scan_tables | | + pg_write_all_data | | + pg_write_server_files | | + pgbouncer | | + pgsodium_keyholder | pgsodium_keyiduser | f + pgsodium_keyiduser | | + pgsodium_keymaker | pgsodium_keyholder | f + pgsodium_keymaker | pgsodium_keyiduser | f + pgtle_admin | | + postgres | anon | f + postgres | authenticated | f + postgres | pg_monitor | f + postgres | pg_read_all_data | f + postgres | pg_signal_backend | f + postgres | pgtle_admin | f + postgres | service_role | f + postgres | supabase_auth_admin | f + postgres | supabase_storage_admin | f + service_role | | + supabase_admin | | + supabase_auth_admin | | + supabase_functions_admin | | + supabase_read_only_user | pg_read_all_data | f + supabase_replication_admin | | + supabase_storage_admin | authenticator | f +(42 rows) + +-- Check all privileges of the roles on the schemas +select schema_name, privilege_type, grantee, default_for +from ( + -- ALTER DEFAULT privileges on schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + d.defaclrole::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_default_acl d + join + pg_namespace n on d.defaclnamespace = n.oid + cross join lateral aclexplode(d.defaclacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type != 'MAINTAIN' -- TODO: this is to maintain compat with pg17, we should cover it + union all + -- explicit grant usage and create on the schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + n.nspowner::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_namespace n + cross join lateral aclexplode(n.nspacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type in ('CREATE', 'USAGE') +) sub +order by schema_order, schema_name, privilege_type, grantee, default_for; + schema_name | privilege_type | grantee | default_for +--------------------+----------------+--------------------------+--------------------- + public | CREATE | pg_database_owner | pg_database_owner + public | DELETE | anon | supabase_admin + public | DELETE | anon | postgres + public | DELETE | authenticated | supabase_admin + public | DELETE | authenticated | postgres + public | DELETE | postgres | supabase_admin + public | DELETE | postgres | postgres + public | DELETE | service_role | supabase_admin + public | DELETE | service_role | postgres + public | EXECUTE | anon | supabase_admin + public | EXECUTE | anon | postgres + public | EXECUTE | authenticated | supabase_admin + public | EXECUTE | authenticated | postgres + public | EXECUTE | postgres | supabase_admin + public | EXECUTE | postgres | postgres + public | EXECUTE | service_role | supabase_admin + public | EXECUTE | service_role | postgres + public | INSERT | anon | supabase_admin + public | INSERT | anon | postgres + public | INSERT | authenticated | supabase_admin + public | INSERT | authenticated | postgres + public | INSERT | postgres | supabase_admin + public | INSERT | postgres | postgres + public | INSERT | service_role | supabase_admin + public | INSERT | service_role | postgres + public | REFERENCES | anon | supabase_admin + public | REFERENCES | anon | postgres + public | REFERENCES | authenticated | supabase_admin + public | REFERENCES | authenticated | postgres + public | REFERENCES | postgres | supabase_admin + public | REFERENCES | postgres | postgres + public | REFERENCES | service_role | supabase_admin + public | REFERENCES | service_role | postgres + public | SELECT | anon | supabase_admin + public | SELECT | anon | supabase_admin + public | SELECT | anon | postgres + public | SELECT | anon | postgres + public | SELECT | authenticated | supabase_admin + public | SELECT | authenticated | supabase_admin + public | SELECT | authenticated | postgres + public | SELECT | authenticated | postgres + public | SELECT | postgres | supabase_admin + public | SELECT | postgres | supabase_admin + public | SELECT | postgres | postgres + public | SELECT | postgres | postgres + public | SELECT | service_role | supabase_admin + public | SELECT | service_role | supabase_admin + public | SELECT | service_role | postgres + public | SELECT | service_role | postgres + public | TRIGGER | anon | supabase_admin + public | TRIGGER | anon | postgres + public | TRIGGER | authenticated | supabase_admin + public | TRIGGER | authenticated | postgres + public | TRIGGER | postgres | supabase_admin + public | TRIGGER | postgres | postgres + public | TRIGGER | service_role | supabase_admin + public | TRIGGER | service_role | postgres + public | TRUNCATE | anon | supabase_admin + public | TRUNCATE | anon | postgres + public | TRUNCATE | authenticated | supabase_admin + public | TRUNCATE | authenticated | postgres + public | TRUNCATE | postgres | supabase_admin + public | TRUNCATE | postgres | postgres + public | TRUNCATE | service_role | supabase_admin + public | TRUNCATE | service_role | postgres + public | UPDATE | anon | supabase_admin + public | UPDATE | anon | supabase_admin + public | UPDATE | anon | postgres + public | UPDATE | anon | postgres + public | UPDATE | authenticated | supabase_admin + public | UPDATE | authenticated | supabase_admin + public | UPDATE | authenticated | postgres + public | UPDATE | authenticated | postgres + public | UPDATE | postgres | supabase_admin + public | UPDATE | postgres | supabase_admin + public | UPDATE | postgres | postgres + public | UPDATE | postgres | postgres + public | UPDATE | service_role | supabase_admin + public | UPDATE | service_role | supabase_admin + public | UPDATE | service_role | postgres + public | UPDATE | service_role | postgres + public | USAGE | anon | supabase_admin + public | USAGE | anon | pg_database_owner + public | USAGE | anon | postgres + public | USAGE | authenticated | supabase_admin + public | USAGE | authenticated | pg_database_owner + public | USAGE | authenticated | postgres + public | USAGE | pg_database_owner | pg_database_owner + public | USAGE | postgres | supabase_admin + public | USAGE | postgres | pg_database_owner + public | USAGE | postgres | postgres + public | USAGE | service_role | supabase_admin + public | USAGE | service_role | pg_database_owner + public | USAGE | service_role | postgres + auth | CREATE | dashboard_user | supabase_admin + auth | CREATE | postgres | supabase_admin + auth | CREATE | supabase_admin | supabase_admin + auth | CREATE | supabase_auth_admin | supabase_admin + auth | DELETE | dashboard_user | supabase_auth_admin + auth | DELETE | postgres | supabase_auth_admin + auth | EXECUTE | dashboard_user | supabase_auth_admin + auth | EXECUTE | postgres | supabase_auth_admin + auth | INSERT | dashboard_user | supabase_auth_admin + auth | INSERT | postgres | supabase_auth_admin + auth | REFERENCES | dashboard_user | supabase_auth_admin + auth | REFERENCES | postgres | supabase_auth_admin + auth | SELECT | dashboard_user | supabase_auth_admin + auth | SELECT | dashboard_user | supabase_auth_admin + auth | SELECT | postgres | supabase_auth_admin + auth | SELECT | postgres | supabase_auth_admin + auth | TRIGGER | dashboard_user | supabase_auth_admin + auth | TRIGGER | postgres | supabase_auth_admin + auth | TRUNCATE | dashboard_user | supabase_auth_admin + auth | TRUNCATE | postgres | supabase_auth_admin + auth | UPDATE | dashboard_user | supabase_auth_admin + auth | UPDATE | dashboard_user | supabase_auth_admin + auth | UPDATE | postgres | supabase_auth_admin + auth | UPDATE | postgres | supabase_auth_admin + auth | USAGE | anon | supabase_admin + auth | USAGE | authenticated | supabase_admin + auth | USAGE | dashboard_user | supabase_admin + auth | USAGE | dashboard_user | supabase_auth_admin + auth | USAGE | postgres | supabase_admin + auth | USAGE | postgres | supabase_auth_admin + auth | USAGE | service_role | supabase_admin + auth | USAGE | supabase_admin | supabase_admin + auth | USAGE | supabase_auth_admin | supabase_admin + extensions | CREATE | dashboard_user | postgres + extensions | CREATE | postgres | postgres + extensions | DELETE | postgres | supabase_admin + extensions | EXECUTE | postgres | supabase_admin + extensions | INSERT | postgres | supabase_admin + extensions | REFERENCES | postgres | supabase_admin + extensions | SELECT | postgres | supabase_admin + extensions | SELECT | postgres | supabase_admin + extensions | TRIGGER | postgres | supabase_admin + extensions | TRUNCATE | postgres | supabase_admin + extensions | UPDATE | postgres | supabase_admin + extensions | UPDATE | postgres | supabase_admin + extensions | USAGE | anon | postgres + extensions | USAGE | authenticated | postgres + extensions | USAGE | dashboard_user | postgres + extensions | USAGE | postgres | supabase_admin + extensions | USAGE | postgres | postgres + extensions | USAGE | service_role | postgres + graphql | CREATE | supabase_admin | supabase_admin + graphql | DELETE | anon | supabase_admin + graphql | DELETE | authenticated | supabase_admin + graphql | DELETE | postgres | supabase_admin + graphql | DELETE | service_role | supabase_admin + graphql | EXECUTE | anon | supabase_admin + graphql | EXECUTE | authenticated | supabase_admin + graphql | EXECUTE | postgres | supabase_admin + graphql | EXECUTE | service_role | supabase_admin + graphql | INSERT | anon | supabase_admin + graphql | INSERT | authenticated | supabase_admin + graphql | INSERT | postgres | supabase_admin + graphql | INSERT | service_role | supabase_admin + graphql | REFERENCES | anon | supabase_admin + graphql | REFERENCES | authenticated | supabase_admin + graphql | REFERENCES | postgres | supabase_admin + graphql | REFERENCES | service_role | supabase_admin + graphql | SELECT | anon | supabase_admin + graphql | SELECT | anon | supabase_admin + graphql | SELECT | authenticated | supabase_admin + graphql | SELECT | authenticated | supabase_admin + graphql | SELECT | postgres | supabase_admin + graphql | SELECT | postgres | supabase_admin + graphql | SELECT | service_role | supabase_admin + graphql | SELECT | service_role | supabase_admin + graphql | TRIGGER | anon | supabase_admin + graphql | TRIGGER | authenticated | supabase_admin + graphql | TRIGGER | postgres | supabase_admin + graphql | TRIGGER | service_role | supabase_admin + graphql | TRUNCATE | anon | supabase_admin + graphql | TRUNCATE | authenticated | supabase_admin + graphql | TRUNCATE | postgres | supabase_admin + graphql | TRUNCATE | service_role | supabase_admin + graphql | UPDATE | anon | supabase_admin + graphql | UPDATE | anon | supabase_admin + graphql | UPDATE | authenticated | supabase_admin + graphql | UPDATE | authenticated | supabase_admin + graphql | UPDATE | postgres | supabase_admin + graphql | UPDATE | postgres | supabase_admin + graphql | UPDATE | service_role | supabase_admin + graphql | UPDATE | service_role | supabase_admin + graphql | USAGE | anon | supabase_admin + graphql | USAGE | anon | supabase_admin + graphql | USAGE | authenticated | supabase_admin + graphql | USAGE | authenticated | supabase_admin + graphql | USAGE | postgres | supabase_admin + graphql | USAGE | postgres | supabase_admin + graphql | USAGE | service_role | supabase_admin + graphql | USAGE | service_role | supabase_admin + graphql | USAGE | supabase_admin | supabase_admin + graphql_public | CREATE | supabase_admin | supabase_admin + graphql_public | DELETE | anon | supabase_admin + graphql_public | DELETE | authenticated | supabase_admin + graphql_public | DELETE | postgres | supabase_admin + graphql_public | DELETE | service_role | supabase_admin + graphql_public | EXECUTE | anon | supabase_admin + graphql_public | EXECUTE | authenticated | supabase_admin + graphql_public | EXECUTE | postgres | supabase_admin + graphql_public | EXECUTE | service_role | supabase_admin + graphql_public | INSERT | anon | supabase_admin + graphql_public | INSERT | authenticated | supabase_admin + graphql_public | INSERT | postgres | supabase_admin + graphql_public | INSERT | service_role | supabase_admin + graphql_public | REFERENCES | anon | supabase_admin + graphql_public | REFERENCES | authenticated | supabase_admin + graphql_public | REFERENCES | postgres | supabase_admin + graphql_public | REFERENCES | service_role | supabase_admin + graphql_public | SELECT | anon | supabase_admin + graphql_public | SELECT | anon | supabase_admin + graphql_public | SELECT | authenticated | supabase_admin + graphql_public | SELECT | authenticated | supabase_admin + graphql_public | SELECT | postgres | supabase_admin + graphql_public | SELECT | postgres | supabase_admin + graphql_public | SELECT | service_role | supabase_admin + graphql_public | SELECT | service_role | supabase_admin + graphql_public | TRIGGER | anon | supabase_admin + graphql_public | TRIGGER | authenticated | supabase_admin + graphql_public | TRIGGER | postgres | supabase_admin + graphql_public | TRIGGER | service_role | supabase_admin + graphql_public | TRUNCATE | anon | supabase_admin + graphql_public | TRUNCATE | authenticated | supabase_admin + graphql_public | TRUNCATE | postgres | supabase_admin + graphql_public | TRUNCATE | service_role | supabase_admin + graphql_public | UPDATE | anon | supabase_admin + graphql_public | UPDATE | anon | supabase_admin + graphql_public | UPDATE | authenticated | supabase_admin + graphql_public | UPDATE | authenticated | supabase_admin + graphql_public | UPDATE | postgres | supabase_admin + graphql_public | UPDATE | postgres | supabase_admin + graphql_public | UPDATE | service_role | supabase_admin + graphql_public | UPDATE | service_role | supabase_admin + graphql_public | USAGE | anon | supabase_admin + graphql_public | USAGE | anon | supabase_admin + graphql_public | USAGE | authenticated | supabase_admin + graphql_public | USAGE | authenticated | supabase_admin + graphql_public | USAGE | postgres | supabase_admin + graphql_public | USAGE | postgres | supabase_admin + graphql_public | USAGE | service_role | supabase_admin + graphql_public | USAGE | service_role | supabase_admin + graphql_public | USAGE | supabase_admin | supabase_admin + information_schema | CREATE | supabase_admin | supabase_admin + information_schema | USAGE | supabase_admin | supabase_admin + net | CREATE | supabase_admin | supabase_admin + net | USAGE | anon | supabase_admin + net | USAGE | authenticated | supabase_admin + net | USAGE | postgres | supabase_admin + net | USAGE | service_role | supabase_admin + net | USAGE | supabase_admin | supabase_admin + net | USAGE | supabase_functions_admin | supabase_admin + pg_catalog | CREATE | supabase_admin | supabase_admin + pg_catalog | USAGE | supabase_admin | supabase_admin + pgmq | CREATE | supabase_admin | supabase_admin + pgmq | SELECT | pg_monitor | supabase_admin + pgmq | SELECT | pg_monitor | supabase_admin + pgmq | USAGE | pg_monitor | supabase_admin + pgmq | USAGE | supabase_admin | supabase_admin + pgsodium | CREATE | supabase_admin | supabase_admin + pgsodium | DELETE | pgsodium_keyholder | supabase_admin + pgsodium | INSERT | pgsodium_keyholder | supabase_admin + pgsodium | REFERENCES | pgsodium_keyholder | supabase_admin + pgsodium | SELECT | pgsodium_keyholder | supabase_admin + pgsodium | SELECT | pgsodium_keyholder | supabase_admin + pgsodium | TRIGGER | pgsodium_keyholder | supabase_admin + pgsodium | TRUNCATE | pgsodium_keyholder | supabase_admin + pgsodium | UPDATE | pgsodium_keyholder | supabase_admin + pgsodium | UPDATE | pgsodium_keyholder | supabase_admin + pgsodium | USAGE | pgsodium_keyholder | supabase_admin + pgsodium | USAGE | supabase_admin | supabase_admin + pgsodium_masks | CREATE | supabase_admin | supabase_admin + pgsodium_masks | DELETE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | EXECUTE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | INSERT | pgsodium_keyiduser | supabase_admin + pgsodium_masks | REFERENCES | pgsodium_keyiduser | supabase_admin + pgsodium_masks | SELECT | pgsodium_keyiduser | supabase_admin + pgsodium_masks | SELECT | pgsodium_keyiduser | supabase_admin + pgsodium_masks | TRIGGER | pgsodium_keyiduser | supabase_admin + pgsodium_masks | TRUNCATE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | UPDATE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | UPDATE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | USAGE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | USAGE | pgsodium_keyiduser | supabase_admin + pgsodium_masks | USAGE | supabase_admin | supabase_admin + pgtle | CREATE | pgtle_admin | supabase_admin + pgtle | CREATE | supabase_admin | supabase_admin + pgtle | USAGE | pgtle_admin | supabase_admin + pgtle | USAGE | supabase_admin | supabase_admin + realtime | CREATE | supabase_admin | supabase_admin + realtime | DELETE | dashboard_user | supabase_admin + realtime | DELETE | postgres | supabase_admin + realtime | EXECUTE | dashboard_user | supabase_admin + realtime | EXECUTE | postgres | supabase_admin + realtime | INSERT | dashboard_user | supabase_admin + realtime | INSERT | postgres | supabase_admin + realtime | REFERENCES | dashboard_user | supabase_admin + realtime | REFERENCES | postgres | supabase_admin + realtime | SELECT | dashboard_user | supabase_admin + realtime | SELECT | dashboard_user | supabase_admin + realtime | SELECT | postgres | supabase_admin + realtime | SELECT | postgres | supabase_admin + realtime | TRIGGER | dashboard_user | supabase_admin + realtime | TRIGGER | postgres | supabase_admin + realtime | TRUNCATE | dashboard_user | supabase_admin + realtime | TRUNCATE | postgres | supabase_admin + realtime | UPDATE | dashboard_user | supabase_admin + realtime | UPDATE | dashboard_user | supabase_admin + realtime | UPDATE | postgres | supabase_admin + realtime | UPDATE | postgres | supabase_admin + realtime | USAGE | dashboard_user | supabase_admin + realtime | USAGE | postgres | supabase_admin + realtime | USAGE | postgres | supabase_admin + realtime | USAGE | supabase_admin | supabase_admin + repack | CREATE | postgres | supabase_admin + repack | CREATE | supabase_admin | supabase_admin + repack | DELETE | postgres | supabase_admin + repack | INSERT | postgres | supabase_admin + repack | REFERENCES | postgres | supabase_admin + repack | SELECT | postgres | supabase_admin + repack | SELECT | postgres | supabase_admin + repack | TRIGGER | postgres | supabase_admin + repack | TRUNCATE | postgres | supabase_admin + repack | UPDATE | postgres | supabase_admin + repack | UPDATE | postgres | supabase_admin + repack | USAGE | postgres | supabase_admin + repack | USAGE | postgres | supabase_admin + repack | USAGE | supabase_admin | supabase_admin + storage | CREATE | dashboard_user | supabase_admin + storage | CREATE | postgres | supabase_admin + storage | CREATE | supabase_admin | supabase_admin + storage | CREATE | supabase_storage_admin | supabase_admin + storage | DELETE | anon | postgres + storage | DELETE | authenticated | postgres + storage | DELETE | postgres | postgres + storage | DELETE | service_role | postgres + storage | EXECUTE | anon | postgres + storage | EXECUTE | authenticated | postgres + storage | EXECUTE | postgres | postgres + storage | EXECUTE | service_role | postgres + storage | INSERT | anon | postgres + storage | INSERT | authenticated | postgres + storage | INSERT | postgres | postgres + storage | INSERT | service_role | postgres + storage | REFERENCES | anon | postgres + storage | REFERENCES | authenticated | postgres + storage | REFERENCES | postgres | postgres + storage | REFERENCES | service_role | postgres + storage | SELECT | anon | postgres + storage | SELECT | anon | postgres + storage | SELECT | authenticated | postgres + storage | SELECT | authenticated | postgres + storage | SELECT | postgres | postgres + storage | SELECT | postgres | postgres + storage | SELECT | service_role | postgres + storage | SELECT | service_role | postgres + storage | TRIGGER | anon | postgres + storage | TRIGGER | authenticated | postgres + storage | TRIGGER | postgres | postgres + storage | TRIGGER | service_role | postgres + storage | TRUNCATE | anon | postgres + storage | TRUNCATE | authenticated | postgres + storage | TRUNCATE | postgres | postgres + storage | TRUNCATE | service_role | postgres + storage | UPDATE | anon | postgres + storage | UPDATE | anon | postgres + storage | UPDATE | authenticated | postgres + storage | UPDATE | authenticated | postgres + storage | UPDATE | postgres | postgres + storage | UPDATE | postgres | postgres + storage | UPDATE | service_role | postgres + storage | UPDATE | service_role | postgres + storage | USAGE | anon | supabase_admin + storage | USAGE | anon | postgres + storage | USAGE | authenticated | supabase_admin + storage | USAGE | authenticated | postgres + storage | USAGE | dashboard_user | supabase_admin + storage | USAGE | postgres | supabase_admin + storage | USAGE | postgres | postgres + storage | USAGE | service_role | supabase_admin + storage | USAGE | service_role | postgres + storage | USAGE | supabase_admin | supabase_admin + storage | USAGE | supabase_storage_admin | supabase_admin + topology | CREATE | supabase_admin | supabase_admin + topology | USAGE | supabase_admin | supabase_admin + vault | CREATE | supabase_admin | supabase_admin + vault | USAGE | postgres | supabase_admin + vault | USAGE | supabase_admin | supabase_admin +(390 rows) + diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index 755e6c516..018b98aae 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -13,33 +13,6 @@ where storage | supabase_admin (1 row) --- attributes of the supabase_storage_admin -select - rolcreaterole , - rolcanlogin , - rolsuper , - rolinherit , - rolcreatedb , - rolreplication , - rolconnlimit , - rolbypassrls , - rolvaliduntil -from pg_roles r -where r.rolname = 'supabase_storage_admin'; - rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil ----------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- - t | t | f | f | f | f | -1 | f | -(1 row) - -select - rolconfig -from pg_roles r -where r.rolname = 'supabase_storage_admin'; - rolconfig ------------------------------------------- - {search_path=storage,log_statement=none} -(1 row) - -- storage schema tables with owners and rls policies select ns.nspname as schema_name, @@ -123,52 +96,3 @@ order by storage | search | supabase_storage_admin (4 rows) --- roles which have USAGE on the storage schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'storage' - and a.privilege_type = 'USAGE' -order by - r.rolname; - schema_name | role_name | privilege_type --------------+------------------------+---------------- - storage | anon | USAGE - storage | authenticated | USAGE - storage | dashboard_user | USAGE - storage | postgres | USAGE - storage | service_role | USAGE - storage | supabase_admin | USAGE - storage | supabase_storage_admin | USAGE -(7 rows) - --- roles which have CREATE on the storage schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'storage' - and a.privilege_type = 'CREATE' -order by - r.rolname; - schema_name | role_name | privilege_type --------------+------------------------+---------------- - storage | dashboard_user | CREATE - storage | postgres | CREATE - storage | supabase_admin | CREATE - storage | supabase_storage_admin | CREATE -(4 rows) - diff --git a/nix/tests/sql/auth.sql b/nix/tests/sql/auth.sql index 47e2931ae..051d6e638 100644 --- a/nix/tests/sql/auth.sql +++ b/nix/tests/sql/auth.sql @@ -9,25 +9,6 @@ join where n.nspname = 'auth'; --- attributes of the supabase_auth_admin -select - rolcreaterole , - rolcanlogin , - rolsuper , - rolinherit , - rolcreatedb , - rolreplication , - rolconnlimit , - rolbypassrls , - rolvaliduntil -from pg_roles r -where r.rolname = 'supabase_auth_admin'; - -select - rolconfig -from pg_roles r -where r.rolname = 'supabase_auth_admin'; - -- auth schema tables with owners and rls policies select ns.nspname as schema_name, @@ -87,35 +68,3 @@ where n.nspname = 'auth' order by p.proname; - --- roles which have USAGE on the auth schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'auth' - and a.privilege_type = 'USAGE' -order by - r.rolname; - --- roles which have CREATE on the auth schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'auth' - and a.privilege_type = 'CREATE' -order by - r.rolname; diff --git a/nix/tests/sql/default_privs.sql b/nix/tests/sql/default_privs.sql deleted file mode 100644 index 5df2629b9..000000000 --- a/nix/tests/sql/default_privs.sql +++ /dev/null @@ -1,2 +0,0 @@ --- this tests the outcome of doing ALTER DEFAULT PRIVILEGES.. -select defaclrole::regrole, defaclnamespace::regnamespace, defaclobjtype from pg_default_acl where defaclnamespace = 'public'::regnamespace::oid order by defaclrole::regrole, defaclobjtype; diff --git a/nix/tests/sql/roles.sql b/nix/tests/sql/roles.sql new file mode 100644 index 000000000..9e68a171a --- /dev/null +++ b/nix/tests/sql/roles.sql @@ -0,0 +1,77 @@ +-- all roles and attributes +select + rolname, + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + +select + rolname, + rolconfig +from pg_roles r +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + +-- all role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +-- TODO: this exclusion is to maintain compat with pg17, we should cover it +where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; + +-- Check all privileges of the roles on the schemas +select schema_name, privilege_type, grantee, default_for +from ( + -- ALTER DEFAULT privileges on schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + d.defaclrole::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_default_acl d + join + pg_namespace n on d.defaclnamespace = n.oid + cross join lateral aclexplode(d.defaclacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type != 'MAINTAIN' -- TODO: this is to maintain compat with pg17, we should cover it + union all + -- explicit grant usage and create on the schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + n.nspowner::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_namespace n + cross join lateral aclexplode(n.nspacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type in ('CREATE', 'USAGE') +) sub +order by schema_order, schema_name, privilege_type, grantee, default_for; diff --git a/nix/tests/sql/storage.sql b/nix/tests/sql/storage.sql index 5dfd5f0bb..8e52dda6f 100644 --- a/nix/tests/sql/storage.sql +++ b/nix/tests/sql/storage.sql @@ -9,25 +9,6 @@ join where n.nspname = 'storage'; --- attributes of the supabase_storage_admin -select - rolcreaterole , - rolcanlogin , - rolsuper , - rolinherit , - rolcreatedb , - rolreplication , - rolconnlimit , - rolbypassrls , - rolvaliduntil -from pg_roles r -where r.rolname = 'supabase_storage_admin'; - -select - rolconfig -from pg_roles r -where r.rolname = 'supabase_storage_admin'; - -- storage schema tables with owners and rls policies select ns.nspname as schema_name, @@ -87,35 +68,3 @@ where n.nspname = 'storage' order by p.proname; - --- roles which have USAGE on the storage schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'storage' - and a.privilege_type = 'USAGE' -order by - r.rolname; - --- roles which have CREATE on the storage schema -select - n.nspname as schema_name, - r.rolname as role_name, - a.privilege_type -from - pg_namespace n -cross join lateral aclexplode(n.nspacl) as a -join - pg_roles r on a.grantee = r.oid -where - n.nspname = 'storage' - and a.privilege_type = 'CREATE' -order by - r.rolname; From 55957eaf40e071c3bdf173150215958e917c4508 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 4 Apr 2025 15:46:38 -0500 Subject: [PATCH 194/271] test: realtime publication Only includes a publication, but a dedicated file for realtime for improved visibility. --- nix/tests/expected/realtime.out | 16 ++++++++++++++++ nix/tests/sql/realtime.sql | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 nix/tests/expected/realtime.out create mode 100644 nix/tests/sql/realtime.sql diff --git a/nix/tests/expected/realtime.out b/nix/tests/expected/realtime.out new file mode 100644 index 000000000..48f7c6aab --- /dev/null +++ b/nix/tests/expected/realtime.out @@ -0,0 +1,16 @@ +-- only a publication from supabase realtime is expected +SELECT + pubname AS publication_name, + pubowner::regrole AS owner, + puballtables, + pubinsert, + pubupdate, + pubdelete, + pubtruncate +FROM + pg_publication; + publication_name | owner | puballtables | pubinsert | pubupdate | pubdelete | pubtruncate +-------------------+----------+--------------+-----------+-----------+-----------+------------- + supabase_realtime | postgres | f | t | t | t | t +(1 row) + diff --git a/nix/tests/sql/realtime.sql b/nix/tests/sql/realtime.sql new file mode 100644 index 000000000..28f13a5ed --- /dev/null +++ b/nix/tests/sql/realtime.sql @@ -0,0 +1,11 @@ +-- only a publication from supabase realtime is expected +SELECT + pubname AS publication_name, + pubowner::regrole AS owner, + puballtables, + pubinsert, + pubupdate, + pubdelete, + pubtruncate +FROM + pg_publication; From 62421a2b09e8bb8dc4579e2a4c04e7aa7e1e6aa9 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 4 Apr 2025 16:16:35 -0500 Subject: [PATCH 195/271] test: extensions schema tests that there are default extensions included in the "extensions" schema. --- nix/tests/expected/extensions_schema.out | 22 ++++++++++++++++++++++ nix/tests/sql/extensions_schema.sql | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 nix/tests/expected/extensions_schema.out create mode 100644 nix/tests/sql/extensions_schema.sql diff --git a/nix/tests/expected/extensions_schema.out b/nix/tests/expected/extensions_schema.out new file mode 100644 index 000000000..7d3dffa95 --- /dev/null +++ b/nix/tests/expected/extensions_schema.out @@ -0,0 +1,22 @@ +-- all default extensions are installed in a schema "extensions" +-- we don't include the version as that will break often, we only care about +-- ensuring these extensions are present +select + e.extname as extension_name, + n.nspname as schema_name, + e.extowner::regrole as extension_owner +from + pg_extension e +join + pg_namespace n on e.extnamespace = n.oid +where + n.nspname = 'extensions' and e.extname != 'pgjwt' +order by + e.extname; + extension_name | schema_name | extension_owner +--------------------+-------------+----------------- + pg_stat_statements | extensions | supabase_admin + pgcrypto | extensions | supabase_admin + uuid-ossp | extensions | supabase_admin +(3 rows) + diff --git a/nix/tests/sql/extensions_schema.sql b/nix/tests/sql/extensions_schema.sql new file mode 100644 index 000000000..f3d0b3528 --- /dev/null +++ b/nix/tests/sql/extensions_schema.sql @@ -0,0 +1,15 @@ +-- all default extensions are installed in a schema "extensions" +-- we don't include the version as that will break often, we only care about +-- ensuring these extensions are present +select + e.extname as extension_name, + n.nspname as schema_name, + e.extowner::regrole as extension_owner +from + pg_extension e +join + pg_namespace n on e.extnamespace = n.oid +where + n.nspname = 'extensions' and e.extname != 'pgjwt' +order by + e.extname; From 79837275296612c2d896dd90ee028e70024f8323 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 4 Apr 2025 16:30:53 -0500 Subject: [PATCH 196/271] test: add event trigger function schema --- nix/tests/expected/evtrigs.out | 47 ++++++++++++++++++---------------- nix/tests/sql/evtrigs.sql | 19 ++++++++------ 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/nix/tests/expected/evtrigs.out b/nix/tests/expected/evtrigs.out index c3b642701..7f8025834 100644 --- a/nix/tests/expected/evtrigs.out +++ b/nix/tests/expected/evtrigs.out @@ -1,25 +1,28 @@ -SELECT +select e.evtname, - e.evtowner::regrole AS evtowner, - e.evtfoid::regproc AS evtfunction, - p.proowner::regrole AS function_owner -FROM pg_event_trigger e -JOIN pg_proc p - ON e.evtfoid = p.oid -WHERE p.prorettype = 'event_trigger'::regtype; - evtname | evtowner | evtfunction | function_owner -----------------------------------------+----------------+------------------------------------+---------------- - issue_pg_net_access | postgres | grant_pg_net_access | postgres - issue_pg_graphql_access | supabase_admin | grant_pg_graphql_access | supabase_admin - issue_graphql_placeholder | supabase_admin | set_graphql_placeholder | supabase_admin - pgrst_ddl_watch | supabase_admin | pgrst_ddl_watch | supabase_admin - pgrst_drop_watch | supabase_admin | pgrst_drop_watch | supabase_admin - graphql_watch_ddl | supabase_admin | graphql.increment_schema_version | supabase_admin - graphql_watch_drop | supabase_admin | graphql.increment_schema_version | supabase_admin - issue_pg_cron_access | supabase_admin | grant_pg_cron_access | postgres - pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle.pg_tle_feature_info_sql_drop | supabase_admin - pgaudit_ddl_command_end | supabase_admin | pgaudit_ddl_command_end | supabase_admin - pgaudit_sql_drop | supabase_admin | pgaudit_sql_drop | supabase_admin - pgsodium_trg_mask_update | supabase_admin | pgsodium.trg_mask_update | supabase_admin + e.evtowner::regrole as evtowner, + n_func.nspname as evtfunction_schema, + e.evtfoid::regproc as evtfunction, + p.proowner::regrole as function_owner +from pg_event_trigger e +join pg_proc p + on e.evtfoid = p.oid +join pg_namespace n_func + on p.pronamespace = n_func.oid +where p.prorettype = 'event_trigger'::regtype; + evtname | evtowner | evtfunction_schema | evtfunction | function_owner +----------------------------------------+----------------+--------------------+------------------------------------+---------------- + issue_pg_net_access | postgres | extensions | grant_pg_net_access | postgres + issue_pg_graphql_access | supabase_admin | extensions | grant_pg_graphql_access | supabase_admin + issue_graphql_placeholder | supabase_admin | extensions | set_graphql_placeholder | supabase_admin + pgrst_ddl_watch | supabase_admin | extensions | pgrst_ddl_watch | supabase_admin + pgrst_drop_watch | supabase_admin | extensions | pgrst_drop_watch | supabase_admin + graphql_watch_ddl | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin + graphql_watch_drop | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin + issue_pg_cron_access | supabase_admin | extensions | grant_pg_cron_access | postgres + pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle | pgtle.pg_tle_feature_info_sql_drop | supabase_admin + pgaudit_ddl_command_end | supabase_admin | public | pgaudit_ddl_command_end | supabase_admin + pgaudit_sql_drop | supabase_admin | public | pgaudit_sql_drop | supabase_admin + pgsodium_trg_mask_update | supabase_admin | pgsodium | pgsodium.trg_mask_update | supabase_admin (12 rows) diff --git a/nix/tests/sql/evtrigs.sql b/nix/tests/sql/evtrigs.sql index f482dd7ed..cfbb201aa 100644 --- a/nix/tests/sql/evtrigs.sql +++ b/nix/tests/sql/evtrigs.sql @@ -1,9 +1,12 @@ -SELECT +select e.evtname, - e.evtowner::regrole AS evtowner, - e.evtfoid::regproc AS evtfunction, - p.proowner::regrole AS function_owner -FROM pg_event_trigger e -JOIN pg_proc p - ON e.evtfoid = p.oid -WHERE p.prorettype = 'event_trigger'::regtype; + e.evtowner::regrole as evtowner, + n_func.nspname as evtfunction_schema, + e.evtfoid::regproc as evtfunction, + p.proowner::regrole as function_owner +from pg_event_trigger e +join pg_proc p + on e.evtfoid = p.oid +join pg_namespace n_func + on p.pronamespace = n_func.oid +where p.prorettype = 'event_trigger'::regtype; From 7d57e19769e6ef1053e71ad3706dde6f1f32b672 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 4 Apr 2025 16:43:22 -0500 Subject: [PATCH 197/271] test: storage and auth migrations --- nix/tests/expected/auth.out | 13 +++++++++++++ nix/tests/expected/storage.out | 6 ++++++ nix/tests/sql/auth.sql | 3 +++ nix/tests/sql/storage.sql | 3 +++ 4 files changed, 25 insertions(+) diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out index 22c983c00..60b32ca19 100644 --- a/nix/tests/expected/auth.out +++ b/nix/tests/expected/auth.out @@ -102,3 +102,16 @@ order by auth | uid | supabase_auth_admin (3 rows) +-- auth service schema migrations +select * from auth.schema_migrations; + version +---------------- + 20171026211738 + 20171026211808 + 20171026211834 + 20180103212743 + 20180108183307 + 20180119214651 + 20180125194653 +(7 rows) + diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index 018b98aae..30530a2b6 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -96,3 +96,9 @@ order by storage | search | supabase_storage_admin (4 rows) +-- storage service migrations +select * from storage.migrations ; + id | name | hash | executed_at +----+------+------+------------- +(0 rows) + diff --git a/nix/tests/sql/auth.sql b/nix/tests/sql/auth.sql index 051d6e638..9bba4d0ee 100644 --- a/nix/tests/sql/auth.sql +++ b/nix/tests/sql/auth.sql @@ -68,3 +68,6 @@ where n.nspname = 'auth' order by p.proname; + +-- auth service schema migrations +select * from auth.schema_migrations; diff --git a/nix/tests/sql/storage.sql b/nix/tests/sql/storage.sql index 8e52dda6f..6938c8414 100644 --- a/nix/tests/sql/storage.sql +++ b/nix/tests/sql/storage.sql @@ -68,3 +68,6 @@ where n.nspname = 'storage' order by p.proname; + +-- storage service migrations +select * from storage.migrations ; From 294a017f8ee10dfcda78d6f00a336619994121d8 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Sun, 6 Apr 2025 11:25:21 +0530 Subject: [PATCH 198/271] fix: adminapi permissions for auth dir (#1524) * fix: adminapi permissions for auth dir * mnv --- ansible/files/permission_check.py | 1 + ansible/tasks/internal/admin-api.yml | 2 +- ansible/tasks/setup-gotrue.yml | 2 +- ansible/vars.yml | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index 5bf421018..c4f73aa4e 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -79,6 +79,7 @@ {"groupname": "admin", "username": "adminapi"}, {"groupname": "adminapi", "username": "adminapi"}, {"groupname": "envoy", "username": "adminapi"}, + {"groupname": "gotrue", "username": "adminapi"}, {"groupname": "kong", "username": "adminapi"}, {"groupname": "pgbouncer", "username": "adminapi"}, {"groupname": "postgres", "username": "adminapi"}, diff --git a/ansible/tasks/internal/admin-api.yml b/ansible/tasks/internal/admin-api.yml index da93fef62..5eb6fd276 100644 --- a/ansible/tasks/internal/admin-api.yml +++ b/ansible/tasks/internal/admin-api.yml @@ -1,7 +1,7 @@ - name: adminapi - system user user: name: adminapi - groups: root,admin,envoy,kong,pgbouncer,postgres,postgrest,systemd-journal,vector,wal-g + groups: root,admin,envoy,gotrue,kong,pgbouncer,postgres,postgrest,systemd-journal,vector,wal-g append: yes - name: Move shell scripts to /root dir diff --git a/ansible/tasks/setup-gotrue.yml b/ansible/tasks/setup-gotrue.yml index d2c763853..786f9a767 100644 --- a/ansible/tasks/setup-gotrue.yml +++ b/ansible/tasks/setup-gotrue.yml @@ -35,7 +35,7 @@ path: /etc/auth.d state: directory owner: gotrue - mode: 0755 + mode: 0775 - name: gotrue - unpack archive in /opt/gotrue unarchive: diff --git a/ansible/vars.yml b/ansible/vars.yml index 630bdee62..1755b628f 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.59-orioledb" - postgres17: "17.4.1.009" - postgres15: "15.8.1.066" + postgresorioledb-17: "17.0.1.60-orioledb" + postgres17: "17.4.1.010" + postgres15: "15.8.1.067" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 0d378bb03e7d4887aa5abb36d579d0fd75200c93 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Sun, 6 Apr 2025 20:10:52 +0530 Subject: [PATCH 199/271] fix: permissions for github release (#1527) * fix: permissions for github release * Update vars.yml --- .github/workflows/ami-release-nix.yml | 2 +- ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 31089218d..004a597d7 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: permissions: - contents: read + contents: write id-token: write jobs: diff --git a/ansible/vars.yml b/ansible/vars.yml index 1755b628f..aea7e45cc 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.60-orioledb" - postgres17: "17.4.1.010" - postgres15: "15.8.1.067" + postgresorioledb-17: "17.0.1.61-orioledb" + postgres17: "17.4.1.011" + postgres15: "15.8.1.068" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 0281d1c824598e1a83f7cd67e32a44e6a39e7620 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sun, 6 Apr 2025 10:48:35 -0400 Subject: [PATCH 200/271] chore: keep oriole numbering consistent --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index aea7e45cc..6454ddf3e 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.61-orioledb" - postgres17: "17.4.1.011" - postgres15: "15.8.1.068" + postgresorioledb-17: "17.0.1.062-orioledb" + postgres17: "17.4.1.012" + postgres15: "15.8.1.069" # Non Postgres Extensions pgbouncer_release: "1.19.0" From dcd764762137fca1e0a76f34999faca3bfa518d7 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Mon, 7 Apr 2025 14:30:27 +0800 Subject: [PATCH 201/271] chore: allow manually releasing migrations on stg --- .github/workflows/publish-migrations-staging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-migrations-staging.yml b/.github/workflows/publish-migrations-staging.yml index 440838ac7..72b28e927 100644 --- a/.github/workflows/publish-migrations-staging.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + workflow_dispatch: jobs: build: From 4dab2fb6a9ec2c41a610c43e6695d47c6bf83c02 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 8 Apr 2025 07:46:05 +0800 Subject: [PATCH 202/271] chore: additional note on qemu build process --- qemu_artifact.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu_artifact.md b/qemu_artifact.md index c26b63b36..847a1c8c2 100644 --- a/qemu_artifact.md +++ b/qemu_artifact.md @@ -26,6 +26,8 @@ b. packer build (`qemu-arm64-nix.pkr.hcl`) - performs the work that was performed as part of the "stage1" and "stage2" builds - this work is executed using `ebssurrogate/scripts/qemu-bootstrap-nix.sh` +While the AMI build uses the EBS Surrogate Packer builder to create a minimal boot environment that it then adds things to, the QEMU build merely adds things to the Ubuntu Cloud Image. As such, it's likely possible to make something more minimal with a bit more work, but this was deemed unnecessary for now. Collapsing Stage1 and Stage2 was done in the interest of iteration speed, as executing them together is much faster than saving an artifact off stage1, booting another VM off it, and then executing stage2. + ## Publish image for later use Following `make init alpine-image`, the generated VM image should be bundled as a container image with the name: `supabase-postgres-test` . Publish the built docker image to a registry of your choosing, and use the published image with e.g. KubeVirt. From 645db7243cfdb34ac487ff11dc806485c9f72ace Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:26:40 +0100 Subject: [PATCH 203/271] fix: bump versions to add new fixed adminapi version (#1534) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 6454ddf3e..3cd541336 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.062-orioledb" - postgres17: "17.4.1.012" - postgres15: "15.8.1.069" + postgresorioledb-17: "17.0.1.063-orioledb" + postgres17: "17.4.1.013" + postgres15: "15.8.1.070" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.77.0 +adminapi_release: 0.77.1 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From ae8cdaf6c41a656a262c97c45d19b2fbce82c1ee Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Thu, 10 Apr 2025 22:14:17 +0200 Subject: [PATCH 204/271] feat: limit /etc to readonly (#1451) * feat: limit /etc to readonly https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#ReadWritePaths= Prevent postgres, or child-process of, from writing to /etc * bump version numbers * chore: add test for read-only mount * start / stop postgresql.service when doing osquery permission checks * chore: version suffix for local infra tests * chore: bump versions --------- Co-authored-by: Sam Rose --- ansible/files/permission_check.py | 31 +++++++++++++++++++ .../postgresql_config/postgresql.service.j2 | 3 ++ ansible/playbook.yml | 2 ++ ansible/vars.yml | 6 ++-- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index c4f73aa4e..a753f69ec 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -96,6 +96,8 @@ ], } +# postgresql.service is expected to mount /etc as read-only +expected_mount = "/etc ro" # This program depends on osquery being installed on the system # Function to run osquery @@ -152,6 +154,33 @@ def check_nixbld_users(): print("All nixbld users are in the 'nixbld' group.") +def check_postgresql_mount(): + # processes table has the nix .postgres-wrapped path as the + # binary path, rather than /usr/lib/postgresql/bin/postgres which + # is a symlink to /var/lib/postgresql/.nix-profile/bin/postgres, a script + # that ultimately calls /nix/store/...-postgresql-and-plugins-15.8/bin/.postgres-wrapped + query = """ + SELECT pid + FROM processes + WHERE path LIKE '%.postgres-wrapped%' + AND cmdline LIKE '%-D /etc/postgresql%'; + """ + query_result = run_osquery(query) + parsed_result = parse_json(query_result) + + pid = parsed_result[0].get("pid") + + # get the mounts for the process + with open(f"/proc/{pid}/mounts", "r") as o: + lines = [line for line in o if "/etc" in line and "ro," in line] + if len(lines) == 0: + print(f"Expected exactly 1 match, got 0") + sys.exit(1) + if len(lines) != 1: + print(f"Expected exactly 1 match, got {len(lines)}: {';'.join(lines)}") + sys.exit(1) + + print("postgresql.service mounts /etc as read-only.") def main(): parser = argparse.ArgumentParser( @@ -219,6 +248,8 @@ def main(): # Check if all nixbld users are in the nixbld group check_nixbld_users() + # Check if postgresql.service is using a read-only mount for /etc + check_postgresql_mount() if __name__ == "__main__": main() diff --git a/ansible/files/postgresql_config/postgresql.service.j2 b/ansible/files/postgresql_config/postgresql.service.j2 index c056ac433..4cc138ec7 100644 --- a/ansible/files/postgresql_config/postgresql.service.j2 +++ b/ansible/files/postgresql_config/postgresql.service.j2 @@ -21,5 +21,8 @@ RestartSec=5 OOMScoreAdjust=-1000 EnvironmentFile=-/etc/environment.d/postgresql.env LimitNOFILE=16384 +{% if supabase_internal is defined %} +ReadOnlyPaths=/etc +{% endif %} [Install] WantedBy=multi-user.target diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 806079aa9..bcd47ac9b 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -213,7 +213,9 @@ - name: Run osquery permission checks become: yes shell: | + systemctl start postgresql.service sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && /usr/bin/python3 /tmp/ansible-playbook/ansible/files/permission_check.py {{ '--qemu' if qemu_mode is defined else '' }}" + systemctl stop postgresql.service when: stage2_nix - name: Remove osquery diff --git a/ansible/vars.yml b/ansible/vars.yml index 3cd541336..f0da23fd2 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.063-orioledb" - postgres17: "17.4.1.013" - postgres15: "15.8.1.070" + postgresorioledb-17: "17.0.1.064-orioledb" + postgres17: "17.4.1.014" + postgres15: "15.8.1.071" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 36b18b42fa4f8fcb0ce19f8193221c9538a25c7c Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 10 Apr 2025 22:19:56 -0500 Subject: [PATCH 205/271] test: pgmq functions' owner modification The change on https://github.com/supabase/postgres/pull/1362 modified pgmq functions default owner, which is `supabase_admin`, to `postgres`. This tests function owners of pgmq. Partly addresses https://github.com/supabase/postgres/issues/1536. --- nix/tests/expected/pgmq.out | 51 ++++++++++++++++++++++++++++++++++++- nix/tests/sql/pgmq.sql | 21 ++++++++++++--- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/nix/tests/expected/pgmq.out b/nix/tests/expected/pgmq.out index 9fb18191b..bce379fc7 100644 --- a/nix/tests/expected/pgmq.out +++ b/nix/tests/expected/pgmq.out @@ -51,7 +51,7 @@ select msg_id, read_ct, message -from +from pgmq.pop('Foo'); msg_id | read_ct | message --------+---------+--------- @@ -139,3 +139,52 @@ CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" PL/pgSQL function pgmq."create"(text) line 3 at PERFORM +\echo + +-- pgmq schema functions with owners (ownership is modified on ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql) +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'pgmq' +order by + p.proname; + schema_name | function_name | owner +-------------+-------------------------------+---------- + pgmq | _belongs_to_pgmq | postgres + pgmq | _ensure_pg_partman_installed | postgres + pgmq | _get_partition_col | postgres + pgmq | _get_pg_partman_major_version | postgres + pgmq | _get_pg_partman_schema | postgres + pgmq | archive | postgres + pgmq | archive | postgres + pgmq | convert_archive_partitioned | postgres + pgmq | create | postgres + pgmq | create_non_partitioned | postgres + pgmq | create_partitioned | postgres + pgmq | create_unlogged | postgres + pgmq | delete | postgres + pgmq | delete | postgres + pgmq | detach_archive | postgres + pgmq | drop_queue | postgres + pgmq | format_table_name | postgres + pgmq | list_queues | postgres + pgmq | metrics | postgres + pgmq | metrics_all | postgres + pgmq | pop | postgres + pgmq | purge_queue | postgres + pgmq | read | postgres + pgmq | read_with_poll | postgres + pgmq | send | postgres + pgmq | send_batch | postgres + pgmq | set_vt | postgres + pgmq | validate_queue_name | postgres +(28 rows) + diff --git a/nix/tests/sql/pgmq.sql b/nix/tests/sql/pgmq.sql index cd47cc34d..dffb108bf 100644 --- a/nix/tests/sql/pgmq.sql +++ b/nix/tests/sql/pgmq.sql @@ -35,7 +35,7 @@ select msg_id, read_ct, message -from +from pgmq.pop('Foo'); @@ -84,7 +84,20 @@ select select pgmq.create('F--oo'); select pgmq.create('F$oo'); select pgmq.create($$F'oo$$); +\echo - - - +-- pgmq schema functions with owners (ownership is modified on ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql) +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'pgmq' +order by + p.proname; From f7d6479283b19e813ca1dd4cd3d035f09a6261b0 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Mon, 14 Apr 2025 11:10:54 +0800 Subject: [PATCH 206/271] chore: bump adminapi to v0.77.2 (#1538) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index f0da23fd2..4d3102a17 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.064-orioledb" - postgres17: "17.4.1.014" - postgres15: "15.8.1.071" + postgresorioledb-17: "17.0.1.065-orioledb" + postgres17: "17.4.1.015" + postgres15: "15.8.1.072" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.77.1 +adminapi_release: 0.77.2 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From 67fb756c16711aa5ea8c71f9709df9f11c22c3c8 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Mon, 14 Apr 2025 16:26:18 +1000 Subject: [PATCH 207/271] feat: bump wrappers version to v0.4.6 (#1542) * feat: test bump wrappers version to v0.4.6 * feat: test bump wrappers version to v0.4.6 * feat: test bump wrappers version to v0.4.6 * feat: test bump wrappers version to v0.4.6 * increase runner size * feat: test bump wrappers version to v0.4.6 * restore temp changes * update release hash code * chore: fix nix build on macos and address space on gh runner (#1543) * chore: fix nix build on macos and address space on gh runner * chore: special handling for oriole * chore: permissions * chore: make sure permission to run is granted * test on staging * restore temp change for release test --------- Co-authored-by: samrose --- .github/workflows/testinfra-nix.yml | 22 +++++++++++++++++++++- Dockerfile-15 | 2 +- Dockerfile-17 | 2 +- Dockerfile-orioledb-17 | 2 +- nix/ext/wrappers/default.nix | 20 +++++++++++++++----- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-nix.yml index c486dfc34..2b07e716f 100644 --- a/.github/workflows/testinfra-nix.yml +++ b/.github/workflows/testinfra-nix.yml @@ -19,6 +19,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main + - name: Clean Nix store before build + run: | + sudo nix-collect-garbage -d || true + sudo nix-store --optimize || true + df -h / # Display available space + - name: Set PostgreSQL versions id: set-versions run: | @@ -80,13 +86,27 @@ jobs: packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - + + - name: Clean up after AMI stage 1 + if: always() # Run even if previous steps fail + run: | + sudo nix-collect-garbage -d # Delete old generations of all profiles + sudo rm -rf /tmp/* # Clean temporary files + df -h / # Display available space + - name: Build AMI stage 2 run: | packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl + - name: Clean up after AMI stage 2 + if: always() # Run even if previous steps fail + run: | + sudo nix-collect-garbage -d # Delete old generations of all profiles + sudo rm -rf /tmp/* # Clean temporary files + df -h / # Display available space + - name: Run tests timeout-minutes: 10 env: diff --git a/Dockerfile-15 b/Dockerfile-15 index b7f48977e..42ffc858c 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -30,7 +30,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.5 +ARG wrappers_release=0.4.6 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-17 b/Dockerfile-17 index 83d2f265b..8bfdf39af 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.5 +ARG wrappers_release=0.4.6 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index fe9b902cb..f7c0d4f63 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.5 +ARG wrappers_release=0.4.6 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 74810a342..e87dfb372 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -17,16 +17,16 @@ let in buildPgrxExtension_0_12_9 rec { pname = "supabase-wrappers"; - version = "0.4.5"; + version = "0.4.6"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = ["0.4.5" "0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; rev = "v${version}"; - hash = "sha256-IgDfVFROMCHYLZ/Iqj12MsQjPPCdRoH+3oi3Ki/iaRI="; + hash = "sha256-hthb3qEXT1Kf4yPoq0udEbQzlyLtI5tug6sK4YAPFjU="; }; nativeBuildInputs = [ pkg-config cargo git ]; @@ -38,11 +38,21 @@ buildPgrxExtension_0_12_9 rec { NIX_LDFLAGS = "-L${postgresql}/lib -lpq"; - # Set necessary environment variables for pgrx + # Set necessary environment variables for pgrx in darwin only env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - PGPORT = "5435"; + # Calculate unique port for each PostgreSQL version: + # - Check if version contains underscore (indicating OrioleDB) + # - Add 1 to port if it's OrioleDB + # - Add 2 for each major version above 15 + # Examples: + # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435 + # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440 + # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439 + PGPORT = toString (5435 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version }; OPENSSL_NO_VENDOR = 1; From 61ff753243078fe2b14e5b8f184f4a00c80342ee Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Mon, 14 Apr 2025 11:00:38 -0500 Subject: [PATCH 208/271] test: role privileges on vault objects and indexes Improves the previous tests while reducing britleness and revealing more implicit privileges. - Reveals privileges on the `_crypto_aead_det_*` functions. - Avoids testing the signature of functions, which is already done on z_15_ext_interface.out. (https://github.com/supabase/postgres/blob/9bdefbcb7cc00b0692562c889b6c7d625120bd66/nix/tests/expected/z_15_ext_interface.out#L4754-L4755) - Unique index test is maintained while also revealing the index owner. - Avoids testing error messages, which can change across versions. - Avoids testing implementation details, and reduces verboseness. --- nix/tests/expected/vault.out | 126 ++++++++++++++++++++++++----------- nix/tests/sql/vault.sql | 81 ++++++++++++++-------- 2 files changed, 138 insertions(+), 69 deletions(-) diff --git a/nix/tests/expected/vault.out b/nix/tests/expected/vault.out index e4eaff2e8..ec414ed27 100644 --- a/nix/tests/expected/vault.out +++ b/nix/tests/expected/vault.out @@ -1,42 +1,88 @@ -select - 1 -from - vault.create_secret('my_s3kre3t'); - ?column? ----------- - 1 -(1 row) +-- Tests role privileges on the vault objects +-- INSERT and UPDATE privileges should not be present on the vault tables for postgres and service_role, only SELECT and DELETE +WITH schema_obj AS ( + SELECT oid, nspname + FROM pg_namespace + WHERE nspname = 'vault' +) +SELECT + s.nspname AS schema, + c.relname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_class c +JOIN schema_obj s ON s.oid = c.relnamespace +CROSS JOIN LATERAL aclexplode(c.relacl) AS acl +WHERE c.relkind IN ('r', 'v', 'm', 'f', 'p') + AND acl.privilege_type <> 'MAINTAIN' +UNION ALL +SELECT + s.nspname AS schema, + p.proname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_proc p +JOIN schema_obj s ON s.oid = p.pronamespace +CROSS JOIN LATERAL aclexplode(p.proacl) AS acl +ORDER BY object_name, grantee, privilege_type; + schema | object_name | grantee | privilege_type +--------+---------------------------+----------------+---------------- + vault | _crypto_aead_det_decrypt | postgres | EXECUTE + vault | _crypto_aead_det_decrypt | supabase_admin | EXECUTE + vault | _crypto_aead_det_encrypt | supabase_admin | EXECUTE + vault | _crypto_aead_det_noncegen | supabase_admin | EXECUTE + vault | create_secret | postgres | EXECUTE + vault | create_secret | supabase_admin | EXECUTE + vault | decrypted_secrets | postgres | DELETE + vault | decrypted_secrets | postgres | SELECT + vault | decrypted_secrets | supabase_admin | DELETE + vault | decrypted_secrets | supabase_admin | INSERT + vault | decrypted_secrets | supabase_admin | REFERENCES + vault | decrypted_secrets | supabase_admin | SELECT + vault | decrypted_secrets | supabase_admin | TRIGGER + vault | decrypted_secrets | supabase_admin | TRUNCATE + vault | decrypted_secrets | supabase_admin | UPDATE + vault | secrets | postgres | DELETE + vault | secrets | postgres | SELECT + vault | secrets | supabase_admin | DELETE + vault | secrets | supabase_admin | INSERT + vault | secrets | supabase_admin | REFERENCES + vault | secrets | supabase_admin | SELECT + vault | secrets | supabase_admin | TRIGGER + vault | secrets | supabase_admin | TRUNCATE + vault | secrets | supabase_admin | UPDATE + vault | update_secret | postgres | EXECUTE + vault | update_secret | supabase_admin | EXECUTE +(26 rows) -select - 1 -from - vault.create_secret( - 'another_s3kre3t', - 'unique_name', - 'This is the description' - ); - ?column? ----------- - 1 -(1 row) +-- vault indexes with owners +SELECT + ns.nspname AS schema, + t.relname AS table, + i.relname AS index_name, + r.rolname AS index_owner, + CASE + WHEN idx.indisunique THEN 'Unique' + ELSE 'Non Unique' + END AS index_type +FROM + pg_class t +JOIN + pg_namespace ns ON t.relnamespace = ns.oid +JOIN + pg_index idx ON t.oid = idx.indrelid +JOIN + pg_class i ON idx.indexrelid = i.oid +JOIN + pg_roles r ON i.relowner = r.oid +WHERE + ns.nspname = 'vault' +ORDER BY + t.relname, + i.relname; + schema | table | index_name | index_owner | index_type +--------+---------+------------------+----------------+------------ + vault | secrets | secrets_name_idx | supabase_admin | Unique + vault | secrets | secrets_pkey | supabase_admin | Unique +(2 rows) -insert into vault.secrets (secret) -values - ('s3kre3t_k3y'); -select - name, - description -from - vault.decrypted_secrets -order by - created_at desc -limit - 3; - name | description --------------+------------------------- - | - unique_name | This is the description - | -(3 rows) - - diff --git a/nix/tests/sql/vault.sql b/nix/tests/sql/vault.sql index bafcb4df8..81f4d22fb 100644 --- a/nix/tests/sql/vault.sql +++ b/nix/tests/sql/vault.sql @@ -1,30 +1,53 @@ -select - 1 -from - vault.create_secret('my_s3kre3t'); - -select - 1 -from - vault.create_secret( - 'another_s3kre3t', - 'unique_name', - 'This is the description' - ); - -insert into vault.secrets (secret) -values - ('s3kre3t_k3y'); - -select - name, - description -from - vault.decrypted_secrets -order by - created_at desc -limit - 3; - - +-- Tests role privileges on the vault objects +-- INSERT and UPDATE privileges should not be present on the vault tables for postgres and service_role, only SELECT and DELETE +WITH schema_obj AS ( + SELECT oid, nspname + FROM pg_namespace + WHERE nspname = 'vault' +) +SELECT + s.nspname AS schema, + c.relname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_class c +JOIN schema_obj s ON s.oid = c.relnamespace +CROSS JOIN LATERAL aclexplode(c.relacl) AS acl +WHERE c.relkind IN ('r', 'v', 'm', 'f', 'p') + AND acl.privilege_type <> 'MAINTAIN' +UNION ALL +SELECT + s.nspname AS schema, + p.proname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_proc p +JOIN schema_obj s ON s.oid = p.pronamespace +CROSS JOIN LATERAL aclexplode(p.proacl) AS acl +ORDER BY object_name, grantee, privilege_type; +-- vault indexes with owners +SELECT + ns.nspname AS schema, + t.relname AS table, + i.relname AS index_name, + r.rolname AS index_owner, + CASE + WHEN idx.indisunique THEN 'Unique' + ELSE 'Non Unique' + END AS index_type +FROM + pg_class t +JOIN + pg_namespace ns ON t.relnamespace = ns.oid +JOIN + pg_index idx ON t.oid = idx.indrelid +JOIN + pg_class i ON idx.indexrelid = i.oid +JOIN + pg_roles r ON i.relowner = r.oid +WHERE + ns.nspname = 'vault' +ORDER BY + t.relname, + i.relname; From 00cf91534e77ab6c21a57c0a34749604d057f540 Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:37:50 -0700 Subject: [PATCH 209/271] chore: bump gotrue to v2.171.0 (#1548) Link: https://github.com/supabase/auth/releases/tag/v2.171.0 Co-authored-by: Chris Stockton --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 4d3102a17..15c5ddc3c 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.065-orioledb" - postgres17: "17.4.1.015" - postgres15: "15.8.1.072" + postgresorioledb-17: "17.0.1.066-orioledb" + postgres17: "17.4.1.016" + postgres15: "15.8.1.073" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.170.0 -gotrue_release_checksum: sha1:a5741163de7d8da490c013cc8566c7210ed9f6fe +gotrue_release: 2.171.0 +gotrue_release_checksum: sha1:9199d177e653c12202db4b12532853afc6493d32 aws_cli_release: "2.23.11" From b6a5b1e9681810ef4e43cd0969b697fc72cd510c Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 16 Apr 2025 14:49:25 +0800 Subject: [PATCH 210/271] fix: update wrappers server options post-upgrade Wrappers were previously using `vault.secrets.key_id`, which will no longer work with new Vault; we migrate it to use `vault.secrets.id` instead. --- .../pg_upgrade_scripts/complete.sh | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index cd6c1f066..a1d37e7cd 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -32,6 +32,45 @@ function execute_extension_upgrade_patches { fi } +function execute_wrappers_patch { + # If upgrading to pgsodium-less Vault, Wrappers need to be updated so that + # foreign servers use `vault.secrets.id` instead of `vault.secrets.key_id` + UPDATE_WRAPPERS_SERVER_OPTIONS_QUERY=$(cat < 0 from pg_extension where extname = 'pg_net';") @@ -220,6 +259,13 @@ function complete_pg_upgrade { execute_extension_upgrade_patches || true + # For this to work we need `vault.secrets` from the old project to be + # preserved, but `run_generated_sql` includes `ALTER EXTENSION + # supabase_vault UPDATE` which modifies that. So we need to run it + # beforehand. + echo "3.1. Patch Wrappers server options" + execute_wrappers_patch + echo "4. Running generated SQL files" retry 3 run_generated_sql From 88372b935fe9c284c1c8672b91315da675b1fad9 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 17 Apr 2025 19:21:54 +0800 Subject: [PATCH 211/271] fix: wrappers >=0.4.6 check clause --- .../pg_upgrade_scripts/complete.sh | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index a1d37e7cd..35766427c 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -42,8 +42,34 @@ function execute_wrappers_patch { option_rec RECORD; vault_secrets RECORD; BEGIN - IF EXISTS (SELECT FROM pg_available_extension_versions WHERE name = 'wrappers' AND version = '0.4.6') - AND EXISTS (SELECT FROM pg_extension WHERE extname = 'wrappers') + IF EXISTS (SELECT FROM pg_extension WHERE extname = 'wrappers' AND extversion NOT IN ( + '0.1.0', + '0.1.1', + '0.1.4', + '0.1.5', + '0.1.6', + '0.1.7', + '0.1.8', + '0.1.9', + '0.1.10', + '0.1.11', + '0.1.12', + '0.1.14', + '0.1.15', + '0.1.16', + '0.1.17', + '0.1.18', + '0.1.19', + '0.2.0', + '0.3.0', + '0.3.1', + '0.4.0', + '0.4.1', + '0.4.2', + '0.4.3', + '0.4.4', + '0.4.5' + )) THEN FOR server_rec IN SELECT srvname, srvoptions From a4828c292717e392fefc3fbc81cee63e9b8f525f Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 17 Apr 2025 20:41:37 +0800 Subject: [PATCH 212/271] fix: wrappers server options again --- ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 35766427c..108409463 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -42,7 +42,8 @@ function execute_wrappers_patch { option_rec RECORD; vault_secrets RECORD; BEGIN - IF EXISTS (SELECT FROM pg_extension WHERE extname = 'wrappers' AND extversion NOT IN ( + IF EXISTS (SELECT FROM pg_extension WHERE extname = 'wrappers') + AND EXISTS (SELECT FROM pg_available_extension_versions WHERE name = 'wrappers' AND version NOT IN ( '0.1.0', '0.1.1', '0.1.4', From b3010c8064c224c34396cb7c8cde1d95653e531c Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 17 Apr 2025 16:29:52 -0400 Subject: [PATCH 213/271] docs: update the "new migration create" doc to cover missing steps (#1553) * docs: update thie new migration create to cover missing steps * Update migrations/README.md Co-authored-by: Kang Ming * Update migrations/README.md Co-authored-by: Kang Ming --------- Co-authored-by: Kang Ming --- migrations/README.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/migrations/README.md b/migrations/README.md index ef3c7215b..dd1da5b48 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -78,23 +78,31 @@ Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/deve ### Add a Migration -First, start a local postgres server and apply the migrations +First, start a local postgres server in another terminal window: ```shell -# Start the database server -nix run .#dbmate-tool -- --version 15 --flake-url "." +# Start the database server in another window +nix run .#start-server 15 +``` -# create a new migration -nix develop -dbmate new '' +Then, in your main terminal window: + +```shell +# Set up the database URL for migrations +export DATABASE_URL="postgres://supabase_admin@localhost:5435/postgres?sslmode=disable" + +# Create a new migration (make sure to specify the migrations directory) +dbmate --migrations-dir="migrations/db/migrations" new '' ``` -Then, execute the migration at `./db/migrations/xxxxxxxxx_` and make sure it runs sucessfully with +Then, execute the migration at `./migrations/db/xxxxxxxxx_` and make sure it runs successfully with: ```shell dbmate up ``` +Note: Migrations are applied using the `supabase_admin` superuser role, as specified in the "How it was Created" section above. + ### Adding a migration with docker-compose dbmate can optionally be run locally using docker: From 7b521ba6fbb1ea87b3620cefd199e2ecc8a0190d Mon Sep 17 00:00:00 2001 From: samrose Date: Sun, 20 Apr 2025 07:46:59 -0400 Subject: [PATCH 214/271] Sam/docs add tests update (#1556) * docs: schema.sql per maj version update * docs: update command for flake checks --- migrations/README.md | 10 ++++++++++ nix/docs/adding-tests.md | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/migrations/README.md b/migrations/README.md index dd1da5b48..ffe18a0b5 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -120,7 +120,17 @@ Then, populate the migration at `./db/migrations/xxxxxxxxx_` and m ```shell docker-compose run --rm dbmate up ``` +### Updating schema.sql for each major version +After making changes to migrations, you should update the schema.sql files for each major version of PostgreSQL: + +```shell +# First, stop any running PostgreSQL servers +# Then from the root of supabase/postgres run: +nix run .#dbmate-tool -- --version all +``` + +This will create a schema.sql file for each major version of PostgreSQL. Commit these changes to your repository and push to your branch. The test.yml workflow will verify these changes against the test matrix. ## Testing Migrations are tested in CI to ensure they do not raise an exception against previously released `supabase/postgres` docker images. The full version matrix is at [test.yml](./.github/workflows/test.yml) in the `supabase-version` variable. diff --git a/nix/docs/adding-tests.md b/nix/docs/adding-tests.md index e828a3ed7..8ab21ad9b 100644 --- a/nix/docs/adding-tests.md +++ b/nix/docs/adding-tests.md @@ -11,12 +11,20 @@ and [prime.sql](../tests/prime.sql) (extensions may be enabled in either place.) ## pg\_regress tests pg\_regress tests are in [tests/sql](./../tests/sql/) with output in [tests/expected](./../tests/expected/). -To create a new test, create a new SQL file in [tests/sql](./../tests/sql/) and then run: +To create a new test, create a new SQL file in [tests/sql](./../tests/sql/) + +Next, for each current major version of postgres, we run a "flake check" build one at a time. + +Examples: ``` -nix flake check -L +nix build .#checks.aarch64-darwin.psql_15 -L +nix build .#checks.aarch64-darwin.psql_17 -L +nix build .#checks.aarch64-darwin.psql_orioledb-17 -L ``` +(Note that the evaluation and nix build of the postgres packages "bundle" of each major version must succeed here, even though we run one version at a time. If you made changes to postgres or extensions, or wrappers those may rebuild here when you run this. Otherwise they will usually download the prebuilt version from the supabase nix binary cache) + Next, review the logs to identify where the test output was written ``` From 057221788a3e4f2311853ac343d466d435b5e6b2 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Mon, 21 Apr 2025 10:55:24 +0800 Subject: [PATCH 215/271] feat: upgrade to latest admin-api release (0.79.0) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 15c5ddc3c..d0251b3dc 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.066-orioledb" - postgres17: "17.4.1.016" - postgres15: "15.8.1.073" + postgresorioledb-17: "17.0.1.067-orioledb" + postgres17: "17.4.1.017" + postgres15: "15.8.1.074" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.77.2 +adminapi_release: 0.79.0 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From dd2363e180a4b0db8bb211dc50f43ad52a00d4df Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 21 Apr 2025 19:25:56 -0400 Subject: [PATCH 216/271] docs: update docs and some of the scripts that run them (#1560) --- flake.nix | 1 + migrations/README.md | 12 ++++++++---- nix/tools/dbmate-tool.sh.in | 9 ++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index a0a347760..f3564df71 100644 --- a/flake.nix +++ b/flake.nix @@ -951,6 +951,7 @@ ]; shellHook = '' export HISTFILE=.history + export DATABASE_URL="postgres://supabase_admin@localhost:5435/postgres?sslmode=disable" ''; }; cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { diff --git a/migrations/README.md b/migrations/README.md index ffe18a0b5..7cb439df8 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -85,12 +85,16 @@ First, start a local postgres server in another terminal window: nix run .#start-server 15 ``` -Then, in your main terminal window: +Then, in your main terminal window, run: ```shell -# Set up the database URL for migrations -export DATABASE_URL="postgres://supabase_admin@localhost:5435/postgres?sslmode=disable" +nix develop +``` +in the root of `supabase/postgres`. + +Next run: +``` shell # Create a new migration (make sure to specify the migrations directory) dbmate --migrations-dir="migrations/db/migrations" new '' ``` @@ -98,7 +102,7 @@ dbmate --migrations-dir="migrations/db/migrations" new '' Then, execute the migration at `./migrations/db/xxxxxxxxx_` and make sure it runs successfully with: ```shell -dbmate up +dbmate --no-dump-schema --migrations-dir"migrations/db/migrations" up ``` Note: Migrations are applied using the `supabase_admin` superuser role, as specified in the "How it was Created" section above. diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index fe3f524b7..ca38f3ac1 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -189,8 +189,15 @@ perform_dump() { while [ $attempt -le $max_attempts ]; do echo "Attempting dbmate dump (attempt $attempt/$max_attempts)" + # Run dbmate dump if dbmate dump; then - return 0 + # Post-process schema.sql to remove schema_migrations INSERT statements + if [ -f "db/schema.sql" ]; then + # Remove INSERT INTO schema_migrations lines + sed -i '/^INSERT INTO schema_migrations/d' db/schema.sql + echo "Schema dump completed successfully (schema_migrations data removed)" + return 0 + fi fi echo "Dump attempt $attempt failed, waiting before retry..." From 404d1049b756616818535db32b86c0e64480e2e6 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Tue, 22 Apr 2025 14:14:02 +0800 Subject: [PATCH 217/271] fix: update pgbouncer.get_auth (INFRA-1530) (#1554) * fix: update pgbouncer.get_auth * chore: add tests for pgbouncer * chore: add pgbouncer test for role privileges * chore: fix pgbouncer tests * chore: include test for pgbouncer schema * chore: remove unnecessary comment * test: update schema files used for testing (#1559) --------- Co-authored-by: samrose --- ...250417190610_update_pgbouncer_get_auth.sql | 24 +++++++ migrations/schema-15.sql | 24 ++++--- migrations/schema-17.sql | 24 ++++--- migrations/schema-orioledb-17.sql | 24 ++++--- migrations/tests/database/exists.sql | 1 + nix/tests/expected/pgbouncer.out | 68 +++++++++++++++++++ nix/tests/sql/pgbouncer.sql | 53 +++++++++++++++ 7 files changed, 191 insertions(+), 27 deletions(-) create mode 100644 migrations/db/migrations/20250417190610_update_pgbouncer_get_auth.sql create mode 100644 nix/tests/expected/pgbouncer.out create mode 100644 nix/tests/sql/pgbouncer.sql diff --git a/migrations/db/migrations/20250417190610_update_pgbouncer_get_auth.sql b/migrations/db/migrations/20250417190610_update_pgbouncer_get_auth.sql new file mode 100644 index 000000000..5e6e6a582 --- /dev/null +++ b/migrations/db/migrations/20250417190610_update_pgbouncer_get_auth.sql @@ -0,0 +1,24 @@ +-- migrate:up + +create or replace function pgbouncer.get_auth(p_usename text) returns table (username text, password text) + language plpgsql security definer + as $$ +begin + raise debug 'PgBouncer auth request: %', p_usename; + + return query + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid + where rolname=$1 and rolcanlogin; +end; +$$; + +-- from migrations/db/migrations/20250312095419_pgbouncer_ownership.sql +grant execute on function pgbouncer.get_auth(p_usename text) to postgres; + +-- migrate:down diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 802fbae79..8ff507a84 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -483,15 +483,21 @@ COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeh CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) LANGUAGE plpgsql SECURITY DEFINER - AS $$ -BEGIN - RAISE WARNING 'PgBouncer auth request: %', p_usename; - - RETURN QUERY - SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow - WHERE usename = p_usename; -END; -$$; + AS $_$ +begin + raise debug 'PgBouncer auth request: %', p_usename; + + return query + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid + where rolname=$1 and rolcanlogin; +end; +$_$; -- diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index eac1280b1..06fe1e7e9 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -470,15 +470,21 @@ COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeh CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) LANGUAGE plpgsql SECURITY DEFINER - AS $$ -BEGIN - RAISE WARNING 'PgBouncer auth request: %', p_usename; - - RETURN QUERY - SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow - WHERE usename = p_usename; -END; -$$; + AS $_$ +begin + raise debug 'PgBouncer auth request: %', p_usename; + + return query + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid + where rolname=$1 and rolcanlogin; +end; +$_$; -- diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 013b23d1f..1cd6aecaa 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -484,15 +484,21 @@ COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeh CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) LANGUAGE plpgsql SECURITY DEFINER - AS $$ -BEGIN - RAISE WARNING 'PgBouncer auth request: %', p_usename; - - RETURN QUERY - SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow - WHERE usename = p_usename; -END; -$$; + AS $_$ +begin + raise debug 'PgBouncer auth request: %', p_usename; + + return query + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid + where rolname=$1 and rolcanlogin; +end; +$_$; -- diff --git a/migrations/tests/database/exists.sql b/migrations/tests/database/exists.sql index 54b2a3861..bc19cd32f 100644 --- a/migrations/tests/database/exists.sql +++ b/migrations/tests/database/exists.sql @@ -1,6 +1,7 @@ SELECT has_schema('public'); SELECT has_schema('auth'); +SELECT has_schema('pgbouncer'); SELECT has_schema('extensions'); SELECT has_schema('graphql'); SELECT has_schema('graphql_public'); diff --git a/nix/tests/expected/pgbouncer.out b/nix/tests/expected/pgbouncer.out new file mode 100644 index 000000000..17f2c6293 --- /dev/null +++ b/nix/tests/expected/pgbouncer.out @@ -0,0 +1,68 @@ +-- pgbouncer schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'pgbouncer'; + schema_name | owner +-------------+----------- + pgbouncer | pgbouncer +(1 row) + +-- pgbouncer schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'pgbouncer' +order by + p.proname; + schema_name | function_name | owner +-------------+---------------+---------------- + pgbouncer | get_auth | supabase_admin +(1 row) + +-- Tests role privileges on the pgbouncer objects +WITH schema_obj AS ( + SELECT oid, nspname + FROM pg_namespace + WHERE nspname = 'pgbouncer' +) +SELECT + s.nspname AS schema, + c.relname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_class c +JOIN schema_obj s ON s.oid = c.relnamespace +CROSS JOIN LATERAL aclexplode(c.relacl) AS acl +WHERE c.relkind IN ('r', 'v', 'm', 'f', 'p') + AND acl.privilege_type <> 'MAINTAIN' +UNION ALL +SELECT + s.nspname AS schema, + p.proname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_proc p +JOIN schema_obj s ON s.oid = p.pronamespace +CROSS JOIN LATERAL aclexplode(p.proacl) AS acl +ORDER BY object_name, grantee, privilege_type; + schema | object_name | grantee | privilege_type +-----------+-------------+----------------+---------------- + pgbouncer | get_auth | pgbouncer | EXECUTE + pgbouncer | get_auth | postgres | EXECUTE + pgbouncer | get_auth | supabase_admin | EXECUTE +(3 rows) + diff --git a/nix/tests/sql/pgbouncer.sql b/nix/tests/sql/pgbouncer.sql new file mode 100644 index 000000000..4ddac10e2 --- /dev/null +++ b/nix/tests/sql/pgbouncer.sql @@ -0,0 +1,53 @@ +-- pgbouncer schema owner +select + n.nspname as schema_name, + r.rolname as owner +from + pg_namespace n +join + pg_roles r on n.nspowner = r.oid +where + n.nspname = 'pgbouncer'; + +-- pgbouncer schema functions with owners +select + n.nspname as schema_name, + p.proname as function_name, + r.rolname as owner +from + pg_proc p +join + pg_namespace n on p.pronamespace = n.oid +join + pg_roles r on p.proowner = r.oid +where + n.nspname = 'pgbouncer' +order by + p.proname; + +-- Tests role privileges on the pgbouncer objects +WITH schema_obj AS ( + SELECT oid, nspname + FROM pg_namespace + WHERE nspname = 'pgbouncer' +) +SELECT + s.nspname AS schema, + c.relname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_class c +JOIN schema_obj s ON s.oid = c.relnamespace +CROSS JOIN LATERAL aclexplode(c.relacl) AS acl +WHERE c.relkind IN ('r', 'v', 'm', 'f', 'p') + AND acl.privilege_type <> 'MAINTAIN' +UNION ALL +SELECT + s.nspname AS schema, + p.proname AS object_name, + acl.grantee::regrole::text AS grantee, + acl.privilege_type +FROM pg_proc p +JOIN schema_obj s ON s.oid = p.pronamespace +CROSS JOIN LATERAL aclexplode(p.proacl) AS acl +ORDER BY object_name, grantee, privilege_type; From db4b292753bcc00ded8ee9f7d5adc7c7827f3842 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 22 Apr 2025 11:14:33 -0400 Subject: [PATCH 218/271] feat: for schema tests, try to use pg_dump (#1562) * feat: for schema tests, try to use pg_dump * feat: use pg_dump generated schemas --- migrations/schema-15.sql | 12 +++++++----- migrations/schema-17.sql | 12 +++++++----- migrations/schema-orioledb-17.sql | 12 +++++++----- nix/tools/dbmate-tool.sh.in | 13 +++---------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 8ff507a84..56390f882 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -1,3 +1,10 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 15.8 +-- Dumped by pg_dump version 15.8 + SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; @@ -1004,8 +1011,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- - --- --- Dbmate schema migrations --- - diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index 06fe1e7e9..ed8480733 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -1,3 +1,10 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 17.4 +-- Dumped by pg_dump version 17.4 + SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; @@ -991,8 +998,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- - --- --- Dbmate schema migrations --- - diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 1cd6aecaa..482cefe88 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -1,3 +1,10 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 17.0 +-- Dumped by pg_dump version 17.0 + SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; @@ -1005,8 +1012,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- - --- --- Dbmate schema migrations --- - diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index ca38f3ac1..d914c5aec 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -187,17 +187,10 @@ perform_dump() { local attempt=1 while [ $attempt -le $max_attempts ]; do - echo "Attempting dbmate dump (attempt $attempt/$max_attempts)" + echo "Attempting pg_dump (attempt $attempt/$max_attempts)" - # Run dbmate dump - if dbmate dump; then - # Post-process schema.sql to remove schema_migrations INSERT statements - if [ -f "db/schema.sql" ]; then - # Remove INSERT INTO schema_migrations lines - sed -i '/^INSERT INTO schema_migrations/d' db/schema.sql - echo "Schema dump completed successfully (schema_migrations data removed)" - return 0 - fi + if "${PSQLBIN}/pg_dump" -h localhost -p "$PORTNO" -U "$PGSQL_SUPERUSER" -d postgres --schema-only --no-owner --no-privileges > "./db/schema.sql"; then + return 0 fi echo "Dump attempt $attempt failed, waiting before retry..." From 70b1181850ace216612ef0c55e873d70e22d5396 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 22 Apr 2025 11:15:14 -0400 Subject: [PATCH 219/271] docs: schema.sql per maj version update (#1555) * Update migrations/README.md Co-authored-by: Steve Chavez * chore: more info on generation of schema.sql and running tests * chore: fix typo --------- Co-authored-by: Steve Chavez --- migrations/README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/migrations/README.md b/migrations/README.md index 7cb439df8..cab371553 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -134,7 +134,22 @@ After making changes to migrations, you should update the schema.sql files for e nix run .#dbmate-tool -- --version all ``` -This will create a schema.sql file for each major version of PostgreSQL. Commit these changes to your repository and push to your branch. The test.yml workflow will verify these changes against the test matrix. +This will create automatically schema.sql file for each major version of PostgreSQL and OrioleDB (the files are named like `schema-`, `schema-oriole-`). Commit these changes to your repository and push to your branch. The workflow in `.github/workflows/test.yml` will re-run this command in CI, and perform a git diff to verify the idempotency of the migrations, and that the latest changes have been committed. + ## Testing -Migrations are tested in CI to ensure they do not raise an exception against previously released `supabase/postgres` docker images. The full version matrix is at [test.yml](./.github/workflows/test.yml) in the `supabase-version` variable. +In addition to ci test mentioned above, you can test migrations locally by running the following test for each major version of postgres one at a time. + +Examples: + +``` +nix build .#checks.aarch64-darwin.psql_15 -L +nix build .#checks.aarch64-darwin.psql_17 -L +nix build .#checks.aarch64-darwin.psql_orioledb-17 -L +``` + +(Note that the evaluation and nix build of the postgres packages "bundle" of each major version must succeed here, even though we run one version at a time. If you made changes to postgres or extensions, or wrappers those may rebuild here when you run this. Otherwise they will usually download the prebuilt version from the supabase nix binary cache) + +At the end of these commands, you will see the output of both `pg_regress` tests, and migration tests + +see [Adding Tests](https://github.com/supabase/postgres/blob/develop/nix/docs/adding-tests.md) for more information. From 8d32169739d28473f3fe9119ff4c1415e8c7c298 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 23 Apr 2025 12:25:42 -0400 Subject: [PATCH 220/271] =?UTF-8?q?feat:=20keep=20pgjwt=20present=20but=20?= =?UTF-8?q?deactivated=20for=20orioledb=20only=20to=20avoid=20r=E2=80=A6?= =?UTF-8?q?=20(#1557)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: keep pgjwt present but deactivated for orioledb only to avoid restore issues * feat: adjust to only create for pg 15.x * feat: rm legacy manipulation of schema and just use what is generated 1:1 * test: recreate schemas for this branch after rebase * chore: bump suffix to try and build again due to timeout * chore: bump versions for release to fix oriole pause restore --- ansible/vars.yml | 6 +++--- flake.nix | 8 +++++--- .../init-scripts/00000000000000-initial-schema.sql | 4 +++- migrations/schema-15.sql | 14 +++++++------- migrations/schema-17.sql | 14 +++++++------- migrations/schema-orioledb-17.sql | 14 +++++++------- nix/tests/prime.sql | 4 +++- nix/tools/dbmate-tool.sh.in | 12 ------------ 8 files changed, 35 insertions(+), 41 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index d0251b3dc..019f19279 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.067-orioledb" - postgres17: "17.4.1.017" - postgres15: "15.8.1.074" + postgresorioledb-17: "17.0.1.068-orioledb" + postgres17: "17.4.1.018" + postgres15: "15.8.1.075" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index f3564df71..519e89567 100644 --- a/flake.nix +++ b/flake.nix @@ -154,12 +154,14 @@ x: x != ./nix/ext/timescaledb.nix && x != ./nix/ext/timescaledb-2.9.1.nix && - x != ./nix/ext/plv8.nix && - x != ./nix/ext/pgjwt.nix + x != ./nix/ext/plv8.nix ) ourExtensions; orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - dbExtensions17 = orioleFilteredExtensions; + dbExtensions17 = builtins.filter ( + x: + x != ./nix/ext/pgjwt.nix + ) orioleFilteredExtensions; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index 3d71bb176..71b6ab06a 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -22,7 +22,9 @@ do $$ begin if exists (select 1 from pg_available_extensions where name = 'pgjwt') then if not exists (select 1 from pg_extension where extname = 'pgjwt') then - create extension if not exists pgjwt with schema "extensions" cascade; + if current_setting('server_version_num')::int / 10000 = 15 then + create extension if not exists pgjwt with schema "extensions" cascade; + end if; end if; end if; end $$; diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 56390f882..5a38517ba 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -495,13 +495,13 @@ begin raise debug 'PgBouncer auth request: %', p_usename; return query - select - rolname::text, - case when rolvaliduntil < now() - then null - else rolpassword::text - end - from pg_authid + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid where rolname=$1 and rolcanlogin; end; $_$; diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index ed8480733..f120b1b27 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -482,13 +482,13 @@ begin raise debug 'PgBouncer auth request: %', p_usename; return query - select - rolname::text, - case when rolvaliduntil < now() - then null - else rolpassword::text - end - from pg_authid + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid where rolname=$1 and rolcanlogin; end; $_$; diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 482cefe88..8c5d32c39 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -496,13 +496,13 @@ begin raise debug 'PgBouncer auth request: %', p_usename; return query - select - rolname::text, - case when rolvaliduntil < now() - then null - else rolpassword::text - end - from pg_authid + select + rolname::text, + case when rolvaliduntil < now() + then null + else rolpassword::text + end + from pg_authid where rolname=$1 and rolcanlogin; end; $_$; diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 918ba3d81..84545145e 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -61,7 +61,9 @@ do $$ begin if exists (select 1 from pg_available_extensions where name = 'pgjwt') then if not exists (select 1 from pg_extension where extname = 'pgjwt') then - create extension if not exists pgjwt; + if current_setting('server_version_num')::int / 10000 = 15 then + create extension if not exists pgjwt; + end if; end if; end if; end $$; diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index d914c5aec..8fa266fce 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -170,18 +170,6 @@ check_orioledb_ready() { return 1 } -trim_schema() { - case "$CURRENT_SYSTEM" in - "x86_64-darwin"|"aarch64-darwin") - sed -i '' '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql" - echo "Matched: $CURRENT_SYSTEM" - ;; - *) - sed -i '/INSERT INTO public.schema_migrations/,$d' "./db/schema.sql" - ;; - esac -} - perform_dump() { local max_attempts=3 local attempt=1 From 1ffe2e3fb47e7f3eb7b214c7ee6a3ea117ea83c3 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 24 Apr 2025 07:37:12 +0800 Subject: [PATCH 221/271] chore: add test for pgbouncer.get_auth (#1567) --- ansible/vars.yml | 6 +++--- nix/tests/expected/pgbouncer.out | 21 ++++++++++++++++++++- nix/tests/sql/pgbouncer.sql | 15 ++++++++++++++- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 019f19279..735e08923 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.068-orioledb" - postgres17: "17.4.1.018" - postgres15: "15.8.1.075" + postgresorioledb-17: "17.0.1.069-orioledb" + postgres17: "17.4.1.019" + postgres15: "15.8.1.076" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/tests/expected/pgbouncer.out b/nix/tests/expected/pgbouncer.out index 17f2c6293..83845cb52 100644 --- a/nix/tests/expected/pgbouncer.out +++ b/nix/tests/expected/pgbouncer.out @@ -58,7 +58,7 @@ SELECT FROM pg_proc p JOIN schema_obj s ON s.oid = p.pronamespace CROSS JOIN LATERAL aclexplode(p.proacl) AS acl -ORDER BY object_name, grantee, privilege_type; +ORDER BY object_name, grantee, privilege_type; schema | object_name | grantee | privilege_type -----------+-------------+----------------+---------------- pgbouncer | get_auth | pgbouncer | EXECUTE @@ -66,3 +66,22 @@ ORDER BY object_name, grantee, privilege_type; pgbouncer | get_auth | supabase_admin | EXECUTE (3 rows) +-- Ensure that pgbouncer.get_auth() function does not return an expired password +create role test_expired_user_password with login password 'expired_password' valid until '2000-01-01 00:00:00+00'; +create role test_valid_user_password with login password 'valid_password' valid until '2100-01-01 00:00:00+00'; +-- Update the pg_authid catalog directly to replace with a known SCRAM hash +update pg_authid set rolpassword = 'SCRAM-SHA-256$4096:testsaltbase64$storedkeybase64$serverkeybase64' where rolname = 'test_valid_user_password'; +select pgbouncer.get_auth('test_expired_user_password'); + get_auth +------------------------------- + (test_expired_user_password,) +(1 row) + +select pgbouncer.get_auth('test_valid_user_password'); + get_auth +---------------------------------------------------------------------------------------------- + (test_valid_user_password,SCRAM-SHA-256$4096:testsaltbase64$storedkeybase64$serverkeybase64) +(1 row) + +drop role test_expired_user_password; +drop role test_valid_user_password; diff --git a/nix/tests/sql/pgbouncer.sql b/nix/tests/sql/pgbouncer.sql index 4ddac10e2..e6b56cb6b 100644 --- a/nix/tests/sql/pgbouncer.sql +++ b/nix/tests/sql/pgbouncer.sql @@ -50,4 +50,17 @@ SELECT FROM pg_proc p JOIN schema_obj s ON s.oid = p.pronamespace CROSS JOIN LATERAL aclexplode(p.proacl) AS acl -ORDER BY object_name, grantee, privilege_type; +ORDER BY object_name, grantee, privilege_type; + +-- Ensure that pgbouncer.get_auth() function does not return an expired password +create role test_expired_user_password with login password 'expired_password' valid until '2000-01-01 00:00:00+00'; +create role test_valid_user_password with login password 'valid_password' valid until '2100-01-01 00:00:00+00'; +-- Update the pg_authid catalog directly to replace with a known SCRAM hash +update pg_authid set rolpassword = 'SCRAM-SHA-256$4096:testsaltbase64$storedkeybase64$serverkeybase64' where rolname = 'test_valid_user_password'; + +select pgbouncer.get_auth('test_expired_user_password'); + +select pgbouncer.get_auth('test_valid_user_password'); + +drop role test_expired_user_password; +drop role test_valid_user_password; From 646bde8a248a833b88c20face1b977aa3c226a46 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:09:43 +0800 Subject: [PATCH 222/271] fix: grant Vault privs to service_role (#1539) * fix: grant Vault privs to service_role * adjust tests according to the fix * chore: bump versions * fix: missing Vault privileges for postgres * fix: also privs in the migration * test: schema snapshots changed Trailing whitespace were somehow added in https://github.com/supabase/postgres/pull/1562; probably different handling between dbmate and pg_dump --------- Co-authored-by: steve-chavez --- .../supabase_vault/after-create.sql | 7 ++++++- ansible/vars.yml | 6 +++--- .../20221207154255_create_pgsodium_and_vault.sql | 9 ++++++--- nix/tests/expected/roles.out | 3 ++- nix/tests/expected/vault.out | 13 ++++++++++++- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql index 7ca37637a..f5c728428 100644 --- a/ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/supabase_vault/after-create.sql @@ -1,3 +1,8 @@ grant usage on schema vault to postgres with grant option; -grant select, delete on vault.secrets, vault.decrypted_secrets to postgres with grant option; +grant select, delete, truncate, references on vault.secrets, vault.decrypted_secrets to postgres with grant option; grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to postgres with grant option; + +-- service_role used to be able to manage secrets in Vault <=0.2.8 because it had privileges to pgsodium functions +grant usage on schema vault to service_role; +grant select, delete on vault.secrets, vault.decrypted_secrets to service_role; +grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to service_role; diff --git a/ansible/vars.yml b/ansible/vars.yml index 735e08923..a814ee494 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.069-orioledb" - postgres17: "17.4.1.019" - postgres15: "15.8.1.076" + postgresorioledb-17: "17.0.1.070-orioledb" + postgres17: "17.4.1.020" + postgres15: "15.8.1.077" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql index f93cc211a..ba3ca40ef 100644 --- a/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql +++ b/migrations/db/migrations/20221207154255_create_pgsodium_and_vault.sql @@ -10,9 +10,12 @@ BEGIN -- for some reason extension custom scripts aren't run during AMI build, so -- we manually run it here - GRANT USAGE ON SCHEMA vault TO postgres WITH GRANT OPTION; - GRANT SELECT, DELETE ON vault.secrets, vault.decrypted_secrets TO postgres WITH GRANT OPTION; - GRANT EXECUTE ON FUNCTION vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt TO postgres WITH GRANT OPTION; + grant usage on schema vault to postgres with grant option; + grant select, delete, truncate, references on vault.secrets, vault.decrypted_secrets to postgres with grant option; + grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to postgres with grant option; + grant usage on schema vault to service_role; + grant select, delete on vault.secrets, vault.decrypted_secrets to service_role; + grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to service_role; ELSE pgsodium_exists = ( select count(*) = 1 diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index b4188512b..481d1b0ef 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -575,6 +575,7 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; topology | USAGE | supabase_admin | supabase_admin vault | CREATE | supabase_admin | supabase_admin vault | USAGE | postgres | supabase_admin + vault | USAGE | service_role | supabase_admin vault | USAGE | supabase_admin | supabase_admin -(390 rows) +(391 rows) diff --git a/nix/tests/expected/vault.out b/nix/tests/expected/vault.out index ec414ed27..4ffb68664 100644 --- a/nix/tests/expected/vault.out +++ b/nix/tests/expected/vault.out @@ -28,13 +28,19 @@ ORDER BY object_name, grantee, privilege_type; schema | object_name | grantee | privilege_type --------+---------------------------+----------------+---------------- vault | _crypto_aead_det_decrypt | postgres | EXECUTE + vault | _crypto_aead_det_decrypt | service_role | EXECUTE vault | _crypto_aead_det_decrypt | supabase_admin | EXECUTE vault | _crypto_aead_det_encrypt | supabase_admin | EXECUTE vault | _crypto_aead_det_noncegen | supabase_admin | EXECUTE vault | create_secret | postgres | EXECUTE + vault | create_secret | service_role | EXECUTE vault | create_secret | supabase_admin | EXECUTE vault | decrypted_secrets | postgres | DELETE + vault | decrypted_secrets | postgres | REFERENCES vault | decrypted_secrets | postgres | SELECT + vault | decrypted_secrets | postgres | TRUNCATE + vault | decrypted_secrets | service_role | DELETE + vault | decrypted_secrets | service_role | SELECT vault | decrypted_secrets | supabase_admin | DELETE vault | decrypted_secrets | supabase_admin | INSERT vault | decrypted_secrets | supabase_admin | REFERENCES @@ -43,7 +49,11 @@ ORDER BY object_name, grantee, privilege_type; vault | decrypted_secrets | supabase_admin | TRUNCATE vault | decrypted_secrets | supabase_admin | UPDATE vault | secrets | postgres | DELETE + vault | secrets | postgres | REFERENCES vault | secrets | postgres | SELECT + vault | secrets | postgres | TRUNCATE + vault | secrets | service_role | DELETE + vault | secrets | service_role | SELECT vault | secrets | supabase_admin | DELETE vault | secrets | supabase_admin | INSERT vault | secrets | supabase_admin | REFERENCES @@ -52,8 +62,9 @@ ORDER BY object_name, grantee, privilege_type; vault | secrets | supabase_admin | TRUNCATE vault | secrets | supabase_admin | UPDATE vault | update_secret | postgres | EXECUTE + vault | update_secret | service_role | EXECUTE vault | update_secret | supabase_admin | EXECUTE -(26 rows) +(37 rows) -- vault indexes with owners SELECT From d1b671b822ebc9b15e804057e2c4ca387aa820b7 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 25 Apr 2025 19:38:30 -0400 Subject: [PATCH 223/271] feat: keep pgjwt for all versions, deactivated by default in 17/oriole (#1571) * feat: keep pgjwt for all versions, deactivated by default in 17/oriole * test: suffix for tests * test: fix regress tests to account for pgjwt * chore: bump version * chore: bump version * chore: bump version --- ansible/vars.yml | 6 +++--- flake.nix | 5 +---- nix/tests/expected/z_17_ext_interface.out | 3 ++- nix/tests/expected/z_orioledb-17_ext_interface.out | 3 ++- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a814ee494..7679cbd9b 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.070-orioledb" - postgres17: "17.4.1.020" - postgres15: "15.8.1.077" + postgresorioledb-17: "17.0.1.071-orioledb" + postgres17: "17.4.1.021" + postgres15: "15.8.1.078" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.nix b/flake.nix index 519e89567..70810e194 100644 --- a/flake.nix +++ b/flake.nix @@ -158,10 +158,7 @@ ) ourExtensions; orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - dbExtensions17 = builtins.filter ( - x: - x != ./nix/ext/pgjwt.nix - ) orioleFilteredExtensions; + dbExtensions17 = orioleFilteredExtensions; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index db2962678..f7750f849 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -23,9 +23,10 @@ order by name ------------------------ pg_cron + pgjwt postgis_tiger_geocoder tsm_system_time -(3 rows) +(4 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index db2962678..f7750f849 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -23,9 +23,10 @@ order by name ------------------------ pg_cron + pgjwt postgis_tiger_geocoder tsm_system_time -(3 rows) +(4 rows) /* From 1bb5a829cbbc6b381c3dac6bb7e36a1dbbad78f8 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Sat, 26 Apr 2025 16:35:24 +0200 Subject: [PATCH 224/271] feat: bump admin-api to 0.82 (#1573) --- ansible/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 7679cbd9b..07edefc6b 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.79.0 +adminapi_release: 0.82.0 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From 3f98b62c92e216c11de3068a243541790c17658b Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Mon, 28 Apr 2025 12:46:43 +0200 Subject: [PATCH 225/271] fix: increment version numbers for adminapi v0.82 (#1574) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 07edefc6b..e57848646 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.071-orioledb" - postgres17: "17.4.1.021" - postgres15: "15.8.1.078" + postgresorioledb-17: "17.0.1.072-orioledb" + postgres17: "17.4.1.022" + postgres15: "15.8.1.079" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 5e19b6c1fb0f6cef1bd631e70b8347d690dab7e7 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:31:47 +0100 Subject: [PATCH 226/271] chore: bump admin api version and sb ami version (#1575) * chore: bump admin api version and sb ami version * chore: bump to 0.83.1 --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index e57848646..fd102e3a0 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.072-orioledb" - postgres17: "17.4.1.022" - postgres15: "15.8.1.079" + postgresorioledb-17: "17.0.1.073-orioledb" + postgres17: "17.4.1.023" + postgres15: "15.8.1.080" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.82.0 +adminapi_release: 0.83.1 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From 4a08f05aeb39ce803b076781d1f1e71024259825 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 30 Apr 2025 14:05:53 -0500 Subject: [PATCH 227/271] test: role privileges on auth/storage db objects --- nix/tests/expected/auth.out | 132 +++++++++++++++++++++++++++++++++ nix/tests/expected/storage.out | 132 +++++++++++++++++++++++++++++++++ nix/tests/sql/auth.sql | 24 ++++++ nix/tests/sql/storage.sql | 24 ++++++ 4 files changed, 312 insertions(+) diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out index 60b32ca19..6ada416c6 100644 --- a/nix/tests/expected/auth.out +++ b/nix/tests/expected/auth.out @@ -44,6 +44,138 @@ order by auth | users | supabase_auth_admin | f | (5 rows) +-- auth schema objects with roles privileges +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as role_name, + a.privilege_type, + a.is_grantable +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +cross join lateral + aclexplode(c.relacl) as a +join + pg_roles r on a.grantee = r.oid +where + ns.nspname = 'auth' + and c.relkind in ('r', 'v', 'm') + and a.privilege_type <> 'MAINTAIN' +order by + c.relname, + r.rolname, + a.privilege_type; + schema_name | table_name | role_name | privilege_type | is_grantable +-------------+-------------------+---------------------+----------------+-------------- + auth | audit_log_entries | dashboard_user | DELETE | f + auth | audit_log_entries | dashboard_user | INSERT | f + auth | audit_log_entries | dashboard_user | REFERENCES | f + auth | audit_log_entries | dashboard_user | SELECT | f + auth | audit_log_entries | dashboard_user | TRIGGER | f + auth | audit_log_entries | dashboard_user | TRUNCATE | f + auth | audit_log_entries | dashboard_user | UPDATE | f + auth | audit_log_entries | postgres | DELETE | f + auth | audit_log_entries | postgres | INSERT | f + auth | audit_log_entries | postgres | REFERENCES | f + auth | audit_log_entries | postgres | SELECT | f + auth | audit_log_entries | postgres | TRIGGER | f + auth | audit_log_entries | postgres | TRUNCATE | f + auth | audit_log_entries | postgres | UPDATE | f + auth | audit_log_entries | supabase_auth_admin | DELETE | f + auth | audit_log_entries | supabase_auth_admin | INSERT | f + auth | audit_log_entries | supabase_auth_admin | REFERENCES | f + auth | audit_log_entries | supabase_auth_admin | SELECT | f + auth | audit_log_entries | supabase_auth_admin | TRIGGER | f + auth | audit_log_entries | supabase_auth_admin | TRUNCATE | f + auth | audit_log_entries | supabase_auth_admin | UPDATE | f + auth | instances | dashboard_user | DELETE | f + auth | instances | dashboard_user | INSERT | f + auth | instances | dashboard_user | REFERENCES | f + auth | instances | dashboard_user | SELECT | f + auth | instances | dashboard_user | TRIGGER | f + auth | instances | dashboard_user | TRUNCATE | f + auth | instances | dashboard_user | UPDATE | f + auth | instances | postgres | DELETE | f + auth | instances | postgres | INSERT | f + auth | instances | postgres | REFERENCES | f + auth | instances | postgres | SELECT | f + auth | instances | postgres | TRIGGER | f + auth | instances | postgres | TRUNCATE | f + auth | instances | postgres | UPDATE | f + auth | instances | supabase_auth_admin | DELETE | f + auth | instances | supabase_auth_admin | INSERT | f + auth | instances | supabase_auth_admin | REFERENCES | f + auth | instances | supabase_auth_admin | SELECT | f + auth | instances | supabase_auth_admin | TRIGGER | f + auth | instances | supabase_auth_admin | TRUNCATE | f + auth | instances | supabase_auth_admin | UPDATE | f + auth | refresh_tokens | dashboard_user | DELETE | f + auth | refresh_tokens | dashboard_user | INSERT | f + auth | refresh_tokens | dashboard_user | REFERENCES | f + auth | refresh_tokens | dashboard_user | SELECT | f + auth | refresh_tokens | dashboard_user | TRIGGER | f + auth | refresh_tokens | dashboard_user | TRUNCATE | f + auth | refresh_tokens | dashboard_user | UPDATE | f + auth | refresh_tokens | postgres | DELETE | f + auth | refresh_tokens | postgres | INSERT | f + auth | refresh_tokens | postgres | REFERENCES | f + auth | refresh_tokens | postgres | SELECT | f + auth | refresh_tokens | postgres | TRIGGER | f + auth | refresh_tokens | postgres | TRUNCATE | f + auth | refresh_tokens | postgres | UPDATE | f + auth | refresh_tokens | supabase_auth_admin | DELETE | f + auth | refresh_tokens | supabase_auth_admin | INSERT | f + auth | refresh_tokens | supabase_auth_admin | REFERENCES | f + auth | refresh_tokens | supabase_auth_admin | SELECT | f + auth | refresh_tokens | supabase_auth_admin | TRIGGER | f + auth | refresh_tokens | supabase_auth_admin | TRUNCATE | f + auth | refresh_tokens | supabase_auth_admin | UPDATE | f + auth | schema_migrations | dashboard_user | DELETE | f + auth | schema_migrations | dashboard_user | INSERT | f + auth | schema_migrations | dashboard_user | REFERENCES | f + auth | schema_migrations | dashboard_user | SELECT | f + auth | schema_migrations | dashboard_user | TRIGGER | f + auth | schema_migrations | dashboard_user | TRUNCATE | f + auth | schema_migrations | dashboard_user | UPDATE | f + auth | schema_migrations | postgres | DELETE | f + auth | schema_migrations | postgres | INSERT | f + auth | schema_migrations | postgres | REFERENCES | f + auth | schema_migrations | postgres | SELECT | f + auth | schema_migrations | postgres | TRIGGER | f + auth | schema_migrations | postgres | TRUNCATE | f + auth | schema_migrations | postgres | UPDATE | f + auth | schema_migrations | supabase_auth_admin | DELETE | f + auth | schema_migrations | supabase_auth_admin | INSERT | f + auth | schema_migrations | supabase_auth_admin | REFERENCES | f + auth | schema_migrations | supabase_auth_admin | SELECT | f + auth | schema_migrations | supabase_auth_admin | TRIGGER | f + auth | schema_migrations | supabase_auth_admin | TRUNCATE | f + auth | schema_migrations | supabase_auth_admin | UPDATE | f + auth | users | dashboard_user | DELETE | f + auth | users | dashboard_user | INSERT | f + auth | users | dashboard_user | REFERENCES | f + auth | users | dashboard_user | SELECT | f + auth | users | dashboard_user | TRIGGER | f + auth | users | dashboard_user | TRUNCATE | f + auth | users | dashboard_user | UPDATE | f + auth | users | postgres | DELETE | f + auth | users | postgres | INSERT | f + auth | users | postgres | REFERENCES | f + auth | users | postgres | SELECT | f + auth | users | postgres | TRIGGER | f + auth | users | postgres | TRUNCATE | f + auth | users | postgres | UPDATE | f + auth | users | supabase_auth_admin | DELETE | f + auth | users | supabase_auth_admin | INSERT | f + auth | users | supabase_auth_admin | REFERENCES | f + auth | users | supabase_auth_admin | SELECT | f + auth | users | supabase_auth_admin | TRIGGER | f + auth | users | supabase_auth_admin | TRUNCATE | f + auth | users | supabase_auth_admin | UPDATE | f +(105 rows) + -- auth indexes with owners select ns.nspname as table_schema, diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index 30530a2b6..6c14bb47f 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -42,6 +42,138 @@ order by storage | objects | supabase_storage_admin | t | (3 rows) +-- storage schema objects with roles privileges +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as role_name, + a.privilege_type, + a.is_grantable +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +cross join lateral + aclexplode(c.relacl) as a +join + pg_roles r on a.grantee = r.oid +where + ns.nspname = 'storage' + and c.relkind in ('r', 'v', 'm') + and a.privilege_type <> 'MAINTAIN' +order by + c.relname, + r.rolname, + a.privilege_type; + schema_name | table_name | role_name | privilege_type | is_grantable +-------------+------------+------------------------+----------------+-------------- + storage | buckets | anon | DELETE | f + storage | buckets | anon | INSERT | f + storage | buckets | anon | REFERENCES | f + storage | buckets | anon | SELECT | f + storage | buckets | anon | TRIGGER | f + storage | buckets | anon | TRUNCATE | f + storage | buckets | anon | UPDATE | f + storage | buckets | authenticated | DELETE | f + storage | buckets | authenticated | INSERT | f + storage | buckets | authenticated | REFERENCES | f + storage | buckets | authenticated | SELECT | f + storage | buckets | authenticated | TRIGGER | f + storage | buckets | authenticated | TRUNCATE | f + storage | buckets | authenticated | UPDATE | f + storage | buckets | postgres | DELETE | f + storage | buckets | postgres | INSERT | f + storage | buckets | postgres | REFERENCES | f + storage | buckets | postgres | SELECT | f + storage | buckets | postgres | TRIGGER | f + storage | buckets | postgres | TRUNCATE | f + storage | buckets | postgres | UPDATE | f + storage | buckets | service_role | DELETE | f + storage | buckets | service_role | INSERT | f + storage | buckets | service_role | REFERENCES | f + storage | buckets | service_role | SELECT | f + storage | buckets | service_role | TRIGGER | f + storage | buckets | service_role | TRUNCATE | f + storage | buckets | service_role | UPDATE | f + storage | buckets | supabase_storage_admin | DELETE | f + storage | buckets | supabase_storage_admin | INSERT | f + storage | buckets | supabase_storage_admin | REFERENCES | f + storage | buckets | supabase_storage_admin | SELECT | f + storage | buckets | supabase_storage_admin | TRIGGER | f + storage | buckets | supabase_storage_admin | TRUNCATE | f + storage | buckets | supabase_storage_admin | UPDATE | f + storage | migrations | anon | DELETE | f + storage | migrations | anon | INSERT | f + storage | migrations | anon | REFERENCES | f + storage | migrations | anon | SELECT | f + storage | migrations | anon | TRIGGER | f + storage | migrations | anon | TRUNCATE | f + storage | migrations | anon | UPDATE | f + storage | migrations | authenticated | DELETE | f + storage | migrations | authenticated | INSERT | f + storage | migrations | authenticated | REFERENCES | f + storage | migrations | authenticated | SELECT | f + storage | migrations | authenticated | TRIGGER | f + storage | migrations | authenticated | TRUNCATE | f + storage | migrations | authenticated | UPDATE | f + storage | migrations | postgres | DELETE | f + storage | migrations | postgres | INSERT | f + storage | migrations | postgres | REFERENCES | f + storage | migrations | postgres | SELECT | f + storage | migrations | postgres | TRIGGER | f + storage | migrations | postgres | TRUNCATE | f + storage | migrations | postgres | UPDATE | f + storage | migrations | service_role | DELETE | f + storage | migrations | service_role | INSERT | f + storage | migrations | service_role | REFERENCES | f + storage | migrations | service_role | SELECT | f + storage | migrations | service_role | TRIGGER | f + storage | migrations | service_role | TRUNCATE | f + storage | migrations | service_role | UPDATE | f + storage | migrations | supabase_storage_admin | DELETE | f + storage | migrations | supabase_storage_admin | INSERT | f + storage | migrations | supabase_storage_admin | REFERENCES | f + storage | migrations | supabase_storage_admin | SELECT | f + storage | migrations | supabase_storage_admin | TRIGGER | f + storage | migrations | supabase_storage_admin | TRUNCATE | f + storage | migrations | supabase_storage_admin | UPDATE | f + storage | objects | anon | DELETE | f + storage | objects | anon | INSERT | f + storage | objects | anon | REFERENCES | f + storage | objects | anon | SELECT | f + storage | objects | anon | TRIGGER | f + storage | objects | anon | TRUNCATE | f + storage | objects | anon | UPDATE | f + storage | objects | authenticated | DELETE | f + storage | objects | authenticated | INSERT | f + storage | objects | authenticated | REFERENCES | f + storage | objects | authenticated | SELECT | f + storage | objects | authenticated | TRIGGER | f + storage | objects | authenticated | TRUNCATE | f + storage | objects | authenticated | UPDATE | f + storage | objects | postgres | DELETE | f + storage | objects | postgres | INSERT | f + storage | objects | postgres | REFERENCES | f + storage | objects | postgres | SELECT | f + storage | objects | postgres | TRIGGER | f + storage | objects | postgres | TRUNCATE | f + storage | objects | postgres | UPDATE | f + storage | objects | service_role | DELETE | f + storage | objects | service_role | INSERT | f + storage | objects | service_role | REFERENCES | f + storage | objects | service_role | SELECT | f + storage | objects | service_role | TRIGGER | f + storage | objects | service_role | TRUNCATE | f + storage | objects | service_role | UPDATE | f + storage | objects | supabase_storage_admin | DELETE | f + storage | objects | supabase_storage_admin | INSERT | f + storage | objects | supabase_storage_admin | REFERENCES | f + storage | objects | supabase_storage_admin | SELECT | f + storage | objects | supabase_storage_admin | TRIGGER | f + storage | objects | supabase_storage_admin | TRUNCATE | f + storage | objects | supabase_storage_admin | UPDATE | f +(105 rows) + -- storage indexes with owners select ns.nspname as table_schema, diff --git a/nix/tests/sql/auth.sql b/nix/tests/sql/auth.sql index 9bba4d0ee..d0b27e480 100644 --- a/nix/tests/sql/auth.sql +++ b/nix/tests/sql/auth.sql @@ -32,6 +32,30 @@ group by order by c.relname; +-- auth schema objects with roles privileges +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as role_name, + a.privilege_type, + a.is_grantable +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +cross join lateral + aclexplode(c.relacl) as a +join + pg_roles r on a.grantee = r.oid +where + ns.nspname = 'auth' + and c.relkind in ('r', 'v', 'm') + and a.privilege_type <> 'MAINTAIN' +order by + c.relname, + r.rolname, + a.privilege_type; + -- auth indexes with owners select ns.nspname as table_schema, diff --git a/nix/tests/sql/storage.sql b/nix/tests/sql/storage.sql index 6938c8414..b9d80820f 100644 --- a/nix/tests/sql/storage.sql +++ b/nix/tests/sql/storage.sql @@ -32,6 +32,30 @@ group by order by c.relname; +-- storage schema objects with roles privileges +select + ns.nspname as schema_name, + c.relname as table_name, + r.rolname as role_name, + a.privilege_type, + a.is_grantable +from + pg_class c +join + pg_namespace ns on c.relnamespace = ns.oid +cross join lateral + aclexplode(c.relacl) as a +join + pg_roles r on a.grantee = r.oid +where + ns.nspname = 'storage' + and c.relkind in ('r', 'v', 'm') + and a.privilege_type <> 'MAINTAIN' +order by + c.relname, + r.rolname, + a.privilege_type; + -- storage indexes with owners select ns.nspname as table_schema, From 93c0123c38ee7322113767cc97727c5d05824024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Thu, 1 May 2025 17:22:20 +0700 Subject: [PATCH 228/271] chore: bump admin api version for larger instance size support (#1578) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index fd102e3a0..4210a443d 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.073-orioledb" - postgres17: "17.4.1.023" - postgres15: "15.8.1.080" + postgresorioledb-17: "17.0.1.074-orioledb" + postgres17: "17.4.1.024" + postgres15: "15.8.1.081" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.83.1 +adminapi_release: 0.84.0 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From f832c257cb318f0be9bd09e7facf6bf2750e1d9f Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Thu, 1 May 2025 19:27:45 +0100 Subject: [PATCH 229/271] chore: update admin api to 0.84.1 (#1579) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 4210a443d..093440c73 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.074-orioledb" - postgres17: "17.4.1.024" - postgres15: "15.8.1.081" + postgresorioledb-17: "17.0.1.075-orioledb" + postgres17: "17.4.1.025" + postgres15: "15.8.1.082" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.84.0 +adminapi_release: 0.84.1 adminmgr_release: 0.25.0 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" From 1bf753cefd02d60a5754c8cacd7461bbd781fdcd Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 2 Apr 2025 15:25:44 +0800 Subject: [PATCH 230/271] feat(migrations): alter internal evt trig owner --- ...0085357_revoke_writes_on_cron_job_from_postgres.sql | 1 + ...internal_event_triggers_owner_to_supabase_admin.sql | 10 ++++++++++ nix/tests/expected/evtrigs.out | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 migrations/db/migrations/20250402065937_alter_internal_event_triggers_owner_to_supabase_admin.sql diff --git a/migrations/db/migrations/20231020085357_revoke_writes_on_cron_job_from_postgres.sql b/migrations/db/migrations/20231020085357_revoke_writes_on_cron_job_from_postgres.sql index 25b827110..4aea5d10c 100644 --- a/migrations/db/migrations/20231020085357_revoke_writes_on_cron_job_from_postgres.sql +++ b/migrations/db/migrations/20231020085357_revoke_writes_on_cron_job_from_postgres.sql @@ -40,6 +40,7 @@ END; $$; drop event trigger if exists issue_pg_cron_access; +alter function extensions.grant_pg_cron_access owner to supabase_admin; CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG IN ('CREATE EXTENSION') EXECUTE FUNCTION extensions.grant_pg_cron_access(); diff --git a/migrations/db/migrations/20250402065937_alter_internal_event_triggers_owner_to_supabase_admin.sql b/migrations/db/migrations/20250402065937_alter_internal_event_triggers_owner_to_supabase_admin.sql new file mode 100644 index 000000000..9308f07d4 --- /dev/null +++ b/migrations/db/migrations/20250402065937_alter_internal_event_triggers_owner_to_supabase_admin.sql @@ -0,0 +1,10 @@ +-- migrate:up +drop event trigger if exists issue_pg_net_access; + +alter function extensions.grant_pg_net_access owner to supabase_admin; + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + +-- migrate:down diff --git a/nix/tests/expected/evtrigs.out b/nix/tests/expected/evtrigs.out index 7f8025834..3e3f523fc 100644 --- a/nix/tests/expected/evtrigs.out +++ b/nix/tests/expected/evtrigs.out @@ -12,14 +12,14 @@ join pg_namespace n_func where p.prorettype = 'event_trigger'::regtype; evtname | evtowner | evtfunction_schema | evtfunction | function_owner ----------------------------------------+----------------+--------------------+------------------------------------+---------------- - issue_pg_net_access | postgres | extensions | grant_pg_net_access | postgres issue_pg_graphql_access | supabase_admin | extensions | grant_pg_graphql_access | supabase_admin issue_graphql_placeholder | supabase_admin | extensions | set_graphql_placeholder | supabase_admin pgrst_ddl_watch | supabase_admin | extensions | pgrst_ddl_watch | supabase_admin pgrst_drop_watch | supabase_admin | extensions | pgrst_drop_watch | supabase_admin graphql_watch_ddl | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin graphql_watch_drop | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin - issue_pg_cron_access | supabase_admin | extensions | grant_pg_cron_access | postgres + issue_pg_cron_access | supabase_admin | extensions | grant_pg_cron_access | supabase_admin + issue_pg_net_access | supabase_admin | extensions | grant_pg_net_access | supabase_admin pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle | pgtle.pg_tle_feature_info_sql_drop | supabase_admin pgaudit_ddl_command_end | supabase_admin | public | pgaudit_ddl_command_end | supabase_admin pgaudit_sql_drop | supabase_admin | public | pgaudit_sql_drop | supabase_admin From f084044ca145e6ff9542752b0ff3532aab877200 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 11 Apr 2025 17:19:19 -0500 Subject: [PATCH 231/271] feat: bump to supautils v2.9.1 --- nix/ext/supautils.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index f3f5f1482..40973a1af 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "supautils"; - version = "2.6.0"; + version = "2.9.1"; buildInputs = [ postgresql ]; @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-QNfUpQjqHNzbNqBvjb5a3GtNH9hjbBMDUK19xUU3LpI="; + hash = "sha256-Rw7dmIUg9bJ7SuiHxCsZtnVhdG9hg4WlptiB/MxVmPc="; }; installPhase = '' mkdir -p $out/lib - install -D *${postgresql.dlSuffix} -t $out/lib + install -D build/*${postgresql.dlSuffix} -t $out/lib ''; meta = with lib; { From b1fd9d638a3d976d4ef64ebde3923194c5ae421b Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 1 May 2025 17:26:00 -0500 Subject: [PATCH 232/271] chore: bump pg versions --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 093440c73..5b8add482 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.075-orioledb" - postgres17: "17.4.1.025" - postgres15: "15.8.1.082" + postgresorioledb-17: "17.0.1.076-orioledb" + postgres17: "17.4.1.026" + postgres15: "15.8.1.083" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 10db5b3ed6be5f752ad299399e7ed9564378e80d Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 12 Jun 2024 14:38:53 +0800 Subject: [PATCH 233/271] feat: revoke supabase_*_admin from postgres Prevents Auth and Storage schemas & migrations from being modified --- ...701_revoke_supabase_storage_admin_from_postgres.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql diff --git a/migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql b/migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql new file mode 100644 index 000000000..4c5c48b79 --- /dev/null +++ b/migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql @@ -0,0 +1,10 @@ +-- migrate:up +revoke supabase_storage_admin from postgres; +revoke create on schema storage from postgres; +revoke all on storage.migrations from anon, authenticated, service_role, postgres; + +revoke supabase_auth_admin from postgres; +revoke create on schema auth from postgres; +revoke all on auth.schema_migrations from dashboard_user, postgres; + +-- migrate:down From 218b2fe85257278392c20e298ea484568dc23fb0 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 30 Apr 2025 15:50:11 +0800 Subject: [PATCH 234/271] test: update snapshots --- ...4701_revoke_admin_roles_from_postgres.sql} | 0 nix/tests/expected/auth.out | 16 +--------- nix/tests/expected/roles.out | 8 ++--- nix/tests/expected/storage.out | 30 +------------------ 4 files changed, 4 insertions(+), 50 deletions(-) rename migrations/db/migrations/{20250421084701_revoke_supabase_storage_admin_from_postgres.sql => 20250421084701_revoke_admin_roles_from_postgres.sql} (100%) diff --git a/migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql b/migrations/db/migrations/20250421084701_revoke_admin_roles_from_postgres.sql similarity index 100% rename from migrations/db/migrations/20250421084701_revoke_supabase_storage_admin_from_postgres.sql rename to migrations/db/migrations/20250421084701_revoke_admin_roles_from_postgres.sql diff --git a/nix/tests/expected/auth.out b/nix/tests/expected/auth.out index 6ada416c6..419e74a41 100644 --- a/nix/tests/expected/auth.out +++ b/nix/tests/expected/auth.out @@ -132,20 +132,6 @@ order by auth | refresh_tokens | supabase_auth_admin | TRIGGER | f auth | refresh_tokens | supabase_auth_admin | TRUNCATE | f auth | refresh_tokens | supabase_auth_admin | UPDATE | f - auth | schema_migrations | dashboard_user | DELETE | f - auth | schema_migrations | dashboard_user | INSERT | f - auth | schema_migrations | dashboard_user | REFERENCES | f - auth | schema_migrations | dashboard_user | SELECT | f - auth | schema_migrations | dashboard_user | TRIGGER | f - auth | schema_migrations | dashboard_user | TRUNCATE | f - auth | schema_migrations | dashboard_user | UPDATE | f - auth | schema_migrations | postgres | DELETE | f - auth | schema_migrations | postgres | INSERT | f - auth | schema_migrations | postgres | REFERENCES | f - auth | schema_migrations | postgres | SELECT | f - auth | schema_migrations | postgres | TRIGGER | f - auth | schema_migrations | postgres | TRUNCATE | f - auth | schema_migrations | postgres | UPDATE | f auth | schema_migrations | supabase_auth_admin | DELETE | f auth | schema_migrations | supabase_auth_admin | INSERT | f auth | schema_migrations | supabase_auth_admin | REFERENCES | f @@ -174,7 +160,7 @@ order by auth | users | supabase_auth_admin | TRIGGER | f auth | users | supabase_auth_admin | TRUNCATE | f auth | users | supabase_auth_admin | UPDATE | f -(105 rows) +(91 rows) -- auth indexes with owners select diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index 481d1b0ef..1cf984cf1 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -137,8 +137,6 @@ order by postgres | pg_signal_backend | f postgres | pgtle_admin | f postgres | service_role | f - postgres | supabase_auth_admin | f - postgres | supabase_storage_admin | f service_role | | supabase_admin | | supabase_auth_admin | | @@ -146,7 +144,7 @@ order by supabase_read_only_user | pg_read_all_data | f supabase_replication_admin | | supabase_storage_admin | authenticator | f -(42 rows) +(40 rows) -- Check all privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for @@ -281,7 +279,6 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; public | USAGE | service_role | pg_database_owner public | USAGE | service_role | postgres auth | CREATE | dashboard_user | supabase_admin - auth | CREATE | postgres | supabase_admin auth | CREATE | supabase_admin | supabase_admin auth | CREATE | supabase_auth_admin | supabase_admin auth | DELETE | dashboard_user | supabase_auth_admin @@ -517,7 +514,6 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; repack | USAGE | postgres | supabase_admin repack | USAGE | supabase_admin | supabase_admin storage | CREATE | dashboard_user | supabase_admin - storage | CREATE | postgres | supabase_admin storage | CREATE | supabase_admin | supabase_admin storage | CREATE | supabase_storage_admin | supabase_admin storage | DELETE | anon | postgres @@ -577,5 +573,5 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; vault | USAGE | postgres | supabase_admin vault | USAGE | service_role | supabase_admin vault | USAGE | supabase_admin | supabase_admin -(391 rows) +(389 rows) diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index 6c14bb47f..353604ec8 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -102,34 +102,6 @@ order by storage | buckets | supabase_storage_admin | TRIGGER | f storage | buckets | supabase_storage_admin | TRUNCATE | f storage | buckets | supabase_storage_admin | UPDATE | f - storage | migrations | anon | DELETE | f - storage | migrations | anon | INSERT | f - storage | migrations | anon | REFERENCES | f - storage | migrations | anon | SELECT | f - storage | migrations | anon | TRIGGER | f - storage | migrations | anon | TRUNCATE | f - storage | migrations | anon | UPDATE | f - storage | migrations | authenticated | DELETE | f - storage | migrations | authenticated | INSERT | f - storage | migrations | authenticated | REFERENCES | f - storage | migrations | authenticated | SELECT | f - storage | migrations | authenticated | TRIGGER | f - storage | migrations | authenticated | TRUNCATE | f - storage | migrations | authenticated | UPDATE | f - storage | migrations | postgres | DELETE | f - storage | migrations | postgres | INSERT | f - storage | migrations | postgres | REFERENCES | f - storage | migrations | postgres | SELECT | f - storage | migrations | postgres | TRIGGER | f - storage | migrations | postgres | TRUNCATE | f - storage | migrations | postgres | UPDATE | f - storage | migrations | service_role | DELETE | f - storage | migrations | service_role | INSERT | f - storage | migrations | service_role | REFERENCES | f - storage | migrations | service_role | SELECT | f - storage | migrations | service_role | TRIGGER | f - storage | migrations | service_role | TRUNCATE | f - storage | migrations | service_role | UPDATE | f storage | migrations | supabase_storage_admin | DELETE | f storage | migrations | supabase_storage_admin | INSERT | f storage | migrations | supabase_storage_admin | REFERENCES | f @@ -172,7 +144,7 @@ order by storage | objects | supabase_storage_admin | TRIGGER | f storage | objects | supabase_storage_admin | TRUNCATE | f storage | objects | supabase_storage_admin | UPDATE | f -(105 rows) +(77 rows) -- storage indexes with owners select From 4c10c24c52df0d044408c3a6966bad05522eba7f Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Fri, 2 May 2025 15:59:00 +0800 Subject: [PATCH 235/271] chore: bump versions --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 5b8add482..d3a93682a 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.076-orioledb" - postgres17: "17.4.1.026" - postgres15: "15.8.1.083" + postgresorioledb-17: "17.0.1.077-orioledb" + postgres17: "17.4.1.027" + postgres15: "15.8.1.084" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 60f8fda593c9c150278b56ad91c65fad19abc95f Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 2 May 2025 14:19:40 -0400 Subject: [PATCH 236/271] Sam/build ami local (#1547) * feature: run testinfra locally * chore: create way to run testinfra locally * feature: local ami dev tools * feat: retry * feat: run components of testinfra locally as distinct apps * test: local run of testinfra * test: specify ami and branch * feat: pin nixpkgs dep until ready to update * feat: use ref fo rbranch * test: push trigger * test: add premission block * test: aws creds * test: run on our arm runner * feat: no need to check aws-vault on run * test: running testinfra locally * chore: roll back inputs for now. change in a future pr * fix: dynamic port handling since it can collide with parallel test * feat: make sure ec2 instance terminates at end of run no matter how ended * docs: document usage * chore: remove as not needed after all * chore: newline --- ...tinfra-nix.yml => testinfra-ami-build.yml} | 0 .gitignore | 1 + flake.nix | 1569 +++++++++++------ nix/docs/development-workflow.md | 141 ++ nix/ext/pg_jsonschema.nix | 5 +- testinfra/test_ami_nix.py | 203 ++- 6 files changed, 1298 insertions(+), 621 deletions(-) rename .github/workflows/{testinfra-nix.yml => testinfra-ami-build.yml} (100%) create mode 100644 nix/docs/development-workflow.md diff --git a/.github/workflows/testinfra-nix.yml b/.github/workflows/testinfra-ami-build.yml similarity index 100% rename from .github/workflows/testinfra-nix.yml rename to .github/workflows/testinfra-ami-build.yml diff --git a/.gitignore b/.gitignore index 005d3ece6..d32cc8f60 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ result* .vscode/ db/schema.sql +common-nix.vars.pkr.hcl diff --git a/flake.nix b/flake.nix index 70810e194..d49c9e3fa 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, flake-utils, nix2container, nix-editor, rust-overlay, ...}: + outputs = { self, nixpkgs, flake-utils, nix-editor, rust-overlay, nix2container, ... }: let gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; @@ -23,14 +23,13 @@ let pgsqlDefaultPort = "5435"; pgsqlSuperuser = "supabase_admin"; - nix2img = nix2container.packages.${system}.nix2container; pkgs = import nixpkgs { - config = { + config = { allowUnfree = true; permittedInsecurePackages = [ "v8-9.7.106.18" - ]; + ]; }; inherit system; overlays = [ @@ -84,6 +83,16 @@ }) ]; }; + # Define pythonEnv here + pythonEnv = pkgs.python3.withPackages (ps: with ps; [ + boto3 + docker + pytest + pytest-testinfra + requests + ec2instanceconnectcli + paramiko + ]); 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 { }; @@ -150,15 +159,16 @@ #Where we import and build the orioledb extension, we add on our custom extensions # plus the orioledb option #we're not using timescaledb or plv8 in the orioledb-17 version or pg 17 of supabase extensions - orioleFilteredExtensions = builtins.filter ( - x: + orioleFilteredExtensions = builtins.filter + ( + x: x != ./nix/ext/timescaledb.nix && x != ./nix/ext/timescaledb-2.9.1.nix && x != ./nix/ext/plv8.nix ) ourExtensions; orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - dbExtensions17 = orioleFilteredExtensions; + dbExtensions17 = orioleFilteredExtensions; getPostgresqlPackage = version: pkgs.postgresql."postgresql_${version}"; # Create a 'receipt' file for a given postgresql package. This is a way @@ -196,14 +206,16 @@ }; makeOurPostgresPkgs = version: - let + let postgresql = getPostgresqlPackage version; - extensionsToUse = if (builtins.elem version ["orioledb-17"]) + extensionsToUse = + if (builtins.elem version [ "orioledb-17" ]) then orioledbExtensions - else if (builtins.elem version ["17"]) - then dbExtensions17 + else if (builtins.elem version [ "17" ]) + then dbExtensions17 else ourExtensions; - in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; + in + map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; # Create an attrset that contains all the extensions included in a server. makeOurPostgresPkgsSet = version: @@ -252,372 +264,841 @@ recurseForDerivations = true; }; - makePostgresDevSetup = { pkgs, name, extraSubstitutions ? {} }: - let - paths = { - migrationsDir = builtins.path { - name = "migrations"; - path = ./migrations/db; - }; - postgresqlSchemaSql = builtins.path { - name = "postgresql-schema"; - path = ./nix/tools/postgresql_schema.sql; - }; - pgbouncerAuthSchemaSql = builtins.path { - name = "pgbouncer-auth-schema"; - path = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - }; - statExtensionSql = builtins.path { - name = "stat-extension"; - path = ./ansible/files/stat_extension.sql; - }; - pgconfigFile = builtins.path { - name = "postgresql.conf"; - path = ./ansible/files/postgresql_config/postgresql.conf.j2; - }; - supautilsConfigFile = builtins.path { - name = "supautils.conf"; - path = ./ansible/files/postgresql_config/supautils.conf.j2; - }; - loggingConfigFile = builtins.path { - name = "logging.conf"; - path = ./ansible/files/postgresql_config/postgresql-csvlog.conf; - }; - readReplicaConfigFile = builtins.path { - name = "readreplica.conf"; - path = ./ansible/files/postgresql_config/custom_read_replica.conf.j2; - }; - pgHbaConfigFile = builtins.path { - name = "pg_hba.conf"; - path = ./ansible/files/postgresql_config/pg_hba.conf.j2; - }; - pgIdentConfigFile = builtins.path { - name = "pg_ident.conf"; - path = ./ansible/files/postgresql_config/pg_ident.conf.j2; - }; - postgresqlExtensionCustomScriptsPath = builtins.path { - name = "extension-custom-scripts"; - path = ./ansible/files/postgresql_extension_custom_scripts; - }; - getkeyScript = builtins.path { - name = "pgsodium_getkey.sh"; - path = ./nix/tests/util/pgsodium_getkey.sh; + makePostgresDevSetup = { pkgs, name, extraSubstitutions ? { } }: + let + paths = { + migrationsDir = builtins.path { + name = "migrations"; + path = ./migrations/db; + }; + postgresqlSchemaSql = builtins.path { + name = "postgresql-schema"; + path = ./nix/tools/postgresql_schema.sql; + }; + pgbouncerAuthSchemaSql = builtins.path { + name = "pgbouncer-auth-schema"; + path = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + }; + statExtensionSql = builtins.path { + name = "stat-extension"; + path = ./ansible/files/stat_extension.sql; + }; + pgconfigFile = builtins.path { + name = "postgresql.conf"; + path = ./ansible/files/postgresql_config/postgresql.conf.j2; + }; + supautilsConfigFile = builtins.path { + name = "supautils.conf"; + path = ./ansible/files/postgresql_config/supautils.conf.j2; + }; + loggingConfigFile = builtins.path { + name = "logging.conf"; + path = ./ansible/files/postgresql_config/postgresql-csvlog.conf; + }; + readReplicaConfigFile = builtins.path { + name = "readreplica.conf"; + path = ./ansible/files/postgresql_config/custom_read_replica.conf.j2; + }; + pgHbaConfigFile = builtins.path { + name = "pg_hba.conf"; + path = ./ansible/files/postgresql_config/pg_hba.conf.j2; + }; + pgIdentConfigFile = builtins.path { + name = "pg_ident.conf"; + path = ./ansible/files/postgresql_config/pg_ident.conf.j2; + }; + postgresqlExtensionCustomScriptsPath = builtins.path { + name = "extension-custom-scripts"; + path = ./ansible/files/postgresql_extension_custom_scripts; + }; + getkeyScript = builtins.path { + name = "pgsodium_getkey.sh"; + path = ./nix/tests/util/pgsodium_getkey.sh; + }; }; - }; - - localeArchive = if pkgs.stdenv.isDarwin - then "${pkgs.darwin.locale}/share/locale" - else "${pkgs.glibcLocales}/lib/locale/locale-archive"; - - substitutions = { - SHELL_PATH = "${pkgs.bash}/bin/bash"; - PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; - PGSQL_SUPERUSER = "${pgsqlSuperuser}"; - PSQL15_BINDIR = "${basePackages.psql_15.bin}"; - PSQL17_BINDIR = "${basePackages.psql_17.bin}"; - PSQL_CONF_FILE = "${paths.pgconfigFile}"; - PSQLORIOLEDB17_BINDIR = "${basePackages.psql_orioledb-17.bin}"; - PGSODIUM_GETKEY = "${paths.getkeyScript}"; - READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; - LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; - SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; - PG_HBA = "${paths.pgHbaConfigFile}"; - PG_IDENT = "${paths.pgIdentConfigFile}"; - LOCALES = "${localeArchive}"; - EXTENSION_CUSTOM_SCRIPTS_DIR = "${paths.postgresqlExtensionCustomScriptsPath}"; - MECAB_LIB = "${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so"; - GROONGA_DIR = "${supabase-groonga}"; - MIGRATIONS_DIR = "${paths.migrationsDir}"; - POSTGRESQL_SCHEMA_SQL = "${paths.postgresqlSchemaSql}"; - PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; - STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; - CURRENT_SYSTEM = "${system}"; - } // extraSubstitutions; # Merge in any extra substitutions - in pkgs.runCommand name { - inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; - } '' - set -x - mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts + + localeArchive = + if pkgs.stdenv.isDarwin + then "${pkgs.darwin.locale}/share/locale" + else "${pkgs.glibcLocales}/lib/locale/locale-archive"; + + substitutions = { + SHELL_PATH = "${pkgs.bash}/bin/bash"; + PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; + PGSQL_SUPERUSER = "${pgsqlSuperuser}"; + PSQL15_BINDIR = "${basePackages.psql_15.bin}"; + PSQL17_BINDIR = "${basePackages.psql_17.bin}"; + PSQL_CONF_FILE = "${paths.pgconfigFile}"; + PSQLORIOLEDB17_BINDIR = "${basePackages.psql_orioledb-17.bin}"; + PGSODIUM_GETKEY = "${paths.getkeyScript}"; + READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; + LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; + SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; + PG_HBA = "${paths.pgHbaConfigFile}"; + PG_IDENT = "${paths.pgIdentConfigFile}"; + LOCALES = "${localeArchive}"; + EXTENSION_CUSTOM_SCRIPTS_DIR = "${paths.postgresqlExtensionCustomScriptsPath}"; + MECAB_LIB = "${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so"; + GROONGA_DIR = "${supabase-groonga}"; + MIGRATIONS_DIR = "${paths.migrationsDir}"; + POSTGRESQL_SCHEMA_SQL = "${paths.postgresqlSchemaSql}"; + PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; + STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; + CURRENT_SYSTEM = "${system}"; + } // extraSubstitutions; # Merge in any extra substitutions + in + pkgs.runCommand name + { + inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; + } '' + set -x + mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts - # Copy config files with error handling - cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } - cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } - cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } - cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } - cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } - cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } - cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } + # Copy config files with error handling + cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } + cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } + cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } + cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } + cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } + cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } + cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } - echo "Copy operation completed" - chmod 644 $out/etc/postgresql-custom/supautils.conf - chmod 644 $out/etc/postgresql/postgresql.conf - chmod 644 $out/etc/postgresql-custom/logging.conf - chmod 644 $out/etc/postgresql/pg_hba.conf - - substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ - ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs - (name: value: "--subst-var-by '${name}' '${value}'") - substitutions - ))} - chmod +x $out/bin/start-postgres-server - ''; + echo "Copy operation completed" + chmod 644 $out/etc/postgresql-custom/supautils.conf + chmod 644 $out/etc/postgresql/postgresql.conf + chmod 644 $out/etc/postgresql-custom/logging.conf + chmod 644 $out/etc/postgresql/pg_hba.conf + + substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ + ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs + (name: value: "--subst-var-by '${name}' '${value}'") + substitutions + ))} + chmod +x $out/bin/start-postgres-server + ''; # The base set of packages that we export from this Nix Flake, that can # be used with 'nix build'. Don't use the names listed below; check the # name in 'nix flake show' in order to make sure exactly what name you # want. - basePackages = let - # Function to get the PostgreSQL version from the attribute name - getVersion = name: - let - match = builtins.match "psql_([0-9]+)" name; - in - if match == null then null else builtins.head match; - - # Define the available PostgreSQL versions - postgresVersions = { - psql_15 = makePostgres "15"; - psql_17 = makePostgres "17"; - psql_orioledb-17 = makePostgres "orioledb-17" ; - }; + basePackages = + let + # Function to get the PostgreSQL version from the attribute name + getVersion = name: + let + match = builtins.match "psql_([0-9]+)" name; + in + if match == null then null else builtins.head match; + + # Define the available PostgreSQL versions + postgresVersions = { + psql_15 = makePostgres "15"; + psql_17 = makePostgres "17"; + psql_orioledb-17 = makePostgres "orioledb-17"; + }; - # Find the active PostgreSQL version - activeVersion = getVersion (builtins.head (builtins.attrNames postgresVersions)); + # Find the active PostgreSQL version + activeVersion = getVersion (builtins.head (builtins.attrNames postgresVersions)); - # Function to create the pg_regress package - makePgRegress = version: - let - postgresqlPackage = pkgs."postgresql_${version}"; - in - pkgs.callPackage ./nix/ext/pg_regress.nix { + # Function to create the pg_regress package + makePgRegress = version: + let + postgresqlPackage = pkgs."postgresql_${version}"; + in + pkgs.callPackage ./nix/ext/pg_regress.nix { postgresql = postgresqlPackage; }; - postgresql_15 = getPostgresqlPackage "15"; - postgresql_17 = getPostgresqlPackage "17"; - postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; - in - postgresVersions // { - 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; - cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; - # PostgreSQL versions. - psql_15 = postgresVersions.psql_15; - psql_17 = postgresVersions.psql_17; - psql_orioledb-17 = postgresVersions.psql_orioledb-17; - wal-g-2 = wal-g-2; - wal-g-3 = wal-g-3; - sfcgal = sfcgal; - pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_17 postgresql_orioledb-17; - postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; - postgresql_17_debug = if pkgs.stdenv.isLinux then postgresql_17.debug else null; - postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; - postgresql_15_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-15-src"; - version = postgresql_15.version; - - src = postgresql_15.src; - - nativeBuildInputs = [ pkgs.bzip2 ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out - cp -r . $out - ''; + postgresql_15 = getPostgresqlPackage "15"; + postgresql_17 = getPostgresqlPackage "17"; + postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; + in + postgresVersions // { + 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; + cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; + # PostgreSQL versions. + psql_15 = postgresVersions.psql_15; + psql_17 = postgresVersions.psql_17; + psql_orioledb-17 = postgresVersions.psql_orioledb-17; + wal-g-2 = wal-g-2; + wal-g-3 = wal-g-3; + sfcgal = sfcgal; + pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; + inherit postgresql_15 postgresql_17 postgresql_orioledb-17; + postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; + postgresql_17_debug = if pkgs.stdenv.isLinux then postgresql_17.debug else null; + postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; + postgresql_15_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-15-src"; + version = postgresql_15.version; + + src = postgresql_15.src; + + nativeBuildInputs = [ pkgs.bzip2 ]; + + phases = [ "unpackPhase" "installPhase" ]; - meta = with pkgs.lib; { - description = "PostgreSQL 15 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + + meta = with pkgs.lib; { + description = "PostgreSQL 15 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; }; - }; - postgresql_17_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-17-src"; - version = postgresql_17.version; - src = postgresql_17.src; + postgresql_17_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-17-src"; + version = postgresql_17.version; + src = postgresql_17.src; - nativeBuildInputs = [ pkgs.bzip2 ]; + nativeBuildInputs = [ pkgs.bzip2 ]; - phases = [ "unpackPhase" "installPhase" ]; + phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' - mkdir -p $out - cp -r . $out - ''; - meta = with pkgs.lib; { - description = "PostgreSQL 17 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + meta = with pkgs.lib; { + description = "PostgreSQL 17 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; }; - }; - postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-17-src"; - version = postgresql_orioledb-17.version; + postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { + pname = "postgresql-17-src"; + version = postgresql_orioledb-17.version; - src = postgresql_orioledb-17.src; + src = postgresql_orioledb-17.src; - nativeBuildInputs = [ pkgs.bzip2 ]; + nativeBuildInputs = [ pkgs.bzip2 ]; - phases = [ "unpackPhase" "installPhase" ]; + phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' - mkdir -p $out - cp -r . $out - ''; + installPhase = '' + mkdir -p $out + cp -r . $out + ''; - meta = with pkgs.lib; { - description = "PostgreSQL 15 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; + meta = with pkgs.lib; { + description = "PostgreSQL 15 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + platforms = platforms.all; + }; }; - }; - mecab_naist_jdic = mecab-naist-jdic; - supabase_groonga = supabase-groonga; - pg_regress = makePgRegress activeVersion; - # Start a version of the server. - start-server = makePostgresDevSetup { - inherit pkgs; - name = "start-postgres-server"; - }; + mecab_naist_jdic = mecab-naist-jdic; + supabase_groonga = supabase-groonga; + pg_regress = makePgRegress activeVersion; + # Start a version of the server. + start-server = makePostgresDevSetup { + inherit pkgs; + name = "start-postgres-server"; + }; + + # Start a version of the client and runs migrations script on server. + start-client = + let + migrationsDir = ./migrations/db; + postgresqlSchemaSql = ./nix/tools/postgresql_schema.sql; + pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ./ansible/files/stat_extension.sql; + in + pkgs.runCommand "start-postgres-client" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/run-client.sh.in} $out/bin/start-postgres-client \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ + --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ + --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL17_BINDIR' '${basePackages.psql_17.bin}' \ + --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ + --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ + --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/start-postgres-client + ''; + + # Migrate between two data directories. + migrate-tool = + let + configFile = ./nix/tests/postgresql.conf.in; + getkeyScript = ./nix/tests/util/pgsodium_getkey.sh; + primingScript = ./nix/tests/prime.sql; + migrationData = ./nix/tests/migrations/data.sql; + in + pkgs.runCommand "migrate-postgres" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/migrate-tool.sh.in} $out/bin/migrate-postgres \ + --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ + --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ + --subst-var-by 'PRIMING_SCRIPT' '${primingScript}' \ + --subst-var-by 'MIGRATION_DATA' '${migrationData}' + + chmod +x $out/bin/migrate-postgres + ''; - # Start a version of the client and runs migrations script on server. - start-client = - let - migrationsDir = ./migrations/db; - postgresqlSchemaSql = ./nix/tools/postgresql_schema.sql; - pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - statExtensionSql = ./ansible/files/stat_extension.sql; - in - pkgs.runCommand "start-postgres-client" { } '' + start-replica = pkgs.runCommand "start-postgres-replica" { } '' mkdir -p $out/bin - substitute ${./nix/tools/run-client.sh.in} $out/bin/start-postgres-client \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ + substitute ${./nix/tools/run-replica.sh.in} $out/bin/start-postgres-replica \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL17_BINDIR' '${basePackages.psql_17.bin}' \ - --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ - --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ - --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ - --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ - --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' - chmod +x $out/bin/start-postgres-client + --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' + chmod +x $out/bin/start-postgres-replica + ''; + pg-restore = + pkgs.runCommand "run-pg-restore" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/run-restore.sh.in} $out/bin/pg-restore \ + --subst-var-by PSQL15_BINDIR '${basePackages.psql_15.bin}' + chmod +x $out/bin/pg-restore + ''; + sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' + mkdir -p $out/bin + substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ + --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ + --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ + --subst-var-by 'NIX_EDITOR' '${nix-editor.packages.${system}.nix-editor}/bin/nix-editor' \ + --subst-var-by 'NIXPREFETCHURL' '${pkgs.nixVersions.nix_2_20}/bin/nix-prefetch-url' \ + --subst-var-by 'NIX' '${pkgs.nixVersions.nix_2_20}/bin/nix' + chmod +x $out/bin/sync-exts-versions ''; - # Migrate between two data directories. - migrate-tool = - let - configFile = ./nix/tests/postgresql.conf.in; - getkeyScript = ./nix/tests/util/pgsodium_getkey.sh; - primingScript = ./nix/tests/prime.sql; - migrationData = ./nix/tests/migrations/data.sql; - in - pkgs.runCommand "migrate-postgres" { } '' + local-infra-bootstrap = pkgs.runCommand "local-infra-bootstrap" { } '' mkdir -p $out/bin - substitute ${./nix/tools/migrate-tool.sh.in} $out/bin/migrate-postgres \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ - --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ - --subst-var-by 'PRIMING_SCRIPT' '${primingScript}' \ - --subst-var-by 'MIGRATION_DATA' '${migrationData}' - - chmod +x $out/bin/migrate-postgres + substitute ${./nix/tools/local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap + chmod +x $out/bin/local-infra-bootstrap ''; - - start-replica = pkgs.runCommand "start-postgres-replica" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/run-replica.sh.in} $out/bin/start-postgres-replica \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' - chmod +x $out/bin/start-postgres-replica - ''; - pg-restore = - pkgs.runCommand "run-pg-restore" { } '' + dbmate-tool = + let + migrationsDir = ./migrations/db; + ansibleVars = ./ansible/vars.yml; + pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ./ansible/files/stat_extension.sql; + in + pkgs.runCommand "dbmate-tool" + { + buildInputs = with pkgs; [ + overmind + dbmate + nix + jq + yq + ]; + nativeBuildInputs = with pkgs; [ + makeWrapper + ]; + } '' + mkdir -p $out/bin $out/migrations + cp -r ${migrationsDir}/* $out + substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ + --subst-var-by 'MIGRATIONS_DIR' $out \ + --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ + --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/dbmate-tool + wrapProgram $out/bin/dbmate-tool \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} + ''; + show-commands = pkgs.runCommand "show-commands" + { + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ pkgs.nushell ]; + } '' mkdir -p $out/bin - substitute ${./nix/tools/run-restore.sh.in} $out/bin/pg-restore \ - --subst-var-by PSQL15_BINDIR '${basePackages.psql_15.bin}' - chmod +x $out/bin/pg-restore + cat > $out/bin/show-commands << 'EOF' + #!${pkgs.nushell}/bin/nu + let json_output = (nix flake show --json --quiet --all-systems | from json) + let apps = ($json_output | get apps.${system}) + $apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" } + EOF + chmod +x $out/bin/show-commands + wrapProgram $out/bin/show-commands \ + --prefix PATH : ${pkgs.nushell}/bin ''; - sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ - --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ - --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ - --subst-var-by 'NIX_EDITOR' '${nix-editor.packages.${system}.nix-editor}/bin/nix-editor' \ - --subst-var-by 'NIXPREFETCHURL' '${pkgs.nixVersions.nix_2_20}/bin/nix-prefetch-url' \ - --subst-var-by 'NIX' '${pkgs.nixVersions.nix_2_20}/bin/nix' - chmod +x $out/bin/sync-exts-versions - ''; - - local-infra-bootstrap = pkgs.runCommand "local-infra-bootstrap" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap - chmod +x $out/bin/local-infra-bootstrap - ''; - dbmate-tool = - let - migrationsDir = ./migrations/db; - ansibleVars = ./ansible/vars.yml; - pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - statExtensionSql = ./ansible/files/stat_extension.sql; - in - pkgs.runCommand "dbmate-tool" { - buildInputs = with pkgs; [ - overmind - dbmate - nix - jq - yq - ]; - nativeBuildInputs = with pkgs; [ - makeWrapper - ]; - } '' - mkdir -p $out/bin $out/migrations - cp -r ${migrationsDir}/* $out - substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ - --subst-var-by 'MIGRATIONS_DIR' $out \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ - --subst-var-by 'CURRENT_SYSTEM' '${system}' \ - --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ - --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' - chmod +x $out/bin/dbmate-tool - wrapProgram $out/bin/dbmate-tool \ - --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} + update-readme = pkgs.runCommand "update-readme" + { + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ pkgs.nushell ]; + } '' + mkdir -p $out/bin + cp ${./nix/tools/update_readme.nu} $out/bin/update-readme + chmod +x $out/bin/update-readme + wrapProgram $out/bin/update-readme \ + --prefix PATH : ${pkgs.nushell}/bin ''; - show-commands = pkgs.runCommand "show-commands" { - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ pkgs.nushell ]; - } '' - mkdir -p $out/bin - cat > $out/bin/show-commands << 'EOF' - #!${pkgs.nushell}/bin/nu - let json_output = (nix flake show --json --quiet --all-systems | from json) - let apps = ($json_output | get apps.${system}) - $apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" } - EOF - chmod +x $out/bin/show-commands - wrapProgram $out/bin/show-commands \ - --prefix PATH : ${pkgs.nushell}/bin - ''; - update-readme = pkgs.runCommand "update-readme" { - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ pkgs.nushell ]; - } '' - mkdir -p $out/bin - cp ${./nix/tools/update_readme.nu} $out/bin/update-readme - chmod +x $out/bin/update-readme - wrapProgram $out/bin/update-readme \ - --prefix PATH : ${pkgs.nushell}/bin - ''; - }; + # Script to run the AMI build and tests locally + build-test-ami = pkgs.runCommand "build-test-ami" + { + buildInputs = with pkgs; [ + packer + awscli2 + yq + jq + openssl + git + coreutils + aws-vault + ]; + } '' + mkdir -p $out/bin + cat > $out/bin/build-test-ami << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: build-test-ami [--help] + + Build AMI images for PostgreSQL testing. + + This script will: + 1. Check for required tools and AWS authentication + 2. Build two AMI stages using Packer + 3. Clean up any temporary instances + 4. Output the final AMI name for use with run-testinfra + + Arguments: + postgres-version PostgreSQL major version to build (required) + + Options: + --help Show this help message and exit + + Requirements: + - AWS Vault profile must be set in AWS_VAULT environment variable + - Packer, AWS CLI, yq, jq, and OpenSSL must be installed + - Must be run from a git repository + + Example: + aws-vault exec -- nix run .#build-test-ami 15 + EOF + } + + # Handle help flag + if [[ "$#" -gt 0 && "$1" == "--help" ]]; then + show_help + exit 0 + fi + + export PATH="${pkgs.lib.makeBinPath (with pkgs; [ + packer + awscli2 + yq + jq + openssl + git + coreutils + aws-vault + ])}:$PATH" + + # Check for required tools + for cmd in packer aws-vault yq jq openssl; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check AWS Vault profile + if [ -z "''${AWS_VAULT:-}" ]; then + echo "Error: AWS_VAULT environment variable must be set with the profile name" + echo "Usage: aws-vault exec -- nix run .#build-test-ami " + exit 1 + fi + + # Set values + REGION="ap-southeast-1" + POSTGRES_VERSION="$1" + RANDOM_STRING=$(openssl rand -hex 8) + GIT_SHA=$(git rev-parse HEAD) + RUN_ID=$(date +%s) + + # Generate common-nix.vars.pkr.hcl + PG_VERSION=$(yq -r ".postgres_release[\"postgres$POSTGRES_VERSION\"]" ansible/vars.yml) + echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl + + # Build AMI Stage 1 + packer init amazon-arm64-nix.pkr.hcl + packer build \ + -var "git-head-version=$GIT_SHA" \ + -var "packer-execution-id=$RUN_ID" \ + -var-file="development-arm.vars.pkr.hcl" \ + -var-file="common-nix.vars.pkr.hcl" \ + -var "ansible_arguments=" \ + -var "postgres-version=$RANDOM_STRING" \ + -var "region=$REGION" \ + -var 'ami_regions=["'"$REGION"'"]' \ + -var "force-deregister=true" \ + -var "ansible_arguments=-e postgresql_major=$POSTGRES_VERSION" \ + amazon-arm64-nix.pkr.hcl + + # Build AMI Stage 2 + packer init stage2-nix-psql.pkr.hcl + packer build \ + -var "git-head-version=$GIT_SHA" \ + -var "packer-execution-id=$RUN_ID" \ + -var "postgres_major_version=$POSTGRES_VERSION" \ + -var-file="development-arm.vars.pkr.hcl" \ + -var-file="common-nix.vars.pkr.hcl" \ + -var "postgres-version=$RANDOM_STRING" \ + -var "region=$REGION" \ + -var 'ami_regions=["'"$REGION"'"]' \ + -var "force-deregister=true" \ + -var "git_sha=$GIT_SHA" \ + stage2-nix-psql.pkr.hcl + + # Cleanup instances from AMI builds + cleanup_instances() { + echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." + aws ec2 --region $REGION describe-instances \ + --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ + --query "Reservations[].Instances[].InstanceId" \ + --output text | xargs -r aws ec2 terminate-instances \ + --region $REGION --instance-ids || true + } + + # Set up traps for various signals to ensure cleanup + trap cleanup_instances EXIT HUP INT QUIT TERM + + # Create and activate virtual environment + VENV_DIR=$(mktemp -d) + trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM + python3 -m venv "$VENV_DIR" + source "$VENV_DIR/bin/activate" + + # Install required Python packages + echo "Installing required Python packages..." + pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests + + # Run the tests with aws-vault + echo "Running tests for AMI: $RANDOM_STRING using AWS Vault profile: $AWS_VAULT_PROFILE" + aws-vault exec $AWS_VAULT_PROFILE -- pytest -vv -s testinfra/test_ami_nix.py + + # Deactivate virtual environment (cleanup is handled by trap) + deactivate + EOL + chmod +x $out/bin/build-test-ami + ''; + + run-testinfra = pkgs.runCommand "run-testinfra" + { + buildInputs = with pkgs; [ + aws-vault + python3 + python3Packages.pip + coreutils + ]; + } '' + mkdir -p $out/bin + cat > $out/bin/run-testinfra << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: run-testinfra --ami-name NAME [--aws-vault-profile PROFILE] + + Run the testinfra tests locally against a specific AMI. + + This script will: + 1. Check if aws-vault is installed and configured + 2. Set up the required environment variables + 3. Create and activate a virtual environment + 4. Install required Python packages from pip + 5. Run the tests with aws-vault credentials + 6. Clean up the virtual environment + + Required flags: + --ami-name NAME The name of the AMI to test + + Optional flags: + --aws-vault-profile PROFILE AWS Vault profile to use (default: staging) + --help Show this help message and exit + + Requirements: + - aws-vault installed and configured + - Python 3 with pip + - Must be run from the repository root + + Examples: + run-testinfra --ami-name supabase-postgres-abc123 + run-testinfra --ami-name supabase-postgres-abc123 --aws-vault-profile production + EOF + } + + # Default values + AWS_VAULT_PROFILE="staging" + AMI_NAME="" + + # Parse arguments + while [[ $# -gt 0 ]]; do + case $1 in + --aws-vault-profile) + AWS_VAULT_PROFILE="$2" + shift 2 + ;; + --ami-name) + AMI_NAME="$2" + shift 2 + ;; + --help) + show_help + exit 0 + ;; + *) + echo "Error: Unexpected argument: $1" + show_help + exit 1 + ;; + esac + done + + # Check for required tools + if ! command -v aws-vault &> /dev/null; then + echo "Error: aws-vault is required but not found" + exit 1 + fi + + # Check for AMI name argument + if [ -z "$AMI_NAME" ]; then + echo "Error: --ami-name is required" + show_help + exit 1 + fi + + # Set environment variables + export AWS_REGION="ap-southeast-1" + export AWS_DEFAULT_REGION="ap-southeast-1" + export AMI_NAME="$AMI_NAME" # Export AMI_NAME for pytest + export RUN_ID="local-$(date +%s)" # Generate a unique RUN_ID + + # Function to terminate EC2 instances + terminate_instances() { + echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." + aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 --region ap-southeast-1 describe-instances \ + --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ + --query "Reservations[].Instances[].InstanceId" \ + --output text | xargs -r aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 terminate-instances \ + --region ap-southeast-1 --instance-ids || true + } + + # Set up traps for various signals to ensure cleanup + trap terminate_instances EXIT HUP INT QUIT TERM + + # Create and activate virtual environment + VENV_DIR=$(mktemp -d) + trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM + python3 -m venv "$VENV_DIR" + source "$VENV_DIR/bin/activate" + + # Install required Python packages + echo "Installing required Python packages..." + pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests + + # Function to run tests and ensure cleanup + run_tests() { + local exit_code=0 + echo "Running tests for AMI: $AMI_NAME using AWS Vault profile: $AWS_VAULT_PROFILE" + aws-vault exec "$AWS_VAULT_PROFILE" -- pytest -vv -s testinfra/test_ami_nix.py || exit_code=$? + return $exit_code + } + + # Run tests and capture exit code + run_tests + test_exit_code=$? + + # Deactivate virtual environment + deactivate + + # Explicitly call cleanup + terminate_instances + + # Exit with the test exit code + exit $test_exit_code + EOL + chmod +x $out/bin/run-testinfra + ''; + + cleanup-ami = pkgs.runCommand "cleanup-ami" + { + buildInputs = with pkgs; [ + awscli2 + aws-vault + ]; + } '' + mkdir -p $out/bin + cat > $out/bin/cleanup-ami << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + export PATH="${pkgs.lib.makeBinPath (with pkgs; [ + awscli2 + aws-vault + ])}:$PATH" + + # Check for required tools + for cmd in aws-vault; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check AWS Vault profile + if [ -z "''${AWS_VAULT:-}" ]; then + echo "Error: AWS_VAULT environment variable must be set with the profile name" + echo "Usage: aws-vault exec -- nix run .#cleanup-ami " + exit 1 + fi + + # Check for AMI name argument + if [ -z "''${1:-}" ]; then + echo "Error: AMI name must be provided" + echo "Usage: aws-vault exec -- nix run .#cleanup-ami " + exit 1 + fi + + AMI_NAME="$1" + REGION="ap-southeast-1" + + # Deregister AMIs + for AMI_PATTERN in "supabase-postgres-ci-ami-test-stage-1" "$AMI_NAME"; do + aws ec2 describe-images --region $REGION --owners self \ + --filters "Name=name,Values=$AMI_PATTERN" \ + --query 'Images[*].ImageId' --output text | while read -r ami_id; do + echo "Deregistering AMI: $ami_id" + aws ec2 deregister-image --region $REGION --image-id "$ami_id" || true + done + done + EOL + chmod +x $out/bin/cleanup-ami + ''; + + trigger-nix-build = pkgs.runCommand "trigger-nix-build" + { + buildInputs = with pkgs; [ + gh + git + coreutils + ]; + } '' + mkdir -p $out/bin + cat > $out/bin/trigger-nix-build << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: trigger-nix-build [--help] + + Trigger the nix-build workflow for the current branch and watch its progress. + + This script will: + 1. Check if you're authenticated with GitHub + 2. Get the current branch and commit + 3. Verify you're on a standard branch (develop or release/*) or prompt for confirmation + 4. Trigger the nix-build workflow + 5. Watch the workflow progress until completion + + Options: + --help Show this help message and exit + + Requirements: + - GitHub CLI (gh) installed and authenticated + - Git installed + - Must be run from a git repository + + Example: + trigger-nix-build + EOF + } + + # Handle help flag + if [[ "$#" -gt 0 && "$1" == "--help" ]]; then + show_help + exit 0 + fi + + export PATH="${pkgs.lib.makeBinPath (with pkgs; [ + gh + git + coreutils + ])}:$PATH" + + # Check for required tools + for cmd in gh git; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check if user is authenticated with GitHub + if ! gh auth status &>/dev/null; then + echo "Error: Not authenticated with GitHub. Please run 'gh auth login' first." + exit 1 + fi + + # Get current branch and commit + BRANCH=$(git rev-parse --abbrev-ref HEAD) + COMMIT=$(git rev-parse HEAD) + + # Check if we're on a standard branch + if [[ "$BRANCH" != "develop" && ! "$BRANCH" =~ ^release/ ]]; then + echo "Warning: Running workflow from non-standard branch: $BRANCH" + echo "This is supported for testing purposes." + read -p "Continue? [y/N] " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Aborted." + exit 1 + fi + fi + + # Trigger the workflow + echo "Triggering nix-build workflow for branch $BRANCH (commit: $COMMIT)" + gh workflow run nix-build.yml --ref "$BRANCH" + + # Wait for workflow to start and get the run ID + echo "Waiting for workflow to start..." + sleep 5 + + # Get the latest run ID for this workflow + RUN_ID=$(gh run list --workflow=nix-build.yml --limit 1 --json databaseId --jq '.[0].databaseId') + + if [ -z "$RUN_ID" ]; then + echo "Error: Could not find workflow run ID" + exit 1 + fi + + echo "Watching workflow run $RUN_ID..." + echo "The script will automatically exit when the workflow completes." + echo "Press Ctrl+C to stop watching (workflow will continue running)" + echo "----------------------------------------" + + # Try to watch the run, but handle network errors gracefully + while true; do + if gh run watch "$RUN_ID" --exit-status; then + break + else + echo "Network error while watching workflow. Retrying in 5 seconds..." + echo "You can also check the status manually with: gh run view $RUN_ID" + sleep 5 + fi + done + EOL + chmod +x $out/bin/trigger-nix-build + ''; + }; # Create a testing harness for a PostgreSQL package. This is used for @@ -685,10 +1166,10 @@ let name = pkg.version; in - if builtins.match "15.*" name != null then "15" - else if builtins.match "17.*" name != null then "17" - else if builtins.match "orioledb-17.*" name != null then "orioledb-17" - else throw "Unsupported PostgreSQL version: ${name}"; + if builtins.match "15.*" name != null then "15" + else if builtins.match "17.*" name != null then "17" + else if builtins.match "orioledb-17.*" name != null then "orioledb-17" + else throw "Unsupported PostgreSQL version: ${name}"; # Helper function to filter SQL files based on version filterTestFiles = version: dir: @@ -697,7 +1178,7 @@ isValidFile = name: let isVersionSpecific = builtins.match "z_.*" name != null; - matchesVersion = + matchesVersion = if isVersionSpecific then if version == "orioledb-17" @@ -712,163 +1193,174 @@ pkgs.lib.filterAttrs (name: _: isValidFile name) files; # Get the major version for filtering - majorVersion = - let - version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version; - _ = builtins.trace "Entering majorVersion logic"; - isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null; - isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null; - result = - if isOrioledbMatch - then "orioledb-17" - else if isSeventeenMatch - then "17" - else "15"; - in - builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8" + majorVersion = + let + version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version; + _ = builtins.trace "Entering majorVersion logic"; + isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null; + isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null; + result = + if isOrioledbMatch + then "orioledb-17" + else if isSeventeenMatch + then "17" + else "15"; + in + builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8" # Filter SQL test files filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; - + # Convert filtered tests to a sorted list of basenames (without extension) - testList = pkgs.lib.mapAttrsToList (name: _: - builtins.substring 0 (pkgs.lib.stringLength name - 4) name - ) filteredSqlTests; + testList = pkgs.lib.mapAttrsToList + (name: _: + builtins.substring 0 (pkgs.lib.stringLength name - 4) name + ) + filteredSqlTests; sortedTestList = builtins.sort (a: b: a < b) testList; in pkgs.runCommand "postgres-${pgpkg.version}-check-harness" { - nativeBuildInputs = with pkgs; [ - coreutils bash perl pgpkg pg_prove pg_regress procps - start-postgres-server-bin which getkey-script supabase-groonga + nativeBuildInputs = with pkgs; [ + coreutils + bash + perl + pgpkg + pg_prove + pg_regress + procps + start-postgres-server-bin + which + getkey-script + supabase-groonga ]; } '' - set -e - - #First we need to create a generic pg cluster for pgtap tests and run those - export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins - PGTAP_CLUSTER=$(mktemp -d) - initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" - substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ - --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" - echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf - echo "Checking shared_preload_libraries setting:" - grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf - # Remove timescaledb if running orioledb-17 check - echo "I AM ${pgpkg.version}====================================================" - if [[ "${pgpkg.version}" == *"17"* ]]; then - perl -pi -e 's/ timescaledb,//g' "$PGTAP_CLUSTER/postgresql.conf" + set -e + + #First we need to create a generic pg cluster for pgtap tests and run those + export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins + PGTAP_CLUSTER=$(mktemp -d) + initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" + substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ + --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" + echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf + echo "Checking shared_preload_libraries setting:" + grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf + # Remove timescaledb if running orioledb-17 check + echo "I AM ${pgpkg.version}====================================================" + if [[ "${pgpkg.version}" == *"17"* ]]; then + perl -pi -e 's/ timescaledb,//g' "$PGTAP_CLUSTER/postgresql.conf" + fi + #NOTE in the future we may also need to add the orioledb extension to the cluster when cluster is oriole + echo "PGTAP_CLUSTER directory contents:" + ls -la "$PGTAP_CLUSTER" + + # Check if postgresql.conf exists + if [ ! -f "$PGTAP_CLUSTER/postgresql.conf" ]; then + echo "postgresql.conf is missing!" + exit 1 + fi + + # PostgreSQL startup + if [[ "$(uname)" == "Darwin" ]]; then + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 + else + mkdir -p "$PGTAP_CLUSTER/sockets" + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 + fi || { + echo "pg_ctl failed to start PostgreSQL" + echo "Contents of postgresql.log:" + cat "$PGTAP_CLUSTER"/postgresql.log + exit 1 + } + for i in {1..60}; do + if pg_isready -h localhost -p 5435; then + echo "PostgreSQL is ready" + break fi - #NOTE in the future we may also need to add the orioledb extension to the cluster when cluster is oriole - echo "PGTAP_CLUSTER directory contents:" - ls -la "$PGTAP_CLUSTER" - - # Check if postgresql.conf exists - if [ ! -f "$PGTAP_CLUSTER/postgresql.conf" ]; then - echo "postgresql.conf is missing!" - exit 1 + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL is not ready after 60 seconds" + echo "PostgreSQL status:" + pg_ctl -D "$PGTAP_CLUSTER" status + echo "PostgreSQL log content:" + cat "$PGTAP_CLUSTER"/postgresql.log + exit 1 fi - - # PostgreSQL startup - if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 - else - mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 - fi || { - echo "pg_ctl failed to start PostgreSQL" - echo "Contents of postgresql.log:" + done + createdb -p 5435 -h localhost --username=supabase_admin testing + if ! psql -p 5435 -h localhost --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + echo "Error executing SQL file. PostgreSQL log content:" cat "$PGTAP_CLUSTER"/postgresql.log + pg_ctl -D "$PGTAP_CLUSTER" stop exit 1 - } - for i in {1..60}; do - if pg_isready -h localhost -p 5435; then - echo "PostgreSQL is ready" - break + fi + SORTED_DIR=$(mktemp -d) + for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do + psql -p 5435 -h localhost --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true + done + rm -rf "$SORTED_DIR" + pg_ctl -D "$PGTAP_CLUSTER" stop + rm -rf $PGTAP_CLUSTER + + # End of pgtap tests + # from here on out we are running pg_regress tests, we use a different cluster for this + # which is start by the start-postgres-server-bin script + # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations + + # Ensure pgsodium key directory exists with proper permissions + if [[ "$(uname)" == "Darwin" ]]; then + mkdir -p /private/tmp/pgsodium + chmod 1777 /private/tmp/pgsodium + fi + unset GRN_PLUGINS_DIR + ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize + + for i in {1..60}; do + if pg_isready -h localhost -p 5435 -U supabase_admin -q; then + echo "PostgreSQL is ready" + break fi sleep 1 if [ $i -eq 60 ]; then - echo "PostgreSQL is not ready after 60 seconds" - echo "PostgreSQL status:" - pg_ctl -D "$PGTAP_CLUSTER" status - echo "PostgreSQL log content:" - cat "$PGTAP_CLUSTER"/postgresql.log - exit 1 + echo "PostgreSQL failed to start" + exit 1 fi - done - createdb -p 5435 -h localhost --username=supabase_admin testing - if ! psql -p 5435 -h localhost --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then - echo "Error executing SQL file. PostgreSQL log content:" - cat "$PGTAP_CLUSTER"/postgresql.log - pg_ctl -D "$PGTAP_CLUSTER" stop - exit 1 - fi - SORTED_DIR=$(mktemp -d) - for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do - psql -p 5435 -h localhost --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true - done - rm -rf "$SORTED_DIR" - pg_ctl -D "$PGTAP_CLUSTER" stop - rm -rf $PGTAP_CLUSTER - - # End of pgtap tests - # from here on out we are running pg_regress tests, we use a different cluster for this - # which is start by the start-postgres-server-bin script - # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations - - # Ensure pgsodium key directory exists with proper permissions - if [[ "$(uname)" == "Darwin" ]]; then - mkdir -p /private/tmp/pgsodium - chmod 1777 /private/tmp/pgsodium - fi - unset GRN_PLUGINS_DIR - ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize - - for i in {1..60}; do - if pg_isready -h localhost -p 5435 -U supabase_admin -q; then - echo "PostgreSQL is ready" - break - fi - sleep 1 - if [ $i -eq 60 ]; then - echo "PostgreSQL failed to start" - exit 1 - fi - done - - if ! psql -p 5435 -h localhost --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then - echo "Error executing SQL file" - exit 1 - fi + done - mkdir -p $out/regression_output - if ! pg_regress \ - --use-existing \ - --dbname=postgres \ - --inputdir=${./nix/tests} \ - --outputdir=$out/regression_output \ - --host=localhost \ - --port=5435 \ - --user=supabase_admin \ - ${builtins.concatStringsSep " " sortedTestList}; then - echo "pg_regress tests failed" - cat $out/regression_output/regression.diffs - exit 1 - fi + if ! psql -p 5435 -h localhost --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + echo "Error executing SQL file" + exit 1 + fi + + mkdir -p $out/regression_output + if ! pg_regress \ + --use-existing \ + --dbname=postgres \ + --inputdir=${./nix/tests} \ + --outputdir=$out/regression_output \ + --host=localhost \ + --port=5435 \ + --user=supabase_admin \ + ${builtins.concatStringsSep " " sortedTestList}; then + echo "pg_regress tests failed" + cat $out/regression_output/regression.diffs + exit 1 + fi - echo "Running migrations tests" - pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + echo "Running migrations tests" + pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql - # Copy logs to output - for logfile in $(find /tmp -name postgresql.log -type f); do - cp "$logfile" $out/postgresql.log - done - exit 0 - ''; - in + # Copy logs to output + for logfile in $(find /tmp -name postgresql.log -type f); do + cp "$logfile" $out/postgresql.log + done + exit 0 + ''; + in rec { # The list of all packages that can be built with 'nix build'. The list # of names that can be used can be shown with 'nix flake show' @@ -907,6 +1399,10 @@ dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; update-readme = mkApp "update-readme" "update-readme"; show-commands = mkApp "show-commands" "show-commands"; + build-test-ami = mkApp "build-test-ami" "build-test-ami"; + run-testinfra = mkApp "run-testinfra" "run-testinfra"; + cleanup-ami = mkApp "cleanup-ami" "cleanup-ami"; + trigger-nix-build = mkApp "trigger-nix-build" "trigger-nix-build"; }; # 'devShells.default' lists the set of packages that are included in the @@ -914,54 +1410,59 @@ # for development and puts many convenient devtools instantly within # reach. - devShells = let - mkCargoPgrxDevShell = { pgrxVersion, rustVersion }: pkgs.mkShell { - packages = with pkgs; [ - basePackages."cargo-pgrx_${pgrxVersion}" - (rust-bin.stable.${rustVersion}.default.override { - extensions = [ "rust-src" ]; - }) - ]; - shellHook = '' - export HISTFILE=.history - ''; - }; - in { - default = pkgs.mkShell { - packages = with pkgs; [ - coreutils - just - nix-update - #pg_prove - shellcheck - ansible - ansible-lint - (packer.overrideAttrs (oldAttrs: { - version = "1.7.8"; - })) - - basePackages.start-server - basePackages.start-client - basePackages.start-replica - basePackages.migrate-tool - basePackages.sync-exts-versions - dbmate - nushell - ]; - shellHook = '' - export HISTFILE=.history - export DATABASE_URL="postgres://supabase_admin@localhost:5435/postgres?sslmode=disable" - ''; - }; - cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { - pgrxVersion = "0_11_3"; - rustVersion = "1.80.0"; - }; - cargo-pgrx_0_12_6 = mkCargoPgrxDevShell { - pgrxVersion = "0_12_6"; - rustVersion = "1.80.0"; - }; - }; - } - ); + devShells = + let + mkCargoPgrxDevShell = { pgrxVersion, rustVersion }: pkgs.mkShell { + packages = with pkgs; [ + basePackages."cargo-pgrx_${pgrxVersion}" + (rust-bin.stable.${rustVersion}.default.override { + extensions = [ "rust-src" ]; + }) + ]; + shellHook = '' + export HISTFILE=.history + ''; + }; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + coreutils + just + nix-update + #pg_prove + shellcheck + ansible + ansible-lint + (packer.overrideAttrs (oldAttrs: { + version = "1.7.8"; + })) + + basePackages.start-server + basePackages.start-client + basePackages.start-replica + basePackages.migrate-tool + basePackages.sync-exts-versions + basePackages.build-test-ami + basePackages.run-testinfra + basePackages.cleanup-ami + dbmate + nushell + pythonEnv + ]; + shellHook = '' + export HISTFILE=.history + ''; + }; + cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { + pgrxVersion = "0_11_3"; + rustVersion = "1.80.0"; + }; + cargo-pgrx_0_12_6 = mkCargoPgrxDevShell { + pgrxVersion = "0_12_6"; + rustVersion = "1.80.0"; + }; + }; + } + ); } diff --git a/nix/docs/development-workflow.md b/nix/docs/development-workflow.md new file mode 100644 index 000000000..695427abc --- /dev/null +++ b/nix/docs/development-workflow.md @@ -0,0 +1,141 @@ +# PostgreSQL Development Workflow + +This document outlines the workflow for developing and testing PostgreSQL in an ec2 instance using the tools provided in this repo. + +## Prerequisites + +- Nix installed and configured +- AWS credentials configured with aws-vault (you must set up aws-vault beforehand) +- GitHub access to the repository + +## Workflow Steps + +### 1. Trigger Remote Build and Cache + +To build, test, and cache your changes in the Supabase Nix binary cache: + +```bash +# From your branch +nix run .#trigger-nix-build +``` + +This will: +- Trigger a GitHub Actions workflow +- Build PostgreSQL and extensions +- Run nix flake check tests (evaluation of nix code, pg_regress and migrations tests) +- Cache the results in the Supabase Nix binary cache +- Watch the workflow progress until completion + +The workflow will run on the branch you're currently on. + +If you're on a feature different branch, you'll be prompted to confirm before proceeding. + +### 2. Build AMI + +After the build is complete and cached, build the AMI: + +```bash +# Build AMI for PostgreSQL 15 +aws-vault exec -- nix run .#build-test-ami 15 + +# Or for PostgreSQL 17 +aws-vault exec -- nix run .#build-test-ami 17 + +# Or for PostgreSQL orioledb-17 +aws-vault exec -- nix run .#build-test-ami orioledb-17 +``` + +This will: +- Build two AMI stages using Packer +- Clean up temporary instances after AMI builds +- Output the final AMI name (e.g., `supabase-postgres-abc123`) + +**Important**: Take note of the AMI name output at the end, as you'll need it for the next step. + +### 3. Run Testinfra + +Run the testinfra tests against the AMI: + +```bash +# Run tests against the AMI +nix run .#run-testinfra -- --aws-vault-profile --ami-name supabase-postgres-abc123 +``` + +This will: +- Create a Python virtual environment +- Install required Python packages +- Create an EC2 instance from the AMI +- Run the test suite +- Automatically terminate the EC2 instance when done + +The script handles: +- Setting up AWS credentials via aws-vault +- Creating and managing the Python virtual environment +- Running the tests +- Cleaning up EC2 instances +- Proper error handling and cleanup on interruption + +### 4. Optional: Cleanup AMI + +If you want to clean up the AMI after testing: + +```bash +# Clean up the AMI +aws-vault exec -- nix run .#cleanup-ami supabase-postgres-abc123 +``` + +This will: +- Deregister the AMI +- Clean up any associated resources + +## Troubleshooting + +### Common Issues + +1. **AWS Credentials** + - Ensure aws-vault is properly configured + - Use the `--aws-vault-profile` argument to specify your AWS profile + - Default profile is "staging" if not specified + +2. **EC2 Instance Not Terminating** + - The script includes multiple safeguards for cleanup + - If instances aren't terminated, check AWS console and terminate manually + +3. **Test Failures** + - Check the test output for specific failures + - Ensure you're using the correct AMI name + - Verify AWS region and permissions + +### Environment Variables + +The following environment variables are used: +- `AWS_VAULT`: AWS Vault profile name (default: staging) +- `AWS_REGION`: AWS region (default: ap-southeast-1) +- `AMI_NAME`: Name of the AMI to test + +## Best Practices + +1. **Branch Management** + - Use feature branches for development + - Merge to develop for testing + - Use release branches for version-specific changes + +2. **Resource Cleanup** + - Always run the cleanup step after testing + - Monitor AWS console for any lingering resources + - Use the cleanup-ami command when done with an AMI + +3. **Testing** + - Run tests locally before pushing changes + - Verify AMI builds before running testinfra + - Check test output for any warnings or errors + +## Additional Commands + +```bash +# Show available commands +nix run .#show-commands + +# Update README with latest command information +nix run .#update-readme +``` \ No newline at end of file diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix index 642519f08..654bb93f5 100644 --- a/nix/ext/pg_jsonschema.nix +++ b/nix/ext/pg_jsonschema.nix @@ -26,7 +26,10 @@ buildPgrxExtension_0_12_6 rec { env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - PGPORT = "5433"; + PGPORT = toString (5441 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version + }; cargoLock = { diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 4d354fac3..1975818d6 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -6,10 +6,11 @@ import pytest import requests import socket -import testinfra from ec2instanceconnectcli.EC2InstanceConnectLogger import EC2InstanceConnectLogger from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey from time import sleep +import subprocess +import paramiko # if GITHUB_RUN_ID is not set, use a default value that includes the user and hostname RUN_ID = os.environ.get( @@ -170,6 +171,51 @@ logger.setLevel(logging.DEBUG) +def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): + """Create and return a single SSH connection that can be reused.""" + for attempt in range(max_retries): + try: + # Create SSH client + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + + # Connect with our working parameters + ssh.connect( + hostname=instance_ip, + username='ubuntu', + key_filename=ssh_identity_file, + timeout=10, + banner_timeout=10 + ) + + # Test the connection + stdin, stdout, stderr = ssh.exec_command('echo "SSH test"') + if stdout.channel.recv_exit_status() == 0 and "SSH test" in stdout.read().decode(): + logger.info("SSH connection established successfully") + return ssh + else: + raise Exception("SSH test command failed") + + except Exception as e: + if attempt == max_retries - 1: + raise + logger.warning( + f"Ssh connection failed, retrying: {attempt + 1}/{max_retries} failed, retrying ..." + ) + sleep(5) + + +def run_ssh_command(ssh, command): + """Run a command over the established SSH connection.""" + stdin, stdout, stderr = ssh.exec_command(command) + exit_code = stdout.channel.recv_exit_status() + return { + 'succeeded': exit_code == 0, + 'stdout': stdout.read().decode(), + 'stderr': stderr.read().decode() + } + + # scope='session' uses the same container for all the tests; # scope='function' uses a new container per test function. @pytest.fixture(scope="session") @@ -230,6 +276,7 @@ def gzip_then_base64_encode(s: str) -> str: - 'sudo echo \"pgbouncer\" \"postgres\" >> /etc/pgbouncer/userlist.txt' - 'cd /tmp && aws s3 cp --region ap-southeast-1 s3://init-scripts-staging/project/init.sh .' - 'bash init.sh "staging"' + - 'touch /var/lib/init-complete' - 'rm -rf /tmp/*' """, TagSpecifications=[ @@ -256,108 +303,95 @@ def gzip_then_base64_encode(s: str) -> str: ) assert response["Success"] - # instance doesn't have public ip yet + # Wait for instance to have public IP while not instance.public_ip_address: logger.warning("waiting for ip to be available") sleep(5) instance.reload() - while True: - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if sock.connect_ex((instance.public_ip_address, 22)) == 0: - break - else: - logger.warning("waiting for ssh to be available") - sleep(10) - - def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): - for attempt in range(max_retries): - try: - return testinfra.get_host( - f"paramiko://ubuntu@{instance_ip}?timeout=60", - ssh_identity_file=ssh_identity_file, - ) - except Exception as e: - if attempt == max_retries - 1: - raise - logger.warning( - f"Ssh connection failed, retrying: {attempt + 1}/{max_retries} failed, retrying ..." - ) - sleep(5) - - host = get_ssh_connection( - # paramiko is an ssh backend + # Create single SSH connection + ssh = get_ssh_connection( instance.public_ip_address, temp_key.get_priv_key_file(), ) - def is_healthy(host, instance_ip, ssh_identity_file) -> bool: + # Check PostgreSQL data directory + logger.info("Checking PostgreSQL data directory...") + result = run_ssh_command(ssh, "ls -la /var/lib/postgresql") + if result['succeeded']: + logger.info("PostgreSQL data directory contents:\n" + result['stdout']) + else: + logger.warning("Failed to list PostgreSQL data directory: " + result['stderr']) + + # Wait for init.sh to complete + logger.info("Waiting for init.sh to complete...") + max_attempts = 60 # 5 minutes + attempt = 0 + while attempt < max_attempts: + try: + result = run_ssh_command(ssh, "test -f /var/lib/init-complete") + if result['succeeded']: + logger.info("init.sh has completed") + break + except Exception as e: + logger.warning(f"Error checking init.sh status: {str(e)}") + + attempt += 1 + logger.warning(f"Waiting for init.sh to complete (attempt {attempt}/{max_attempts})") + sleep(5) + + if attempt >= max_attempts: + logger.error("init.sh failed to complete within the timeout period") + instance.terminate() + raise TimeoutError("init.sh failed to complete within the timeout period") + + def is_healthy(ssh) -> bool: health_checks = [ - ( - "postgres", - lambda h: h.run("sudo -u postgres /usr/bin/pg_isready -U postgres"), - ), - ( - "adminapi", - lambda h: h.run( - f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'" - ), - ), - ( - "postgrest", - lambda h: h.run( - "curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready" - ), - ), - ( - "gotrue", - lambda h: h.run( - "curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health" - ), - ), - ("kong", lambda h: h.run("sudo kong health")), - ("fail2ban", lambda h: h.run("sudo fail2ban-client status")), + ("postgres", "sudo -u postgres /usr/bin/pg_isready -U postgres"), + ("adminapi", f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'"), + ("postgrest", "curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready"), + ("gotrue", "curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health"), + ("kong", "sudo kong health"), + ("fail2ban", "sudo fail2ban-client status"), ] - for service, check in health_checks: + for service, command in health_checks: try: - cmd = check(host) - if cmd.failed is True: + result = run_ssh_command(ssh, command) + if not result['succeeded']: logger.warning(f"{service} not ready") return False except Exception: - logger.warning( - f"Connection failed during {service} check, attempting reconnect..." - ) - host = get_ssh_connection(instance_ip, ssh_identity_file) + logger.warning(f"Connection failed during {service} check") return False return True while True: - if is_healthy( - host=host, - instance_ip=instance.public_ip_address, - ssh_identity_file=temp_key.get_priv_key_file(), - ): + if is_healthy(ssh): break sleep(1) - # return a testinfra connection to the instance - yield host + # Return both the SSH connection and instance IP for use in tests + yield { + 'ssh': ssh, + 'ip': instance.public_ip_address + } # at the end of the test suite, destroy the instance instance.terminate() def test_postgrest_is_running(host): - postgrest = host.service("postgrest") - assert postgrest.is_running + """Check if postgrest service is running using our SSH connection.""" + result = run_ssh_command(host['ssh'], "systemctl is-active postgrest") + assert result['succeeded'] and result['stdout'].strip() == 'active', "PostgREST service is not running" def test_postgrest_responds_to_requests(host): + """Test if PostgREST responds to requests.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/", + f"http://{host['ip']}/rest/v1/", headers={ "apikey": anon_key, "authorization": f"Bearer {anon_key}", @@ -367,8 +401,9 @@ def test_postgrest_responds_to_requests(host): def test_postgrest_can_connect_to_db(host): + """Test if PostgREST can connect to the database.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "apikey": service_role_key, "authorization": f"Bearer {service_role_key}", @@ -378,14 +413,10 @@ def test_postgrest_can_connect_to_db(host): assert res.ok -# There would be an error if the `apikey` query parameter isn't removed, -# since PostgREST treats query parameters as conditions. -# -# Worth testing since remove_apikey_query_parameters uses regexp instead -# of parsed query parameters. def test_postgrest_starting_apikey_query_parameter_is_removed(host): + """Test if PostgREST removes apikey query parameter at start.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, @@ -399,8 +430,9 @@ def test_postgrest_starting_apikey_query_parameter_is_removed(host): def test_postgrest_middle_apikey_query_parameter_is_removed(host): + """Test if PostgREST removes apikey query parameter in middle.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, @@ -414,8 +446,9 @@ def test_postgrest_middle_apikey_query_parameter_is_removed(host): def test_postgrest_ending_apikey_query_parameter_is_removed(host): + """Test if PostgREST removes apikey query parameter at end.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, @@ -428,14 +461,10 @@ def test_postgrest_ending_apikey_query_parameter_is_removed(host): assert res.ok -# There would be an error if the empty key query parameter isn't removed, -# since PostgREST treats empty key query parameters as malformed input. -# -# Worth testing since remove_apikey_and_empty_key_query_parameters uses regexp instead -# of parsed query parameters. def test_postgrest_starting_empty_key_query_parameter_is_removed(host): + """Test if PostgREST removes empty key query parameter at start.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, @@ -449,8 +478,9 @@ def test_postgrest_starting_empty_key_query_parameter_is_removed(host): def test_postgrest_middle_empty_key_query_parameter_is_removed(host): + """Test if PostgREST removes empty key query parameter in middle.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, @@ -464,8 +494,9 @@ def test_postgrest_middle_empty_key_query_parameter_is_removed(host): def test_postgrest_ending_empty_key_query_parameter_is_removed(host): + """Test if PostgREST removes empty key query parameter at end.""" res = requests.get( - f"http://{host.backend.get_hostname()}/rest/v1/buckets", + f"http://{host['ip']}/rest/v1/buckets", headers={ "accept-profile": "storage", }, From b2c91b0a29332cec79473ee8a6dfa0e205cd0aaa Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Mon, 5 May 2025 16:27:14 +0200 Subject: [PATCH 237/271] feat: bump auth to v2.172.1 (#1585) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index d3a93682a..0e658202d 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.077-orioledb" - postgres17: "17.4.1.027" - postgres15: "15.8.1.084" + postgresorioledb-17: "17.0.1.078-orioledb" + postgres17: "17.4.1.028" + postgres15: "15.8.1.085" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.171.0 -gotrue_release_checksum: sha1:9199d177e653c12202db4b12532853afc6493d32 +gotrue_release: 2.172.1 +gotrue_release_checksum: sha1:60cca6dce1bd37608566d04193483a7fb733214e aws_cli_release: "2.23.11" From 52f0bbc4fb53a4eb430bf4ebc445eb25724e5439 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 9 May 2025 13:20:33 +0800 Subject: [PATCH 238/271] ci: publish to private ECR repo Private ECR repos allow us to enforce immutability. --- .github/workflows/qemu-image-build.yml | 99 +++++++++----------------- 1 file changed, 32 insertions(+), 67 deletions(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index a2fd4b000..7253af151 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -98,85 +98,50 @@ jobs: VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') echo "version=$VERSION" >> $GITHUB_OUTPUT - # - name: Create nix flake revision tarball - # run: | - # GIT_SHA=${{github.sha}} - # MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} - - # mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" - # echo "$GIT_SHA" >> "/tmp/pg_upgrade_bin/${MAJOR_VERSION}/nix_flake_version" - # tar -czf "/tmp/pg_binaries.tar.gz" -C "/tmp/pg_upgrade_bin" . - - name: configure aws credentials - staging uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + role-to-assume: ${{ secrets.CONTROL_PLANE_DEV_ROLE }} aws-region: "us-east-1" - - name: Login to Amazon ECR Public - id: login-ecr-public + - name: Login to Amazon ECR + id: login-ecr-private-dev uses: aws-actions/amazon-ecr-login@v2 + + - name: Build image + env: + IMAGE_TAG: ${{ steps.process_release_version.outputs.version }} + run: | + docker build -f Dockerfile-kubernetes -t "postgres:$IMAGE_TAG" . + + - name: Push docker image to Amazon ECR + env: + REGISTRY: 812073016711.dkr.ecr.us-east-1.amazonaws.com + REPOSITORY: postgres-vm-image + IMAGE_TAG: ${{ steps.process_release_version.outputs.version }} + run: | + docker tag "postgres:$IMAGE_TAG" "$REGISTRY/$REPOSITORY:$IMAGE_TAG" + docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG" + + # TODO (darora): temporarily also push to prod account from here - add a guard to only publish proper tagged releases to prod? + - name: configure aws credentials - prod + uses: aws-actions/configure-aws-credentials@v4 with: - registry-type: public + role-to-assume: ${{ secrets.CONTROL_PLANE_PROD_ROLE }} + aws-region: "us-east-1" + + - name: Login to Amazon ECR + id: login-ecr-private-prod + uses: aws-actions/amazon-ecr-login@v2 - - name: Build, tag, and push docker image to Amazon ECR Public + - name: Push docker image to Amazon ECR env: - REGISTRY: public.ecr.aws/w9p6e7k7 - REGISTRY_ALIAS: supabase + REGISTRY: 156470330064.dkr.ecr.us-east-1.amazonaws.com REPOSITORY: postgres-vm-image IMAGE_TAG: ${{ steps.process_release_version.outputs.version }} run: | - docker build -f Dockerfile-kubernetes -t "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" . - docker push "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" - - # - name: Upload software manifest to s3 staging - # run: | - # cd ansible - # ansible-playbook -i localhost \ - # -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ - # -e "internal_artifacts_bucket=${{ secrets.ARTIFACTS_BUCKET }}" \ - # -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ - # manifest-playbook.yml - - # - name: Upload nix flake revision to s3 staging - # run: | - # aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz - - # - name: configure aws credentials - prod - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # role-to-assume: ${{ secrets.PROD_AWS_ROLE }} - # aws-region: "us-east-1" - - # - name: Upload software manifest to s3 prod - # run: | - # cd ansible - # ansible-playbook -i localhost \ - # -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ - # -e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \ - # -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ - # manifest-playbook.yml - - # - name: Upload nix flake revision to s3 prod - # run: | - # aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz - - # - name: Create release - # uses: softprops/action-gh-release@v1 - # with: - # name: ${{ steps.process_release_version.outputs.version }} - # tag_name: ${{ steps.process_release_version.outputs.version }} - # target_commitish: ${{github.sha}} - - # - name: Slack Notification on Failure - # if: ${{ failure() }} - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - # SLACK_USERNAME: 'gha-failures-notifier' - # SLACK_COLOR: 'danger' - # SLACK_MESSAGE: 'Building Postgres AMI failed' - # SLACK_FOOTER: '' + docker tag "postgres:$IMAGE_TAG" "$REGISTRY/$REPOSITORY:$IMAGE_TAG" + docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG" - name: Cleanup resources after build if: ${{ always() }} From a84c2c7d97734b78f20a9ab4b0b251f3b2e3babd Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:42:15 +0300 Subject: [PATCH 239/271] add migration for pg_create_subscription grant --- ..._grant_subscription_to_postgres_16_and_above.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql diff --git a/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql new file mode 100644 index 000000000..0472783e4 --- /dev/null +++ b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql @@ -0,0 +1,13 @@ +-- migrate:up +DO $$ +DECLARE + major_version INT; +BEGIN + SELECT current_setting('server_version_num')::INT / 10000 INTO major_version; + + IF major_version >= 16 THEN + GRANT pg_create_subscription TO postgres; + END IF; +END $$; + +-- migrate:down \ No newline at end of file From 7a8fc2c7d27e727d92ea850e900dafdeddff9314 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Fri, 4 Apr 2025 01:59:01 +0800 Subject: [PATCH 240/271] Update migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql --- ...250402093753_grant_subscription_to_postgres_16_and_above.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql index 0472783e4..9e9d881ae 100644 --- a/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql +++ b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql @@ -10,4 +10,4 @@ BEGIN END IF; END $$; --- migrate:down \ No newline at end of file +-- migrate:down From 4039e4cd8bc0557b827d1797a6e14b439109d93a Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 7 May 2025 20:45:50 +0800 Subject: [PATCH 241/271] test: add z_17_roles.sql --- nix/tests/expected/roles.out | 77 ++++++++------------- nix/tests/expected/z_17_roles.out | 111 ++++++++++++++++++++++++++++++ nix/tests/sql/roles.sql | 14 ++-- nix/tests/sql/z_17_roles.sql | 60 ++++++++++++++++ 4 files changed, 211 insertions(+), 51 deletions(-) create mode 100644 nix/tests/expected/z_17_roles.out create mode 100644 nix/tests/sql/z_17_roles.sql diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index 1cf984cf1..2d2d5060e 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -1,3 +1,9 @@ +-- Some predefined roles don't exist in earlier versions of Postgres, so we +-- exclude them in this test file. They're tested in version-specific test files +-- (z__roles.sql). +-- +-- Currently those roles are: +-- pg_create_subscription, pg_maintain, pg_use_reserved_connections -- all roles and attributes select rolname, @@ -11,7 +17,6 @@ select rolbypassrls , rolvaliduntil from pg_roles r --- TODO: this exclusion is to maintain compat with pg17, we should cover it where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by rolname; rolname | rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil @@ -51,7 +56,6 @@ select rolname, rolconfig from pg_roles r --- TODO: this exclusion is to maintain compat with pg17, we should cover it where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by rolname; rolname | rolconfig @@ -98,53 +102,31 @@ left join pg_auth_members m on r.oid = m.member left join pg_roles g on m.roleid = g.oid --- TODO: this exclusion is to maintain compat with pg17, we should cover it where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by r.rolname, g.rolname; - member | member_of (can become) | admin_option -----------------------------+------------------------+-------------- - anon | | - authenticated | | - authenticator | anon | f - authenticator | authenticated | f - authenticator | service_role | f - dashboard_user | | - pg_checkpoint | | - pg_database_owner | | - pg_execute_server_program | | - pg_monitor | pg_read_all_settings | f - pg_monitor | pg_read_all_stats | f - pg_monitor | pg_stat_scan_tables | f - pg_read_all_data | | - pg_read_all_settings | | - pg_read_all_stats | | - pg_read_server_files | | - pg_signal_backend | | - pg_stat_scan_tables | | - pg_write_all_data | | - pg_write_server_files | | - pgbouncer | | - pgsodium_keyholder | pgsodium_keyiduser | f - pgsodium_keyiduser | | - pgsodium_keymaker | pgsodium_keyholder | f - pgsodium_keymaker | pgsodium_keyiduser | f - pgtle_admin | | - postgres | anon | f - postgres | authenticated | f - postgres | pg_monitor | f - postgres | pg_read_all_data | f - postgres | pg_signal_backend | f - postgres | pgtle_admin | f - postgres | service_role | f - service_role | | - supabase_admin | | - supabase_auth_admin | | - supabase_functions_admin | | - supabase_read_only_user | pg_read_all_data | f - supabase_replication_admin | | - supabase_storage_admin | authenticator | f -(40 rows) + member | member_of (can become) | admin_option +-------------------------+------------------------+-------------- + authenticator | anon | f + authenticator | authenticated | f + authenticator | service_role | f + pg_monitor | pg_read_all_settings | f + pg_monitor | pg_read_all_stats | f + pg_monitor | pg_stat_scan_tables | f + pgsodium_keyholder | pgsodium_keyiduser | f + pgsodium_keymaker | pgsodium_keyholder | f + pgsodium_keymaker | pgsodium_keyiduser | f + postgres | anon | f + postgres | authenticated | f + postgres | pg_monitor | f + postgres | pg_read_all_data | f + postgres | pg_signal_backend | f + postgres | pgtle_admin | f + postgres | service_role | f + supabase_read_only_user | pg_read_all_data | f + supabase_storage_admin | authenticator | f +(18 rows) -- Check all privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for @@ -164,7 +146,8 @@ from ( join pg_roles r on a.grantee = r.oid where - a.privilege_type != 'MAINTAIN' -- TODO: this is to maintain compat with pg17, we should cover it + -- PG17+, handled in version-specific test files + a.privilege_type != 'MAINTAIN' union all -- explicit grant usage and create on the schemas select diff --git a/nix/tests/expected/z_17_roles.out b/nix/tests/expected/z_17_roles.out new file mode 100644 index 000000000..a90a6677d --- /dev/null +++ b/nix/tests/expected/z_17_roles.out @@ -0,0 +1,111 @@ +-- version-specific roles and attributes +select + rolname, + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + rolname | rolcreaterole | rolcanlogin | rolsuper | rolinherit | rolcreatedb | rolreplication | rolconnlimit | rolbypassrls | rolvaliduntil +-----------------------------+---------------+-------------+----------+------------+-------------+----------------+--------------+--------------+--------------- + pg_create_subscription | f | f | f | t | f | f | -1 | f | + pg_maintain | f | f | f | t | f | f | -1 | f | + pg_use_reserved_connections | f | f | f | t | f | f | -1 | f | +(3 rows) + +select + rolname, + rolconfig +from pg_roles r +where rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + rolname | rolconfig +-----------------------------+----------- + pg_create_subscription | + pg_maintain | + pg_use_reserved_connections | +(3 rows) + +-- version-specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +where r.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +or g.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; + member | member_of (can become) | admin_option +-----------------------------+------------------------+-------------- + pg_create_subscription | | + pg_maintain | | + pg_use_reserved_connections | | + postgres | pg_create_subscription | f +(4 rows) + +-- Check version-specific privileges of the roles on the schemas +select schema_name, privilege_type, grantee, default_for +from ( + -- ALTER DEFAULT privileges on schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + d.defaclrole::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_default_acl d + join + pg_namespace n on d.defaclnamespace = n.oid + cross join lateral aclexplode(d.defaclacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type = 'MAINTAIN' +) sub +order by schema_order, schema_name, privilege_type, grantee, default_for; + schema_name | privilege_type | grantee | default_for +----------------+----------------+--------------------+--------------------- + public | MAINTAIN | anon | supabase_admin + public | MAINTAIN | anon | postgres + public | MAINTAIN | authenticated | supabase_admin + public | MAINTAIN | authenticated | postgres + public | MAINTAIN | postgres | supabase_admin + public | MAINTAIN | postgres | postgres + public | MAINTAIN | service_role | supabase_admin + public | MAINTAIN | service_role | postgres + auth | MAINTAIN | dashboard_user | supabase_auth_admin + auth | MAINTAIN | postgres | supabase_auth_admin + extensions | MAINTAIN | postgres | supabase_admin + graphql | MAINTAIN | anon | supabase_admin + graphql | MAINTAIN | authenticated | supabase_admin + graphql | MAINTAIN | postgres | supabase_admin + graphql | MAINTAIN | service_role | supabase_admin + graphql_public | MAINTAIN | anon | supabase_admin + graphql_public | MAINTAIN | authenticated | supabase_admin + graphql_public | MAINTAIN | postgres | supabase_admin + graphql_public | MAINTAIN | service_role | supabase_admin + pgsodium | MAINTAIN | pgsodium_keyholder | supabase_admin + pgsodium_masks | MAINTAIN | pgsodium_keyiduser | supabase_admin + realtime | MAINTAIN | dashboard_user | supabase_admin + realtime | MAINTAIN | postgres | supabase_admin + repack | MAINTAIN | postgres | supabase_admin + storage | MAINTAIN | anon | postgres + storage | MAINTAIN | authenticated | postgres + storage | MAINTAIN | postgres | postgres + storage | MAINTAIN | service_role | postgres +(28 rows) + diff --git a/nix/tests/sql/roles.sql b/nix/tests/sql/roles.sql index 9e68a171a..7a582a366 100644 --- a/nix/tests/sql/roles.sql +++ b/nix/tests/sql/roles.sql @@ -1,3 +1,10 @@ +-- Some predefined roles don't exist in earlier versions of Postgres, so we +-- exclude them in this test file. They're tested in version-specific test files +-- (z__roles.sql). +-- +-- Currently those roles are: +-- pg_create_subscription, pg_maintain, pg_use_reserved_connections + -- all roles and attributes select rolname, @@ -11,7 +18,6 @@ select rolbypassrls , rolvaliduntil from pg_roles r --- TODO: this exclusion is to maintain compat with pg17, we should cover it where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by rolname; @@ -19,7 +25,6 @@ select rolname, rolconfig from pg_roles r --- TODO: this exclusion is to maintain compat with pg17, we should cover it where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by rolname; @@ -34,8 +39,8 @@ left join pg_auth_members m on r.oid = m.member left join pg_roles g on m.roleid = g.oid --- TODO: this exclusion is to maintain compat with pg17, we should cover it where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by r.rolname, g.rolname; @@ -57,7 +62,8 @@ from ( join pg_roles r on a.grantee = r.oid where - a.privilege_type != 'MAINTAIN' -- TODO: this is to maintain compat with pg17, we should cover it + -- PG17+, handled in version-specific test files + a.privilege_type != 'MAINTAIN' union all -- explicit grant usage and create on the schemas select diff --git a/nix/tests/sql/z_17_roles.sql b/nix/tests/sql/z_17_roles.sql new file mode 100644 index 000000000..ef17fcb77 --- /dev/null +++ b/nix/tests/sql/z_17_roles.sql @@ -0,0 +1,60 @@ +-- version-specific roles and attributes +select + rolname, + rolcreaterole , + rolcanlogin , + rolsuper , + rolinherit , + rolcreatedb , + rolreplication , + rolconnlimit , + rolbypassrls , + rolvaliduntil +from pg_roles r +where rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + +select + rolname, + rolconfig +from pg_roles r +where rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by rolname; + +-- version-specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +where r.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +or g.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; + +-- Check version-specific privileges of the roles on the schemas +select schema_name, privilege_type, grantee, default_for +from ( + -- ALTER DEFAULT privileges on schemas + select + n.nspname as schema_name, + a.privilege_type, + r.rolname as grantee, + d.defaclrole::regrole as default_for, + case when n.nspname = 'public' then 0 else 1 end as schema_order + from + pg_default_acl d + join + pg_namespace n on d.defaclnamespace = n.oid + cross join lateral aclexplode(d.defaclacl) as a + join + pg_roles r on a.grantee = r.oid + where + a.privilege_type = 'MAINTAIN' +) sub +order by schema_order, schema_name, privilege_type, grantee, default_for; From eb64faac432d29a2e3d120ba8e891a3f6c5e8a8b Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 7 May 2025 20:46:15 +0800 Subject: [PATCH 242/271] fix: also grant pg_create_subscription & pg_monitor post-upgrade --- .../pg_upgrade_scripts/complete.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 108409463..3aeff263c 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -255,7 +255,21 @@ EOF ) run_sql -c "$REENCRYPT_VAULT_SECRETS_QUERY" - run_sql -c "grant pg_read_all_data, pg_signal_backend to postgres" + GRANT_PREDEFINED_ROLES_TO_POSTGRES_QUERY=$(cat <= 16 THEN + GRANT pg_create_subscription TO postgres; + END IF; + GRANT pg_monitor, pg_read_all_data, pg_signal_backend TO postgres; + END + \$\$; +EOF + ) + run_sql -c "$GRANT_PREDEFINED_ROLES_TO_POSTGRES_QUERY" } function complete_pg_upgrade { From 4018cacd15400bfc6d26c3fdb033da42447c38c8 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Thu, 15 May 2025 10:13:53 +1000 Subject: [PATCH 243/271] chore: bump wrappers version to v0.5.0 (#1589) * chore: bump wrappers version to v0.5.0 * feat: update rust to 1.84.0 and related needed changes (#1590) * test ami release * bump postgres release versions --------- Co-authored-by: samrose --- Dockerfile-15 | 2 +- Dockerfile-17 | 2 +- Dockerfile-orioledb-17 | 2 +- ansible/vars.yml | 6 +++--- flake.lock | 12 ++++++------ nix/ext/pg_graphql.nix | 4 +++- nix/ext/wrappers/default.nix | 10 +++++----- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 42ffc858c..5ef571c51 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -30,7 +30,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.6 +ARG wrappers_release=0.5.0 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-17 b/Dockerfile-17 index 8bfdf39af..fe8f96c2d 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.6 +ARG wrappers_release=0.5.0 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index f7c0d4f63..7c981177b 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.4.6 +ARG wrappers_release=0.5.0 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/ansible/vars.yml b/ansible/vars.yml index 0e658202d..4821ee48b 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.078-orioledb" - postgres17: "17.4.1.028" - postgres15: "15.8.1.085" + postgresorioledb-17: "17.0.1.079-orioledb" + postgres17: "17.4.1.029" + postgres15: "15.8.1.086" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.lock b/flake.lock index 2d05388c6..d593fa3dc 100644 --- a/flake.lock +++ b/flake.lock @@ -123,11 +123,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1728538411, - "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", "type": "github" }, "original": { @@ -151,11 +151,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1729045942, - "narHash": "sha256-HjmK0x5Zm2TK2vFpC7XBM2e3EDNVnAIuEoU2FkeN8xw=", + "lastModified": 1746758179, + "narHash": "sha256-JECUw1YBEsTsVauvupRzE5ykZaJoyhHCpoY87ZZJGas=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "9de3cea452d2401d6f93c06ad985178a4e11d1fc", + "rev": "4fd00513eac6b6140c5dced3e1b8133e2369a0f8", "type": "github" }, "original": { diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index af2f02447..ef406f8d4 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -27,7 +27,9 @@ buildPgrxExtension_0_12_9 rec { # Setting RUSTFLAGS in env to ensure it's available for all phases env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; - PGPORT = if (lib.versions.major postgresql.version) == "17" then "5440" else "5439"; + PGPORT = toString (5430 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; NIX_BUILD_CORES = "4"; # Limit parallel jobs CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index e87dfb372..2bd424942 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -12,21 +12,21 @@ , git }: let - rustVersion = "1.81.0"; + rustVersion = "1.84.0"; cargo = rust-bin.stable.${rustVersion}.default; in buildPgrxExtension_0_12_9 rec { pname = "supabase-wrappers"; - version = "0.4.6"; + version = "0.5.0"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.5" "0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = ["0.4.6" "0.4.5" "0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; rev = "v${version}"; - hash = "sha256-hthb3qEXT1Kf4yPoq0udEbQzlyLtI5tug6sK4YAPFjU="; + hash = "sha256-FbRTUcpEHBa5DI6dutvBeahYM0RZVAXIzIAZWIaxvn0"; }; nativeBuildInputs = [ pkg-config cargo git ]; @@ -50,7 +50,7 @@ buildPgrxExtension_0_12_9 rec { # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435 # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440 # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439 - PGPORT = toString (5435 + + PGPORT = toString (5534 + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version }; From d7fffb3ab9032526599bd0bb5710a6178116478f Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 15 May 2025 17:40:15 -0400 Subject: [PATCH 244/271] feat: if upgrade 17 -> 17 modify upgrade process (#1583) * feat: if upgrade 17 -> 17 or 17-orioledb -> 17-orioledb do not run these queries * feat: handle all cases of SERVER_LC_COLLATE and SERVER_LC_CTYPE * fix: explixit set on 17/oriole * feat: handling max_slot_wal_keep_size for pg 17 was needed as well * feat: binary upgrades require max_slot_wal_keep_size to be -1 during binary upgrade * fix: Better to override that during the upgrade process by specifying the option directly when pg_upgrade is executed (-c) * fix: cover only pg 17 * fix: rm oriole handling * fix: do not need max_slot_wal_keep_size on old version * fix: temp config on new-options too * fix: remove unbound var * chore: remove complete.sh change that should not have been committed * chore: bump for testing * chore: stash code * feat: working pg 17 upgrade * feat: pg 15 handling * feat: rm oriole handling, refine 15 -> 17 config * feat: make sure old pg stops if not force stop * chore: bump version * chore: cleanup + bump version for test * fix: rollback to working version with fix from divit * chore: version bump --- .../pg_upgrade_scripts/initiate.sh | 56 +++++++-- ansible/vars.yml | 6 +- nix/docs/testing-pg-upgrade-scripts.md | 115 ++++++++++++++++++ 3 files changed, 166 insertions(+), 11 deletions(-) create mode 100644 nix/docs/testing-pg-upgrade-scripts.md diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 92c1516a5..85b025be0 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -41,10 +41,14 @@ LOG_FILE="/var/log/pg-upgrade-initiate.log" POST_UPGRADE_EXTENSION_SCRIPT="/tmp/pg_upgrade/pg_upgrade_extensions.sql" POST_UPGRADE_POSTGRES_PERMS_SCRIPT="/tmp/pg_upgrade/pg_upgrade_postgres_perms.sql" -OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;") +OLD_PGVERSION=$(pg_config --version | sed 's/PostgreSQL \([0-9]*\.[0-9]*\).*/\1/') + +# Skip locale settings if both versions are PostgreSQL 17+ +if ! [[ "$OLD_PGVERSION" =~ ^17.* && "$PGVERSION" =~ ^17.* ]]; then + SERVER_LC_COLLATE=$(run_sql -A -t -c "SHOW lc_collate;") + SERVER_LC_CTYPE=$(run_sql -A -t -c "SHOW lc_ctype;") +fi -SERVER_LC_COLLATE=$(run_sql -A -t -c "SHOW lc_collate;") -SERVER_LC_CTYPE=$(run_sql -A -t -c "SHOW lc_ctype;") SERVER_ENCODING=$(run_sql -A -t -c "SHOW server_encoding;") POSTGRES_CONFIG_PATH="/etc/postgresql/postgresql.conf" @@ -251,7 +255,12 @@ function initiate_upgrade { if [ -n "$IS_LOCAL_UPGRADE" ]; then mkdir -p "$PG_UPGRADE_BIN_DIR" mkdir -p /tmp/persistent/ - echo "a7189a68ed4ea78c1e73991b5f271043636cf074" > "$PG_UPGRADE_BIN_DIR/nix_flake_version" + if [ -n "$NIX_FLAKE_VERSION" ]; then + echo "$NIX_FLAKE_VERSION" > "$PG_UPGRADE_BIN_DIR/nix_flake_version" + else + echo "a7189a68ed4ea78c1e73991b5f271043636cf074" > "$PG_UPGRADE_BIN_DIR/nix_flake_version" + fi + tar -czf "/tmp/persistent/pg_upgrade_bin.tar.gz" -C "/tmp/pg_upgrade_bin" . rm -rf /tmp/pg_upgrade_bin/ fi @@ -394,9 +403,14 @@ function initiate_upgrade { rm -rf "${PGDATANEW:?}/" if [ "$IS_NIX_UPGRADE" = "true" ]; then - LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --lc-collate=$SERVER_LC_COLLATE --lc-ctype=$SERVER_LC_CTYPE -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres + if [[ "$PGVERSION" =~ ^17.* ]]; then + LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --locale-provider=icu --icu-locale=en_US.UTF-8 -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres + else + LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --lc-collate=$SERVER_LC_COLLATE --lc-ctype=$SERVER_LC_CTYPE -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres + fi else su -c "$PGBINNEW/initdb -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres + fi # This line avoids the need to supply the supabase_admin password on the old @@ -409,6 +423,20 @@ $(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf run_sql -c "select pg_reload_conf();" fi + TMP_CONFIG="/tmp/pg_upgrade/postgresql.conf" + cp "$POSTGRES_CONFIG_PATH" "$TMP_CONFIG" + + # Check if max_slot_wal_keep_size exists in the config + # Add the setting if not found + echo "max_slot_wal_keep_size = -1" >> "$TMP_CONFIG" + + # Remove db_user_namespace if upgrading from PG15 + if [[ "$OLD_PGVERSION" =~ ^15.* && "$PGVERSION" =~ ^17.* ]]; then + sed -i '/^db_user_namespace/d' "$TMP_CONFIG" + fi + + chown postgres:postgres "$TMP_CONFIG" + UPGRADE_COMMAND=$(cat < /etc/postgresql/pg_hba.conf --new-datadir=${PGDATANEW} \ --username=supabase_admin \ --jobs="${WORKERS}" -r \ - --old-options='-c config_file=${POSTGRES_CONFIG_PATH}' \ + --old-options="-c config_file=$TMP_CONFIG" \ --old-options="-c shared_preload_libraries='${SHARED_PRELOAD_LIBRARIES}'" \ --new-options="-c data_directory=${PGDATANEW}" \ + --new-options="-c config_file=$TMP_CONFIG" \ --new-options="-c shared_preload_libraries='${SHARED_PRELOAD_LIBRARIES}'" EOF ) @@ -427,7 +456,12 @@ EOF if [ "$IS_NIX_BASED_SYSTEM" = "true" ]; then UPGRADE_COMMAND=". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $UPGRADE_COMMAND" fi - GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres + + if [[ "$PGVERSION" =~ ^17.* ]]; then + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres + else + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres + fi echo "10. Stopping postgres; running pg_upgrade" # Extra work to ensure postgres is actually stopped @@ -439,11 +473,17 @@ EOF sleep 3 systemctl stop postgresql + else CI_stop_postgres fi - GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres + # Start the old PostgreSQL instance with version-specific options + if [[ "$PGVERSION" =~ ^17.* ]]; then + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres + else + GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres + fi # copying custom configurations echo "11. Copying custom configurations" diff --git a/ansible/vars.yml b/ansible/vars.yml index 4821ee48b..50c6662ce 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.079-orioledb" - postgres17: "17.4.1.029" - postgres15: "15.8.1.086" + postgresorioledb-17: "17.0.1.080-orioledb" + postgres17: "17.4.1.030" + postgres15: "15.8.1.087" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/docs/testing-pg-upgrade-scripts.md b/nix/docs/testing-pg-upgrade-scripts.md new file mode 100644 index 000000000..49c966b5f --- /dev/null +++ b/nix/docs/testing-pg-upgrade-scripts.md @@ -0,0 +1,115 @@ +# Testing PostgreSQL Upgrade Scripts + +This document describes how to test changes to the PostgreSQL upgrade scripts on a running machine. + +## Prerequisites + +- A running PostgreSQL instance +- Access to the Supabase Postgres repository +- Permissions to run GitHub Actions workflows +- ssh access to the ec2 instance + +## Development Workflow + +1. **Make Changes to Upgrade Scripts** + - Make your changes to the scripts in `ansible/files/admin_api_scripts/pg_upgrade_scripts/` + - Commit and push your changes to your feature branch + - For quick testing, you can also edit the script directly on the server at `/etc/adminapi/pg_upgrade_scripts/initiate.sh` + +2. **Publish Script Changes** (Only needed for deploying to new instances) + - Go to [publish-nix-pgupgrade-scripts.yml](https://github.com/supabase/postgres/actions/workflows/publish-nix-pgupgrade-scripts.yml) + - Click "Run workflow" + - Select your branch + - Run the workflow + +3. **Publish Binary Flake Version** (Only needed for deploying to new instances) + - Go to [publish-nix-pgupgrade-bin-flake-version.yml](https://github.com/supabase/postgres/actions/workflows/publish-nix-pgupgrade-bin-flake-version.yml) + - Click "Run workflow" + - Select your branch + - Run the workflow + - Note: Make sure the flake version includes the PostgreSQL version you're testing (e.g., 17) + +4. **Test on Running Machine** + ssh into the machine + ```bash + # Stop PostgreSQL + sudo systemctl stop postgresql + + # Run the upgrade script in local mode with your desired flake version + sudo NIX_FLAKE_VERSION="your-flake-version-here" IS_LOCAL_UPGRADE=true /etc/adminapi/pg_upgrade_scripts/initiate.sh 17 + ``` + Note: This will use the version of the script that exists at `/etc/adminapi/pg_upgrade_scripts/initiate.sh` on the server. + The script should be run as the ubuntu user with sudo privileges. The script will handle switching to the postgres user when needed. + + In local mode: + - The script at `/etc/adminapi/pg_upgrade_scripts/initiate.sh` will be used (your edited version) + - Only the PostgreSQL binaries will be downloaded from the specified flake version + - No new upgrade scripts will be downloaded + - You can override the flake version by setting the NIX_FLAKE_VERSION environment variable + - If NIX_FLAKE_VERSION is not set, it will use the default flake version + +5. **Monitor Progress** + ```bash + # Watch the upgrade log + tail -f /var/log/pg-upgrade-initiate.log + ``` + +6. **Check Results** + In local mode, the script will: + - Create a new data directory at `/data_migration/pgdata` + - Run pg_upgrade to test the upgrade process + - Generate SQL files in `/data_migration/sql/` for any needed post-upgrade steps + - Log the results in `/var/log/pg-upgrade-initiate.log` + + To verify success: + ```bash + # Check the upgrade log for completion + grep "Upgrade complete" /var/log/pg-upgrade-initiate.log + + # Check for any generated SQL files + ls -l /data_migration/sql/ + + # Check the new data directory + ls -l /data_migration/pgdata/ + ``` + + Note: The instance will not be upgraded to the new version in local mode. This is just a test run to verify the upgrade process works correctly. + +## Important Notes + +- The `IS_LOCAL_UPGRADE=true` flag makes the script run in the foreground and skip disk mounting steps +- The script will use the existing data directory +- All output is logged to `/var/log/pg-upgrade-initiate.log` +- The script will automatically restart PostgreSQL after completion or failure +- For testing, you can edit the script directly on the server - the GitHub Actions workflows are only needed for deploying to new instances +- Run the script as the ubuntu user with sudo privileges - the script will handle user switching internally +- Local mode is for testing only - it will not actually upgrade the instance +- The Nix flake version must include the PostgreSQL version you're testing (e.g., 17) +- In local mode, only the PostgreSQL binaries are downloaded from the flake - the upgrade scripts are used from the local filesystem +- You can override the flake version by setting the NIX_FLAKE_VERSION environment variable when running the script + +## Troubleshooting + +If the upgrade fails: +1. Check the logs at `/var/log/pg-upgrade-initiate.log` +2. Look for any error messages in the PostgreSQL logs +3. The script will attempt to clean up and restore the original state +4. If you see an error about missing Nix flake attributes, make sure the flake version includes the PostgreSQL version you're testing + +Common Errors: +- `error: flake 'github:supabase/postgres/...' does not provide attribute 'packages.aarch64-linux.psql_17/bin'` + - This means the Nix flake version doesn't include PostgreSQL 17 binaries + - You need to specify a flake version that includes your target version + - You can find valid flake versions by looking at the commit history of the publish-nix-pgupgrade-bin-flake-version.yml workflow + +## Cleanup + +After testing: +1. The script will automatically clean up temporary files +2. PostgreSQL will be restarted +3. The original configuration will be restored + +## References + +- [publish-nix-pgupgrade-scripts.yml](https://github.com/supabase/postgres/actions/workflows/publish-nix-pgupgrade-scripts.yml) +- [publish-nix-pgupgrade-bin-flake-version.yml](https://github.com/supabase/postgres/actions/workflows/publish-nix-pgupgrade-bin-flake-version.yml) \ No newline at end of file From fcb876d386877fff9a7ef87de411872992b6e858 Mon Sep 17 00:00:00 2001 From: samrose Date: Sat, 17 May 2025 07:29:50 -0400 Subject: [PATCH 245/271] feat: do not enable pgjwt by default in pg 15 (#1592) --- ansible/tasks/stage2-setup-postgres.yml | 6 +++++- ansible/vars.yml | 6 +++--- .../init-scripts/00000000000000-initial-schema.sql | 10 ---------- migrations/schema-15.sql | 14 -------------- nix/tests/expected/z_15_ext_interface.out | 14 ++++---------- nix/tests/expected/z_15_pgjwt.out | 4 ++++ nix/tests/prime.sql | 10 ---------- nix/tests/sql/z_15_pgjwt.sql | 6 ++++++ nix/tools/run-server.sh.in | 3 +-- 9 files changed, 23 insertions(+), 50 deletions(-) diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 99b89d6d9..d3209fc04 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -13,6 +13,10 @@ - name: Check if psql_version is psql_17 set_fact: is_psql_17: "{{ psql_version in ['psql_17'] }}" + + - name: Check if psql_version is psql_15 + set_fact: + is_psql_15: "{{ psql_version in ['psql_15'] }}" - name: Remove specified extensions from postgresql.conf if orioledb-17 or 17 build ansible.builtin.command: @@ -25,7 +29,7 @@ - name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g' + sed -i 's/ timescaledb,//g; s/ plv8,//g' /etc/postgresql-custom/supautils.conf when: is_psql_oriole or is_psql_17 and stage2_nix become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index 50c6662ce..5a0eca3ec 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.080-orioledb" - postgres17: "17.4.1.030" - postgres15: "15.8.1.087" + postgresorioledb-17: "17.0.1.081-orioledb" + postgres17: "17.4.1.031" + postgres15: "15.8.1.088" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index 71b6ab06a..272c989c0 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -18,16 +18,6 @@ grant pg_read_all_data to supabase_read_only_user; create schema if not exists extensions; create extension if not exists "uuid-ossp" with schema extensions; create extension if not exists pgcrypto with schema extensions; -do $$ -begin - if exists (select 1 from pg_available_extensions where name = 'pgjwt') then - if not exists (select 1 from pg_extension where extname = 'pgjwt') then - if current_setting('server_version_num')::int / 10000 = 15 then - create extension if not exists pgjwt with schema "extensions" cascade; - end if; - end if; - end if; -end $$; -- Set up auth roles for the developer diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 5a38517ba..00e62c8eb 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -114,20 +114,6 @@ CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; --- --- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; - - --- --- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; - - -- -- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - -- diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 566da6aed..540bee2e8 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -30,8 +30,9 @@ order by name ----------------- pg_cron + pgjwt tsm_system_time -(2 rows) +(3 rows) /* @@ -94,7 +95,6 @@ order by pg_walinspect | t pgaudit | t pgcrypto | t - pgjwt | f pgmq | f pgroonga | f pgroonga_database | f @@ -128,7 +128,7 @@ order by vector | t wrappers | f xml2 | f -(80 rows) +(79 rows) /* @@ -1316,12 +1316,6 @@ order by pgcrypto | extensions | pgp_sym_encrypt | text, text, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text | bytea pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea - pgjwt | extensions | algorithm_sign | signables text, secret text, algorithm text | text - pgjwt | extensions | sign | payload json, secret text, algorithm text | text - pgjwt | extensions | try_cast_double | inp text | double precision - pgjwt | extensions | url_decode | data text | bytea - pgjwt | extensions | url_encode | data bytea | text - pgjwt | extensions | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void pgmq | pgmq | _get_partition_col | partition_interval text | text @@ -5227,7 +5221,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5057 rows) +(5051 rows) /* diff --git a/nix/tests/expected/z_15_pgjwt.out b/nix/tests/expected/z_15_pgjwt.out index 4e4500fd4..8ccdce1d1 100644 --- a/nix/tests/expected/z_15_pgjwt.out +++ b/nix/tests/expected/z_15_pgjwt.out @@ -1,3 +1,7 @@ +-- Install pgjwt in extensions schema +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; +-- Set search path to include extensions schema +SET search_path TO extensions, public; select sign( payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}', diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 84545145e..fb724847f 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -57,16 +57,6 @@ create extension if not exists pg_walinspect; create extension if not exists pgaudit; create extension if not exists pgcrypto; create extension if not exists pgtap; -do $$ -begin - if exists (select 1 from pg_available_extensions where name = 'pgjwt') then - if not exists (select 1 from pg_extension where extname = 'pgjwt') then - if current_setting('server_version_num')::int / 10000 = 15 then - create extension if not exists pgjwt; - end if; - end if; - end if; -end $$; create extension if not exists pgroonga; create extension if not exists pgroonga_database; create extension if not exists pgsodium; diff --git a/nix/tests/sql/z_15_pgjwt.sql b/nix/tests/sql/z_15_pgjwt.sql index 24179e7a0..d6b488635 100644 --- a/nix/tests/sql/z_15_pgjwt.sql +++ b/nix/tests/sql/z_15_pgjwt.sql @@ -1,3 +1,9 @@ +-- Install pgjwt in extensions schema +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + +-- Set search path to include extensions schema +SET search_path TO extensions, public; + select sign( payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}', diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 227e1b7be..a1e289d66 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -267,13 +267,12 @@ orioledb_config_items() { echo "non-macos pg 17 conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/supautils.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf" - perl -pi -e 's/ pgjwt,//g;' "$DATDIR/supautils.conf" fi } From 83ebd030a35022fdded45065a0c2c7c93d20fc43 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Sun, 18 May 2025 15:14:50 +0100 Subject: [PATCH 246/271] fix: update adminapi systemd unit file to wait for the network (#1595) * fix: update adminapi systemd unit file to wait for the network and pgbouncer * fix: remove the want pgboucner section as we might not want it to always start --- ansible/files/adminapi.service.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible/files/adminapi.service.j2 b/ansible/files/adminapi.service.j2 index 3b2821984..ed5a5b39b 100644 --- a/ansible/files/adminapi.service.j2 +++ b/ansible/files/adminapi.service.j2 @@ -1,5 +1,11 @@ [Unit] Description=AdminAPI +Requires=network-online.target +After=network-online.target pgbouncer.service + +# Move this to the Service section if on systemd >=250 +StartLimitIntervalSec=60 +StartLimitBurst=10 [Service] Type=simple @@ -7,10 +13,13 @@ ExecStart=/opt/supabase-admin-api User=adminapi Restart=always RestartSec=3 +TimeoutStopSec=10 Environment="AWS_USE_DUALSTACK_ENDPOINT=true" {% if qemu_mode is defined and qemu_mode %} Environment="AWS_SDK_LOAD_CONFIG=true" {% endif %} +StandardOutput=journal +StandardError=journal [Install] WantedBy=multi-user.target From a194072c0ae34eff6e6d7d606c32e07c4e8f7f19 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Mon, 19 May 2025 11:59:01 +0100 Subject: [PATCH 247/271] fix: drop pgbouncer from unit after (#1598) * fix: drop pgbouncer from unit after * fix: bump verisons for a release. --- ansible/files/adminapi.service.j2 | 2 +- ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/files/adminapi.service.j2 b/ansible/files/adminapi.service.j2 index ed5a5b39b..cc1e9dc2a 100644 --- a/ansible/files/adminapi.service.j2 +++ b/ansible/files/adminapi.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=AdminAPI Requires=network-online.target -After=network-online.target pgbouncer.service +After=network-online.target # Move this to the Service section if on systemd >=250 StartLimitIntervalSec=60 diff --git a/ansible/vars.yml b/ansible/vars.yml index 5a0eca3ec..45fc3d170 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.081-orioledb" - postgres17: "17.4.1.031" - postgres15: "15.8.1.088" + postgresorioledb-17: "17.0.1.082-orioledb" + postgres17: "17.4.1.032" + postgres15: "15.8.1.089" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 48ddeb21f06a28b5c402fe883da4b2d6f1a22b30 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 19 May 2025 21:52:54 +0800 Subject: [PATCH 248/271] fix: update default collation to match hosted platform (#1596) * fix: update default collation to match hosted platform * chore: update pg17 image * chore: update oriole image --- Dockerfile-15 | 2 -- Dockerfile-17 | 2 -- Dockerfile-orioledb-17 | 2 -- 3 files changed, 6 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 5ef571c51..e8dd95c72 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -216,8 +216,6 @@ RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/l ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C.UTF-8 ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive RUN mkdir -p /usr/share/postgresql/extension/ && \ ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ diff --git a/Dockerfile-17 b/Dockerfile-17 index fe8f96c2d..e83a273d4 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -225,8 +225,6 @@ RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/l ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C.UTF-8 ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive RUN mkdir -p /usr/share/postgresql/extension/ && \ ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 7c981177b..bd36e6fd0 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -230,8 +230,6 @@ RUN echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/l ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE=C.UTF-8 -ENV LC_COLLATE=C.UTF-8 ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive RUN mkdir -p /usr/share/postgresql/extension/ && \ ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \ From 0fddd4725ca7b3aab17ea4ea5715df0a5ae0aa80 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Mon, 19 May 2025 21:37:30 +0200 Subject: [PATCH 249/271] feat: bump auth to v2.173.0 (#1599) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 45fc3d170..b935fd7ae 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.082-orioledb" - postgres17: "17.4.1.032" - postgres15: "15.8.1.089" + postgresorioledb-17: "17.0.1.084-orioledb" + postgres17: "17.4.1.034" + postgres15: "15.8.1.091" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.172.1 -gotrue_release_checksum: sha1:60cca6dce1bd37608566d04193483a7fb733214e +gotrue_release: 2.173.0 +gotrue_release_checksum: sha1:8ec5e9396f3b30cb867d32bdbe39fcfdd78f1f59 aws_cli_release: "2.23.11" From 413a82d9bc70e5b80e2cf3b38f0f28198a3fce17 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 20 May 2025 12:47:56 -0400 Subject: [PATCH 250/271] fix: continue to use previous way to read old pg version in upgrade script (#1601) --- .../files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 2 +- ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 85b025be0..18850883c 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -41,7 +41,7 @@ LOG_FILE="/var/log/pg-upgrade-initiate.log" POST_UPGRADE_EXTENSION_SCRIPT="/tmp/pg_upgrade/pg_upgrade_extensions.sql" POST_UPGRADE_POSTGRES_PERMS_SCRIPT="/tmp/pg_upgrade/pg_upgrade_postgres_perms.sql" -OLD_PGVERSION=$(pg_config --version | sed 's/PostgreSQL \([0-9]*\.[0-9]*\).*/\1/') +OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;") # Skip locale settings if both versions are PostgreSQL 17+ if ! [[ "$OLD_PGVERSION" =~ ^17.* && "$PGVERSION" =~ ^17.* ]]; then diff --git a/ansible/vars.yml b/ansible/vars.yml index b935fd7ae..87233533a 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.084-orioledb" - postgres17: "17.4.1.034" - postgres15: "15.8.1.091" + postgresorioledb-17: "17.0.1.085-orioledb" + postgres17: "17.4.1.035" + postgres15: "15.8.1.092" # Non Postgres Extensions pgbouncer_release: "1.19.0" From ebaf44357e0cac55eecff8cbbb19d6f62ded0e3e Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 21 May 2025 13:48:16 -0400 Subject: [PATCH 251/271] feat: covering ranges for upgrades (#1603) * feat: need to cover less than or equal to 15 * feat: handle range of 16 or greater for destination of upgrade * feat: use -ge approach for all instances of 16+ handling * chore: testing vers bump * chore: version bump for release --- .../pg_upgrade_scripts/initiate.sh | 14 +++++++------- ansible/vars.yml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 18850883c..e5c4ddbf7 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -43,8 +43,8 @@ POST_UPGRADE_EXTENSION_SCRIPT="/tmp/pg_upgrade/pg_upgrade_extensions.sql" POST_UPGRADE_POSTGRES_PERMS_SCRIPT="/tmp/pg_upgrade/pg_upgrade_postgres_perms.sql" OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;") -# Skip locale settings if both versions are PostgreSQL 17+ -if ! [[ "$OLD_PGVERSION" =~ ^17.* && "$PGVERSION" =~ ^17.* ]]; then +# Skip locale settings if both versions are PostgreSQL 16+ +if ! [[ "${OLD_PGVERSION%%.*}" -ge 16 && "${PGVERSION%%.*}" -ge 16 ]]; then SERVER_LC_COLLATE=$(run_sql -A -t -c "SHOW lc_collate;") SERVER_LC_CTYPE=$(run_sql -A -t -c "SHOW lc_ctype;") fi @@ -403,7 +403,7 @@ function initiate_upgrade { rm -rf "${PGDATANEW:?}/" if [ "$IS_NIX_UPGRADE" = "true" ]; then - if [[ "$PGVERSION" =~ ^17.* ]]; then + if [[ "${PGVERSION%%.*}" -ge 16 ]]; then LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --locale-provider=icu --icu-locale=en_US.UTF-8 -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres else LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $PGBINNEW/initdb --encoding=$SERVER_ENCODING --lc-collate=$SERVER_LC_COLLATE --lc-ctype=$SERVER_LC_CTYPE -L $PGSHARENEW -D $PGDATANEW/ --username=supabase_admin" -s "$SHELL" postgres @@ -430,8 +430,8 @@ $(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf # Add the setting if not found echo "max_slot_wal_keep_size = -1" >> "$TMP_CONFIG" - # Remove db_user_namespace if upgrading from PG15 - if [[ "$OLD_PGVERSION" =~ ^15.* && "$PGVERSION" =~ ^17.* ]]; then + # Remove db_user_namespace if upgrading from PG15 or lower to PG16+ + if [[ "${OLD_PGVERSION%%.*}" -le 15 && "${PGVERSION%%.*}" -ge 16 ]]; then sed -i '/^db_user_namespace/d' "$TMP_CONFIG" fi @@ -457,7 +457,7 @@ EOF UPGRADE_COMMAND=". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && $UPGRADE_COMMAND" fi - if [[ "$PGVERSION" =~ ^17.* ]]; then + if [[ "${PGVERSION%%.*}" -ge 16 ]]; then GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres else GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND --check" -s "$SHELL" postgres @@ -479,7 +479,7 @@ EOF fi # Start the old PostgreSQL instance with version-specific options - if [[ "$PGVERSION" =~ ^17.* ]]; then + if [[ "${PGVERSION%%.*}" -ge 16 ]]; then GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres else GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins LC_ALL=en_US.UTF-8 LC_CTYPE=$SERVER_LC_CTYPE LC_COLLATE=$SERVER_LC_COLLATE LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LOCALE_ARCHIVE=/usr/lib/locale/locale-archive su -pc "$UPGRADE_COMMAND" -s "$SHELL" postgres diff --git a/ansible/vars.yml b/ansible/vars.yml index 87233533a..c33f69a76 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.085-orioledb" - postgres17: "17.4.1.035" - postgres15: "15.8.1.092" + postgresorioledb-17: "17.0.1.086-orioledb" + postgres17: "17.4.1.036" + postgres15: "15.8.1.093" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 905c9f213c313413383d180397a9804ea9b167ec Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Thu, 22 May 2025 08:53:50 +0200 Subject: [PATCH 252/271] fix: sync supabase roles with $POSTGRES_PASSWORD (#1604) * fix: sync supabase roles with $POSTGRES_PASSWORD * add changes to pg 17 Dockerfile * add changes to oriole docker image * Update docker-entrypoint.sh --------- Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> --- Dockerfile-15 | 8 +++- Dockerfile-17 | 8 +++- Dockerfile-orioledb-17 | 8 +++- docker/docker-entrypoint.sh | 83 +++++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100755 docker/docker-entrypoint.sh diff --git a/Dockerfile-15 b/Dockerfile-15 index e8dd95c72..11781df42 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -181,6 +181,10 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + # Remove supabase_admin line from pg_hba.conf + sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ + # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users + sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -194,7 +198,9 @@ COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00- COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ - /usr/local/bin/ + /usr/local/bin/upstream-docker-entrypoint.sh +# # Add custom entrypoint script +COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-17 b/Dockerfile-17 index e83a273d4..8dd7a0de4 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -181,6 +181,10 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + # Remove supabase_admin line from pg_hba.conf + sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ + # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users + sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -202,7 +206,9 @@ COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00- COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ - /usr/local/bin/ + /usr/local/bin/upstream-docker-entrypoint.sh +# # Add custom entrypoint script +COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index bd36e6fd0..8b3f9c806 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -181,6 +181,10 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ + # Remove supabase_admin line from pg_hba.conf + sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ + # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users + sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -207,7 +211,9 @@ RUN echo "CREATE EXTENSION orioledb;" > /docker-entrypoint-initdb.d/init-scripts COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ - /usr/local/bin/ + /usr/local/bin/upstream-docker-entrypoint.sh +# # Add custom entrypoint script +COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100755 index 000000000..02f38505a --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +set -Eeo pipefail + +source /usr/local/bin/upstream-docker-entrypoint.sh + +# sync $POSTGRES_PASSWORD to supabase-specific roles +pg_sync_password() { + # PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless + # e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGS + export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" + docker_temp_server_start "$@" + + # alter the supabase_admin password + docker_process_sql <<-'EOSQL' + \set pgpass `echo "$POSTGRES_PASSWORD"` + ALTER USER supabase_admin WITH PASSWORD :'pgpass'; + EOSQL + + # execute the roles SQL file using docker_process_sql + docker_process_sql -f /docker-entrypoint-initdb.d/init-scripts/99-roles.sql + + docker_temp_server_stop + unset PGPASSWORD +} + +_main() { + # if first arg looks like a flag, assume we want to run postgres server + if [ "${1:0:1}" = '-' ]; then + set -- postgres "$@" + fi + + if [ "$1" = 'postgres' ] && ! _pg_want_help "$@"; then + docker_setup_env + # setup data directories and permissions (when run as root) + docker_create_db_directories + if [ "$(id -u)" = '0' ]; then + # then restart script as postgres user + exec gosu postgres "$BASH_SOURCE" "$@" + fi + + # only run initialization on an empty data directory + if [ -z "$DATABASE_ALREADY_EXISTS" ]; then + docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + + docker_init_database_dir + pg_setup_hba_conf "$@" + + # PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless + # e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGS + export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" + docker_temp_server_start "$@" + + docker_setup_db + docker_process_init_files /docker-entrypoint-initdb.d/* + + docker_temp_server_stop + unset PGPASSWORD + + cat <<-'EOM' + + PostgreSQL init process complete; ready for start up. + + EOM + else + cat <<-'EOM' + + PostgreSQL Database directory appears to contain a database; Skipping initialization + + EOM + fi + + pg_sync_password "$@" + fi + + exec "$@" +} + +if ! _is_sourced; then + _main "$@" +fi From 29f0834eb0178ae1cd2efbdb778394426595073d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20K=C4=B1l=C4=B1=C3=A7?= Date: Tue, 27 May 2025 16:28:22 +0200 Subject: [PATCH 253/271] feat: bump auth to v2.174.0 (#1610) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index c33f69a76..9a07c087c 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.086-orioledb" - postgres17: "17.4.1.036" - postgres15: "15.8.1.093" + postgresorioledb-17: "17.0.1.087-orioledb" + postgres17: "17.4.1.037" + postgres15: "15.8.1.094" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.173.0 -gotrue_release_checksum: sha1:8ec5e9396f3b30cb867d32bdbe39fcfdd78f1f59 +gotrue_release: 2.174.0 +gotrue_release_checksum: sha1:d9ac9bb209a5e0b383ab96e05d05409eaebdbaac aws_cli_release: "2.23.11" From c1b31caf6ccecc94686c24f7bc3ffca42639a622 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 28 May 2025 10:58:14 -0400 Subject: [PATCH 254/271] feat: release a single version of postgres AMI from any branch (#1613) * feat: release a single version of postgres AMI from any branchi workflow dispatch only * chore: newline * chore: newline --- .github/workflows/ami-release-nix-single.yml | 140 +++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 .github/workflows/ami-release-nix-single.yml diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml new file mode 100644 index 000000000..f2c2abf9e --- /dev/null +++ b/.github/workflows/ami-release-nix-single.yml @@ -0,0 +1,140 @@ +name: Release Single AMI Nix + +on: + workflow_dispatch: + inputs: + postgres_version: + description: 'PostgreSQL major version to build (e.g. 15)' + required: true + type: string + branch: + description: 'Branch to run the workflow from' + required: true + type: string + default: 'main' + +permissions: + contents: write + id-token: write + +jobs: + build: + runs-on: arm-runner + timeout-minutes: 150 + + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.branch }} + + - uses: DeterminateSystems/nix-installer-action@main + + - name: Set PostgreSQL version environment variable + run: echo "POSTGRES_MAJOR_VERSION=${{ github.event.inputs.postgres_version }}" >> $GITHUB_ENV + + - name: Generate common-nix.vars.pkr.hcl + run: | + PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ env.POSTGRES_MAJOR_VERSION }}'"]' ansible/vars.yml) + PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes + echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl + # Ensure there's a newline at the end of the file + echo "" >> common-nix.vars.pkr.hcl + + - name: Build AMI stage 1 + env: + POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} + run: | + packer init amazon-arm64-nix.pkr.hcl + GIT_SHA=${{github.sha}} + packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + + - name: Build AMI stage 2 + env: + POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} + run: | + packer init stage2-nix-psql.pkr.hcl + GIT_SHA=${{github.sha}} + POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} + packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + + - name: Grab release version + id: process_release_version + run: | + VERSION=$(cat common-nix.vars.pkr.hcl | sed -e 's/postgres-version = "\(.*\)"/\1/g') + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create nix flake revision tarball + run: | + GIT_SHA=${{github.sha}} + MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} + + mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" + echo "$GIT_SHA" >> "/tmp/pg_upgrade_bin/${MAJOR_VERSION}/nix_flake_version" + tar -czf "/tmp/pg_binaries.tar.gz" -C "/tmp/pg_upgrade_bin" . + + - name: configure aws credentials - staging + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + aws-region: "us-east-1" + + - name: Upload software manifest to s3 staging + run: | + cd ansible + ansible-playbook -i localhost \ + -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ + -e "internal_artifacts_bucket=${{ secrets.ARTIFACTS_BUCKET }}" \ + -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ + manifest-playbook.yml + + - name: Upload nix flake revision to s3 staging + run: | + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + + - name: configure aws credentials - prod + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.PROD_AWS_ROLE }} + aws-region: "us-east-1" + + - name: Upload software manifest to s3 prod + run: | + cd ansible + ansible-playbook -i localhost \ + -e "ami_release_version=${{ steps.process_release_version.outputs.version }}" \ + -e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \ + -e "postgres_major_version=${{ env.POSTGRES_MAJOR_VERSION }}" \ + manifest-playbook.yml + + - name: Upload nix flake revision to s3 prod + run: | + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + name: ${{ steps.process_release_version.outputs.version }} + tag_name: ${{ steps.process_release_version.outputs.version }} + target_commitish: ${{github.sha}} + + - name: Slack Notification on Failure + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: 'gha-failures-notifier' + SLACK_COLOR: 'danger' + SLACK_MESSAGE: 'Building Postgres AMI failed' + SLACK_FOOTER: '' + + - name: Cleanup resources after build + if: ${{ always() }} + run: | + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + + - name: Cleanup resources on build cancellation + if: ${{ cancelled() }} + run: | + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + From 61c75e372e25438324bc8d645c9921a9b9ebf500 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 28 May 2025 16:22:11 -0400 Subject: [PATCH 255/271] chore: get and use commit of branch we are trying to build (#1614) --- .github/workflows/ami-release-nix-single.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index f2c2abf9e..86a1d40fc 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -28,6 +28,11 @@ jobs: with: ref: ${{ github.event.inputs.branch }} + - name: Get current branch SHA + id: get_sha + run: | + echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable @@ -46,7 +51,7 @@ jobs: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init amazon-arm64-nix.pkr.hcl - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 @@ -54,7 +59,7 @@ jobs: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | packer init stage2-nix-psql.pkr.hcl - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl @@ -66,7 +71,7 @@ jobs: - name: Create nix flake revision tarball run: | - GIT_SHA=${{github.sha}} + GIT_SHA=${{ steps.get_sha.outputs.sha }} MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} mkdir -p "/tmp/pg_upgrade_bin/${MAJOR_VERSION}" @@ -116,7 +121,7 @@ jobs: with: name: ${{ steps.process_release_version.outputs.version }} tag_name: ${{ steps.process_release_version.outputs.version }} - target_commitish: ${{github.sha}} + target_commitish: ${{ steps.get_sha.outputs.sha }} - name: Slack Notification on Failure if: ${{ failure() }} From b7f1ed11bcbd73dc0452253b5171aaa5830739fc Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Fri, 30 May 2025 11:14:02 +0100 Subject: [PATCH 256/271] ci: build pg17 + pg17-oriole for qemu vm --- .github/workflows/qemu-image-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 7253af151..708c7faf2 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -30,7 +30,7 @@ jobs: - name: Set PostgreSQL versions - only builds pg17 atm id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[2]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1,2]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: From 7dc361080f43813d4e98ccb533445676784e91c3 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 30 May 2025 17:25:53 +0200 Subject: [PATCH 257/271] hotfix: remove self-hosting logic from the `supabase/postgres` image (#1615) --- Dockerfile-15 | 8 +--- Dockerfile-17 | 8 +--- Dockerfile-orioledb-17 | 8 +--- ansible/vars.yml | 6 +-- docker/docker-entrypoint.sh | 83 ------------------------------------- 5 files changed, 6 insertions(+), 107 deletions(-) delete mode 100755 docker/docker-entrypoint.sh diff --git a/Dockerfile-15 b/Dockerfile-15 index 11781df42..6acf86037 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -181,10 +181,6 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ - # Remove supabase_admin line from pg_hba.conf - sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ - # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users - sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -198,9 +194,7 @@ COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00- COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ - /usr/local/bin/upstream-docker-entrypoint.sh -# # Add custom entrypoint script -COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh + /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-17 b/Dockerfile-17 index 8dd7a0de4..1f1309fc1 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -181,10 +181,6 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ - # Remove supabase_admin line from pg_hba.conf - sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ - # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users - sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -206,9 +202,7 @@ COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00- COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ - /usr/local/bin/upstream-docker-entrypoint.sh -# # Add custom entrypoint script -COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh + /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 8b3f9c806..4a0413cb0 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -181,10 +181,6 @@ RUN sed -i \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \ - # Remove supabase_admin line from pg_hba.conf - sed -i '/local all supabase_admin scram-sha-256/d' /etc/postgresql/pg_hba.conf && \ - # Add supabase_admin mappings block to pg_ident.conf before supabase-specific users - sed -i '/# supabase-specific users/i\# supabase_admin user mappings\nsupabase_map postgres supabase_admin\nsupabase_map root supabase_admin\nsupabase_map ubuntu supabase_admin\n' /etc/postgresql/pg_ident.conf && \ usermod -aG postgres wal-g && \ mkdir -p /etc/postgresql-custom && \ chown postgres:postgres /etc/postgresql-custom @@ -211,9 +207,7 @@ RUN echo "CREATE EXTENSION orioledb;" > /docker-entrypoint-initdb.d/init-scripts COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ - /usr/local/bin/upstream-docker-entrypoint.sh -# # Add custom entrypoint script -COPY --chmod=0755 docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh + /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/ansible/vars.yml b/ansible/vars.yml index 9a07c087c..3a1b08dd9 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.087-orioledb" - postgres17: "17.4.1.037" - postgres15: "15.8.1.094" + postgresorioledb-17: "17.0.1.088-orioledb" + postgres17: "17.4.1.038" + postgres15: "15.8.1.095" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh deleted file mode 100755 index 02f38505a..000000000 --- a/docker/docker-entrypoint.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env bash -set -Eeo pipefail - -source /usr/local/bin/upstream-docker-entrypoint.sh - -# sync $POSTGRES_PASSWORD to supabase-specific roles -pg_sync_password() { - # PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless - # e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGS - export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" - docker_temp_server_start "$@" - - # alter the supabase_admin password - docker_process_sql <<-'EOSQL' - \set pgpass `echo "$POSTGRES_PASSWORD"` - ALTER USER supabase_admin WITH PASSWORD :'pgpass'; - EOSQL - - # execute the roles SQL file using docker_process_sql - docker_process_sql -f /docker-entrypoint-initdb.d/init-scripts/99-roles.sql - - docker_temp_server_stop - unset PGPASSWORD -} - -_main() { - # if first arg looks like a flag, assume we want to run postgres server - if [ "${1:0:1}" = '-' ]; then - set -- postgres "$@" - fi - - if [ "$1" = 'postgres' ] && ! _pg_want_help "$@"; then - docker_setup_env - # setup data directories and permissions (when run as root) - docker_create_db_directories - if [ "$(id -u)" = '0' ]; then - # then restart script as postgres user - exec gosu postgres "$BASH_SOURCE" "$@" - fi - - # only run initialization on an empty data directory - if [ -z "$DATABASE_ALREADY_EXISTS" ]; then - docker_verify_minimum_env - - # check dir permissions to reduce likelihood of half-initialized database - ls /docker-entrypoint-initdb.d/ > /dev/null - - docker_init_database_dir - pg_setup_hba_conf "$@" - - # PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless - # e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGS - export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" - docker_temp_server_start "$@" - - docker_setup_db - docker_process_init_files /docker-entrypoint-initdb.d/* - - docker_temp_server_stop - unset PGPASSWORD - - cat <<-'EOM' - - PostgreSQL init process complete; ready for start up. - - EOM - else - cat <<-'EOM' - - PostgreSQL Database directory appears to contain a database; Skipping initialization - - EOM - fi - - pg_sync_password "$@" - fi - - exec "$@" -} - -if ! _is_sourced; then - _main "$@" -fi From af325c067b0af3accdb7e145b3d9f5c3bd79277a Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Fri, 23 May 2025 16:01:24 +0800 Subject: [PATCH 258/271] fix: vault grants post-upgrade --- .../admin_api_scripts/pg_upgrade_scripts/complete.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 3aeff263c..37115ce02 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -226,9 +226,14 @@ EOF AND EXISTS (SELECT FROM pg_extension WHERE extname = 'supabase_vault') THEN IF (SELECT extversion FROM pg_extension WHERE extname = 'supabase_vault') != '0.2.8' THEN - GRANT USAGE ON SCHEMA vault TO postgres WITH GRANT OPTION; - GRANT SELECT, DELETE ON vault.secrets, vault.decrypted_secrets TO postgres WITH GRANT OPTION; - GRANT EXECUTE ON FUNCTION vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt TO postgres WITH GRANT OPTION; + grant usage on schema vault to postgres with grant option; + grant select, delete, truncate, references on vault.secrets, vault.decrypted_secrets to postgres with grant option; + grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to postgres with grant option; + + -- service_role used to be able to manage secrets in Vault <=0.2.8 because it had privileges to pgsodium functions + grant usage on schema vault to service_role; + grant select, delete on vault.secrets, vault.decrypted_secrets to service_role; + grant execute on function vault.create_secret, vault.update_secret, vault._crypto_aead_det_decrypt to service_role; END IF; -- Do an explicit IF EXISTS check to avoid referencing pgsodium objects if the project already migrated away from using pgsodium. IF EXISTS (SELECT FROM vault.secrets WHERE key_id IS NOT NULL) THEN From b5400670892af41358cda3c5682b2d6090bb08a9 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Wed, 4 Jun 2025 09:16:57 +1000 Subject: [PATCH 259/271] chore: add cargo pgrx v0.14.3 for nix (#1619) * chore: add cargo pgrx v0.14.3 for nix * chore: update cargoHash --------- Co-authored-by: Sam Rose --- flake.nix | 5 +++++ nix/cargo-pgrx/default.nix | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index d49c9e3fa..f4c333fbb 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,10 @@ cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9; }; + buildPgrxExtension_0_14_3 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3; + }; + }) (final: prev: { postgresql = final.callPackage ./nix/postgresql/default.nix { @@ -417,6 +421,7 @@ 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; cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; + cargo-pgrx_0_14_3 = pkgs.cargo-pgrx.cargo-pgrx_0_14_3; # PostgreSQL versions. psql_15 = postgresVersions.psql_15; psql_17 = postgresVersions.psql_17; diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 64e15160b..c1e1a4dee 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -8,7 +8,7 @@ , rust-bin }: let - rustVersion = "1.76.0"; + rustVersion = "1.85.1"; rustPlatform = makeRustPlatform { cargo = rust-bin.stable.${rustVersion}.default; rustc = rust-bin.stable.${rustVersion}.default; @@ -19,6 +19,11 @@ let , cargoHash }: rustPlatform.buildRustPackage rec { + # rust-overlay uses 'cargo-auditable' wrapper for 'cargo' command, but it + # is using older version 0.18.1 of 'cargo_metadata' which doesn't support + # rust edition 2024, so we disable the 'cargo-auditable' just for now. + # ref: https://github.com/oxalica/rust-overlay/issues/153 + auditable = false; pname = "cargo-pgrx"; inherit version; src = fetchCrate { @@ -69,7 +74,12 @@ in cargo-pgrx_0_12_9 = generic { version = "0.12.9"; hash = "sha256-aR3DZAjeEEAjLQfZ0ZxkjLqTVMIEbU0UiZ62T4BkQq8="; - cargoHash = "sha256-53HKhvsKLTa2JCByLEcK3UzWXoM+LTatd98zvS1C9no="; + cargoHash = "sha256-KTKcol9qSNLQZGW32e6fBb6cPkUGItknyVpLdBYqrBY="; + }; + cargo-pgrx_0_14_3 = generic { + version = "0.14.3"; + hash = "sha256-3TsNpEqNm3Uol5XPW1i0XEbP2fF2+RKB2d7lO6BDnvQ="; + cargoHash = "sha256-Ny7j56pwB+2eEK62X0nWfFKQy5fBz+Q1oyvecivxLkk="; }; inherit rustPlatform; } From 347c7dd5f183a4a2befa44ed09e720bbe615e972 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 3 Jun 2025 17:01:07 +0200 Subject: [PATCH 260/271] chore: bump supautils to v2.9.4 --- ansible/files/postgresql_config/supautils.conf.j2 | 2 +- nix/ext/supautils.nix | 6 +++--- nix/tools/run-server.sh.in | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 433f5ae8f..321343bbf 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -7,7 +7,7 @@ supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.ide # omitted because doesn't require superuser: pgmq # omitted because protected: plpgsql supautils.privileged_extensions = 'address_standardizer, address_standardizer_data_us, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intarray, isn, ltree, moddatetime, orioledb, pg_buffercache, pg_cron, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_tle, pg_trgm, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers' -supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' +supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts' supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index 40973a1af..bb01bac55 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "supautils"; - version = "2.9.1"; + version = "2.9.4"; buildInputs = [ postgresql ]; @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-Rw7dmIUg9bJ7SuiHxCsZtnVhdG9hg4WlptiB/MxVmPc="; + hash = "sha256-qP9fOEWXw+wY49GopTizwxSBEGS0UoseJHVBtKS/BdI="; }; installPhase = '' mkdir -p $out/lib - install -D build/*${postgresql.dlSuffix} -t $out/lib + install -D *${postgresql.dlSuffix} -t $out/lib ''; meta = with lib; { diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index a1e289d66..182cbe554 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -220,7 +220,7 @@ mkdir -p "$DATDIR/extension-custom-scripts" cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts" # Configure supautils -sed "s|supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.privileged_extensions_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" +sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" # Configure PostgreSQL sed -e "1i\\ From 736232e30039372339fe7bd55b57b2591ca56d8a Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 3 Jun 2025 17:52:01 +0200 Subject: [PATCH 261/271] chore: bump versions --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 3a1b08dd9..ed2e2f859 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.088-orioledb" - postgres17: "17.4.1.038" - postgres15: "15.8.1.095" + postgresorioledb-17: "17.0.1.089-orioledb" + postgres17: "17.4.1.039" + postgres15: "15.8.1.096" # Non Postgres Extensions pgbouncer_release: "1.19.0" From a3e960f8509a3df76851b0d10abb36a1afa23184 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Wed, 4 Jun 2025 17:01:03 +0530 Subject: [PATCH 262/271] feat: upgrade admin-mgr to v0.25.1 (#1618) * feat: upgrade admin-mgr to v0.25.1 * Update vars.yml --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index ed2e2f859..1a5fe00d3 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.089-orioledb" - postgres17: "17.4.1.039" - postgres15: "15.8.1.096" + postgresorioledb-17: "17.0.1.090-orioledb" + postgres17: "17.4.1.040" + postgres15: "15.8.1.097" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -53,7 +53,7 @@ postgres_exporter_release_checksum: amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 adminapi_release: 0.84.1 -adminmgr_release: 0.25.0 +adminmgr_release: 0.25.1 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" From 9669e7b7fb218a265571d5e8c0ddf99aff8e404d Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Thu, 5 Jun 2025 21:03:54 +0300 Subject: [PATCH 263/271] Add migration `with admin` option for permissions to administer roles for postgres role beyond pg16 (#1625) --- ansible/vars.yml | 6 +- ...nt_with_admin_to_postgres_16_and_above.sql | 13 ++++ nix/tests/expected/roles.out | 37 ---------- nix/tests/expected/z_15_roles.out | 35 +++++++++ nix/tests/expected/z_17_roles.out | 72 ++++++++++++++++--- nix/tests/sql/roles.sql | 16 ----- nix/tests/sql/z_15.roles.sql | 15 ++++ nix/tests/sql/z_15_roles.sql | 13 ++++ nix/tests/sql/z_17_roles.sql | 20 +++++- 9 files changed, 158 insertions(+), 69 deletions(-) create mode 100644 migrations/db/migrations/20250605172253_grant_with_admin_to_postgres_16_and_above.sql create mode 100644 nix/tests/expected/z_15_roles.out create mode 100644 nix/tests/sql/z_15.roles.sql create mode 100644 nix/tests/sql/z_15_roles.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 1a5fe00d3..c72c962f7 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.090-orioledb" - postgres17: "17.4.1.040" - postgres15: "15.8.1.097" + postgresorioledb-17: "17.0.1.091-orioledb" + postgres17: "17.4.1.041" + postgres15: "15.8.1.098" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250605172253_grant_with_admin_to_postgres_16_and_above.sql b/migrations/db/migrations/20250605172253_grant_with_admin_to_postgres_16_and_above.sql new file mode 100644 index 000000000..5f2cd574a --- /dev/null +++ b/migrations/db/migrations/20250605172253_grant_with_admin_to_postgres_16_and_above.sql @@ -0,0 +1,13 @@ +-- migrate:up +DO $$ +DECLARE + major_version INT; +BEGIN + SELECT current_setting('server_version_num')::INT / 10000 INTO major_version; + + IF major_version >= 16 THEN + GRANT anon, authenticated, service_role, authenticator, pg_monitor, pg_read_all_data, pg_signal_backend TO postgres WITH ADMIN OPTION; + END IF; +END $$; + +-- migrate:down diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index 2d2d5060e..aef247b35 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -91,43 +91,6 @@ order by rolname; supabase_storage_admin | {search_path=storage,log_statement=none} (29 rows) --- all role memberships -select - r.rolname as member, - g.rolname as "member_of (can become)", - m.admin_option -from - pg_roles r -left join - pg_auth_members m on r.oid = m.member -left join - pg_roles g on m.roleid = g.oid -where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -order by - r.rolname, g.rolname; - member | member_of (can become) | admin_option --------------------------+------------------------+-------------- - authenticator | anon | f - authenticator | authenticated | f - authenticator | service_role | f - pg_monitor | pg_read_all_settings | f - pg_monitor | pg_read_all_stats | f - pg_monitor | pg_stat_scan_tables | f - pgsodium_keyholder | pgsodium_keyiduser | f - pgsodium_keymaker | pgsodium_keyholder | f - pgsodium_keymaker | pgsodium_keyiduser | f - postgres | anon | f - postgres | authenticated | f - postgres | pg_monitor | f - postgres | pg_read_all_data | f - postgres | pg_signal_backend | f - postgres | pgtle_admin | f - postgres | service_role | f - supabase_read_only_user | pg_read_all_data | f - supabase_storage_admin | authenticator | f -(18 rows) - -- Check all privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for from ( diff --git a/nix/tests/expected/z_15_roles.out b/nix/tests/expected/z_15_roles.out new file mode 100644 index 000000000..42c2314e8 --- /dev/null +++ b/nix/tests/expected/z_15_roles.out @@ -0,0 +1,35 @@ +-- version-specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +order by + r.rolname, g.rolname; + member | member_of (can become) | admin_option +-------------------------+------------------------+-------------- + authenticator | anon | f + authenticator | authenticated | f + authenticator | service_role | f + pg_monitor | pg_read_all_settings | f + pg_monitor | pg_read_all_stats | f + pg_monitor | pg_stat_scan_tables | f + pgsodium_keyholder | pgsodium_keyiduser | f + pgsodium_keymaker | pgsodium_keyholder | f + pgsodium_keymaker | pgsodium_keyiduser | f + postgres | anon | f + postgres | authenticated | f + postgres | pg_monitor | f + postgres | pg_read_all_data | f + postgres | pg_signal_backend | f + postgres | pgtle_admin | f + postgres | service_role | f + supabase_read_only_user | pg_read_all_data | f + supabase_storage_admin | authenticator | f +(18 rows) + diff --git a/nix/tests/expected/z_17_roles.out b/nix/tests/expected/z_17_roles.out index a90a6677d..40ce6007d 100644 --- a/nix/tests/expected/z_17_roles.out +++ b/nix/tests/expected/z_17_roles.out @@ -40,21 +40,35 @@ select m.admin_option from pg_roles r -left join +join pg_auth_members m on r.oid = m.member left join pg_roles g on m.roleid = g.oid -where r.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -or g.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by r.rolname, g.rolname; - member | member_of (can become) | admin_option ------------------------------+------------------------+-------------- - pg_create_subscription | | - pg_maintain | | - pg_use_reserved_connections | | - postgres | pg_create_subscription | f -(4 rows) + member | member_of (can become) | admin_option +-------------------------+------------------------+-------------- + authenticator | anon | f + authenticator | authenticated | f + authenticator | service_role | f + pg_monitor | pg_read_all_settings | f + pg_monitor | pg_read_all_stats | f + pg_monitor | pg_stat_scan_tables | f + pgsodium_keyholder | pgsodium_keyiduser | f + pgsodium_keymaker | pgsodium_keyholder | f + pgsodium_keymaker | pgsodium_keyiduser | f + postgres | anon | t + postgres | authenticated | t + postgres | authenticator | t + postgres | pg_create_subscription | f + postgres | pg_monitor | t + postgres | pg_read_all_data | t + postgres | pg_signal_backend | t + postgres | pgtle_admin | f + postgres | service_role | t + supabase_read_only_user | pg_read_all_data | f + supabase_storage_admin | authenticator | f +(20 rows) -- Check version-specific privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for @@ -109,3 +123,41 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; storage | MAINTAIN | service_role | postgres (28 rows) +-- version specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; + member | member_of (can become) | admin_option +-------------------------+------------------------+-------------- + authenticator | anon | f + authenticator | authenticated | f + authenticator | service_role | f + pg_monitor | pg_read_all_settings | f + pg_monitor | pg_read_all_stats | f + pg_monitor | pg_stat_scan_tables | f + pgsodium_keyholder | pgsodium_keyiduser | f + pgsodium_keymaker | pgsodium_keyholder | f + pgsodium_keymaker | pgsodium_keyiduser | f + postgres | anon | t + postgres | authenticated | t + postgres | authenticator | t + postgres | pg_monitor | t + postgres | pg_read_all_data | t + postgres | pg_signal_backend | t + postgres | pgtle_admin | f + postgres | service_role | t + supabase_read_only_user | pg_read_all_data | f + supabase_storage_admin | authenticator | f +(19 rows) + diff --git a/nix/tests/sql/roles.sql b/nix/tests/sql/roles.sql index 7a582a366..34fd5db7e 100644 --- a/nix/tests/sql/roles.sql +++ b/nix/tests/sql/roles.sql @@ -28,22 +28,6 @@ from pg_roles r where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by rolname; --- all role memberships -select - r.rolname as member, - g.rolname as "member_of (can become)", - m.admin_option -from - pg_roles r -left join - pg_auth_members m on r.oid = m.member -left join - pg_roles g on m.roleid = g.oid -where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -order by - r.rolname, g.rolname; - -- Check all privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for from ( diff --git a/nix/tests/sql/z_15.roles.sql b/nix/tests/sql/z_15.roles.sql new file mode 100644 index 000000000..721709ec0 --- /dev/null +++ b/nix/tests/sql/z_15.roles.sql @@ -0,0 +1,15 @@ +-- all role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; diff --git a/nix/tests/sql/z_15_roles.sql b/nix/tests/sql/z_15_roles.sql new file mode 100644 index 000000000..423e48cca --- /dev/null +++ b/nix/tests/sql/z_15_roles.sql @@ -0,0 +1,13 @@ +-- version-specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +order by + r.rolname, g.rolname; diff --git a/nix/tests/sql/z_17_roles.sql b/nix/tests/sql/z_17_roles.sql index ef17fcb77..ae14f5718 100644 --- a/nix/tests/sql/z_17_roles.sql +++ b/nix/tests/sql/z_17_roles.sql @@ -28,12 +28,10 @@ select m.admin_option from pg_roles r -left join +join pg_auth_members m on r.oid = m.member left join pg_roles g on m.roleid = g.oid -where r.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') -or g.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') order by r.rolname, g.rolname; @@ -58,3 +56,19 @@ from ( a.privilege_type = 'MAINTAIN' ) sub order by schema_order, schema_name, privilege_type, grantee, default_for; + +-- version specific role memberships +select + r.rolname as member, + g.rolname as "member_of (can become)", + m.admin_option +from + pg_roles r +left join + pg_auth_members m on r.oid = m.member +left join + pg_roles g on m.roleid = g.oid +where r.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +and g.rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections') +order by + r.rolname, g.rolname; From 897bb88dafff2341ce80ef9f461a0e9bddb3f934 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 4 Jun 2025 17:21:04 -0500 Subject: [PATCH 264/271] refactor: deduplicate host and port --- flake.nix | 61 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/flake.nix b/flake.nix index f4c333fbb..f22415789 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ flake-utils.lib.eachSystem ourSystems (system: let pgsqlDefaultPort = "5435"; + pgsqlDefaultHost = "localhost"; pgsqlSuperuser = "supabase_admin"; pkgs = import nixpkgs { @@ -349,7 +350,7 @@ PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; CURRENT_SYSTEM = "${system}"; - } // extraSubstitutions; # Merge in any extra substitutions + } // extraSubstitutions; # Merge in any extra substitutions in pkgs.runCommand name { @@ -357,7 +358,7 @@ } '' set -x mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts - + # Copy config files with error handling cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } @@ -366,7 +367,7 @@ cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } - + echo "Copy operation completed" chmod 644 $out/etc/postgresql-custom/supautils.conf chmod 644 $out/etc/postgresql/postgresql.conf @@ -374,8 +375,8 @@ chmod 644 $out/etc/postgresql/pg_hba.conf substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ - ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs - (name: value: "--subst-var-by '${name}' '${value}'") + ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs + (name: value: "--subst-var-by '${name}' '${value}'") substitutions ))} chmod +x $out/bin/start-postgres-server @@ -565,7 +566,7 @@ chmod +x $out/bin/pg-restore ''; sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' - mkdir -p $out/bin + mkdir -p $out/bin substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ @@ -600,7 +601,7 @@ makeWrapper ]; } '' - mkdir -p $out/bin $out/migrations + mkdir -p $out/bin $out/migrations cp -r ${migrationsDir}/* $out substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ @@ -1076,10 +1077,10 @@ # Wait for workflow to start and get the run ID echo "Waiting for workflow to start..." sleep 5 - + # Get the latest run ID for this workflow RUN_ID=$(gh run list --workflow=nix-build.yml --limit 1 --json databaseId --jq '.[0].databaseId') - + if [ -z "$RUN_ID" ]; then echo "Error: Could not find workflow run ID" exit 1 @@ -1121,22 +1122,22 @@ cat > $out/bin/pgsodium-getkey << 'EOF' #!${pkgs.bash}/bin/bash set -euo pipefail - + TMPDIR_BASE=$(mktemp -d) - + if [[ "$(uname)" == "Darwin" ]]; then KEY_DIR="/private/tmp/pgsodium" else KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" fi KEY_FILE="$KEY_DIR/pgsodium.key" - + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then echo "Error: Could not create key directory $KEY_DIR" >&2 exit 1 fi chmod 1777 "$KEY_DIR" - + if [[ ! -f "$KEY_FILE" ]]; then if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then if ! (openssl rand -hex 32 > "$KEY_FILE"); then @@ -1146,7 +1147,7 @@ fi chmod 644 "$KEY_FILE" fi - + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then cat "$KEY_FILE" else @@ -1250,7 +1251,7 @@ substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = ${pgsqlDefaultPort}" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf echo "Checking shared_preload_libraries setting:" grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf @@ -1271,18 +1272,18 @@ # PostgreSQL startup if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgsqlDefaultPort} -d 5" start 2>&1 else mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgsqlDefaultPort} -d 5" start 2>&1 fi || { - echo "pg_ctl failed to start PostgreSQL" + echo "pg_ctl failed to start PostgreSQL" echo "Contents of postgresql.log:" cat "$PGTAP_CLUSTER"/postgresql.log exit 1 } for i in {1..60}; do - if pg_isready -h localhost -p 5435; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort}; then echo "PostgreSQL is ready" break fi @@ -1296,8 +1297,8 @@ exit 1 fi done - createdb -p 5435 -h localhost --username=supabase_admin testing - if ! psql -p 5435 -h localhost --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + createdb -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing + if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then echo "Error executing SQL file. PostgreSQL log content:" cat "$PGTAP_CLUSTER"/postgresql.log pg_ctl -D "$PGTAP_CLUSTER" stop @@ -1305,15 +1306,15 @@ fi SORTED_DIR=$(mktemp -d) for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do - psql -p 5435 -h localhost --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true + psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true done rm -rf "$SORTED_DIR" pg_ctl -D "$PGTAP_CLUSTER" stop rm -rf $PGTAP_CLUSTER - + # End of pgtap tests # from here on out we are running pg_regress tests, we use a different cluster for this - # which is start by the start-postgres-server-bin script + # which is start by the start-postgres-server-bin script # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations # Ensure pgsodium key directory exists with proper permissions @@ -1323,9 +1324,9 @@ fi unset GRN_PLUGINS_DIR ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize - + for i in {1..60}; do - if pg_isready -h localhost -p 5435 -U supabase_admin -q; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort} -U supabase_admin -q; then echo "PostgreSQL is ready" break fi @@ -1336,7 +1337,7 @@ fi done - if ! psql -p 5435 -h localhost --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then echo "Error executing SQL file" exit 1 fi @@ -1347,8 +1348,8 @@ --dbname=postgres \ --inputdir=${./nix/tests} \ --outputdir=$out/regression_output \ - --host=localhost \ - --port=5435 \ + --host=${pgsqlDefaultHost} \ + --port=${pgsqlDefaultPort} \ --user=supabase_admin \ ${builtins.concatStringsSep " " sortedTestList}; then echo "pg_regress tests failed" @@ -1357,7 +1358,7 @@ fi echo "Running migrations tests" - pg_prove -p 5435 -U supabase_admin -h localhost -d postgres -v ${./migrations/tests}/test.sql + pg_prove -p ${pgsqlDefaultPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do From 19bdfcce7a55acc79a24d40987e81764daecfbec Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Thu, 5 Jun 2025 12:56:58 -0700 Subject: [PATCH 265/271] feat: bumps auth to v2.175.0 (#1627) Bumps Auth to v2.175.0 Co-authored-by: Chris Stockton --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index c72c962f7..9e512d428 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.174.0 -gotrue_release_checksum: sha1:d9ac9bb209a5e0b383ab96e05d05409eaebdbaac +gotrue_release: 2.175.0 +gotrue_release_checksum: sha1:4e2a41e08936195daf443c60201691c1bd991709 aws_cli_release: "2.23.11" From 50d0c7701fa7874b4dad9d2a3ec807cb9ff8b44a Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Fri, 6 Jun 2025 13:57:31 +0300 Subject: [PATCH 266/271] fix(pg_upgrade): enable alter role queries after upgrade completes (#1630) --- ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 37115ce02..31cc7d09d 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -268,6 +268,7 @@ EOF SELECT current_setting('server_version_num')::INT / 10000 INTO major_version; IF major_version >= 16 THEN GRANT pg_create_subscription TO postgres; + GRANT anon, authenticated, service_role, authenticator, pg_monitor, pg_read_all_data, pg_signal_backend TO postgres WITH ADMIN OPTION; END IF; GRANT pg_monitor, pg_read_all_data, pg_signal_backend TO postgres; END From df59facb984053dbc253921fbe9d94412de48797 Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Fri, 6 Jun 2025 09:12:45 -0700 Subject: [PATCH 267/271] feat: bumps auth to v2.175.0 (#1631) Bumps Auth to v2.175.0 Co-authored-by: Chris Stockton --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 9e512d428..9473fe44e 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.091-orioledb" - postgres17: "17.4.1.041" - postgres15: "15.8.1.098" + postgresorioledb-17: "17.0.1.092-orioledb" + postgres17: "17.4.1.042" + postgres15: "15.8.1.099" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 87829ebda52b1e66ef9c9d6a4082e725f8baa325 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Wed, 11 Jun 2025 13:58:24 +0200 Subject: [PATCH 268/271] feat: auth v2.176.1 (#1636) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 9473fe44e..2838d6f92 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.092-orioledb" - postgres17: "17.4.1.042" - postgres15: "15.8.1.099" + postgresorioledb-17: "17.0.1.093-orioledb" + postgres17: "17.4.1.043" + postgres15: "15.8.1.100" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.175.0 -gotrue_release_checksum: sha1:4e2a41e08936195daf443c60201691c1bd991709 +gotrue_release: 2.176.1 +gotrue_release_checksum: sha1:3b392d2e332d5b5114e571c0d62ab9f827fd5b76 aws_cli_release: "2.23.11" From a7c5b02fd2ab4c51a27f61b4f71ac41434f54a26 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 16 Jun 2025 10:22:45 -0400 Subject: [PATCH 269/271] feat: add an action that handles git checkouts for all workflows (#1644) --- .github/actions/shared-checkout/action.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/actions/shared-checkout/action.yml diff --git a/.github/actions/shared-checkout/action.yml b/.github/actions/shared-checkout/action.yml new file mode 100644 index 000000000..59a236db8 --- /dev/null +++ b/.github/actions/shared-checkout/action.yml @@ -0,0 +1,12 @@ +name: Checkout +description: Checkout repository for pull requests and branches +runs: + using: "composite" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + fetch-tags: true From 2bdd0f95f5fa5673849349e4ff761be1c56c2afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 17 Jun 2025 14:35:39 +0200 Subject: [PATCH 270/271] feat: allow checkout of fork repository on workflow approval (#1643) * feat: allow checkout of fork repository on workflow approval Based on #1635 * Do not use secrets if they are not available In the forks, secrets are not available. --- .github/workflows/ami-release-nix-single.yml | 2 +- .github/workflows/ami-release-nix.yml | 6 ++--- .github/workflows/check-shellscripts.yml | 3 ++- .github/workflows/ci.yml | 2 +- .../workflows/dockerhub-release-matrix.yml | 14 ++++++---- .github/workflows/manual-docker-release.yml | 14 ++++++---- .github/workflows/mirror-postgrest.yml | 3 ++- .github/workflows/nix-build.yml | 12 +++------ .github/workflows/publish-migrations-prod.yml | 4 +-- .../workflows/publish-migrations-staging.yml | 3 +-- ...ublish-nix-pgupgrade-bin-flake-version.yml | 10 +++---- .../publish-nix-pgupgrade-scripts.yml | 8 +++--- .github/workflows/qemu-image-build.yml | 4 +-- .github/workflows/test.yml | 7 ++--- .github/workflows/testinfra-ami-build.yml | 4 +-- docker/nix/build_nix.sh | 27 +++++++++++-------- 16 files changed, 67 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 86a1d40fc..863135ef3 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD with: ref: ${{ github.event.inputs.branch }} diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 004a597d7..ee78de99c 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -22,8 +22,8 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL versions @@ -48,7 +48,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main diff --git a/.github/workflows/check-shellscripts.yml b/.github/workflows/check-shellscripts.yml index ab0f59b87..aabf17413 100644 --- a/.github/workflows/check-shellscripts.yml +++ b/.github/workflows/check-shellscripts.yml @@ -14,7 +14,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Run ShellCheck uses: ludeeus/action-shellcheck@master env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93a2afdc5..f10f5f58e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Load postgres_release values id: load_postgres_release diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index ed7075d1d..1ac5b2ccc 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: DeterminateSystems/nix-installer-action@main - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Generate build matrix id: set-matrix run: | @@ -53,7 +53,8 @@ jobs: outputs: build_args: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV @@ -77,7 +78,8 @@ jobs: runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - run: docker context create builders - uses: docker/setup-buildx-action@v3 @@ -132,7 +134,8 @@ jobs: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v2 @@ -175,7 +178,8 @@ jobs: needs: [prepare, merge_manifest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Debug Input from Prepare diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml index 8948324db..e702014dc 100644 --- a/.github/workflows/manual-docker-release.yml +++ b/.github/workflows/manual-docker-release.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: DeterminateSystems/nix-installer-action@main - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Generate build matrix id: set-matrix run: | @@ -50,7 +50,8 @@ jobs: outputs: build_args: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV @@ -74,7 +75,8 @@ jobs: runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - run: docker context create builders - uses: docker/setup-buildx-action@v3 @@ -141,7 +143,8 @@ jobs: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v2 @@ -184,7 +187,8 @@ jobs: needs: [prepare, merge_manifest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Debug Input from Prepare diff --git a/.github/workflows/mirror-postgrest.yml b/.github/workflows/mirror-postgrest.yml index 1658730f7..0195ab695 100644 --- a/.github/workflows/mirror-postgrest.yml +++ b/.github/workflows/mirror-postgrest.yml @@ -17,7 +17,8 @@ jobs: outputs: postgrest_release: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v4 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - id: args uses: mikefarah/yq@master with: diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index c1811fd00..b6458a807 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -27,15 +27,11 @@ jobs: runs-on: ${{ matrix.runner }} timeout-minutes: 180 steps: - - - name: Check out code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref || github.ref }} - fetch-depth: 0 - fetch-tags: true + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: aws-creds uses: aws-actions/configure-aws-credentials@v4 + if: ${{ github.secret_source == 'Actions' }} with: role-to-assume: ${{ secrets.DEV_AWS_ROLE }} aws-region: "us-east-1" @@ -48,7 +44,7 @@ jobs: env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - name: Log in to Docker Hub - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' + if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' && github.secret_source == 'Actions' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/publish-migrations-prod.yml b/.github/workflows/publish-migrations-prod.yml index d7e813667..e3d7365cb 100644 --- a/.github/workflows/publish-migrations-prod.yml +++ b/.github/workflows/publish-migrations-prod.yml @@ -21,8 +21,8 @@ jobs: env: GITHUB_REF: ${{ github.ref }} - - name: Checkout Repo - uses: actions/checkout@v2 + - name: Checkout repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Merging migration files run: cat $(ls -1) > ../migration-output.sql diff --git a/.github/workflows/publish-migrations-staging.yml b/.github/workflows/publish-migrations-staging.yml index 72b28e927..9cef8be4b 100644 --- a/.github/workflows/publish-migrations-staging.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -16,8 +16,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v2 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Merging migration files run: cat $(ls -1) > ../migration-output.sql working-directory: ${{ github.workspace }}/migrations/db/migrations diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index bec85166e..847e6d47c 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -17,8 +17,8 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL versions @@ -36,8 +36,8 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Grab release version @@ -88,7 +88,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Grab release version id: process_release_version diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index ece3e5966..19e255fca 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -24,7 +24,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -94,8 +94,8 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Grab release version diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 708c7faf2..8abee1461 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -23,7 +23,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a218ef882..ac285af26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Clear Nix cache run: | @@ -49,7 +49,8 @@ jobs: POSTGRES_PORT: 5478 POSTGRES_PASSWORD: password steps: - - uses: actions/checkout@v4 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Clear Nix cache run: | sudo rm -rf /home/runner/.cache/nix @@ -86,4 +87,4 @@ jobs: echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql exit 1 - fi \ No newline at end of file + fi diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 2b07e716f..752bc3938 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -15,7 +15,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -52,7 +52,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - id: args uses: mikefarah/yq@master diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index efaafbe89..8e7d9cfa8 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -18,11 +18,13 @@ nix build .#wal-g-2 -o wal-g-2 -L 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 ./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 +if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then + 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 ./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 +fi if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_15_debug -o ./postgresql_15_debug @@ -31,10 +33,13 @@ if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src nix build .#postgresql_17_debug -o ./postgresql_17_debug nix build .#postgresql_17_src -o ./postgresql_17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src + + if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src + fi fi From 521a9746cb3afd1b93efb3acd520be903e16308f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 18 Jun 2025 03:53:44 +0200 Subject: [PATCH 271/271] Use nix-fast-build to build all checks (#1642) * Use nix-fast-build to build all checks CI build the required nix packages defined in flake checks. We use the `nix-fast-build` tool to speed up the evaluation and build process. We now use the same GitHub action to install nix. We upload the build results to the cache using a post build hook. * Run nix-fast-build from the GH Actions workflow No need to run an extra shell script to run nix-fast-build. * Upgrade the runners * Fix issue with simultaneous pg build on darwin Make sure each build use different port per version. Make sure they use different pgsodium directories. --- .github/workflows/nix-build.yml | 65 +++++++++++++++++---------------- docker/nix/build_nix.sh | 38 +------------------ flake.nix | 43 +++++++++++----------- 3 files changed, 56 insertions(+), 90 deletions(-) mode change 100644 => 100755 docker/nix/build_nix.sh diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index b6458a807..e95d65a43 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -18,11 +18,11 @@ jobs: fail-fast: false matrix: include: - - runner: larger-runner-4cpu + - runner: large-linux-x86 arch: amd64 - - runner: arm-runner + - runner: large-linux-arm arch: arm64 - - runner: macos-latest + - runner: macos-latest-xlarge arch: arm64 runs-on: ${{ matrix.runner }} timeout-minutes: 180 @@ -43,37 +43,38 @@ jobs: python -c "import os; file = open('nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()" env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - - name: Log in to Docker Hub - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' && github.secret_source == 'Actions' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build psql bundle with nix - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' - run: docker build -t base_nix -f docker/nix/Dockerfile . - - name: Run build psql bundle - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' - run: | - docker run -e AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }} \ - -e AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }} \ - -e AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }} \ - base_nix bash -c "./workspace/docker/nix/build_nix.sh" - - name: Build psql bundle on macos - if: matrix.runner == 'macos-latest' || matrix.runner == 'macos-13' + - name: Setup cache script + if: ${{ github.secret_source == 'Actions' }} run: | - curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ - --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ - --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh - cp ./docker/nix/build_nix.sh ./build_nix.sh - sed -i '' '1s|^#!/bin/env bash|#!/usr/bin/env bash|' ./build_nix.sh - chmod +x ./build_nix.sh - ./build_nix.sh + mkdir -p /etc/nix + cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null + #!/usr/bin/env bash + set -eouf + export IFS=' ' + echo /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=nix-secret-key' \$OUT_PATHS + EOF + chmod +x /etc/nix/upload-to-cache.sh + - name: Install nix + uses: DeterminateSystems/nix-installer-action@main + if: ${{ github.secret_source == 'Actions' }} + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + post-build-hook = /etc/nix/upload-to-cache.sh + - name: Install nix + uses: DeterminateSystems/nix-installer-action@main + if: ${{ github.secret_source == 'None' }} + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Build psql bundle + run: > + nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" + -- --skip-cached --no-nom + --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} - - name: build psql bundle on ${{ matrix.arch }} - diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh old mode 100644 new mode 100755 index 8e7d9cfa8..118fdf61d --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -6,40 +6,4 @@ if [ -d "/workspace" ]; then cd /workspace fi -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 .#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 -nix build .#wal-g-2 -o wal-g-2 -L -nix build .#wal-g-3 -o wal-g-3 -L - -# Copy to S3 -if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then - 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 ./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 -fi - -if [ "$SYSTEM" = "aarch64-linux" ]; then - nix build .#postgresql_15_debug -o ./postgresql_15_debug - nix build .#postgresql_15_src -o ./postgresql_15_src - nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug - nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src - nix build .#postgresql_17_debug -o ./postgresql_17_debug - nix build .#postgresql_17_src -o ./postgresql_17_src - - if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src - fi -fi +nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" -- --skip-cached --no-nom --flake ".#checks" diff --git a/flake.nix b/flake.nix index f22415789..a7f48d58c 100644 --- a/flake.nix +++ b/flake.nix @@ -1125,11 +1125,7 @@ TMPDIR_BASE=$(mktemp -d) - if [[ "$(uname)" == "Darwin" ]]; then - KEY_DIR="/private/tmp/pgsodium" - else - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - fi + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" KEY_FILE="$KEY_DIR/pgsodium.key" if ! mkdir -p "$KEY_DIR" 2>/dev/null; then @@ -1165,6 +1161,7 @@ name = "start-postgres-server-test"; extraSubstitutions = { PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey"; + PGSQL_DEFAULT_PORT = pgPort; }; }; @@ -1217,6 +1214,12 @@ # Filter SQL test files filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; + pgPort = if (majorVersion == "17") then + "5535" + else if (majorVersion == "15") then + "5536" + else "5537"; + # Convert filtered tests to a sorted list of basenames (without extension) testList = pkgs.lib.mapAttrsToList (name: _: @@ -1251,7 +1254,7 @@ substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "port = ${pgsqlDefaultPort}" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = ${pgPort}" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf echo "Checking shared_preload_libraries setting:" grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf @@ -1272,10 +1275,10 @@ # PostgreSQL startup if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgsqlDefaultPort} -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgPort} -d 5" start 2>&1 else mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgsqlDefaultPort} -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgPort} -d 5" start 2>&1 fi || { echo "pg_ctl failed to start PostgreSQL" echo "Contents of postgresql.log:" @@ -1283,7 +1286,7 @@ exit 1 } for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort}; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort}; then echo "PostgreSQL is ready" break fi @@ -1297,8 +1300,8 @@ exit 1 fi done - createdb -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing - if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + createdb -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing + if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then echo "Error executing SQL file. PostgreSQL log content:" cat "$PGTAP_CLUSTER"/postgresql.log pg_ctl -D "$PGTAP_CLUSTER" stop @@ -1306,7 +1309,7 @@ fi SORTED_DIR=$(mktemp -d) for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do - psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true + psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true done rm -rf "$SORTED_DIR" pg_ctl -D "$PGTAP_CLUSTER" stop @@ -1317,16 +1320,11 @@ # which is start by the start-postgres-server-bin script # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations - # Ensure pgsodium key directory exists with proper permissions - if [[ "$(uname)" == "Darwin" ]]; then - mkdir -p /private/tmp/pgsodium - chmod 1777 /private/tmp/pgsodium - fi unset GRN_PLUGINS_DIR ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort} -U supabase_admin -q; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort} -U supabase_admin -q; then echo "PostgreSQL is ready" break fi @@ -1337,7 +1335,7 @@ fi done - if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then echo "Error executing SQL file" exit 1 fi @@ -1349,7 +1347,7 @@ --inputdir=${./nix/tests} \ --outputdir=$out/regression_output \ --host=${pgsqlDefaultHost} \ - --port=${pgsqlDefaultPort} \ + --port=${pgPort} \ --user=supabase_admin \ ${builtins.concatStringsSep " " sortedTestList}; then echo "pg_regress tests failed" @@ -1358,7 +1356,7 @@ fi echo "Running migrations tests" - pg_prove -p ${pgsqlDefaultPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql + pg_prove -p ${pgPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do @@ -1382,6 +1380,9 @@ psql_15 = makeCheckHarness basePackages.psql_15.bin; psql_17 = makeCheckHarness basePackages.psql_17.bin; psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; + inherit (basePackages) wal-g-2 wal-g-3; + } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { + inherit (basePackages) postgresql_15_debug postgresql_15_src postgresql_orioledb-17_debug postgresql_orioledb-17_src postgresql_17_debug postgresql_17_src; }; # Apps is a list of names of things that can be executed with 'nix run';