From 2a81e26080b2482af31cc64842fbc8164fa538b7 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Wed, 13 Dec 2023 02:03:37 +1100 Subject: [PATCH 01/23] add bindings for `pg_foreign_data_wrapper.h` --- pgrx-pg-sys/include/pg12.h | 1 + pgrx-pg-sys/include/pg13.h | 1 + pgrx-pg-sys/include/pg14.h | 1 + pgrx-pg-sys/include/pg15.h | 1 + pgrx-pg-sys/include/pg16.h | 1 + 5 files changed, 5 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index 1d7a7b74f..18eae24fe 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -45,6 +45,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_enum.h" #include "catalog/pg_extension.h" +#include "catalog/pg_foreign_data_wrapper.h" #include "catalog/pg_foreign_server.h" #include "catalog/pg_foreign_table.h" #include "catalog/pg_operator.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 924cceed8..49c136bc8 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -45,6 +45,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_enum.h" #include "catalog/pg_extension.h" +#include "catalog/pg_foreign_data_wrapper.h" #include "catalog/pg_foreign_server.h" #include "catalog/pg_foreign_table.h" #include "catalog/pg_operator.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index 924cceed8..49c136bc8 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -45,6 +45,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_enum.h" #include "catalog/pg_extension.h" +#include "catalog/pg_foreign_data_wrapper.h" #include "catalog/pg_foreign_server.h" #include "catalog/pg_foreign_table.h" #include "catalog/pg_operator.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 67687065e..213a94a67 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -46,6 +46,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_enum.h" #include "catalog/pg_extension.h" +#include "catalog/pg_foreign_data_wrapper.h" #include "catalog/pg_foreign_server.h" #include "catalog/pg_foreign_table.h" #include "catalog/pg_operator.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index 2e9fffb35..cd3f32414 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -46,6 +46,7 @@ #include "catalog/pg_database.h" #include "catalog/pg_enum.h" #include "catalog/pg_extension.h" +#include "catalog/pg_foreign_data_wrapper.h" #include "catalog/pg_foreign_server.h" #include "catalog/pg_foreign_table.h" #include "catalog/pg_operator.h" From 82b914b769953994586c44ca1f3080a2c3ceae25 Mon Sep 17 00:00:00 2001 From: Eric Ridge Date: Sat, 16 Dec 2023 12:39:02 -0500 Subject: [PATCH 02/23] make CI work --- .github/workflows/tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 315d6f3cf..2bc4a7a6e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,8 @@ jobs: - name: Set up prerequisites and environment run: | + sudo apt-get update -y -qq --fix-missing + echo "" echo "----- Install sccache -----" mkdir -p $HOME/.local/bin @@ -277,6 +279,8 @@ jobs: - name: Set up prerequisites and environment run: | + sudo apt-get update -y -qq --fix-missing + echo "" echo "----- Install / Set up sccache -----" @@ -402,9 +406,12 @@ jobs: - name: Workaround GitHub Actions Python issues run: brew unlink python && brew link --overwrite python + # install postgres with homebrew, but do't let homebrew do an update too. The update + # process not only takes forever, but it tends to fail when the internet changes + # https://github.com/Homebrew/brew/issues/1670#issuecomment-267096602 - name: brew install postgresql run: | - brew install ${FORMULA} + HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install ${FORMULA} echo "$(brew --prefix ${FORMULA})/bin" >> $GITHUB_PATH env: From c7fe6ce37cc054b9648ce4bb6403018a70c31e3e Mon Sep 17 00:00:00 2001 From: damien clochard Date: Sat, 16 Dec 2023 18:39:34 +0100 Subject: [PATCH 03/23] Include rule utils header (#1431) The rule utils header contains useful fonctions such as `deparse_expression()`. --- pgrx-pg-sys/include/pg12.h | 1 + pgrx-pg-sys/include/pg13.h | 1 + pgrx-pg-sys/include/pg14.h | 1 + pgrx-pg-sys/include/pg15.h | 1 + pgrx-pg-sys/include/pg16.h | 1 + 5 files changed, 5 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index 18eae24fe..4222c70eb 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -148,6 +148,7 @@ #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/ruleutils.h" #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 49c136bc8..8598cf63f 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -145,6 +145,7 @@ #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/ruleutils.h" #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index 49c136bc8..8598cf63f 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -145,6 +145,7 @@ #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/ruleutils.h" #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 213a94a67..8f450eb1f 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -146,6 +146,7 @@ #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/ruleutils.h" #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index cd3f32414..5225d344e 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -146,6 +146,7 @@ #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/ruleutils.h" #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" From b96204ff5a9cd883cf5166c4187ca4a04a6fdade Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sat, 16 Dec 2023 10:51:32 -0700 Subject: [PATCH 04/23] expand readme (#1433) this explains the version match requirements of `cargo-pgrx` and also breaks up the initial "one step" into two steps with slightly more explanation. --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e284e97b..e6250242e 100644 --- a/README.md +++ b/README.md @@ -95,14 +95,25 @@ scl enable devtoolset-7 bash ## Getting Started -First install the `cargo-pgrx` sub-command and initialize the development environment: +First install the `cargo-pgrx` sub-command. ```bash cargo install --locked cargo-pgrx +``` + +**Important:** `cargo-pgrx` **must** be built using the same compiler as you'll use to build the rest of your project. Every time you update your Rust toolchain you have to also manually reinstall `cargo-pgrx`. See [Upgrading](#Upgrading), below. + +Once `cargo-pgrx` is ready you can initialize the "PGRX Home" directory: + +```bash cargo pgrx init ``` -The `init` command downloads currently supported PostgreSQL versions, compiles them to `~/.pgrx/`, and runs `initdb`. It's also possible to use an existing (user-writable) PostgreSQL install, or install a subset of versions, see the [`README.md` of `cargo-pgrx` for details](cargo-pgrx/README.md#first-time-initialization). +The `init` command downloads all currently supported PostgreSQL versions, compiles them to `~/.pgrx/`, and runs `initdb`. + +It's also possible to use an existing (user-writable) PostgreSQL install, or install a subset of versions, see the [`README.md` of `cargo-pgrx` for details](cargo-pgrx/README.md#first-time-initialization). + +Now you can begin work on a specific pgrx extension: ```bash cargo pgrx new my_extension @@ -161,7 +172,7 @@ As new Postgres versions are supported by `pgrx`, you can re-run the `pgrx init` cargo pgrx init ``` -### Mapping of Postgres types to Rust +## Mapping of Postgres types to Rust | Postgres Type | Rust Type (as `Option`) | |----------------------------|---------------------------------------------------------| From d97f7fe02a5d298b737c312706ac584a401ced72 Mon Sep 17 00:00:00 2001 From: Eric Ridge Date: Sat, 16 Dec 2023 14:36:39 -0500 Subject: [PATCH 05/23] fix issue #1437 (#1440) This fixes issue #1437. The problem here is that we were blindly converting the entire `syn::Variant` value to the Postgres enum variant name when in fact all we want is its `Ident` value. --- pgrx-sql-entity-graph/src/postgres_enum/mod.rs | 2 +- pgrx-tests/src/tests/enum_type_tests.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pgrx-sql-entity-graph/src/postgres_enum/mod.rs b/pgrx-sql-entity-graph/src/postgres_enum/mod.rs index 96e6f68f4..c1cbed915 100644 --- a/pgrx-sql-entity-graph/src/postgres_enum/mod.rs +++ b/pgrx-sql-entity-graph/src/postgres_enum/mod.rs @@ -121,7 +121,7 @@ impl ToEntityGraphTokens for PostgresEnum { let (_static_impl_generics, static_ty_generics, static_where_clauses) = static_generics.split_for_impl(); - let variants = self.variants.iter(); + let variants = self.variants.iter().map(|variant| variant.ident.clone()); let sql_graph_entity_fn_name = syn::Ident::new(&format!("__pgrx_internals_enum_{}", name), Span::call_site()); diff --git a/pgrx-tests/src/tests/enum_type_tests.rs b/pgrx-tests/src/tests/enum_type_tests.rs index 87e1577f6..143797527 100644 --- a/pgrx-tests/src/tests/enum_type_tests.rs +++ b/pgrx-tests/src/tests/enum_type_tests.rs @@ -9,8 +9,9 @@ //LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file. use pgrx::prelude::*; -#[derive(PostgresEnum, PartialEq, Debug)] +#[derive(PostgresEnum, PartialEq, Debug, Default)] pub enum Foo { + #[default] One, Two, Three, From b98d9098460454f469b174b4e475243d7dc58853 Mon Sep 17 00:00:00 2001 From: Usamoi Date: Sun, 17 Dec 2023 03:38:00 +0800 Subject: [PATCH 06/23] add bindings for` libpq/pqformat.h` (#1436) Discussed was also adding `libpq.h` but that would expand development requirements to Kerberos development headers and that isn't a good situation for existing users. --- pgrx-pg-sys/include/pg12.h | 1 + pgrx-pg-sys/include/pg13.h | 1 + pgrx-pg-sys/include/pg14.h | 1 + pgrx-pg-sys/include/pg15.h | 1 + pgrx-pg-sys/include/pg16.h | 1 + 5 files changed, 5 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index 4222c70eb..4d19ee60d 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -76,6 +76,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 8598cf63f..1bae236f5 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -76,6 +76,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index 8598cf63f..1bae236f5 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -76,6 +76,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 8f450eb1f..27133d602 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -77,6 +77,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index 5225d344e..380e6b83a 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -77,6 +77,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" #include "nodes/extensible.h" From d2f634bd9b98f685df97ae6196ee86c6ba8112a7 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 27 Dec 2023 23:31:08 +0100 Subject: [PATCH 07/23] Allow to build cargo-pgrx either with rustls (default) or native-tls (#1448) ureq defines `default = ["tls", "gzip"]`, so "tls" feature (rustls) is currently always enabled even when native-tls is preferred, i.e. both rustls and native-tls is built if openssl headers are available and the user cannot opt-out from using rustls. This also disallows building cargo-pgrx on platforms not supported by the ring crate (dependency of rustls). This should also solve #1430 if `cargo-pgrx` is built with `--no-default-features --features native-tls`. --- cargo-pgrx/Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cargo-pgrx/Cargo.toml b/cargo-pgrx/Cargo.toml index b7ed69383..371e157a6 100644 --- a/cargo-pgrx/Cargo.toml +++ b/cargo-pgrx/Cargo.toml @@ -40,7 +40,7 @@ proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } quote = "1.0.33" rayon = "1.8.0" regex = "1.10.0" -ureq = "2.8.0" +ureq = { version = "2.8.0", default-features = false, features = [ "gzip" ] } url = "2.4.1" serde = { version = "1.0", features = [ "derive" ] } serde_derive = "1.0" @@ -61,5 +61,6 @@ tempfile = "3.8.0" nix = { version = "0.27", default-features = false, features = ["user"] } [features] -default = ["ureq/native-tls"] +default = ["rustls"] +native-tls = ["ureq/native-tls"] rustls = ["ureq/tls"] From 3d349ce59fe9d22100ae065ab64371f0ab671fea Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:01:27 -0800 Subject: [PATCH 08/23] Use native-certs with ureq (#1449) I first settled down to write up something using `rustls-native_certs` but then I actually noticed ureq simply enables this with a feature. This should fully solve #1430 for both rustls and native-tls. --- Cargo.lock | 22 ++++++++++++++++++++++ cargo-pgrx/Cargo.toml | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 4612d0865..180789d81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2034,6 +2034,27 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2870,6 +2891,7 @@ dependencies = [ "native-tls", "once_cell", "rustls", + "rustls-native-certs", "rustls-webpki", "url", "webpki-roots", diff --git a/cargo-pgrx/Cargo.toml b/cargo-pgrx/Cargo.toml index 371e157a6..d46d7ae44 100644 --- a/cargo-pgrx/Cargo.toml +++ b/cargo-pgrx/Cargo.toml @@ -63,4 +63,7 @@ nix = { version = "0.27", default-features = false, features = ["user"] } [features] default = ["rustls"] native-tls = ["ureq/native-tls"] -rustls = ["ureq/tls"] +rustls = [ + "ureq/tls", + "ureq/native-certs" # induces rustls to use the OS-level root of trust +] From 281ab4fefb8cd8b728e62f57e2a47a67a5893cd2 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:22:27 -0800 Subject: [PATCH 09/23] Alpine should not need tar (#1450) Closes #1360 --- .github/docker/Dockerfile.alpine:3.18 | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/docker/Dockerfile.alpine:3.18 b/.github/docker/Dockerfile.alpine:3.18 index 55b09d648..864737628 100644 --- a/.github/docker/Dockerfile.alpine:3.18 +++ b/.github/docker/Dockerfile.alpine:3.18 @@ -27,7 +27,6 @@ RUN apk add --no-cache \ make \ musl-dev \ openssl-dev \ - tar \ util-linux-dev # Set up permissions so that the rust user below can create extensions From bc795ff80e1b529a4e9d03d1e81bef4f872e08b7 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:27:25 -0800 Subject: [PATCH 10/23] Add regproc.h (#1453) Closes https://github.com/pgcentralfoundation/pgrx/issues/164 --- pgrx-pg-sys/include/pg12.h | 1 + pgrx-pg-sys/include/pg13.h | 1 + pgrx-pg-sys/include/pg14.h | 1 + pgrx-pg-sys/include/pg15.h | 1 + pgrx-pg-sys/include/pg16.h | 1 + 5 files changed, 5 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index 4d19ee60d..fd2fff44b 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -147,6 +147,7 @@ #include "utils/memutils.h" #include "utils/numeric.h" #include "utils/palloc.h" +#include "utils/regproc.h" #include "utils/rel.h" #include "utils/relcache.h" #include "utils/ruleutils.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 1bae236f5..1105b9318 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -145,6 +145,7 @@ #include "utils/numeric.h" #include "utils/palloc.h" #include "utils/rel.h" +#include "utils/regproc.h" #include "utils/relcache.h" #include "utils/ruleutils.h" #include "utils/sampling.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index 1bae236f5..ddc680dfe 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -144,6 +144,7 @@ #include "utils/memutils.h" #include "utils/numeric.h" #include "utils/palloc.h" +#include "utils/regproc.h" #include "utils/rel.h" #include "utils/relcache.h" #include "utils/ruleutils.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 27133d602..316ffa9cd 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -145,6 +145,7 @@ #include "utils/memutils.h" #include "utils/numeric.h" #include "utils/palloc.h" +#include "utils/regproc.h" #include "utils/rel.h" #include "utils/relcache.h" #include "utils/ruleutils.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index 380e6b83a..ee5ba3b2b 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -145,6 +145,7 @@ #include "utils/memutils.h" #include "utils/numeric.h" #include "utils/palloc.h" +#include "utils/regproc.h" #include "utils/rel.h" #include "utils/relcache.h" #include "utils/ruleutils.h" From 411ce80e0e1605aeea0dc63bf9c52be94d1020b5 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Fri, 29 Dec 2023 12:15:23 -0700 Subject: [PATCH 11/23] use the full `cargo` version string in the version match check. (#1443) Rather than `cargo-pgrx` using just the `rustc` minor version when checking for a toolchain version mismatch, this now uses the full `cargo` version string. `cargo` uses the same version number as `rustc`, so it's a sufficient stand in for checking the version of `rustc`. By checking the full version string instead of only the minor version, we can now detect a mismatch between two nightly versions of rust issued in the same 6 week period. Example: `cargo 1.76.0-nightly (9b13310ca 2023-11-24)` vs `cargo 1.76.0-nightly (1aa9df1a5 2023-12-12)` These detect as the same minor version, but using the new full string check they will correctly show up as different and flag the mismatch error. Also: the error message now alerts people how they can override the version check when necessary. --- cargo-pgrx/build.rs | 28 ++++++++++-------- cargo-pgrx/src/command/schema.rs | 49 +++++++++++++++----------------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/cargo-pgrx/build.rs b/cargo-pgrx/build.rs index 4358539d8..34bbed319 100644 --- a/cargo-pgrx/build.rs +++ b/cargo-pgrx/build.rs @@ -9,19 +9,23 @@ //LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file. fn main() { println!("cargo:rerun-if-changed=build.rs"); - if let Some(minor_version) = rust_minor_version() { - println!("cargo:rustc-env=MINOR_RUST_VERSION={minor_version}"); + if let Some(cargo_version) = cargo_version() { + println!("cargo:rustc-env=CARGO_VERSION_DURING_BUILD={cargo_version}"); } } -fn rust_minor_version() -> Option { - let rustc = std::env::var_os("RUSTC").unwrap_or_else(|| "rustc".into()); - let output = std::process::Command::new(rustc).arg("--version").output().ok()?; - let version = std::str::from_utf8(&output.stdout).ok()?; - let mut iter = version.split('.'); - if iter.next() != Some("rustc 1") { - None - } else { - iter.next()?.parse().ok() - } +/// Gets the current `cargo` version. +/// +/// Used to check our toolchain version. `cargo` sets the `CARGO` env var both +/// when running the build script and when running `cargo-pgrx`, so it's easier +/// to check `cargo` than to check itself `rustc` itself. Also `cargo` will +/// always have the same version as the `rustc` it goes with, so checking the +/// `cargo` version is sufficient. +/// +/// [Reference: Environment variables Cargo sets for build +/// scripts](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts) +fn cargo_version() -> Option { + let cargo = std::env::var_os("CARGO").expect("`CARGO` env var wasn't set!"); + let output = std::process::Command::new(cargo).arg("--version").output().ok()?; + std::str::from_utf8(&output.stdout).map(|s| s.trim().to_string()).ok() } diff --git a/cargo-pgrx/src/command/schema.rs b/cargo-pgrx/src/command/schema.rs index 96a76bdd9..b3bf719b6 100644 --- a/cargo-pgrx/src/command/schema.rs +++ b/cargo-pgrx/src/command/schema.rs @@ -126,47 +126,44 @@ impl CommandExecute for Schema { } } -// This is *mostly* a copy of the function in `build.rs`, except using -// `CARGO`/`cargo` rather than `RUSTC`/`rustc`. It seems too painful to try and -// share them, given how they're close-but-not-identical. -fn rust_minor_version() -> Option { - // In order to support `cargo +whatever pgrx`, use `CARGO` here (which - // cargo sets for subcommands to allow this), if present. - let rustc = std::env::var_os("CARGO").unwrap_or_else(|| "cargo".into()); - let output = std::process::Command::new(rustc).arg("--version").output().ok()?; - let version = std::str::from_utf8(&output.stdout).ok()?; - let mut iter = version.split('.'); - if iter.next() != Some("cargo 1") { - None - } else { - iter.next()?.parse().ok() - } +/// Gets the current `cargo` version. +/// +/// This is a copy of the function in `build.rs`. +/// +/// [Environment variables Cargo sets for 3rd party subcommands](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-3rd-party-subcommands) +fn cargo_version() -> Option { + let cargo = std::env::var_os("CARGO").expect("`CARGO` env var wasn't set!"); + let output = std::process::Command::new(cargo).arg("--version").output().ok()?; + std::str::from_utf8(&output.stdout).map(|s| s.trim().to_string()).ok() } -/// Returns an error if the Rust minor version at build time doesn't match the -/// one at runtime. +/// Returns an error if the rust toolchain version used to build `cargo-pgrx` +/// doesn't match the active toolchain's version. /// /// This is an error because we `dlopen` rust code that we build, and call /// `extern "Rust"` functions on `#[repr(Rust)]` types. This may be relaxed in /// the future, but for now is a requirement. /// -/// To waive this, you may set `PGRX_IGNORE_RUST_VERSIONS` in the environment (to -/// any value other than `"0"`). Also, note that this check is best-effort only, -/// and is expected to error only if there is a definite mismatch. +/// To waive this, you may set `PGRX_IGNORE_RUST_VERSIONS` in the environment +/// (to any value other than `"0"`). Also, note that this check is best-effort +/// only, and is expected to error only if there is a definite mismatch. /// /// It also cannot detect versions of `cargo-pgrx` and `pgrx` differing, which /// could cause similar issues (in the future this may be detected). fn check_rust_version() -> eyre::Result<()> { - const COMPILE_TIME_MINOR_VERSION: Option<&str> = option_env!("MINOR_RUST_VERSION"); + const CARGO_VERSION_DURING_BUILD: &str = env!("CARGO_VERSION_DURING_BUILD"); if matches!(std::env::var("PGRX_IGNORE_RUST_VERSIONS"), Ok(s) if s != "0") { return Ok(()); } - let parsed = COMPILE_TIME_MINOR_VERSION.and_then(|s| s.trim().parse::().ok()); - if let (Some(from_env), Some(run_locally)) = (parsed, rust_minor_version()) { - if from_env != run_locally { + if let (Some(during_build), Some(during_run)) = + (Some(CARGO_VERSION_DURING_BUILD), cargo_version()) + { + if during_build != during_run { eyre::bail!( - "Mismatched rust versions: `cargo-pgrx` was built with Rust `1.{from_env}`, but \ - Rust `1.{run_locally}` is currently in use.", + "Mismatched toolchain versions: \ + `cargo-pgrx` was built with `{during_build}`, \ + but `{during_run}` is currently in use. \ + Set `PGRX_IGNORE_RUST_VERSIONS=1` to override this safety check.", ); } } From 4fce3b9c5072fc924083c209d9cd55e457b60407 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:40:41 -0800 Subject: [PATCH 12/23] Remove unused attrs on `Pg_magic_func` (#1460) - `allow(unused)` is redundant with `pub` - `link_name` is redundant with `no_mangle` --- pgrx/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pgrx/src/lib.rs b/pgrx/src/lib.rs index c9f432267..72a5c7453 100644 --- a/pgrx/src/lib.rs +++ b/pgrx/src/lib.rs @@ -214,8 +214,6 @@ macro_rules! pg_magic_func { () => { #[no_mangle] #[allow(non_snake_case)] - #[allow(unused)] - #[link_name = "Pg_magic_func"] #[doc(hidden)] pub extern "C" fn Pg_magic_func() -> &'static pgrx::pg_sys::Pg_magic_struct { use core::mem::size_of; From e0a237049bd2c9d6e30df504051cdab4889a65c3 Mon Sep 17 00:00:00 2001 From: Usamoi Date: Tue, 9 Jan 2024 06:48:16 +0800 Subject: [PATCH 13/23] fix undefined behaviour when loading control file (#1466) pgcentralfoundation/pgrx#911 introduced using the wrong signature and this UB was missed in review amidst the thousands of lines of changes. Signed-off-by: usamoi --- cargo-pgrx/src/command/schema.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cargo-pgrx/src/command/schema.rs b/cargo-pgrx/src/command/schema.rs index b3bf719b6..e086f76a2 100644 --- a/cargo-pgrx/src/command/schema.rs +++ b/cargo-pgrx/src/command/schema.rs @@ -404,12 +404,12 @@ pub(crate) fn generate_schema( .wrap_err_with(|| format!("Couldn't libload {}", lib_so.display()))?; let symbol: libloading::os::unix::Symbol< - unsafe extern "Rust" fn() -> eyre::Result, + unsafe extern "Rust" fn(_: ()) -> pgrx_sql_entity_graph::ControlFile, > = lib .get("__pgrx_marker".as_bytes()) .expect("Couldn't call __pgrx_marker"); let control_file_entity = pgrx_sql_entity_graph::SqlGraphEntity::ExtensionRoot( - symbol().expect("Failed to get control file information"), + symbol(()), ); entities.push(control_file_entity); From 8ada4a39c569692f616e10799ff0c74974660d4e Mon Sep 17 00:00:00 2001 From: Collin Kokotas Date: Tue, 9 Jan 2024 12:08:31 -0800 Subject: [PATCH 14/23] Allow `detail` argument and trailing commas in `ereport!` (#1472) I use `ereport!` because I like to include a `detail` entry but it comes with some inconveniences. When I would write the following snippet in my `Err` match arms, the compiler would complain about mismatch type output from the match arms thus requiring the inclusion of `unreachable!` ```rust pgrx::ereport!( PgLogLevel::ERROR, PgSqlErrorCode::ERRCODE_INTERNAL_ERROR, format!("{} failed", stringify!(snowflake_pool_stats)), err.to_string() ); // necessary to satisfy the compiler unreachable!() ``` After looking at the macro src for `ereport!` I realized why I started writing `PgLogLevel::ERROR` rather than simply `ERROR`: the `ERROR` case didn't support a `detail` argument so let's add that. --- pgrx-pg-sys/src/submodules/elog.rs | 45 +++++++++++++++++------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/pgrx-pg-sys/src/submodules/elog.rs b/pgrx-pg-sys/src/submodules/elog.rs index 8caa0c052..31ec64608 100644 --- a/pgrx-pg-sys/src/submodules/elog.rs +++ b/pgrx-pg-sys/src/submodules/elog.rs @@ -336,77 +336,84 @@ macro_rules! function_name { /// ``` #[macro_export] macro_rules! ereport { - (ERROR, $errcode:expr, $message:expr) => { + (ERROR, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::ERROR); unreachable!(); }; - (PANIC, $errcode:expr, $message:expr) => { + (PANIC, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::PANIC); unreachable!(); }; - (FATAL, $errcode:expr, $message:expr) => { + (FATAL, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::FATAL); unreachable!(); }; - (WARNING, $errcode:expr, $message:expr) => { + (WARNING, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::WARNING) }; - (NOTICE, $errcode:expr, $message:expr) => { + (NOTICE, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::NOTICE) }; - (INFO, $errcode:expr, $message:expr) => { + (INFO, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::INFO) }; - (LOG, $errcode:expr, $message:expr) => { + (LOG, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::LOG) }; - (DEBUG5, $errcode:expr, $message:expr) => { + (DEBUG5, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::DEBUG5) }; - (DEBUG4, $errcode:expr, $message:expr) => { + (DEBUG4, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::DEBUG4) }; - (DEBUG3, $errcode:expr, $message:expr) => { + (DEBUG3, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::DEBUG3) }; - (DEBUG2, $errcode:expr, $message:expr) => { + (DEBUG2, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::DEBUG2) }; - (DEBUG1, $errcode:expr, $message:expr) => { + (DEBUG1, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) + $(.set_detail($detail))? .report($crate::elog::PgLogLevel::DEBUG1) }; - ($loglevel:expr, $errcode:expr, $message:expr) => { + ($loglevel:expr, $errcode:expr, $message:expr $(, $detail:expr)? $(,)?) => { $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) - .report($loglevel); - }; - - ($loglevel:expr, $errcode:expr, $message:expr, $detail:expr) => { - $crate::panic::ErrorReport::new($errcode, $message, $crate::function_name!()) - .set_detail($detail) + $(.set_detail($detail))? .report($loglevel); }; } From cabfe028119f09246772f44d0f80bb3aba55773a Mon Sep 17 00:00:00 2001 From: Ming Date: Wed, 24 Jan 2024 15:51:15 -0500 Subject: [PATCH 15/23] Add bindings for "access/multixact.h" (#1486) Adds header files for multixact.h and its dependencies. --- pgrx-pg-sys/include/pg12.h | 4 ++++ pgrx-pg-sys/include/pg13.h | 4 ++++ pgrx-pg-sys/include/pg14.h | 4 ++++ pgrx-pg-sys/include/pg15.h | 4 ++++ pgrx-pg-sys/include/pg16.h | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index fd2fff44b..323eb3bac 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -23,6 +23,7 @@ #include "access/heapam.h" #include "access/htup.h" #include "access/htup_details.h" +#include "access/multixact.h" #include "access/relation.h" #include "access/reloptions.h" #include "access/relscan.h" @@ -30,6 +31,7 @@ #include "access/sysattr.h" #include "access/tableam.h" #include "access/xact.h" +#include "access/xlogreader.h" #include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/indexing.h" @@ -76,6 +78,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" @@ -126,6 +129,7 @@ #include "storage/relfilenode.h" #include "storage/smgr.h" #include "storage/spin.h" +#include "storage/sync.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "tsearch/ts_public.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 1105b9318..9dc0fbf84 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -23,6 +23,7 @@ #include "access/heapam.h" #include "access/htup.h" #include "access/htup_details.h" +#include "access/multixact.h" #include "access/relation.h" #include "access/reloptions.h" #include "access/relscan.h" @@ -30,6 +31,7 @@ #include "access/sysattr.h" #include "access/table.h" #include "access/xact.h" +#include "access/xlogreader.h" #include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/indexing.h" @@ -76,6 +78,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" @@ -126,6 +129,7 @@ #include "storage/relfilenode.h" #include "storage/smgr.h" #include "storage/spin.h" +#include "storage/sync.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "tsearch/ts_public.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index ddc680dfe..699a223c5 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -23,6 +23,7 @@ #include "access/heapam.h" #include "access/htup.h" #include "access/htup_details.h" +#include "access/multixact.h" #include "access/relation.h" #include "access/reloptions.h" #include "access/relscan.h" @@ -30,6 +31,7 @@ #include "access/sysattr.h" #include "access/table.h" #include "access/xact.h" +#include "access/xlogreader.h" #include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/indexing.h" @@ -76,6 +78,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" @@ -126,6 +129,7 @@ #include "storage/relfilenode.h" #include "storage/smgr.h" #include "storage/spin.h" +#include "storage/sync.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "tsearch/ts_public.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 316ffa9cd..6d16a20ff 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -23,6 +23,7 @@ #include "access/heapam.h" #include "access/htup.h" #include "access/htup_details.h" +#include "access/multixact.h" #include "access/relation.h" #include "access/reloptions.h" #include "access/relscan.h" @@ -30,6 +31,7 @@ #include "access/sysattr.h" #include "access/table.h" #include "access/xact.h" +#include "access/xlogreader.h" #include "access/xlogrecovery.h" #include "catalog/dependency.h" #include "catalog/index.h" @@ -77,6 +79,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" @@ -127,6 +130,7 @@ #include "storage/relfilenode.h" #include "storage/smgr.h" #include "storage/spin.h" +#include "storage/sync.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "tsearch/ts_public.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index ee5ba3b2b..120cea837 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -23,6 +23,7 @@ #include "access/heapam.h" #include "access/htup.h" #include "access/htup_details.h" +#include "access/multixact.h" #include "access/relation.h" #include "access/reloptions.h" #include "access/relscan.h" @@ -30,6 +31,7 @@ #include "access/sysattr.h" #include "access/table.h" #include "access/xact.h" +#include "access/xlogreader.h" #include "access/xlogrecovery.h" #include "catalog/dependency.h" #include "catalog/index.h" @@ -77,6 +79,7 @@ #include "executor/tuptable.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" +#include "lib/stringinfo.h" #include "libpq/pqformat.h" #include "mb/pg_wchar.h" #include "nodes/execnodes.h" @@ -127,6 +130,7 @@ #include "storage/relfilelocator.h" #include "storage/smgr.h" #include "storage/spin.h" +#include "storage/sync.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "tsearch/ts_public.h" From 892f0f3d7dfe43ac0264e581aa5aebecba68aec6 Mon Sep 17 00:00:00 2001 From: damien clochard Date: Thu, 25 Jan 2024 00:14:02 +0100 Subject: [PATCH 16/23] Include varlena functions (#1485) There's already a pgrx::varlena module but utils/varlena.h adds functions to manipulate GUC variables and identifiers. Includes utils/sortsupport.h as a transitive inclusion, along with varatt.h which is already transitively included. --- pgrx-pg-sys/include/pg12.h | 2 ++ pgrx-pg-sys/include/pg13.h | 2 ++ pgrx-pg-sys/include/pg14.h | 2 ++ pgrx-pg-sys/include/pg15.h | 2 ++ pgrx-pg-sys/include/pg16.h | 3 +++ 5 files changed, 11 insertions(+) diff --git a/pgrx-pg-sys/include/pg12.h b/pgrx-pg-sys/include/pg12.h index 323eb3bac..08a482c61 100644 --- a/pgrx-pg-sys/include/pg12.h +++ b/pgrx-pg-sys/include/pg12.h @@ -158,7 +158,9 @@ #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/sortsupport.h" #include "utils/catcache.h" #include "utils/syscache.h" #include "utils/typcache.h" #include "utils/rangetypes.h" +#include "utils/varlena.h" diff --git a/pgrx-pg-sys/include/pg13.h b/pgrx-pg-sys/include/pg13.h index 9dc0fbf84..cf40fa4af 100644 --- a/pgrx-pg-sys/include/pg13.h +++ b/pgrx-pg-sys/include/pg13.h @@ -155,7 +155,9 @@ #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/sortsupport.h" #include "utils/catcache.h" #include "utils/syscache.h" #include "utils/typcache.h" #include "utils/rangetypes.h" +#include "utils/varlena.h" diff --git a/pgrx-pg-sys/include/pg14.h b/pgrx-pg-sys/include/pg14.h index 699a223c5..a816ad148 100644 --- a/pgrx-pg-sys/include/pg14.h +++ b/pgrx-pg-sys/include/pg14.h @@ -155,7 +155,9 @@ #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/sortsupport.h" #include "utils/catcache.h" #include "utils/syscache.h" #include "utils/typcache.h" #include "utils/rangetypes.h" +#include "utils/varlena.h" diff --git a/pgrx-pg-sys/include/pg15.h b/pgrx-pg-sys/include/pg15.h index 6d16a20ff..7a2db3474 100644 --- a/pgrx-pg-sys/include/pg15.h +++ b/pgrx-pg-sys/include/pg15.h @@ -156,7 +156,9 @@ #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/sortsupport.h" #include "utils/catcache.h" #include "utils/syscache.h" #include "utils/typcache.h" #include "utils/rangetypes.h" +#include "utils/varlena.h" diff --git a/pgrx-pg-sys/include/pg16.h b/pgrx-pg-sys/include/pg16.h index 120cea837..bf5a97278 100644 --- a/pgrx-pg-sys/include/pg16.h +++ b/pgrx-pg-sys/include/pg16.h @@ -14,6 +14,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "pgstat.h" +#include "varatt.h" #include "access/amapi.h" #include "access/genam.h" @@ -156,7 +157,9 @@ #include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/sortsupport.h" #include "utils/catcache.h" #include "utils/syscache.h" #include "utils/typcache.h" #include "utils/rangetypes.h" +#include "utils/varlena.h" From 3a8960ac52cfae0afb021e74910dbb742f054cfe Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:17:56 -0800 Subject: [PATCH 17/23] Use bindgen 0.69 (#1492) Nice. --- Cargo.lock | 4 ++-- pgrx-pg-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 180789d81..f7222ff81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.68.1" +version = "0.69.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d" dependencies = [ "bitflags 2.4.1", "cexpr", diff --git a/pgrx-pg-sys/Cargo.toml b/pgrx-pg-sys/Cargo.toml index 6a7194658..d82ea37a8 100644 --- a/pgrx-pg-sys/Cargo.toml +++ b/pgrx-pg-sys/Cargo.toml @@ -48,7 +48,7 @@ sptr = "0.3" libc = "0.2" [build-dependencies] -bindgen = { version = "0.68.1", default-features = false, features = ["runtime"] } +bindgen = { version = "0.69", default-features = false, features = ["runtime"] } clang-sys = { version = "1", features = ["clang_6_0", "runtime"] } pgrx-pg-config= { path = "../pgrx-pg-config/", version = "=0.11.2" } proc-macro2 = "1.0.69" From 561df5e72db5088b67689c34ebaf3d36ed23fd2c Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:18:56 -0800 Subject: [PATCH 18/23] Document CPU and OS support expectations (#1480) This documents our current state of support, and adds a note for people hoping for 32-bit support: it unfortunately would not be cheap, neither in terms of the incurred technical debt, nor in terms of running the additional build and test infra to test on 32-bit CPUs, which is not something GitHub Actions helps with. --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6250242e..59f403385 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,10 @@ ## System Requirements +PGRX has been tested to work on x86_64⹋ and aarch64⹋ Linux and aarch64 macOS targets. +It is currently expected to work on other "Unix" OS with possible small changes, but +those remain untested. So far, some of PGRX's build tooling works on Windows, but not all. + - A Rust toolchain: `rustc`, `cargo`, and `rustfmt`. The recommended way to get these is from https://rustup.rs † - `git` - `libclang` 5.0 or greater (required by bindgen) @@ -80,9 +84,19 @@ ‡ A local PostgreSQL server installation is not required. `cargo pgrx` can download and compile PostgreSQL versions on its own. + ⹋ PGRX has not been tested to work on 32-bit: the library assumes an 8-byte `pg_sys::Datum` +which may result in unexpected behavior on 32-bit, like dropping 4 bytes of data from `int8` +and `double`. This may not be "unsound" in itself, as it is "merely" illogical, +but it may undermine otherwise-reasonable safety assumptions of PGRX extensions. +We do not plan to add support without considerable ongoing technical and financial contributions. +
How to: GCC 7 on CentOS 7 - + +It is not recommended to use CentOS 7 for PGRX development, even if it works. + +Recommended Linux distributions include recent Debian, Fedora, and Ubuntu. + In order to use GCC 7, install [`scl`](https://wiki.centos.org/AdditionalResources/Repositories/SCL) and enter the GCC 7 development environment: ```bash From 867a0444490266ce8638a2698aa63f4142d8acb0 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:27:57 -0800 Subject: [PATCH 19/23] Bump shlex 1.3 to reduce escaping concerns (#1493) --- Cargo.lock | 4 ++-- pgrx-pg-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7222ff81..3a2e2f808 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2289,9 +2289,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "shmem" diff --git a/pgrx-pg-sys/Cargo.toml b/pgrx-pg-sys/Cargo.toml index d82ea37a8..021e4f40c 100644 --- a/pgrx-pg-sys/Cargo.toml +++ b/pgrx-pg-sys/Cargo.toml @@ -55,6 +55,6 @@ proc-macro2 = "1.0.69" quote = "1.0.33" syn = { version = "1.0.109", features = [ "extra-traits", "full", "fold", "parsing" ] } eyre = "0.6.8" -shlex = "1.2.0" # shell lexing, also used by many of our deps +shlex = "1.3" # shell lexing, also used by many of our deps once_cell = "1.18.0" walkdir = "2" From 1188a906c8c20c422b64b5b58f67770bebd6ac32 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:10:21 -0800 Subject: [PATCH 20/23] Remove atty (#1494) Tweaking owo-color features required due to transitive deps. Addresses a Windows-only, deeply hypothetical security alert for atty. --- Cargo.lock | 43 +-------------------------- cargo-pgrx/Cargo.toml | 3 +- cargo-pgrx/src/main.rs | 7 +++-- pgrx-pg-config/Cargo.toml | 2 +- pgrx-sql-entity-graph/Cargo.toml | 5 ++-- pgrx-sql-entity-graph/src/pgrx_sql.rs | 3 +- pgrx-tests/Cargo.toml | 2 +- pgrx-version-updater/Cargo.toml | 2 +- 8 files changed, 13 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a2e2f808..0649cb297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,17 +147,6 @@ dependencies = [ "rustc_version 0.3.3", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -329,7 +318,6 @@ dependencies = [ name = "cargo-pgrx" version = "0.11.2" dependencies = [ - "atty", "cargo_metadata", "cargo_toml", "clap", @@ -1013,15 +1001,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.3" @@ -1063,12 +1042,6 @@ dependencies = [ "hashbrown 0.14.3", ] -[[package]] -name = "is_ci" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" - [[package]] name = "itoa" version = "1.0.9" @@ -1349,7 +1322,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "libc", ] @@ -1449,9 +1422,6 @@ name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -dependencies = [ - "supports-color", -] [[package]] name = "parking_lot" @@ -1595,7 +1565,6 @@ dependencies = [ name = "pgrx-sql-entity-graph" version = "0.11.2" dependencies = [ - "atty", "convert_case", "eyre", "owo-colors", @@ -2417,16 +2386,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "supports-color" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" -dependencies = [ - "atty", - "is_ci", -] - [[package]] name = "syn" version = "1.0.109" diff --git a/cargo-pgrx/Cargo.toml b/cargo-pgrx/Cargo.toml index d46d7ae44..eb66faacc 100644 --- a/cargo-pgrx/Cargo.toml +++ b/cargo-pgrx/Cargo.toml @@ -24,13 +24,12 @@ exclude = [ "*.png" ] edition = "2021" [dependencies] -atty = "0.2.14" cargo_metadata = "0.17.0" cargo_toml = "0.16.3" clap = { version = "4.4.2", features = [ "env", "suggestions", "cargo", "derive", "wrap_help" ] } clap-cargo = { version = "0.11.0", features = [ "cargo_metadata" ] } semver = "1.0.20" -owo-colors = { version = "3.5.0", features = [ "supports-colors" ] } +owo-colors = { version = "3.5" } env_proxy = "0.4.1" num_cpus = "1.16.0" pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.2" } diff --git a/cargo-pgrx/src/main.rs b/cargo-pgrx/src/main.rs index ca0e095eb..511abf210 100644 --- a/cargo-pgrx/src/main.rs +++ b/cargo-pgrx/src/main.rs @@ -18,8 +18,8 @@ mod pgrx_pg_sys_stub; pub(crate) mod env; pub(crate) mod profile; -use atty::Stream; use clap::Parser; +use std::io::{self, IsTerminal}; use tracing_error::ErrorLayer; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; @@ -61,9 +61,10 @@ impl CommandExecute for CargoSubcommands { } fn main() -> color_eyre::Result<()> { + let stderr_is_tty = io::stderr().is_terminal(); env::initialize(); color_eyre::config::HookBuilder::default() - .theme(if !atty::is(Stream::Stderr) { + .theme(if stderr_is_tty { color_eyre::config::Theme::new() } else { color_eyre::config::Theme::default() @@ -74,7 +75,7 @@ fn main() -> color_eyre::Result<()> { // Initialize tracing with tracing-error, and eyre let fmt_layer = tracing_subscriber::fmt::Layer::new() - .with_ansi(atty::is(Stream::Stderr)) + .with_ansi(stderr_is_tty) .with_writer(std::io::stderr) .pretty(); diff --git a/pgrx-pg-config/Cargo.toml b/pgrx-pg-config/Cargo.toml index e7fc75b38..f13f1d4e4 100644 --- a/pgrx-pg-config/Cargo.toml +++ b/pgrx-pg-config/Cargo.toml @@ -26,7 +26,7 @@ edition = "2021" dirs = "5.0.1" eyre = "0.6.8" pathsearch = "0.2.0" -owo-colors = "3.5.0" +owo-colors = "3.5" serde = { version = "1.0", features = [ "derive" ] } serde_derive = "1.0" serde_json = "1.0" diff --git a/pgrx-sql-entity-graph/Cargo.toml b/pgrx-sql-entity-graph/Cargo.toml index def0b7051..bdd5a2c2b 100644 --- a/pgrx-sql-entity-graph/Cargo.toml +++ b/pgrx-sql-entity-graph/Cargo.toml @@ -21,7 +21,7 @@ readme = "README.md" edition = "2021" [features] -syntax-highlighting = ["dep:syntect", "dep:owo-colors", "dep:atty"] +syntax-highlighting = ["dep:syntect", "dep:owo-colors"] no-schema-generation = [] [dependencies] @@ -34,6 +34,5 @@ syn = { version = "1.0.109", features = [ "extra-traits", "full", "fold", "parsi unescape = "0.1.0" # colorized sql output -atty = { version = "0.2.14", optional = true } -owo-colors = { version = "3.5.0", optional = true } +owo-colors = { version = "3.5", optional = true } syntect = { version = "5.1.0", default-features = false, features = ["default-fancy"], optional = true } diff --git a/pgrx-sql-entity-graph/src/pgrx_sql.rs b/pgrx-sql-entity-graph/src/pgrx_sql.rs index 6e32fe307..dc41df706 100644 --- a/pgrx-sql-entity-graph/src/pgrx_sql.rs +++ b/pgrx-sql-entity-graph/src/pgrx_sql.rs @@ -270,7 +270,8 @@ impl PgrxSql { #[cfg(feature = "syntax-highlighting")] { - if atty::is(atty::Stream::Stdout) { + use std::io::{stdout, IsTerminal}; + if stdout().is_terminal() { self.write_highlighted(out, &generated)?; } else { write!(*out, "{}", generated)?; diff --git a/pgrx-tests/Cargo.toml b/pgrx-tests/Cargo.toml index e658bd1af..af4d7d53c 100644 --- a/pgrx-tests/Cargo.toml +++ b/pgrx-tests/Cargo.toml @@ -46,7 +46,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] clap-cargo = "0.11.0" -owo-colors = "3.5.0" +owo-colors = "3.5" once_cell = "1.18.0" libc = "0.2.149" pgrx-macros = { path = "../pgrx-macros", version = "=0.11.2" } diff --git a/pgrx-version-updater/Cargo.toml b/pgrx-version-updater/Cargo.toml index 484152c88..8f969cfeb 100644 --- a/pgrx-version-updater/Cargo.toml +++ b/pgrx-version-updater/Cargo.toml @@ -18,6 +18,6 @@ description = "Standalone tool to update PGRX Cargo.toml versions and dependenci [dependencies] clap = { version = "4.4.2", features = [ "env", "derive" ] } -owo-colors = "3.5.0" +owo-colors = "3.5" toml_edit = { version = "0.20.2" } walkdir = "2" From 81c3772cf1041dd2b9287e108ce9aa92e415462d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 24 Jan 2024 17:20:28 -0800 Subject: [PATCH 21/23] Remove busted Will-It-Blend pg11 CI --- .github/workflows/will-it-blend-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/will-it-blend-develop.yml b/.github/workflows/will-it-blend-develop.yml index 967b428a0..8366af264 100644 --- a/.github/workflows/will-it-blend-develop.yml +++ b/.github/workflows/will-it-blend-develop.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false # We want all of them to run, even if one fails matrix: - pg_version: ["pg11", "pg12", "pg13", "pg14", "pg15"] + pg_version: ["pg12", "pg13", "pg14", "pg15"] container: ["fedora", "debian:bullseye", "alpine:3.18", "amazon:2"] steps: - uses: actions/checkout@v3 From 544e3ba706ced33f2a2a77b2ad4fdb4bddeeff21 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Tue, 24 Oct 2023 17:38:05 -0700 Subject: [PATCH 22/23] install --sudo destination path must exist to be canonicalized (#1352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `fs::canonicalize` calls `realpath` which requires the dest path to exist. It doesn't when installing the extension for the first time (and a new version of the extension for subsequent times). So...best we can [1] do is trust that @eeeebbbbrrrr 's canonicalization works. 🚀 [1]: https://stackoverflow.com/questions/68231306/stdfscanonicalize-for-files-that-dont-exist --- cargo-pgrx/src/command/sudo_install.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cargo-pgrx/src/command/sudo_install.rs b/cargo-pgrx/src/command/sudo_install.rs index f15ffb311..8f20dd791 100644 --- a/cargo-pgrx/src/command/sudo_install.rs +++ b/cargo-pgrx/src/command/sudo_install.rs @@ -69,7 +69,11 @@ impl CommandExecute for SudoInstall { eprintln!("Using sudo to copy extension files from {}", outdir.display().cyan()); for src in output_files { let src = src.canonicalize()?; - let dest = make_absolute(src.strip_prefix(&outdir)?).canonicalize()?; + let dest_abs = make_absolute(src.strip_prefix(&outdir)?); + let dest = match dest_abs.canonicalize() { + Ok(path) => path, + Err(_) => dest_abs, + }; // we're about to run `sudo` to copy some files, one at a time let mut command = Command::new("sudo"); // NB: If we ever support Windows... From c1bcf74ecaeea0248c1eed3b9d91c9df4ae40c7d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 24 Jan 2024 17:16:44 -0800 Subject: [PATCH 23/23] Prepare pgrx 0.11.3 --- Cargo.lock | 431 +++++++++++++-------------- cargo-pgrx/Cargo.toml | 6 +- cargo-pgrx/src/templates/cargo_toml | 4 +- nix/templates/default/Cargo.toml | 4 +- pgrx-macros/Cargo.toml | 4 +- pgrx-pg-config/Cargo.toml | 2 +- pgrx-pg-sys/Cargo.toml | 8 +- pgrx-pg-sys/src/include/pg12.rs | 299 +++++++++++++++++++ pgrx-pg-sys/src/include/pg12_oids.rs | 2 + pgrx-pg-sys/src/include/pg13.rs | 302 +++++++++++++++++++ pgrx-pg-sys/src/include/pg13_oids.rs | 2 + pgrx-pg-sys/src/include/pg14.rs | 378 ++++++++++++++++++++--- pgrx-pg-sys/src/include/pg14_oids.rs | 2 + pgrx-pg-sys/src/include/pg15.rs | 377 ++++++++++++++++++++--- pgrx-pg-sys/src/include/pg15_oids.rs | 2 + pgrx-pg-sys/src/include/pg16.rs | 380 ++++++++++++++++++++--- pgrx-pg-sys/src/include/pg16_oids.rs | 2 + pgrx-sql-entity-graph/Cargo.toml | 2 +- pgrx-tests/Cargo.toml | 8 +- pgrx/Cargo.toml | 8 +- 20 files changed, 1853 insertions(+), 370 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0649cb297..5ab33c5d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "once_cell", @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arrays" @@ -119,13 +119,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -180,15 +180,15 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "basic-toml" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" dependencies = [ "serde", ] @@ -216,7 +216,7 @@ version = "0.69.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -227,7 +227,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -253,9 +253,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "cargo-pgrx" -version = "0.11.2" +version = "0.11.3" dependencies = [ "cargo_metadata", "cargo_toml", @@ -327,7 +327,7 @@ dependencies = [ "eyre", "flate2", "fork", - "libloading 0.8.1", + "libloading", "nix", "num_cpus", "object", @@ -340,11 +340,11 @@ dependencies = [ "quote", "rayon", "regex", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde-xml-rs", "serde_derive", - "syn 2.0.39", + "syn 2.0.48", "tempfile", "tracing", "tracing-error", @@ -356,9 +356,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -371,7 +371,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -413,20 +413,20 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading", ] [[package]] name = "clap" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -445,9 +445,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -465,7 +465,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -552,9 +552,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -576,36 +576,28 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -661,13 +653,24 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.10.7" @@ -729,7 +732,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -768,9 +771,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f656be11ddf91bd709454d15d5bd896fbaf4cc3314e69349e4d1569f5b46cd" +checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" dependencies = [ "indenter", "once_cell", @@ -867,9 +870,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -877,38 +880,38 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-macro", @@ -931,9 +934,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -1003,9 +1006,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hmac" @@ -1044,15 +1047,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1071,9 +1074,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libflate" @@ -1099,16 +1102,6 @@ dependencies = [ "rle-decode-fast", ] -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.1" @@ -1131,7 +1124,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] @@ -1153,9 +1146,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -1200,9 +1193,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -1230,9 +1223,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1263,7 +1256,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -1337,9 +1330,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "flate2", "memchr", @@ -1348,17 +1341,17 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -1375,7 +1368,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1386,9 +1379,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1470,9 +1463,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -1491,10 +1484,10 @@ dependencies = [ [[package]] name = "pgrx" -version = "0.11.2" +version = "0.11.3" dependencies = [ "atomic-traits", - "bitflags 2.4.1", + "bitflags 2.4.2", "bitvec", "enum-map", "heapless", @@ -1514,7 +1507,7 @@ dependencies = [ [[package]] name = "pgrx-macros" -version = "0.11.2" +version = "0.11.3" dependencies = [ "pgrx-sql-entity-graph", "proc-macro2", @@ -1525,7 +1518,7 @@ dependencies = [ [[package]] name = "pgrx-pg-config" -version = "0.11.2" +version = "0.11.3" dependencies = [ "cargo_toml", "dirs", @@ -1541,7 +1534,7 @@ dependencies = [ [[package]] name = "pgrx-pg-sys" -version = "0.11.2" +version = "0.11.3" dependencies = [ "bindgen", "clang-sys", @@ -1563,7 +1556,7 @@ dependencies = [ [[package]] name = "pgrx-sql-entity-graph" -version = "0.11.2" +version = "0.11.3" dependencies = [ "convert_case", "eyre", @@ -1578,7 +1571,7 @@ dependencies = [ [[package]] name = "pgrx-tests" -version = "0.11.2" +version = "0.11.3" dependencies = [ "clap-cargo", "eyre", @@ -1649,9 +1642,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plist" @@ -1724,19 +1717,19 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1749,7 +1742,7 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.1", + "bitflags 2.4.2", "lazy_static", "num-traits", "rand", @@ -1778,9 +1771,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1840,9 +1833,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -1850,9 +1843,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -1880,13 +1873,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -1901,9 +1894,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -1930,9 +1923,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -1975,16 +1968,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.21", ] [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -1993,9 +1986,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2048,20 +2041,20 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", - "thiserror-core", + "derive_more", "twox-hash", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safemem" @@ -2080,11 +2073,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2152,9 +2145,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -2176,9 +2169,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -2207,20 +2200,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -2229,9 +2222,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2289,9 +2282,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" @@ -2399,9 +2392,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2452,22 +2445,22 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -2484,42 +2477,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] -[[package]] -name = "thiserror-core" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" -dependencies = [ - "thiserror-core-impl", -] - -[[package]] -name = "thiserror-core-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2534,9 +2507,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -2554,9 +2527,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -2578,9 +2551,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -2695,7 +2668,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2758,9 +2731,9 @@ dependencies = [ [[package]] name = "trybuild" -version = "1.0.85" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196a58260a906cedb9bf6d8034b6379d0c11f552416960452f267402ceeddff1" +checksum = "9a9d3ba662913483d6722303f619e75ea10b7855b0f8e0d72799cf8621bb488f" dependencies = [ "basic-toml", "glob", @@ -2807,9 +2780,9 @@ checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2875,9 +2848,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", ] @@ -2943,9 +2916,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2953,24 +2926,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2978,28 +2951,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -3186,9 +3159,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.24" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0383266b19108dfc6314a56047aa545a1b4d1be60e799b4dbdd407b56402704b" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -3219,20 +3192,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.29" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.29" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] diff --git a/cargo-pgrx/Cargo.toml b/cargo-pgrx/Cargo.toml index eb66faacc..f3a6fb553 100644 --- a/cargo-pgrx/Cargo.toml +++ b/cargo-pgrx/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "cargo-pgrx" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Cargo subcommand for 'pgrx' to make Postgres extension development easy" @@ -32,8 +32,8 @@ semver = "1.0.20" owo-colors = { version = "3.5" } env_proxy = "0.4.1" num_cpus = "1.16.0" -pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.2" } -pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.2" } +pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.3" } +pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.3" } prettyplease = "0.2.15" proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } quote = "1.0.33" diff --git a/cargo-pgrx/src/templates/cargo_toml b/cargo-pgrx/src/templates/cargo_toml index a0f9a64ca..95850992e 100644 --- a/cargo-pgrx/src/templates/cargo_toml +++ b/cargo-pgrx/src/templates/cargo_toml @@ -17,10 +17,10 @@ pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ] pg_test = [] [dependencies] -pgrx = "=0.11.2" +pgrx = "=0.11.3" [dev-dependencies] -pgrx-tests = "=0.11.2" +pgrx-tests = "=0.11.3" [profile.dev] panic = "unwind" diff --git a/nix/templates/default/Cargo.toml b/nix/templates/default/Cargo.toml index 06a61ae62..d8bce37cb 100644 --- a/nix/templates/default/Cargo.toml +++ b/nix/templates/default/Cargo.toml @@ -27,10 +27,10 @@ pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ] pg_test = [] [dependencies] -pgrx = "=0.11.2" +pgrx = "=0.11.3" [dev-dependencies] -pgrx-tests = "=0.11.2" +pgrx-tests = "=0.11.3" tempfile = "3.2.0" once_cell = "1.7.2" diff --git a/pgrx-macros/Cargo.toml b/pgrx-macros/Cargo.toml index 2eb617c82..9d6942de7 100644 --- a/pgrx-macros/Cargo.toml +++ b/pgrx-macros/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx-macros" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Proc Macros for 'pgrx'" @@ -31,7 +31,7 @@ rustc-args = ["--cfg", "docsrs"] no-schema-generation = ["pgrx-sql-entity-graph/no-schema-generation"] [dependencies] -pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.2" } +pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.3" } proc-macro2 = "1.0.69" quote = "1.0.33" syn = { version = "1.0.109", features = [ "extra-traits", "full", "fold", "parsing" ] } diff --git a/pgrx-pg-config/Cargo.toml b/pgrx-pg-config/Cargo.toml index f13f1d4e4..f16b452bb 100644 --- a/pgrx-pg-config/Cargo.toml +++ b/pgrx-pg-config/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx-pg-config" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "A Postgres pg_config wrapper for 'pgrx'" diff --git a/pgrx-pg-sys/Cargo.toml b/pgrx-pg-sys/Cargo.toml index 021e4f40c..55f09a2f0 100644 --- a/pgrx-pg-sys/Cargo.toml +++ b/pgrx-pg-sys/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx-pg-sys" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Generated Rust bindings for Postgres internals, for use with 'pgrx'" @@ -40,8 +40,8 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] memoffset = "0.9.0" -pgrx-macros = { path = "../pgrx-macros/", version = "=0.11.2" } -pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph/", version = "=0.11.2" } +pgrx-macros = { path = "../pgrx-macros/", version = "=0.11.3" } +pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph/", version = "=0.11.3" } serde = { version = "1.0", features = [ "derive" ] } # impls on pub types # polyfill until #![feature(strict_provenance)] stabilizes sptr = "0.3" @@ -50,7 +50,7 @@ libc = "0.2" [build-dependencies] bindgen = { version = "0.69", default-features = false, features = ["runtime"] } clang-sys = { version = "1", features = ["clang_6_0", "runtime"] } -pgrx-pg-config= { path = "../pgrx-pg-config/", version = "=0.11.2" } +pgrx-pg-config= { path = "../pgrx-pg-config/", version = "=0.11.3" } proc-macro2 = "1.0.69" quote = "1.0.33" syn = { version = "1.0.109", features = [ "extra-traits", "full", "fold", "parsing" ] } diff --git a/pgrx-pg-sys/src/include/pg12.rs b/pgrx-pg-sys/src/include/pg12.rs index 2fe2e300e..7a3461950 100644 --- a/pgrx-pg-sys/src/include/pg12.rs +++ b/pgrx-pg-sys/src/include/pg12.rs @@ -2258,6 +2258,12 @@ pub const HEAP_INSERT_SKIP_FSM: u32 = 2; pub const HEAP_INSERT_FROZEN: u32 = 4; pub const HEAP_INSERT_NO_LOGICAL: u32 = 8; pub const HEAP_INSERT_SPECULATIVE: u32 = 16; +pub const NUM_MXACTOFFSET_BUFFERS: u32 = 8; +pub const NUM_MXACTMEMBER_BUFFERS: u32 = 16; +pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u32 = 0; +pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u32 = 16; +pub const XLOG_MULTIXACT_CREATE_ID: u32 = 32; +pub const XLOG_MULTIXACT_TRUNCATE_ID: u32 = 48; pub const SHAREDINVALCATALOG_ID: i32 = -1; pub const SHAREDINVALRELCACHE_ID: i32 = -2; pub const SHAREDINVALSMGR_ID: i32 = -3; @@ -2656,6 +2662,15 @@ pub const Anum_pg_extension_extversion: u32 = 6; pub const Anum_pg_extension_extconfig: u32 = 7; pub const Anum_pg_extension_extcondition: u32 = 8; pub const Natts_pg_extension: u32 = 8; +pub const ForeignDataWrapperRelationId: Oid = Oid(2328); +pub const Anum_pg_foreign_data_wrapper_oid: u32 = 1; +pub const Anum_pg_foreign_data_wrapper_fdwname: u32 = 2; +pub const Anum_pg_foreign_data_wrapper_fdwowner: u32 = 3; +pub const Anum_pg_foreign_data_wrapper_fdwhandler: u32 = 4; +pub const Anum_pg_foreign_data_wrapper_fdwvalidator: u32 = 5; +pub const Anum_pg_foreign_data_wrapper_fdwacl: u32 = 6; +pub const Anum_pg_foreign_data_wrapper_fdwoptions: u32 = 7; +pub const Natts_pg_foreign_data_wrapper: u32 = 7; pub const ForeignServerRelationId: Oid = Oid(1417); pub const Anum_pg_foreign_server_oid: u32 = 1; pub const Anum_pg_foreign_server_srvname: u32 = 2; @@ -18696,6 +18711,63 @@ pub const HTSV_Result_HEAPTUPLE_RECENTLY_DEAD: HTSV_Result = 2; pub const HTSV_Result_HEAPTUPLE_INSERT_IN_PROGRESS: HTSV_Result = 3; pub const HTSV_Result_HEAPTUPLE_DELETE_IN_PROGRESS: HTSV_Result = 4; pub type HTSV_Result = ::std::os::raw::c_uint; +pub const MultiXactStatus_MultiXactStatusForKeyShare: MultiXactStatus = 0; +pub const MultiXactStatus_MultiXactStatusForShare: MultiXactStatus = 1; +pub const MultiXactStatus_MultiXactStatusForNoKeyUpdate: MultiXactStatus = 2; +pub const MultiXactStatus_MultiXactStatusForUpdate: MultiXactStatus = 3; +pub const MultiXactStatus_MultiXactStatusNoKeyUpdate: MultiXactStatus = 4; +pub const MultiXactStatus_MultiXactStatusUpdate: MultiXactStatus = 5; +pub type MultiXactStatus = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MultiXactMember { + pub xid: TransactionId, + pub status: MultiXactStatus, +} +impl Default for MultiXactMember { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug)] +pub struct xl_multixact_create { + pub mid: MultiXactId, + pub moff: MultiXactOffset, + pub nmembers: int32, + pub members: __IncompleteArrayField, +} +impl Default for xl_multixact_create { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xl_multixact_truncate { + pub oldestMultiDB: Oid, + pub startTruncOff: MultiXactId, + pub endTruncOff: MultiXactId, + pub startTruncMemb: MultiXactOffset, + pub endTruncMemb: MultiXactOffset, +} +impl Default for xl_multixact_truncate { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const relopt_type_RELOPT_TYPE_BOOL: relopt_type = 0; pub const relopt_type_RELOPT_TYPE_INT: relopt_type = 1; pub const relopt_type_RELOPT_TYPE_REAL: relopt_type = 2; @@ -19528,6 +19600,25 @@ impl Default for FormData_pg_extension { pub type Form_pg_extension = *mut FormData_pg_extension; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FormData_pg_foreign_data_wrapper { + pub oid: Oid, + pub fdwname: NameData, + pub fdwowner: Oid, + pub fdwhandler: Oid, + pub fdwvalidator: Oid, +} +impl Default for FormData_pg_foreign_data_wrapper { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Form_pg_foreign_data_wrapper = *mut FormData_pg_foreign_data_wrapper; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct FormData_pg_foreign_server { pub oid: Oid, pub srvname: NameData, @@ -24938,6 +25029,30 @@ impl Default for RunningTransactionsData { } } pub type RunningTransactions = *mut RunningTransactionsData; +pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; +pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; +pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; +pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; +pub type SyncRequestType = ::std::os::raw::c_uint; +pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; +pub type SyncRequestHandler = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FileTag { + pub handler: int16, + pub forknum: int16, + pub rnode: RelFileNode, + pub segno: uint32, +} +impl Default for FileTag { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const LogStmtLevel_LOGSTMT_NONE: LogStmtLevel = 0; pub const LogStmtLevel_LOGSTMT_DDL: LogStmtLevel = 1; pub const LogStmtLevel_LOGSTMT_MOD: LogStmtLevel = 2; @@ -30657,6 +30772,86 @@ extern "C" { cmin: *mut CommandId, cmax: *mut CommandId, ) -> bool; + pub fn MultiXactIdCreate( + xid1: TransactionId, + status1: MultiXactStatus, + xid2: TransactionId, + status2: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdExpand( + multi: MultiXactId, + xid: TransactionId, + status: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdCreateFromMembers( + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> MultiXactId; + pub fn ReadNextMultiXactId() -> MultiXactId; + pub fn MultiXactIdIsRunning(multi: MultiXactId, isLockOnly: bool) -> bool; + pub fn MultiXactIdSetOldestMember(); + pub fn GetMultiXactIdMembers( + multi: MultiXactId, + xids: *mut *mut MultiXactMember, + allow_old: bool, + isLockOnly: bool, + ) -> ::std::os::raw::c_int; + pub fn MultiXactIdPrecedes(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn MultiXactIdPrecedesOrEquals(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn AtEOXact_MultiXact(); + pub fn AtPrepare_MultiXact(); + pub fn PostPrepare_MultiXact(xid: TransactionId); + pub fn MultiXactShmemSize() -> Size; + pub fn MultiXactShmemInit(); + pub fn BootStrapMultiXact(); + pub fn StartupMultiXact(); + pub fn TrimMultiXact(); + pub fn ShutdownMultiXact(); + pub fn SetMultiXactIdLimit( + oldest_datminmxid: MultiXactId, + oldest_datoid: Oid, + is_startup: bool, + ); + pub fn MultiXactGetCheckptMulti( + is_shutdown: bool, + nextMulti: *mut MultiXactId, + nextMultiOffset: *mut MultiXactOffset, + oldestMulti: *mut MultiXactId, + oldestMultiDB: *mut Oid, + ); + pub fn CheckPointMultiXact(); + pub fn GetOldestMultiXactId() -> MultiXactId; + pub fn TruncateMultiXact(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactSetNextMXact(nextMulti: MultiXactId, nextMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceNextMXact(minMulti: MultiXactId, minMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceOldest(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactMemberFreezeThreshold() -> ::std::os::raw::c_int; + pub fn multixact_twophase_recover( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postcommit( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postabort( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_redo(record: *mut XLogReaderState); + pub fn multixact_desc(buf: StringInfo, record: *mut XLogReaderState); + pub fn multixact_identify(info: uint8) -> *const ::std::os::raw::c_char; + pub fn mxid_to_string( + multi: MultiXactId, + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> *mut ::std::os::raw::c_char; pub fn add_reloption_kind() -> relopt_kind; pub fn add_bool_reloption( kinds: bits32, @@ -33038,6 +33233,56 @@ extern "C" { source: *const ::std::os::raw::c_uchar, length: ::std::os::raw::c_int, ) -> bool; + pub fn pq_beginmessage(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_beginmessage_reuse(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_endmessage(buf: StringInfo); + pub fn pq_endmessage_reuse(buf: StringInfo); + pub fn pq_sendbytes( + buf: StringInfo, + data: *const ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_sendcountedtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + countincludesself: bool, + ); + pub fn pq_sendtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + ); + pub fn pq_sendstring(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_send_ascii_string(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_sendfloat4(buf: StringInfo, f: float4); + pub fn pq_sendfloat8(buf: StringInfo, f: float8); + pub fn pq_begintypsend(buf: StringInfo); + pub fn pq_endtypsend(buf: StringInfo) -> *mut bytea; + pub fn pq_puttextmessage(msgtype: ::std::os::raw::c_char, str_: *const ::std::os::raw::c_char); + pub fn pq_putemptymessage(msgtype: ::std::os::raw::c_char); + pub fn pq_getmsgbyte(msg: StringInfo) -> ::std::os::raw::c_int; + pub fn pq_getmsgint(msg: StringInfo, b: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; + pub fn pq_getmsgint64(msg: StringInfo) -> int64; + pub fn pq_getmsgfloat4(msg: StringInfo) -> float4; + pub fn pq_getmsgfloat8(msg: StringInfo) -> float8; + pub fn pq_getmsgbytes( + msg: StringInfo, + datalen: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; + pub fn pq_copymsgbytes( + msg: StringInfo, + buf: *mut ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_getmsgtext( + msg: StringInfo, + rawbytes: ::std::os::raw::c_int, + nbytes: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; + pub fn pq_getmsgstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgrawstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgend(msg: StringInfo); pub fn RegisterExtensibleNodeMethods(method: *const ExtensibleNodeMethods); pub fn GetExtensibleNodeMethods( name: *const ::std::os::raw::c_char, @@ -35812,6 +36057,17 @@ extern "C" { xmin: *mut TransactionId, catalog_xmin: *mut TransactionId, ); + pub fn InitSync(); + pub fn SyncPreCheckpoint(); + pub fn SyncPostCheckpoint(); + pub fn ProcessSyncRequests(); + pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); + pub fn EnableSyncRequestForwarding(); + pub fn RegisterSyncRequest( + ftag: *const FileTag, + type_: SyncRequestType, + retryOnError: bool, + ) -> bool; pub fn pg_parse_query(query_string: *const ::std::os::raw::c_char) -> *mut List; pub fn pg_analyze_and_rewrite( parsetree: *mut RawStmt, @@ -39000,6 +39256,49 @@ extern "C" { pub fn get_index_isreplident(index_oid: Oid) -> bool; pub fn get_index_isvalid(index_oid: Oid) -> bool; pub fn get_index_isclustered(index_oid: Oid) -> bool; + pub fn stringToQualifiedNameList(string: *const ::std::os::raw::c_char) -> *mut List; + pub fn format_procedure(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_qualified(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + ); + pub fn format_operator(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_qualified(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + ); + pub fn pg_get_indexdef_string(indexrelid: Oid) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns(indexrelid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partkeydef_columns(relid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partconstrdef_string( + partitionId: Oid, + aliasname: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_constraintdef_command(constraintId: Oid) -> *mut ::std::os::raw::c_char; + pub fn deparse_expression( + expr: *mut Node, + dpcontext: *mut List, + forceprefix: bool, + showimplicit: bool, + ) -> *mut ::std::os::raw::c_char; + pub fn deparse_context_for(aliasname: *const ::std::os::raw::c_char, relid: Oid) -> *mut List; + pub fn deparse_context_for_plan_rtable(rtable: *mut List, rtable_names: *mut List) + -> *mut List; + pub fn set_deparse_context_planstate( + dpcontext: *mut List, + planstate: *mut Node, + ancestors: *mut List, + ) -> *mut List; + pub fn select_rtable_names_for_explain( + rtable: *mut List, + rels_used: *mut Bitmapset, + ) -> *mut List; + pub fn generate_collation_name(collid: Oid) -> *mut ::std::os::raw::c_char; + pub fn get_range_partbound_string(bound_datums: *mut List) -> *mut ::std::os::raw::c_char; pub fn sampler_random_init_state( seed: ::std::os::raw::c_long, randstate: *mut ::std::os::raw::c_ushort, diff --git a/pgrx-pg-sys/src/include/pg12_oids.rs b/pgrx-pg-sys/src/include/pg12_oids.rs index 1184ead7b..6adebfb1a 100644 --- a/pgrx-pg-sys/src/include/pg12_oids.rs +++ b/pgrx-pg-sys/src/include/pg12_oids.rs @@ -63,6 +63,7 @@ pub enum BuiltinOid { FLOAT8ARRAYOID = 1022, FLOAT8OID = 701, FLOAT8_BTREE_OPS_OID = 3123, + ForeignDataWrapperRelationId = 2328, ForeignServerRelationId = 1417, ForeignTableRelationId = 3118, GIN_AM_OID = 2742, @@ -291,6 +292,7 @@ impl BuiltinOid { 1022 => Ok(BuiltinOid::FLOAT8ARRAYOID), 701 => Ok(BuiltinOid::FLOAT8OID), 3123 => Ok(BuiltinOid::FLOAT8_BTREE_OPS_OID), + 2328 => Ok(BuiltinOid::ForeignDataWrapperRelationId), 1417 => Ok(BuiltinOid::ForeignServerRelationId), 3118 => Ok(BuiltinOid::ForeignTableRelationId), 2742 => Ok(BuiltinOid::GIN_AM_OID), diff --git a/pgrx-pg-sys/src/include/pg13.rs b/pgrx-pg-sys/src/include/pg13.rs index e37f49450..353f7c6f3 100644 --- a/pgrx-pg-sys/src/include/pg13.rs +++ b/pgrx-pg-sys/src/include/pg13.rs @@ -2457,6 +2457,12 @@ pub const HEAP_INSERT_SKIP_FSM: u32 = 2; pub const HEAP_INSERT_FROZEN: u32 = 4; pub const HEAP_INSERT_NO_LOGICAL: u32 = 8; pub const HEAP_INSERT_SPECULATIVE: u32 = 16; +pub const NUM_MULTIXACTOFFSET_BUFFERS: u32 = 8; +pub const NUM_MULTIXACTMEMBER_BUFFERS: u32 = 16; +pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u32 = 0; +pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u32 = 16; +pub const XLOG_MULTIXACT_CREATE_ID: u32 = 32; +pub const XLOG_MULTIXACT_TRUNCATE_ID: u32 = 48; pub const SHAREDINVALCATALOG_ID: i32 = -1; pub const SHAREDINVALRELCACHE_ID: i32 = -2; pub const SHAREDINVALSMGR_ID: i32 = -3; @@ -2854,6 +2860,15 @@ pub const Anum_pg_extension_extversion: u32 = 6; pub const Anum_pg_extension_extconfig: u32 = 7; pub const Anum_pg_extension_extcondition: u32 = 8; pub const Natts_pg_extension: u32 = 8; +pub const ForeignDataWrapperRelationId: Oid = Oid(2328); +pub const Anum_pg_foreign_data_wrapper_oid: u32 = 1; +pub const Anum_pg_foreign_data_wrapper_fdwname: u32 = 2; +pub const Anum_pg_foreign_data_wrapper_fdwowner: u32 = 3; +pub const Anum_pg_foreign_data_wrapper_fdwhandler: u32 = 4; +pub const Anum_pg_foreign_data_wrapper_fdwvalidator: u32 = 5; +pub const Anum_pg_foreign_data_wrapper_fdwacl: u32 = 6; +pub const Anum_pg_foreign_data_wrapper_fdwoptions: u32 = 7; +pub const Natts_pg_foreign_data_wrapper: u32 = 7; pub const ForeignServerRelationId: Oid = Oid(1417); pub const Anum_pg_foreign_server_oid: u32 = 1; pub const Anum_pg_foreign_server_srvname: u32 = 2; @@ -19274,6 +19289,63 @@ pub const HTSV_Result_HEAPTUPLE_RECENTLY_DEAD: HTSV_Result = 2; pub const HTSV_Result_HEAPTUPLE_INSERT_IN_PROGRESS: HTSV_Result = 3; pub const HTSV_Result_HEAPTUPLE_DELETE_IN_PROGRESS: HTSV_Result = 4; pub type HTSV_Result = ::std::os::raw::c_uint; +pub const MultiXactStatus_MultiXactStatusForKeyShare: MultiXactStatus = 0; +pub const MultiXactStatus_MultiXactStatusForShare: MultiXactStatus = 1; +pub const MultiXactStatus_MultiXactStatusForNoKeyUpdate: MultiXactStatus = 2; +pub const MultiXactStatus_MultiXactStatusForUpdate: MultiXactStatus = 3; +pub const MultiXactStatus_MultiXactStatusNoKeyUpdate: MultiXactStatus = 4; +pub const MultiXactStatus_MultiXactStatusUpdate: MultiXactStatus = 5; +pub type MultiXactStatus = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MultiXactMember { + pub xid: TransactionId, + pub status: MultiXactStatus, +} +impl Default for MultiXactMember { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug)] +pub struct xl_multixact_create { + pub mid: MultiXactId, + pub moff: MultiXactOffset, + pub nmembers: int32, + pub members: __IncompleteArrayField, +} +impl Default for xl_multixact_create { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xl_multixact_truncate { + pub oldestMultiDB: Oid, + pub startTruncOff: MultiXactId, + pub endTruncOff: MultiXactId, + pub startTruncMemb: MultiXactOffset, + pub endTruncMemb: MultiXactOffset, +} +impl Default for xl_multixact_truncate { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const relopt_type_RELOPT_TYPE_BOOL: relopt_type = 0; pub const relopt_type_RELOPT_TYPE_INT: relopt_type = 1; pub const relopt_type_RELOPT_TYPE_REAL: relopt_type = 2; @@ -20215,6 +20287,25 @@ impl Default for FormData_pg_extension { pub type Form_pg_extension = *mut FormData_pg_extension; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FormData_pg_foreign_data_wrapper { + pub oid: Oid, + pub fdwname: NameData, + pub fdwowner: Oid, + pub fdwhandler: Oid, + pub fdwvalidator: Oid, +} +impl Default for FormData_pg_foreign_data_wrapper { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Form_pg_foreign_data_wrapper = *mut FormData_pg_foreign_data_wrapper; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct FormData_pg_foreign_server { pub oid: Oid, pub srvname: NameData, @@ -25872,6 +25963,30 @@ impl Default for RunningTransactionsData { } } pub type RunningTransactions = *mut RunningTransactionsData; +pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; +pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; +pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; +pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; +pub type SyncRequestType = ::std::os::raw::c_uint; +pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; +pub type SyncRequestHandler = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FileTag { + pub handler: int16, + pub forknum: int16, + pub rnode: RelFileNode, + pub segno: uint32, +} +impl Default for FileTag { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const LogStmtLevel_LOGSTMT_NONE: LogStmtLevel = 0; pub const LogStmtLevel_LOGSTMT_DDL: LogStmtLevel = 1; pub const LogStmtLevel_LOGSTMT_MOD: LogStmtLevel = 2; @@ -31483,6 +31598,86 @@ extern "C" { buffer: Buffer, snapshot: Snapshot, ); + pub fn MultiXactIdCreate( + xid1: TransactionId, + status1: MultiXactStatus, + xid2: TransactionId, + status2: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdExpand( + multi: MultiXactId, + xid: TransactionId, + status: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdCreateFromMembers( + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> MultiXactId; + pub fn ReadNextMultiXactId() -> MultiXactId; + pub fn MultiXactIdIsRunning(multi: MultiXactId, isLockOnly: bool) -> bool; + pub fn MultiXactIdSetOldestMember(); + pub fn GetMultiXactIdMembers( + multi: MultiXactId, + xids: *mut *mut MultiXactMember, + allow_old: bool, + isLockOnly: bool, + ) -> ::std::os::raw::c_int; + pub fn MultiXactIdPrecedes(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn MultiXactIdPrecedesOrEquals(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn AtEOXact_MultiXact(); + pub fn AtPrepare_MultiXact(); + pub fn PostPrepare_MultiXact(xid: TransactionId); + pub fn MultiXactShmemSize() -> Size; + pub fn MultiXactShmemInit(); + pub fn BootStrapMultiXact(); + pub fn StartupMultiXact(); + pub fn TrimMultiXact(); + pub fn ShutdownMultiXact(); + pub fn SetMultiXactIdLimit( + oldest_datminmxid: MultiXactId, + oldest_datoid: Oid, + is_startup: bool, + ); + pub fn MultiXactGetCheckptMulti( + is_shutdown: bool, + nextMulti: *mut MultiXactId, + nextMultiOffset: *mut MultiXactOffset, + oldestMulti: *mut MultiXactId, + oldestMultiDB: *mut Oid, + ); + pub fn CheckPointMultiXact(); + pub fn GetOldestMultiXactId() -> MultiXactId; + pub fn TruncateMultiXact(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactSetNextMXact(nextMulti: MultiXactId, nextMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceNextMXact(minMulti: MultiXactId, minMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceOldest(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactMemberFreezeThreshold() -> ::std::os::raw::c_int; + pub fn multixact_twophase_recover( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postcommit( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postabort( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_redo(record: *mut XLogReaderState); + pub fn multixact_desc(buf: StringInfo, record: *mut XLogReaderState); + pub fn multixact_identify(info: uint8) -> *const ::std::os::raw::c_char; + pub fn mxid_to_string( + multi: MultiXactId, + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> *mut ::std::os::raw::c_char; pub fn add_reloption_kind() -> relopt_kind; pub fn add_bool_reloption( kinds: bits32, @@ -34143,6 +34338,56 @@ extern "C" { encoding: ::std::os::raw::c_int, tab: *const ::std::os::raw::c_uchar, ); + pub fn pq_beginmessage(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_beginmessage_reuse(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_endmessage(buf: StringInfo); + pub fn pq_endmessage_reuse(buf: StringInfo); + pub fn pq_sendbytes( + buf: StringInfo, + data: *const ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_sendcountedtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + countincludesself: bool, + ); + pub fn pq_sendtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + ); + pub fn pq_sendstring(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_send_ascii_string(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_sendfloat4(buf: StringInfo, f: float4); + pub fn pq_sendfloat8(buf: StringInfo, f: float8); + pub fn pq_begintypsend(buf: StringInfo); + pub fn pq_endtypsend(buf: StringInfo) -> *mut bytea; + pub fn pq_puttextmessage(msgtype: ::std::os::raw::c_char, str_: *const ::std::os::raw::c_char); + pub fn pq_putemptymessage(msgtype: ::std::os::raw::c_char); + pub fn pq_getmsgbyte(msg: StringInfo) -> ::std::os::raw::c_int; + pub fn pq_getmsgint(msg: StringInfo, b: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; + pub fn pq_getmsgint64(msg: StringInfo) -> int64; + pub fn pq_getmsgfloat4(msg: StringInfo) -> float4; + pub fn pq_getmsgfloat8(msg: StringInfo) -> float8; + pub fn pq_getmsgbytes( + msg: StringInfo, + datalen: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; + pub fn pq_copymsgbytes( + msg: StringInfo, + buf: *mut ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_getmsgtext( + msg: StringInfo, + rawbytes: ::std::os::raw::c_int, + nbytes: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; + pub fn pq_getmsgstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgrawstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgend(msg: StringInfo); pub fn RegisterExtensibleNodeMethods(method: *const ExtensibleNodeMethods); pub fn GetExtensibleNodeMethods( name: *const ::std::os::raw::c_char, @@ -36993,6 +37238,17 @@ extern "C" { xmin: *mut TransactionId, catalog_xmin: *mut TransactionId, ); + pub fn InitSync(); + pub fn SyncPreCheckpoint(); + pub fn SyncPostCheckpoint(); + pub fn ProcessSyncRequests(); + pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); + pub fn EnableSyncRequestForwarding(); + pub fn RegisterSyncRequest( + ftag: *const FileTag, + type_: SyncRequestType, + retryOnError: bool, + ) -> bool; pub fn pg_parse_query(query_string: *const ::std::os::raw::c_char) -> *mut List; pub fn pg_analyze_and_rewrite( parsetree: *mut RawStmt, @@ -40257,6 +40513,52 @@ extern "C" { pub fn get_index_isreplident(index_oid: Oid) -> bool; pub fn get_index_isvalid(index_oid: Oid) -> bool; pub fn get_index_isclustered(index_oid: Oid) -> bool; + pub fn stringToQualifiedNameList(string: *const ::std::os::raw::c_char) -> *mut List; + pub fn format_procedure(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_qualified(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + ); + pub fn format_operator(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_qualified(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + ); + pub fn pg_get_indexdef_string(indexrelid: Oid) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns(indexrelid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partkeydef_columns(relid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partconstrdef_string( + partitionId: Oid, + aliasname: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_constraintdef_command(constraintId: Oid) -> *mut ::std::os::raw::c_char; + pub fn deparse_expression( + expr: *mut Node, + dpcontext: *mut List, + forceprefix: bool, + showimplicit: bool, + ) -> *mut ::std::os::raw::c_char; + pub fn deparse_context_for(aliasname: *const ::std::os::raw::c_char, relid: Oid) -> *mut List; + pub fn deparse_context_for_plan_tree( + pstmt: *mut PlannedStmt, + rtable_names: *mut List, + ) -> *mut List; + pub fn set_deparse_context_plan( + dpcontext: *mut List, + plan: *mut Plan, + ancestors: *mut List, + ) -> *mut List; + pub fn select_rtable_names_for_explain( + rtable: *mut List, + rels_used: *mut Bitmapset, + ) -> *mut List; + pub fn generate_collation_name(collid: Oid) -> *mut ::std::os::raw::c_char; + pub fn generate_opclass_name(opclass: Oid) -> *mut ::std::os::raw::c_char; + pub fn get_range_partbound_string(bound_datums: *mut List) -> *mut ::std::os::raw::c_char; pub fn sampler_random_init_state( seed: ::std::os::raw::c_long, randstate: *mut ::std::os::raw::c_ushort, diff --git a/pgrx-pg-sys/src/include/pg13_oids.rs b/pgrx-pg-sys/src/include/pg13_oids.rs index e74303820..9d9fdae5b 100644 --- a/pgrx-pg-sys/src/include/pg13_oids.rs +++ b/pgrx-pg-sys/src/include/pg13_oids.rs @@ -67,6 +67,7 @@ pub enum BuiltinOid { FLOAT8ARRAYOID = 1022, FLOAT8OID = 701, FLOAT8_BTREE_OPS_OID = 3123, + ForeignDataWrapperRelationId = 2328, ForeignServerRelationId = 1417, ForeignTableRelationId = 3118, GIN_AM_OID = 2742, @@ -304,6 +305,7 @@ impl BuiltinOid { 1022 => Ok(BuiltinOid::FLOAT8ARRAYOID), 701 => Ok(BuiltinOid::FLOAT8OID), 3123 => Ok(BuiltinOid::FLOAT8_BTREE_OPS_OID), + 2328 => Ok(BuiltinOid::ForeignDataWrapperRelationId), 1417 => Ok(BuiltinOid::ForeignServerRelationId), 3118 => Ok(BuiltinOid::ForeignTableRelationId), 2742 => Ok(BuiltinOid::GIN_AM_OID), diff --git a/pgrx-pg-sys/src/include/pg14.rs b/pgrx-pg-sys/src/include/pg14.rs index a8725ed18..ba835d5e3 100644 --- a/pgrx-pg-sys/src/include/pg14.rs +++ b/pgrx-pg-sys/src/include/pg14.rs @@ -2489,6 +2489,12 @@ pub const HEAP_INSERT_SKIP_FSM: u32 = 2; pub const HEAP_INSERT_FROZEN: u32 = 4; pub const HEAP_INSERT_NO_LOGICAL: u32 = 8; pub const HEAP_INSERT_SPECULATIVE: u32 = 16; +pub const NUM_MULTIXACTOFFSET_BUFFERS: u32 = 8; +pub const NUM_MULTIXACTMEMBER_BUFFERS: u32 = 16; +pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u32 = 0; +pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u32 = 16; +pub const XLOG_MULTIXACT_CREATE_ID: u32 = 32; +pub const XLOG_MULTIXACT_TRUNCATE_ID: u32 = 48; pub const LWLOCK_PADDED_SIZE: u32 = 128; pub const NUM_INDIVIDUAL_LWLOCKS: u32 = 48; pub const NUM_BUFFER_PARTITIONS: u32 = 128; @@ -2676,6 +2682,17 @@ pub const Anum_pg_extension_extcondition: u32 = 8; pub const Natts_pg_extension: u32 = 8; pub const ExtensionOidIndexId: u32 = 3080; pub const ExtensionNameIndexId: u32 = 3081; +pub const ForeignDataWrapperRelationId: Oid = Oid(2328); +pub const Anum_pg_foreign_data_wrapper_oid: u32 = 1; +pub const Anum_pg_foreign_data_wrapper_fdwname: u32 = 2; +pub const Anum_pg_foreign_data_wrapper_fdwowner: u32 = 3; +pub const Anum_pg_foreign_data_wrapper_fdwhandler: u32 = 4; +pub const Anum_pg_foreign_data_wrapper_fdwvalidator: u32 = 5; +pub const Anum_pg_foreign_data_wrapper_fdwacl: u32 = 6; +pub const Anum_pg_foreign_data_wrapper_fdwoptions: u32 = 7; +pub const Natts_pg_foreign_data_wrapper: u32 = 7; +pub const ForeignDataWrapperOidIndexId: u32 = 112; +pub const ForeignDataWrapperNameIndexId: u32 = 548; pub const ForeignServerRelationId: Oid = Oid(1417); pub const Anum_pg_foreign_server_oid: u32 = 1; pub const Anum_pg_foreign_server_srvname: u32 = 2; @@ -3510,6 +3527,12 @@ pub const JB_FOBJECT: u32 = 536870912; pub const JB_FARRAY: u32 = 1073741824; pub const ATTSTATSSLOT_VALUES: u32 = 1; pub const ATTSTATSSLOT_NUMBERS: u32 = 2; +pub const FORMAT_PROC_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_PROC_FORCE_QUALIFY: u32 = 2; +pub const FORMAT_OPERATOR_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_OPERATOR_FORCE_QUALIFY: u32 = 2; +pub const RULE_INDEXDEF_PRETTY: u32 = 1; +pub const RULE_INDEXDEF_KEYS_ONLY: u32 = 2; pub const DEFAULT_EQ_SEL: f64 = 0.005; pub const DEFAULT_INEQ_SEL: f64 = 0.3333333333333333; pub const DEFAULT_RANGE_INEQ_SEL: f64 = 0.005; @@ -19687,6 +19710,92 @@ pub type HTSV_Result = ::std::os::raw::c_uint; pub struct GlobalVisState { _unused: [u8; 0], } +pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; +pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; +pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; +pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; +pub type SyncRequestType = ::std::os::raw::c_uint; +pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; +pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; +pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; +pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; +pub type SyncRequestHandler = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FileTag { + pub handler: int16, + pub forknum: int16, + pub rnode: RelFileNode, + pub segno: uint32, +} +impl Default for FileTag { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const MultiXactStatus_MultiXactStatusForKeyShare: MultiXactStatus = 0; +pub const MultiXactStatus_MultiXactStatusForShare: MultiXactStatus = 1; +pub const MultiXactStatus_MultiXactStatusForNoKeyUpdate: MultiXactStatus = 2; +pub const MultiXactStatus_MultiXactStatusForUpdate: MultiXactStatus = 3; +pub const MultiXactStatus_MultiXactStatusNoKeyUpdate: MultiXactStatus = 4; +pub const MultiXactStatus_MultiXactStatusUpdate: MultiXactStatus = 5; +pub type MultiXactStatus = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MultiXactMember { + pub xid: TransactionId, + pub status: MultiXactStatus, +} +impl Default for MultiXactMember { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug)] +pub struct xl_multixact_create { + pub mid: MultiXactId, + pub moff: MultiXactOffset, + pub nmembers: int32, + pub members: __IncompleteArrayField, +} +impl Default for xl_multixact_create { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xl_multixact_truncate { + pub oldestMultiDB: Oid, + pub startTruncOff: MultiXactId, + pub endTruncOff: MultiXactId, + pub startTruncMemb: MultiXactOffset, + pub endTruncMemb: MultiXactOffset, +} +impl Default for xl_multixact_truncate { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LWLock { @@ -20599,6 +20708,25 @@ impl Default for FormData_pg_extension { pub type Form_pg_extension = *mut FormData_pg_extension; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FormData_pg_foreign_data_wrapper { + pub oid: Oid, + pub fdwname: NameData, + pub fdwowner: Oid, + pub fdwhandler: Oid, + pub fdwvalidator: Oid, +} +impl Default for FormData_pg_foreign_data_wrapper { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Form_pg_foreign_data_wrapper = *mut FormData_pg_foreign_data_wrapper; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct FormData_pg_foreign_server { pub oid: Oid, pub srvname: NameData, @@ -21948,35 +22076,6 @@ pub type BgwHandleStatus = ::std::os::raw::c_uint; pub struct BackgroundWorkerHandle { _unused: [u8; 0], } -pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; -pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; -pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; -pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; -pub type SyncRequestType = ::std::os::raw::c_uint; -pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; -pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; -pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; -pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; -pub type SyncRequestHandler = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FileTag { - pub handler: int16, - pub forknum: int16, - pub rnode: RelFileNode, - pub segno: uint32, -} -impl Default for FileTag { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} pub type XidStatus = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -32913,6 +33012,105 @@ extern "C" { buffer: Buffer, snapshot: Snapshot, ); + pub fn InitSync(); + pub fn SyncPreCheckpoint(); + pub fn SyncPostCheckpoint(); + pub fn ProcessSyncRequests(); + pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); + pub fn EnableSyncRequestForwarding(); + pub fn RegisterSyncRequest( + ftag: *const FileTag, + type_: SyncRequestType, + retryOnError: bool, + ) -> bool; + pub fn MultiXactIdCreate( + xid1: TransactionId, + status1: MultiXactStatus, + xid2: TransactionId, + status2: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdExpand( + multi: MultiXactId, + xid: TransactionId, + status: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdCreateFromMembers( + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> MultiXactId; + pub fn ReadNextMultiXactId() -> MultiXactId; + pub fn ReadMultiXactIdRange(oldest: *mut MultiXactId, next: *mut MultiXactId); + pub fn MultiXactIdIsRunning(multi: MultiXactId, isLockOnly: bool) -> bool; + pub fn MultiXactIdSetOldestMember(); + pub fn GetMultiXactIdMembers( + multi: MultiXactId, + xids: *mut *mut MultiXactMember, + allow_old: bool, + isLockOnly: bool, + ) -> ::std::os::raw::c_int; + pub fn MultiXactIdPrecedes(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn MultiXactIdPrecedesOrEquals(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn multixactoffsetssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn multixactmemberssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn AtEOXact_MultiXact(); + pub fn AtPrepare_MultiXact(); + pub fn PostPrepare_MultiXact(xid: TransactionId); + pub fn MultiXactShmemSize() -> Size; + pub fn MultiXactShmemInit(); + pub fn BootStrapMultiXact(); + pub fn StartupMultiXact(); + pub fn TrimMultiXact(); + pub fn SetMultiXactIdLimit( + oldest_datminmxid: MultiXactId, + oldest_datoid: Oid, + is_startup: bool, + ); + pub fn MultiXactGetCheckptMulti( + is_shutdown: bool, + nextMulti: *mut MultiXactId, + nextMultiOffset: *mut MultiXactOffset, + oldestMulti: *mut MultiXactId, + oldestMultiDB: *mut Oid, + ); + pub fn CheckPointMultiXact(); + pub fn GetOldestMultiXactId() -> MultiXactId; + pub fn TruncateMultiXact(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactSetNextMXact(nextMulti: MultiXactId, nextMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceNextMXact(minMulti: MultiXactId, minMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceOldest(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactMemberFreezeThreshold() -> ::std::os::raw::c_int; + pub fn multixact_twophase_recover( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postcommit( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postabort( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_redo(record: *mut XLogReaderState); + pub fn multixact_desc(buf: StringInfo, record: *mut XLogReaderState); + pub fn multixact_identify(info: uint8) -> *const ::std::os::raw::c_char; + pub fn mxid_to_string( + multi: MultiXactId, + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> *mut ::std::os::raw::c_char; pub fn LWLockAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockConditionalAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockAcquireOrWait(lock: *mut LWLock, mode: LWLockMode) -> bool; @@ -35120,17 +35318,6 @@ extern "C" { pub fn BackgroundWorkerInitializeConnectionByOid(dboid: Oid, useroid: Oid, flags: uint32); pub fn BackgroundWorkerBlockSignals(); pub fn BackgroundWorkerUnblockSignals(); - pub fn InitSync(); - pub fn SyncPreCheckpoint(); - pub fn SyncPostCheckpoint(); - pub fn ProcessSyncRequests(); - pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); - pub fn EnableSyncRequestForwarding(); - pub fn RegisterSyncRequest( - ftag: *const FileTag, - type_: SyncRequestType, - retryOnError: bool, - ) -> bool; pub fn TransactionIdSetTreeStatus( xid: TransactionId, nsubxids: ::std::os::raw::c_int, @@ -35587,6 +35774,56 @@ extern "C" { tab: *const ::std::os::raw::c_uchar, noError: bool, ) -> ::std::os::raw::c_int; + pub fn pq_beginmessage(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_beginmessage_reuse(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_endmessage(buf: StringInfo); + pub fn pq_endmessage_reuse(buf: StringInfo); + pub fn pq_sendbytes( + buf: StringInfo, + data: *const ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_sendcountedtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + countincludesself: bool, + ); + pub fn pq_sendtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + ); + pub fn pq_sendstring(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_send_ascii_string(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_sendfloat4(buf: StringInfo, f: float4); + pub fn pq_sendfloat8(buf: StringInfo, f: float8); + pub fn pq_begintypsend(buf: StringInfo); + pub fn pq_endtypsend(buf: StringInfo) -> *mut bytea; + pub fn pq_puttextmessage(msgtype: ::std::os::raw::c_char, str_: *const ::std::os::raw::c_char); + pub fn pq_putemptymessage(msgtype: ::std::os::raw::c_char); + pub fn pq_getmsgbyte(msg: StringInfo) -> ::std::os::raw::c_int; + pub fn pq_getmsgint(msg: StringInfo, b: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; + pub fn pq_getmsgint64(msg: StringInfo) -> int64; + pub fn pq_getmsgfloat4(msg: StringInfo) -> float4; + pub fn pq_getmsgfloat8(msg: StringInfo) -> float8; + pub fn pq_getmsgbytes( + msg: StringInfo, + datalen: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; + pub fn pq_copymsgbytes( + msg: StringInfo, + buf: *mut ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_getmsgtext( + msg: StringInfo, + rawbytes: ::std::os::raw::c_int, + nbytes: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; + pub fn pq_getmsgstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgrawstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgend(msg: StringInfo); pub fn RegisterExtensibleNodeMethods(method: *const ExtensibleNodeMethods); pub fn GetExtensibleNodeMethods( name: *const ::std::os::raw::c_char, @@ -42280,6 +42517,67 @@ extern "C" { pub fn get_index_isreplident(index_oid: Oid) -> bool; pub fn get_index_isvalid(index_oid: Oid) -> bool; pub fn get_index_isclustered(index_oid: Oid) -> bool; + pub fn format_procedure_extended( + procedure_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn format_operator_extended( + operator_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn stringToQualifiedNameList(string: *const ::std::os::raw::c_char) -> *mut List; + pub fn format_procedure(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_qualified(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn format_operator(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_qualified(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn pg_get_indexdef_string(indexrelid: Oid) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns(indexrelid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns_extended( + indexrelid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partkeydef_columns(relid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partconstrdef_string( + partitionId: Oid, + aliasname: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_constraintdef_command(constraintId: Oid) -> *mut ::std::os::raw::c_char; + pub fn deparse_expression( + expr: *mut Node, + dpcontext: *mut List, + forceprefix: bool, + showimplicit: bool, + ) -> *mut ::std::os::raw::c_char; + pub fn deparse_context_for(aliasname: *const ::std::os::raw::c_char, relid: Oid) -> *mut List; + pub fn deparse_context_for_plan_tree( + pstmt: *mut PlannedStmt, + rtable_names: *mut List, + ) -> *mut List; + pub fn set_deparse_context_plan( + dpcontext: *mut List, + plan: *mut Plan, + ancestors: *mut List, + ) -> *mut List; + pub fn select_rtable_names_for_explain( + rtable: *mut List, + rels_used: *mut Bitmapset, + ) -> *mut List; + pub fn generate_collation_name(collid: Oid) -> *mut ::std::os::raw::c_char; + pub fn generate_opclass_name(opclass: Oid) -> *mut ::std::os::raw::c_char; + pub fn get_range_partbound_string(bound_datums: *mut List) -> *mut ::std::os::raw::c_char; + pub fn pg_get_statisticsobjdef_string(statextid: Oid) -> *mut ::std::os::raw::c_char; pub fn sampler_random_init_state( seed: ::std::os::raw::c_long, randstate: *mut ::std::os::raw::c_ushort, diff --git a/pgrx-pg-sys/src/include/pg14_oids.rs b/pgrx-pg-sys/src/include/pg14_oids.rs index 81d016dc3..e9d5f26c2 100644 --- a/pgrx-pg-sys/src/include/pg14_oids.rs +++ b/pgrx-pg-sys/src/include/pg14_oids.rs @@ -70,6 +70,7 @@ pub enum BuiltinOid { FLOAT8ARRAYOID = 1022, FLOAT8OID = 701, FLOAT8_BTREE_OPS_OID = 3123, + ForeignDataWrapperRelationId = 2328, ForeignServerRelationId = 1417, ForeignTableRelationId = 3118, GIN_AM_OID = 2742, @@ -326,6 +327,7 @@ impl BuiltinOid { 1022 => Ok(BuiltinOid::FLOAT8ARRAYOID), 701 => Ok(BuiltinOid::FLOAT8OID), 3123 => Ok(BuiltinOid::FLOAT8_BTREE_OPS_OID), + 2328 => Ok(BuiltinOid::ForeignDataWrapperRelationId), 1417 => Ok(BuiltinOid::ForeignServerRelationId), 3118 => Ok(BuiltinOid::ForeignTableRelationId), 2742 => Ok(BuiltinOid::GIN_AM_OID), diff --git a/pgrx-pg-sys/src/include/pg15.rs b/pgrx-pg-sys/src/include/pg15.rs index 1d33ab222..c804e9b7b 100644 --- a/pgrx-pg-sys/src/include/pg15.rs +++ b/pgrx-pg-sys/src/include/pg15.rs @@ -2517,6 +2517,12 @@ pub const HEAP_INSERT_SKIP_FSM: u32 = 2; pub const HEAP_INSERT_FROZEN: u32 = 4; pub const HEAP_INSERT_NO_LOGICAL: u32 = 8; pub const HEAP_INSERT_SPECULATIVE: u32 = 16; +pub const NUM_MULTIXACTOFFSET_BUFFERS: u32 = 8; +pub const NUM_MULTIXACTMEMBER_BUFFERS: u32 = 16; +pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u32 = 0; +pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u32 = 16; +pub const XLOG_MULTIXACT_CREATE_ID: u32 = 32; +pub const XLOG_MULTIXACT_TRUNCATE_ID: u32 = 48; pub const LWLOCK_PADDED_SIZE: u32 = 128; pub const NUM_INDIVIDUAL_LWLOCKS: u32 = 48; pub const NUM_BUFFER_PARTITIONS: u32 = 128; @@ -2728,6 +2734,17 @@ pub const Anum_pg_extension_extversion: u32 = 6; pub const Anum_pg_extension_extconfig: u32 = 7; pub const Anum_pg_extension_extcondition: u32 = 8; pub const Natts_pg_extension: u32 = 8; +pub const ForeignDataWrapperRelationId: Oid = Oid(2328); +pub const ForeignDataWrapperOidIndexId: u32 = 112; +pub const ForeignDataWrapperNameIndexId: u32 = 548; +pub const Anum_pg_foreign_data_wrapper_oid: u32 = 1; +pub const Anum_pg_foreign_data_wrapper_fdwname: u32 = 2; +pub const Anum_pg_foreign_data_wrapper_fdwowner: u32 = 3; +pub const Anum_pg_foreign_data_wrapper_fdwhandler: u32 = 4; +pub const Anum_pg_foreign_data_wrapper_fdwvalidator: u32 = 5; +pub const Anum_pg_foreign_data_wrapper_fdwacl: u32 = 6; +pub const Anum_pg_foreign_data_wrapper_fdwoptions: u32 = 7; +pub const Natts_pg_foreign_data_wrapper: u32 = 7; pub const ForeignServerRelationId: Oid = Oid(1417); pub const ForeignServerOidIndexId: u32 = 113; pub const ForeignServerNameIndexId: u32 = 549; @@ -3555,6 +3572,12 @@ pub const JB_FOBJECT: u32 = 536870912; pub const JB_FARRAY: u32 = 1073741824; pub const ATTSTATSSLOT_VALUES: u32 = 1; pub const ATTSTATSSLOT_NUMBERS: u32 = 2; +pub const FORMAT_PROC_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_PROC_FORCE_QUALIFY: u32 = 2; +pub const FORMAT_OPERATOR_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_OPERATOR_FORCE_QUALIFY: u32 = 2; +pub const RULE_INDEXDEF_PRETTY: u32 = 1; +pub const RULE_INDEXDEF_KEYS_ONLY: u32 = 2; pub const DEFAULT_EQ_SEL: f64 = 0.005; pub const DEFAULT_INEQ_SEL: f64 = 0.3333333333333333; pub const DEFAULT_RANGE_INEQ_SEL: f64 = 0.005; @@ -19546,6 +19569,92 @@ pub type HTSV_Result = ::std::os::raw::c_uint; pub struct GlobalVisState { _unused: [u8; 0], } +pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; +pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; +pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; +pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; +pub type SyncRequestType = ::std::os::raw::c_uint; +pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; +pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; +pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; +pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; +pub type SyncRequestHandler = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FileTag { + pub handler: int16, + pub forknum: int16, + pub rnode: RelFileNode, + pub segno: uint32, +} +impl Default for FileTag { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const MultiXactStatus_MultiXactStatusForKeyShare: MultiXactStatus = 0; +pub const MultiXactStatus_MultiXactStatusForShare: MultiXactStatus = 1; +pub const MultiXactStatus_MultiXactStatusForNoKeyUpdate: MultiXactStatus = 2; +pub const MultiXactStatus_MultiXactStatusForUpdate: MultiXactStatus = 3; +pub const MultiXactStatus_MultiXactStatusNoKeyUpdate: MultiXactStatus = 4; +pub const MultiXactStatus_MultiXactStatusUpdate: MultiXactStatus = 5; +pub type MultiXactStatus = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MultiXactMember { + pub xid: TransactionId, + pub status: MultiXactStatus, +} +impl Default for MultiXactMember { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug)] +pub struct xl_multixact_create { + pub mid: MultiXactId, + pub moff: MultiXactOffset, + pub nmembers: int32, + pub members: __IncompleteArrayField, +} +impl Default for xl_multixact_create { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xl_multixact_truncate { + pub oldestMultiDB: Oid, + pub startTruncOff: MultiXactId, + pub endTruncOff: MultiXactId, + pub startTruncMemb: MultiXactOffset, + pub endTruncMemb: MultiXactOffset, +} +impl Default for xl_multixact_truncate { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LWLock { @@ -20593,6 +20702,25 @@ impl Default for FormData_pg_extension { pub type Form_pg_extension = *mut FormData_pg_extension; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FormData_pg_foreign_data_wrapper { + pub oid: Oid, + pub fdwname: NameData, + pub fdwowner: Oid, + pub fdwhandler: Oid, + pub fdwvalidator: Oid, +} +impl Default for FormData_pg_foreign_data_wrapper { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Form_pg_foreign_data_wrapper = *mut FormData_pg_foreign_data_wrapper; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct FormData_pg_foreign_server { pub oid: Oid, pub srvname: NameData, @@ -21466,35 +21594,6 @@ pub type BgwHandleStatus = ::std::os::raw::c_uint; pub struct BackgroundWorkerHandle { _unused: [u8; 0], } -pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; -pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; -pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; -pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; -pub type SyncRequestType = ::std::os::raw::c_uint; -pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; -pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; -pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; -pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; -pub type SyncRequestHandler = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FileTag { - pub handler: int16, - pub forknum: int16, - pub rnode: RelFileNode, - pub segno: uint32, -} -impl Default for FileTag { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} pub type XidStatus = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -33142,6 +33241,104 @@ extern "C" { buffer: Buffer, snapshot: Snapshot, ); + pub fn InitSync(); + pub fn SyncPreCheckpoint(); + pub fn SyncPostCheckpoint(); + pub fn ProcessSyncRequests(); + pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); + pub fn RegisterSyncRequest( + ftag: *const FileTag, + type_: SyncRequestType, + retryOnError: bool, + ) -> bool; + pub fn MultiXactIdCreate( + xid1: TransactionId, + status1: MultiXactStatus, + xid2: TransactionId, + status2: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdExpand( + multi: MultiXactId, + xid: TransactionId, + status: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdCreateFromMembers( + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> MultiXactId; + pub fn ReadNextMultiXactId() -> MultiXactId; + pub fn ReadMultiXactIdRange(oldest: *mut MultiXactId, next: *mut MultiXactId); + pub fn MultiXactIdIsRunning(multi: MultiXactId, isLockOnly: bool) -> bool; + pub fn MultiXactIdSetOldestMember(); + pub fn GetMultiXactIdMembers( + multi: MultiXactId, + xids: *mut *mut MultiXactMember, + allow_old: bool, + isLockOnly: bool, + ) -> ::std::os::raw::c_int; + pub fn MultiXactIdPrecedes(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn MultiXactIdPrecedesOrEquals(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn multixactoffsetssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn multixactmemberssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn AtEOXact_MultiXact(); + pub fn AtPrepare_MultiXact(); + pub fn PostPrepare_MultiXact(xid: TransactionId); + pub fn MultiXactShmemSize() -> Size; + pub fn MultiXactShmemInit(); + pub fn BootStrapMultiXact(); + pub fn StartupMultiXact(); + pub fn TrimMultiXact(); + pub fn SetMultiXactIdLimit( + oldest_datminmxid: MultiXactId, + oldest_datoid: Oid, + is_startup: bool, + ); + pub fn MultiXactGetCheckptMulti( + is_shutdown: bool, + nextMulti: *mut MultiXactId, + nextMultiOffset: *mut MultiXactOffset, + oldestMulti: *mut MultiXactId, + oldestMultiDB: *mut Oid, + ); + pub fn CheckPointMultiXact(); + pub fn GetOldestMultiXactId() -> MultiXactId; + pub fn TruncateMultiXact(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactSetNextMXact(nextMulti: MultiXactId, nextMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceNextMXact(minMulti: MultiXactId, minMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceOldest(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactMemberFreezeThreshold() -> ::std::os::raw::c_int; + pub fn multixact_twophase_recover( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postcommit( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postabort( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_redo(record: *mut XLogReaderState); + pub fn multixact_desc(buf: StringInfo, record: *mut XLogReaderState); + pub fn multixact_identify(info: uint8) -> *const ::std::os::raw::c_char; + pub fn mxid_to_string( + multi: MultiXactId, + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> *mut ::std::os::raw::c_char; pub fn LWLockAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockConditionalAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockAcquireOrWait(lock: *mut LWLock, mode: LWLockMode) -> bool; @@ -35079,16 +35276,6 @@ extern "C" { pub fn BackgroundWorkerInitializeConnectionByOid(dboid: Oid, useroid: Oid, flags: uint32); pub fn BackgroundWorkerBlockSignals(); pub fn BackgroundWorkerUnblockSignals(); - pub fn InitSync(); - pub fn SyncPreCheckpoint(); - pub fn SyncPostCheckpoint(); - pub fn ProcessSyncRequests(); - pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); - pub fn RegisterSyncRequest( - ftag: *const FileTag, - type_: SyncRequestType, - retryOnError: bool, - ) -> bool; pub fn TransactionIdSetTreeStatus( xid: TransactionId, nsubxids: ::std::os::raw::c_int, @@ -35976,6 +36163,56 @@ extern "C" { tab: *const ::std::os::raw::c_uchar, noError: bool, ) -> ::std::os::raw::c_int; + pub fn pq_beginmessage(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_beginmessage_reuse(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_endmessage(buf: StringInfo); + pub fn pq_endmessage_reuse(buf: StringInfo); + pub fn pq_sendbytes( + buf: StringInfo, + data: *const ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_sendcountedtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + countincludesself: bool, + ); + pub fn pq_sendtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + ); + pub fn pq_sendstring(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_send_ascii_string(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_sendfloat4(buf: StringInfo, f: float4); + pub fn pq_sendfloat8(buf: StringInfo, f: float8); + pub fn pq_begintypsend(buf: StringInfo); + pub fn pq_endtypsend(buf: StringInfo) -> *mut bytea; + pub fn pq_puttextmessage(msgtype: ::std::os::raw::c_char, str_: *const ::std::os::raw::c_char); + pub fn pq_putemptymessage(msgtype: ::std::os::raw::c_char); + pub fn pq_getmsgbyte(msg: StringInfo) -> ::std::os::raw::c_int; + pub fn pq_getmsgint(msg: StringInfo, b: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; + pub fn pq_getmsgint64(msg: StringInfo) -> int64; + pub fn pq_getmsgfloat4(msg: StringInfo) -> float4; + pub fn pq_getmsgfloat8(msg: StringInfo) -> float8; + pub fn pq_getmsgbytes( + msg: StringInfo, + datalen: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; + pub fn pq_copymsgbytes( + msg: StringInfo, + buf: *mut ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_getmsgtext( + msg: StringInfo, + rawbytes: ::std::os::raw::c_int, + nbytes: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; + pub fn pq_getmsgstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgrawstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgend(msg: StringInfo); pub fn RegisterExtensibleNodeMethods(method: *const ExtensibleNodeMethods); pub fn GetExtensibleNodeMethods( name: *const ::std::os::raw::c_char, @@ -42789,6 +43026,68 @@ extern "C" { pub fn get_index_isreplident(index_oid: Oid) -> bool; pub fn get_index_isvalid(index_oid: Oid) -> bool; pub fn get_index_isclustered(index_oid: Oid) -> bool; + pub fn format_procedure_extended( + procedure_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn format_operator_extended( + operator_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn stringToQualifiedNameList(string: *const ::std::os::raw::c_char) -> *mut List; + pub fn format_procedure(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_qualified(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn format_operator(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_qualified(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn pg_get_indexdef_string(indexrelid: Oid) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns(indexrelid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns_extended( + indexrelid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_querydef(query: *mut Query, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partkeydef_columns(relid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partconstrdef_string( + partitionId: Oid, + aliasname: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_constraintdef_command(constraintId: Oid) -> *mut ::std::os::raw::c_char; + pub fn deparse_expression( + expr: *mut Node, + dpcontext: *mut List, + forceprefix: bool, + showimplicit: bool, + ) -> *mut ::std::os::raw::c_char; + pub fn deparse_context_for(aliasname: *const ::std::os::raw::c_char, relid: Oid) -> *mut List; + pub fn deparse_context_for_plan_tree( + pstmt: *mut PlannedStmt, + rtable_names: *mut List, + ) -> *mut List; + pub fn set_deparse_context_plan( + dpcontext: *mut List, + plan: *mut Plan, + ancestors: *mut List, + ) -> *mut List; + pub fn select_rtable_names_for_explain( + rtable: *mut List, + rels_used: *mut Bitmapset, + ) -> *mut List; + pub fn generate_collation_name(collid: Oid) -> *mut ::std::os::raw::c_char; + pub fn generate_opclass_name(opclass: Oid) -> *mut ::std::os::raw::c_char; + pub fn get_range_partbound_string(bound_datums: *mut List) -> *mut ::std::os::raw::c_char; + pub fn pg_get_statisticsobjdef_string(statextid: Oid) -> *mut ::std::os::raw::c_char; pub fn pg_prng_seed(state: *mut pg_prng_state, seed: uint64); pub fn pg_prng_fseed(state: *mut pg_prng_state, fseed: f64); pub fn pg_prng_seed_check(state: *mut pg_prng_state) -> bool; diff --git a/pgrx-pg-sys/src/include/pg15_oids.rs b/pgrx-pg-sys/src/include/pg15_oids.rs index 681497afd..b9661d1e0 100644 --- a/pgrx-pg-sys/src/include/pg15_oids.rs +++ b/pgrx-pg-sys/src/include/pg15_oids.rs @@ -70,6 +70,7 @@ pub enum BuiltinOid { FLOAT8ARRAYOID = 1022, FLOAT8OID = 701, FLOAT8_BTREE_OPS_OID = 3123, + ForeignDataWrapperRelationId = 2328, ForeignServerRelationId = 1417, ForeignTableRelationId = 3118, GIN_AM_OID = 2742, @@ -325,6 +326,7 @@ impl BuiltinOid { 1022 => Ok(BuiltinOid::FLOAT8ARRAYOID), 701 => Ok(BuiltinOid::FLOAT8OID), 3123 => Ok(BuiltinOid::FLOAT8_BTREE_OPS_OID), + 2328 => Ok(BuiltinOid::ForeignDataWrapperRelationId), 1417 => Ok(BuiltinOid::ForeignServerRelationId), 3118 => Ok(BuiltinOid::ForeignTableRelationId), 2742 => Ok(BuiltinOid::GIN_AM_OID), diff --git a/pgrx-pg-sys/src/include/pg16.rs b/pgrx-pg-sys/src/include/pg16.rs index 6e51c9888..5d1ab5e55 100644 --- a/pgrx-pg-sys/src/include/pg16.rs +++ b/pgrx-pg-sys/src/include/pg16.rs @@ -2450,6 +2450,12 @@ pub const HEAP_INSERT_NO_LOGICAL: u32 = 8; pub const HEAP_INSERT_SPECULATIVE: u32 = 16; pub const HEAP_FREEZE_CHECK_XMIN_COMMITTED: u32 = 1; pub const HEAP_FREEZE_CHECK_XMAX_ABORTED: u32 = 2; +pub const NUM_MULTIXACTOFFSET_BUFFERS: u32 = 8; +pub const NUM_MULTIXACTMEMBER_BUFFERS: u32 = 16; +pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u32 = 0; +pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u32 = 16; +pub const XLOG_MULTIXACT_CREATE_ID: u32 = 32; +pub const XLOG_MULTIXACT_TRUNCATE_ID: u32 = 48; pub const LWLOCK_PADDED_SIZE: u32 = 128; pub const NUM_INDIVIDUAL_LWLOCKS: u32 = 48; pub const NUM_BUFFER_PARTITIONS: u32 = 128; @@ -2665,6 +2671,17 @@ pub const Anum_pg_extension_extversion: u32 = 6; pub const Anum_pg_extension_extconfig: u32 = 7; pub const Anum_pg_extension_extcondition: u32 = 8; pub const Natts_pg_extension: u32 = 8; +pub const ForeignDataWrapperRelationId: Oid = Oid(2328); +pub const ForeignDataWrapperOidIndexId: u32 = 112; +pub const ForeignDataWrapperNameIndexId: u32 = 548; +pub const Anum_pg_foreign_data_wrapper_oid: u32 = 1; +pub const Anum_pg_foreign_data_wrapper_fdwname: u32 = 2; +pub const Anum_pg_foreign_data_wrapper_fdwowner: u32 = 3; +pub const Anum_pg_foreign_data_wrapper_fdwhandler: u32 = 4; +pub const Anum_pg_foreign_data_wrapper_fdwvalidator: u32 = 5; +pub const Anum_pg_foreign_data_wrapper_fdwacl: u32 = 6; +pub const Anum_pg_foreign_data_wrapper_fdwoptions: u32 = 7; +pub const Natts_pg_foreign_data_wrapper: u32 = 7; pub const ForeignServerRelationId: Oid = Oid(1417); pub const ForeignServerOidIndexId: u32 = 113; pub const ForeignServerNameIndexId: u32 = 549; @@ -3566,6 +3583,12 @@ pub const JB_FOBJECT: u32 = 536870912; pub const JB_FARRAY: u32 = 1073741824; pub const ATTSTATSSLOT_VALUES: u32 = 1; pub const ATTSTATSSLOT_NUMBERS: u32 = 2; +pub const FORMAT_PROC_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_PROC_FORCE_QUALIFY: u32 = 2; +pub const FORMAT_OPERATOR_INVALID_AS_NULL: u32 = 1; +pub const FORMAT_OPERATOR_FORCE_QUALIFY: u32 = 2; +pub const RULE_INDEXDEF_PRETTY: u32 = 1; +pub const RULE_INDEXDEF_KEYS_ONLY: u32 = 2; pub const DEFAULT_EQ_SEL: f64 = 0.005; pub const DEFAULT_INEQ_SEL: f64 = 0.3333333333333333; pub const DEFAULT_RANGE_INEQ_SEL: f64 = 0.005; @@ -19724,6 +19747,92 @@ pub struct HeapPageFreeze { pub struct GlobalVisState { _unused: [u8; 0], } +pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; +pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; +pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; +pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; +pub type SyncRequestType = ::std::os::raw::c_uint; +pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; +pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; +pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; +pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; +pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; +pub type SyncRequestHandler = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FileTag { + pub handler: int16, + pub forknum: int16, + pub rlocator: RelFileLocator, + pub segno: uint32, +} +impl Default for FileTag { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const MultiXactStatus_MultiXactStatusForKeyShare: MultiXactStatus = 0; +pub const MultiXactStatus_MultiXactStatusForShare: MultiXactStatus = 1; +pub const MultiXactStatus_MultiXactStatusForNoKeyUpdate: MultiXactStatus = 2; +pub const MultiXactStatus_MultiXactStatusForUpdate: MultiXactStatus = 3; +pub const MultiXactStatus_MultiXactStatusNoKeyUpdate: MultiXactStatus = 4; +pub const MultiXactStatus_MultiXactStatusUpdate: MultiXactStatus = 5; +pub type MultiXactStatus = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MultiXactMember { + pub xid: TransactionId, + pub status: MultiXactStatus, +} +impl Default for MultiXactMember { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug)] +pub struct xl_multixact_create { + pub mid: MultiXactId, + pub moff: MultiXactOffset, + pub nmembers: int32, + pub members: __IncompleteArrayField, +} +impl Default for xl_multixact_create { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct xl_multixact_truncate { + pub oldestMultiDB: Oid, + pub startTruncOff: MultiXactId, + pub endTruncOff: MultiXactId, + pub startTruncMemb: MultiXactOffset, + pub endTruncMemb: MultiXactOffset, +} +impl Default for xl_multixact_truncate { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const LWLockWaitState_LW_WS_NOT_WAITING: LWLockWaitState = 0; pub const LWLockWaitState_LW_WS_WAITING: LWLockWaitState = 1; pub const LWLockWaitState_LW_WS_PENDING_WAKEUP: LWLockWaitState = 2; @@ -20764,6 +20873,25 @@ impl Default for FormData_pg_extension { pub type Form_pg_extension = *mut FormData_pg_extension; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FormData_pg_foreign_data_wrapper { + pub oid: Oid, + pub fdwname: NameData, + pub fdwowner: Oid, + pub fdwhandler: Oid, + pub fdwvalidator: Oid, +} +impl Default for FormData_pg_foreign_data_wrapper { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type Form_pg_foreign_data_wrapper = *mut FormData_pg_foreign_data_wrapper; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct FormData_pg_foreign_server { pub oid: Oid, pub srvname: NameData, @@ -21956,35 +22084,6 @@ pub type BgwHandleStatus = ::std::os::raw::c_uint; pub struct BackgroundWorkerHandle { _unused: [u8; 0], } -pub const SyncRequestType_SYNC_REQUEST: SyncRequestType = 0; -pub const SyncRequestType_SYNC_UNLINK_REQUEST: SyncRequestType = 1; -pub const SyncRequestType_SYNC_FORGET_REQUEST: SyncRequestType = 2; -pub const SyncRequestType_SYNC_FILTER_REQUEST: SyncRequestType = 3; -pub type SyncRequestType = ::std::os::raw::c_uint; -pub const SyncRequestHandler_SYNC_HANDLER_MD: SyncRequestHandler = 0; -pub const SyncRequestHandler_SYNC_HANDLER_CLOG: SyncRequestHandler = 1; -pub const SyncRequestHandler_SYNC_HANDLER_COMMIT_TS: SyncRequestHandler = 2; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_OFFSET: SyncRequestHandler = 3; -pub const SyncRequestHandler_SYNC_HANDLER_MULTIXACT_MEMBER: SyncRequestHandler = 4; -pub const SyncRequestHandler_SYNC_HANDLER_NONE: SyncRequestHandler = 5; -pub type SyncRequestHandler = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FileTag { - pub handler: int16, - pub forknum: int16, - pub rlocator: RelFileLocator, - pub segno: uint32, -} -impl Default for FileTag { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} pub type XidStatus = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -33487,6 +33586,104 @@ extern "C" { buffer: Buffer, snapshot: Snapshot, ); + pub fn InitSync(); + pub fn SyncPreCheckpoint(); + pub fn SyncPostCheckpoint(); + pub fn ProcessSyncRequests(); + pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); + pub fn RegisterSyncRequest( + ftag: *const FileTag, + type_: SyncRequestType, + retryOnError: bool, + ) -> bool; + pub fn MultiXactIdCreate( + xid1: TransactionId, + status1: MultiXactStatus, + xid2: TransactionId, + status2: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdExpand( + multi: MultiXactId, + xid: TransactionId, + status: MultiXactStatus, + ) -> MultiXactId; + pub fn MultiXactIdCreateFromMembers( + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> MultiXactId; + pub fn ReadNextMultiXactId() -> MultiXactId; + pub fn ReadMultiXactIdRange(oldest: *mut MultiXactId, next: *mut MultiXactId); + pub fn MultiXactIdIsRunning(multi: MultiXactId, isLockOnly: bool) -> bool; + pub fn MultiXactIdSetOldestMember(); + pub fn GetMultiXactIdMembers( + multi: MultiXactId, + members: *mut *mut MultiXactMember, + from_pgupgrade: bool, + isLockOnly: bool, + ) -> ::std::os::raw::c_int; + pub fn MultiXactIdPrecedes(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn MultiXactIdPrecedesOrEquals(multi1: MultiXactId, multi2: MultiXactId) -> bool; + pub fn multixactoffsetssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn multixactmemberssyncfiletag( + ftag: *const FileTag, + path: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; + pub fn AtEOXact_MultiXact(); + pub fn AtPrepare_MultiXact(); + pub fn PostPrepare_MultiXact(xid: TransactionId); + pub fn MultiXactShmemSize() -> Size; + pub fn MultiXactShmemInit(); + pub fn BootStrapMultiXact(); + pub fn StartupMultiXact(); + pub fn TrimMultiXact(); + pub fn SetMultiXactIdLimit( + oldest_datminmxid: MultiXactId, + oldest_datoid: Oid, + is_startup: bool, + ); + pub fn MultiXactGetCheckptMulti( + is_shutdown: bool, + nextMulti: *mut MultiXactId, + nextMultiOffset: *mut MultiXactOffset, + oldestMulti: *mut MultiXactId, + oldestMultiDB: *mut Oid, + ); + pub fn CheckPointMultiXact(); + pub fn GetOldestMultiXactId() -> MultiXactId; + pub fn TruncateMultiXact(newOldestMulti: MultiXactId, newOldestMultiDB: Oid); + pub fn MultiXactSetNextMXact(nextMulti: MultiXactId, nextMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceNextMXact(minMulti: MultiXactId, minMultiOffset: MultiXactOffset); + pub fn MultiXactAdvanceOldest(oldestMulti: MultiXactId, oldestMultiDB: Oid); + pub fn MultiXactMemberFreezeThreshold() -> ::std::os::raw::c_int; + pub fn multixact_twophase_recover( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postcommit( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_twophase_postabort( + xid: TransactionId, + info: uint16, + recdata: *mut ::std::os::raw::c_void, + len: uint32, + ); + pub fn multixact_redo(record: *mut XLogReaderState); + pub fn multixact_desc(buf: StringInfo, record: *mut XLogReaderState); + pub fn multixact_identify(info: uint8) -> *const ::std::os::raw::c_char; + pub fn mxid_to_string( + multi: MultiXactId, + nmembers: ::std::os::raw::c_int, + members: *mut MultiXactMember, + ) -> *mut ::std::os::raw::c_char; pub fn LWLockAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockConditionalAcquire(lock: *mut LWLock, mode: LWLockMode) -> bool; pub fn LWLockAcquireOrWait(lock: *mut LWLock, mode: LWLockMode) -> bool; @@ -35813,16 +36010,6 @@ extern "C" { pub fn BackgroundWorkerInitializeConnectionByOid(dboid: Oid, useroid: Oid, flags: uint32); pub fn BackgroundWorkerBlockSignals(); pub fn BackgroundWorkerUnblockSignals(); - pub fn InitSync(); - pub fn SyncPreCheckpoint(); - pub fn SyncPostCheckpoint(); - pub fn ProcessSyncRequests(); - pub fn RememberSyncRequest(ftag: *const FileTag, type_: SyncRequestType); - pub fn RegisterSyncRequest( - ftag: *const FileTag, - type_: SyncRequestType, - retryOnError: bool, - ) -> bool; pub fn TransactionIdSetTreeStatus( xid: TransactionId, nsubxids: ::std::os::raw::c_int, @@ -36722,6 +36909,56 @@ extern "C" { tab: *const ::std::os::raw::c_uchar, noError: bool, ) -> ::std::os::raw::c_int; + pub fn pq_beginmessage(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_beginmessage_reuse(buf: StringInfo, msgtype: ::std::os::raw::c_char); + pub fn pq_endmessage(buf: StringInfo); + pub fn pq_endmessage_reuse(buf: StringInfo); + pub fn pq_sendbytes( + buf: StringInfo, + data: *const ::std::os::raw::c_void, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_sendcountedtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + countincludesself: bool, + ); + pub fn pq_sendtext( + buf: StringInfo, + str_: *const ::std::os::raw::c_char, + slen: ::std::os::raw::c_int, + ); + pub fn pq_sendstring(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_send_ascii_string(buf: StringInfo, str_: *const ::std::os::raw::c_char); + pub fn pq_sendfloat4(buf: StringInfo, f: float4); + pub fn pq_sendfloat8(buf: StringInfo, f: float8); + pub fn pq_begintypsend(buf: StringInfo); + pub fn pq_endtypsend(buf: StringInfo) -> *mut bytea; + pub fn pq_puttextmessage(msgtype: ::std::os::raw::c_char, str_: *const ::std::os::raw::c_char); + pub fn pq_putemptymessage(msgtype: ::std::os::raw::c_char); + pub fn pq_getmsgbyte(msg: StringInfo) -> ::std::os::raw::c_int; + pub fn pq_getmsgint(msg: StringInfo, b: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; + pub fn pq_getmsgint64(msg: StringInfo) -> int64; + pub fn pq_getmsgfloat4(msg: StringInfo) -> float4; + pub fn pq_getmsgfloat8(msg: StringInfo) -> float8; + pub fn pq_getmsgbytes( + msg: StringInfo, + datalen: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; + pub fn pq_copymsgbytes( + msg: StringInfo, + buf: *mut ::std::os::raw::c_char, + datalen: ::std::os::raw::c_int, + ); + pub fn pq_getmsgtext( + msg: StringInfo, + rawbytes: ::std::os::raw::c_int, + nbytes: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; + pub fn pq_getmsgstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgrawstring(msg: StringInfo) -> *const ::std::os::raw::c_char; + pub fn pq_getmsgend(msg: StringInfo); pub fn RegisterExtensibleNodeMethods(methods: *const ExtensibleNodeMethods); pub fn GetExtensibleNodeMethods( extnodename: *const ::std::os::raw::c_char, @@ -43762,6 +43999,71 @@ extern "C" { pub fn get_publication_name(pubid: Oid, missing_ok: bool) -> *mut ::std::os::raw::c_char; pub fn get_subscription_oid(subname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; pub fn get_subscription_name(subid: Oid, missing_ok: bool) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_extended( + procedure_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn format_operator_extended( + operator_oid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn stringToQualifiedNameList( + string: *const ::std::os::raw::c_char, + escontext: *mut Node, + ) -> *mut List; + pub fn format_procedure(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_qualified(procedure_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_procedure_parts( + procedure_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn format_operator(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_qualified(operator_oid: Oid) -> *mut ::std::os::raw::c_char; + pub fn format_operator_parts( + operator_oid: Oid, + objnames: *mut *mut List, + objargs: *mut *mut List, + missing_ok: bool, + ); + pub fn pg_get_indexdef_string(indexrelid: Oid) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns(indexrelid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_indexdef_columns_extended( + indexrelid: Oid, + flags: bits16, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_querydef(query: *mut Query, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partkeydef_columns(relid: Oid, pretty: bool) -> *mut ::std::os::raw::c_char; + pub fn pg_get_partconstrdef_string( + partitionId: Oid, + aliasname: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; + pub fn pg_get_constraintdef_command(constraintId: Oid) -> *mut ::std::os::raw::c_char; + pub fn deparse_expression( + expr: *mut Node, + dpcontext: *mut List, + forceprefix: bool, + showimplicit: bool, + ) -> *mut ::std::os::raw::c_char; + pub fn deparse_context_for(aliasname: *const ::std::os::raw::c_char, relid: Oid) -> *mut List; + pub fn deparse_context_for_plan_tree( + pstmt: *mut PlannedStmt, + rtable_names: *mut List, + ) -> *mut List; + pub fn set_deparse_context_plan( + dpcontext: *mut List, + plan: *mut Plan, + ancestors: *mut List, + ) -> *mut List; + pub fn select_rtable_names_for_explain( + rtable: *mut List, + rels_used: *mut Bitmapset, + ) -> *mut List; + pub fn generate_collation_name(collid: Oid) -> *mut ::std::os::raw::c_char; + pub fn generate_opclass_name(opclass: Oid) -> *mut ::std::os::raw::c_char; + pub fn get_range_partbound_string(bound_datums: *mut List) -> *mut ::std::os::raw::c_char; + pub fn pg_get_statisticsobjdef_string(statextid: Oid) -> *mut ::std::os::raw::c_char; pub fn pg_prng_seed(state: *mut pg_prng_state, seed: uint64); pub fn pg_prng_fseed(state: *mut pg_prng_state, fseed: f64); pub fn pg_prng_seed_check(state: *mut pg_prng_state) -> bool; diff --git a/pgrx-pg-sys/src/include/pg16_oids.rs b/pgrx-pg-sys/src/include/pg16_oids.rs index 681497afd..b9661d1e0 100644 --- a/pgrx-pg-sys/src/include/pg16_oids.rs +++ b/pgrx-pg-sys/src/include/pg16_oids.rs @@ -70,6 +70,7 @@ pub enum BuiltinOid { FLOAT8ARRAYOID = 1022, FLOAT8OID = 701, FLOAT8_BTREE_OPS_OID = 3123, + ForeignDataWrapperRelationId = 2328, ForeignServerRelationId = 1417, ForeignTableRelationId = 3118, GIN_AM_OID = 2742, @@ -325,6 +326,7 @@ impl BuiltinOid { 1022 => Ok(BuiltinOid::FLOAT8ARRAYOID), 701 => Ok(BuiltinOid::FLOAT8OID), 3123 => Ok(BuiltinOid::FLOAT8_BTREE_OPS_OID), + 2328 => Ok(BuiltinOid::ForeignDataWrapperRelationId), 1417 => Ok(BuiltinOid::ForeignServerRelationId), 3118 => Ok(BuiltinOid::ForeignTableRelationId), 2742 => Ok(BuiltinOid::GIN_AM_OID), diff --git a/pgrx-sql-entity-graph/Cargo.toml b/pgrx-sql-entity-graph/Cargo.toml index bdd5a2c2b..d3df08dbc 100644 --- a/pgrx-sql-entity-graph/Cargo.toml +++ b/pgrx-sql-entity-graph/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx-sql-entity-graph" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Sql Entity Graph for `pgrx`" diff --git a/pgrx-tests/Cargo.toml b/pgrx-tests/Cargo.toml index af4d7d53c..d6a077ba9 100644 --- a/pgrx-tests/Cargo.toml +++ b/pgrx-tests/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx-tests" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "Test framework for 'pgrx'-based Postgres extensions" @@ -49,8 +49,8 @@ clap-cargo = "0.11.0" owo-colors = "3.5" once_cell = "1.18.0" libc = "0.2.149" -pgrx-macros = { path = "../pgrx-macros", version = "=0.11.2" } -pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.2" } +pgrx-macros = { path = "../pgrx-macros", version = "=0.11.3" } +pgrx-pg-config = { path = "../pgrx-pg-config", version = "=0.11.3" } postgres = "0.19.7" proptest = { version = "1", optional = true } regex = "1.10.0" @@ -68,4 +68,4 @@ trybuild = "1" [dependencies.pgrx] path = "../pgrx" default-features = false -version = "=0.11.2" +version = "=0.11.3" diff --git a/pgrx/Cargo.toml b/pgrx/Cargo.toml index 8a1189711..12a0ea353 100644 --- a/pgrx/Cargo.toml +++ b/pgrx/Cargo.toml @@ -10,7 +10,7 @@ [package] name = "pgrx" -version = "0.11.2" +version = "0.11.3" authors = ["PgCentral Foundation, Inc. "] license = "MIT" description = "pgrx: A Rust framework for creating Postgres extensions" @@ -44,9 +44,9 @@ no-default-features = true rustc-args = ["--cfg", "docsrs"] [dependencies] -pgrx-macros = { path = "../pgrx-macros", version = "=0.11.2" } -pgrx-pg-sys = { path = "../pgrx-pg-sys", version = "=0.11.2" } -pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.2" } +pgrx-macros = { path = "../pgrx-macros", version = "=0.11.3" } +pgrx-pg-sys = { path = "../pgrx-pg-sys", version = "=0.11.3" } +pgrx-sql-entity-graph = { path = "../pgrx-sql-entity-graph", version = "=0.11.3" } # used to internally impl things once_cell = "1.18.0" # polyfill until std::lazy::OnceCell stabilizes