diff --git a/Cargo.lock b/Cargo.lock index 1b84db60c..7c484cea9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cargo-pgx" -version = "0.1.15" +version = "0.1.16" dependencies = [ "clap", "colored", @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309f13e3f4be6d5917178c84db67c0b9a09177ac16d4f9a7313a767a68adaa77" +checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" dependencies = [ "futures-channel", "futures-core", @@ -507,9 +507,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3b03bd32f6ec7885edeb99acd1e47e20e34fd4dfd3c6deed6fcac8a9d28f6a" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", "futures-sink", @@ -517,15 +517,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed8aeae2b6ab243ebabe6f54cd4cf53054d98883d5d326128af7d57a9ca5cd3d" +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-executor" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7836b36b7533d16fd5937311d98ba8965ab81030de8b0024c299dd5d51fb9b" +checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" dependencies = [ "futures-core", "futures-task", @@ -534,15 +534,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41234e71d5e8ca73d01563974ef6f50e516d71e18f1a2f1184742e31f5d469f" +checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" [[package]] name = "futures-macro" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3520e0eb4e704e88d771b92d51273ee212997f0d8282f17f5d8ff1cb39104e42" +checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -552,24 +552,24 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c72d188479368953c6c8c7140e40d7a4401674ab3b98a41e60e515d6cbdbe5de" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08944cea9021170d383287169859c0ca8147d9ec285978393109954448f33cc7" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd206efbe2ca683b2ce138ccdf61e1b0a63f5816dcedc9d8654c500ba0cea6" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-channel", "futures-core", @@ -626,9 +626,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -643,9 +643,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "half" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "hash32" @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -745,9 +745,9 @@ checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" [[package]] name = "libloading" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9367bdfa836b7e3cf895867f7a570283444da90562980ec2263d6e1569b16bc" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -987,7 +987,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pgx" -version = "0.1.15" +version = "0.1.16" dependencies = [ "atomic-traits", "bitflags", @@ -1008,7 +1008,7 @@ dependencies = [ [[package]] name = "pgx-macros" -version = "0.1.15" +version = "0.1.16" dependencies = [ "pgx-utils", "proc-macro2", @@ -1019,7 +1019,7 @@ dependencies = [ [[package]] name = "pgx-parent" -version = "0.1.15" +version = "0.1.16" dependencies = [ "cargo-pgx", "pgx", @@ -1030,7 +1030,7 @@ dependencies = [ [[package]] name = "pgx-pg-sys" -version = "0.1.15" +version = "0.1.16" dependencies = [ "bindgen", "build-deps", @@ -1048,7 +1048,7 @@ dependencies = [ [[package]] name = "pgx-tests" -version = "0.1.15" +version = "0.1.16" dependencies = [ "colored", "lazy_static", @@ -1066,7 +1066,7 @@ dependencies = [ [[package]] name = "pgx-utils" -version = "0.1.15" +version = "0.1.16" dependencies = [ "colored", "dirs", @@ -1256,7 +1256,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" dependencies = [ - "getrandom 0.2.1", + "getrandom 0.2.2", ] [[package]] @@ -1424,9 +1424,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "seahash" -version = "4.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ee459cae272d224928ca09a1df5406da984f263dc544f9f8bde92a8c3dc916" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "security-framework" @@ -1468,9 +1468,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.119" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bdd36f49e35b61d49efd8aa7fc068fd295961fd2286d0b2ee9a4c7a14e99cc3" +checksum = "166b2349061381baf54a58e4b13c89369feb0ef2eaa57198899e2312aac30aab" dependencies = [ "serde_derive", ] @@ -1487,9 +1487,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.119" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552954ce79a059ddd5fd68c271592374bd15cab2274970380c000118aeffe1cd" +checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775" dependencies = [ "proc-macro2", "quote", @@ -1772,9 +1772,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d258221f566b6c803c7b4714abadc080172b272090cdc5e244a6d4dd13c3a6bd" +checksum = "0ca04cec6ff2474c638057b65798f60ac183e5e79d3448bb7163d36a39cff6ec" dependencies = [ "autocfg", "bytes", @@ -1911,7 +1911,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.1", + "getrandom 0.2.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 609651912..47d523716 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx-parent" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" diff --git a/cargo-pgx/Cargo.toml b/cargo-pgx/Cargo.toml index 43158061d..261f9a393 100644 --- a/cargo-pgx/Cargo.toml +++ b/cargo-pgx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-pgx" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -17,7 +17,7 @@ clap = { version = "2.33.3", features = [ "yaml" ] } colored = "2.0.0" env_proxy = "0.4.1" num_cpus = "1.13.0" -pgx-utils = { path = "../pgx-utils", version = "0.1.15"} +pgx-utils = { path = "../pgx-utils", version = "0.1.16"} proc-macro2 = { version = "1.0.24", features = [ "span-locations" ] } quote = "1.0.8" rayon = "1.5.0" diff --git a/cargo-pgx/src/templates/cargo_toml b/cargo-pgx/src/templates/cargo_toml index 6d269008b..72a0914cb 100644 --- a/cargo-pgx/src/templates/cargo_toml +++ b/cargo-pgx/src/templates/cargo_toml @@ -15,11 +15,11 @@ pg13 = ["pgx/pg13", "pgx-tests/pg13" ] pg_test = [] [dependencies] -pgx = "0.1.15" -pgx-macros = "0.1.15" +pgx = "0.1.16" +pgx-macros = "0.1.16" [dev-dependencies] -pgx-tests = "0.1.15" +pgx-tests = "0.1.16" [profile.dev] panic = "unwind" diff --git a/pgx-macros/Cargo.toml b/pgx-macros/Cargo.toml index e3b370534..ed05ce108 100644 --- a/pgx-macros/Cargo.toml +++ b/pgx-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx-macros" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -14,7 +14,7 @@ readme = "README.md" proc-macro = true [dependencies] -pgx-utils = { path = "../pgx-utils", version = "0.1.15"} +pgx-utils = { path = "../pgx-utils", version = "0.1.16"} proc-macro2 = "1.0.24" quote = "1.0.8" syn = { version = "1.0.58", features = [ "extra-traits", "full", "fold", "parsing" ] } diff --git a/pgx-pg-sys/Cargo.toml b/pgx-pg-sys/Cargo.toml index 12e9e8a2f..b23fbb4fe 100644 --- a/pgx-pg-sys/Cargo.toml +++ b/pgx-pg-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx-pg-sys" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -25,14 +25,14 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] memoffset = "0.6.1" once_cell = "1.5.2" -pgx-macros = { path = "../pgx-macros/", version = "0.1.15"} +pgx-macros = { path = "../pgx-macros/", version = "0.1.16"} [build-dependencies] bindgen = "0.56.0" build-deps = "0.1.4" colored = "2.0.0" num_cpus = "1.13.0" -pgx-utils = { path = "../pgx-utils/", version = "0.1.15"} +pgx-utils = { path = "../pgx-utils/", version = "0.1.16"} proc-macro2 = "1.0.24" quote = "1.0.8" rayon = "1.5.0" diff --git a/pgx-pg-sys/include/pg10.h b/pgx-pg-sys/include/pg10.h index 77c0fcd0a..1eec825b2 100644 --- a/pgx-pg-sys/include/pg10.h +++ b/pgx-pg-sys/include/pg10.h @@ -6,6 +6,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "pgstat.h" + #include "access/amapi.h" #include "access/genam.h" #include "access/heapam.h" @@ -16,73 +17,81 @@ #include "access/skey.h" #include "access/sysattr.h" #include "access/xact.h" - -#define ScanKey struct ScanKeyData * -#include "nodes/execnodes.h" -#undef ScanKey - +#include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/namespace.h" +#include "catalog/objectaddress.h" +#include "catalog/pg_class.h" #include "catalog/pg_enum.h" #include "catalog/pg_proc.h" +#include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/dbcommands.h" +#include "commands/defrem.h" #include "commands/event_trigger.h" +#include "commands/explain.h" #include "commands/proclang.h" -#include "catalog/dependency.h" -#include "catalog/objectaddress.h" -#include "catalog/pg_trigger.h" #include "commands/tablecmds.h" #include "commands/trigger.h" +#include "commands/vacuum.h" #include "executor/executor.h" #include "executor/spi.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" + +#define ScanKey struct ScanKeyData * #include "nodes/execnodes.h" +#undef ScanKey + #include "nodes/extensible.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "nodes/nodes.h" #include "nodes/print.h" -#include "nodes/relation.h" #include "nodes/replnodes.h" #include "nodes/tidbitmap.h" #include "nodes/value.h" -#include "optimizer/cost.h" #include "optimizer/clauses.h" -#include "optimizer/paths.h" +#include "optimizer/cost.h" #include "optimizer/pathnode.h" +#include "optimizer/paths.h" +#include "optimizer/planmain.h" #include "optimizer/planner.h" #include "optimizer/restrictinfo.h" +#include "optimizer/tlist.h" #include "parser/parse_func.h" #include "parser/parse_type.h" #include "parser/parser.h" +#include "parser/parsetree.h" #include "postmaster/bgworker.h" #include "replication/output_plugin.h" #include "rewrite/rewriteHandler.h" #include "storage/block.h" #include "storage/bufmgr.h" +#include "storage/ipc.h" +#include "storage/itemptr.h" #include "storage/lwlock.h" #include "storage/procarray.h" -#include "storage/itemptr.h" -#include "storage/ipc.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "utils/builtins.h" #include "utils/date.h" + #define double float8 #include "utils/geo_decls.h" #undef double + #include "utils/guc.h" #include "utils/json.h" #include "utils/jsonb.h" -#include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/syscache.h" #include "utils/typcache.h" diff --git a/pgx-pg-sys/include/pg11.h b/pgx-pg-sys/include/pg11.h index 90c952899..d2733a22a 100644 --- a/pgx-pg-sys/include/pg11.h +++ b/pgx-pg-sys/include/pg11.h @@ -3,6 +3,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "pgstat.h" + #include "access/amapi.h" #include "access/genam.h" #include "access/heapam.h" @@ -13,30 +14,33 @@ #include "access/skey.h" #include "access/sysattr.h" #include "access/xact.h" - -#define ScanKey struct ScanKeyData * -#include "nodes/execnodes.h" -#undef ScanKey - +#include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/namespace.h" +#include "catalog/objectaddress.h" +#include "catalog/pg_class.h" #include "catalog/pg_enum.h" #include "catalog/pg_proc.h" +#include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/dbcommands.h" +#include "commands/defrem.h" #include "commands/event_trigger.h" -#include "commands/tablecmds.h" +#include "commands/explain.h" #include "commands/proclang.h" -#include "catalog/dependency.h" -#include "catalog/objectaddress.h" -#include "catalog/pg_trigger.h" +#include "commands/tablecmds.h" #include "commands/trigger.h" +#include "commands/vacuum.h" #include "executor/executor.h" #include "executor/spi.h" #include "foreign/fdwapi.h" #include "foreign/foreign.h" + +#define ScanKey struct ScanKeyData * #include "nodes/execnodes.h" +#undef ScanKey + #include "nodes/extensible.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" @@ -46,40 +50,46 @@ #include "nodes/replnodes.h" #include "nodes/tidbitmap.h" #include "nodes/value.h" -#include "optimizer/cost.h" #include "optimizer/clauses.h" -#include "optimizer/paths.h" +#include "optimizer/cost.h" #include "optimizer/pathnode.h" +#include "optimizer/paths.h" +#include "optimizer/planmain.h" #include "optimizer/planner.h" #include "optimizer/restrictinfo.h" +#include "optimizer/tlist.h" #include "parser/parse_func.h" #include "parser/parse_type.h" #include "parser/parser.h" +#include "parser/parsetree.h" #include "postmaster/bgworker.h" #include "replication/output_plugin.h" #include "rewrite/rewriteHandler.h" #include "storage/block.h" #include "storage/bufmgr.h" +#include "storage/ipc.h" +#include "storage/itemptr.h" #include "storage/lwlock.h" #include "storage/procarray.h" -#include "storage/itemptr.h" -#include "storage/ipc.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "utils/builtins.h" #include "utils/date.h" + #define double float8 #include "utils/geo_decls.h" #undef double + +#include "utils/guc.h" #include "utils/json.h" #include "utils/jsonb.h" -#include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/syscache.h" #include "utils/typcache.h" -#include "utils/snapmgr.h" diff --git a/pgx-pg-sys/include/pg12.h b/pgx-pg-sys/include/pg12.h index 25746bc7b..54c8a0cc9 100644 --- a/pgx-pg-sys/include/pg12.h +++ b/pgx-pg-sys/include/pg12.h @@ -3,6 +3,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "pgstat.h" + #include "access/amapi.h" #include "access/genam.h" #include "access/heapam.h" @@ -15,20 +16,24 @@ #include "access/sysattr.h" #include "access/tableam.h" #include "access/xact.h" +#include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/namespace.h" +#include "catalog/objectaddress.h" +#include "catalog/pg_class.h" #include "catalog/pg_enum.h" #include "catalog/pg_proc.h" +#include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/dbcommands.h" +#include "commands/defrem.h" #include "commands/event_trigger.h" +#include "commands/explain.h" #include "commands/proclang.h" #include "commands/tablecmds.h" -#include "catalog/dependency.h" -#include "catalog/objectaddress.h" -#include "catalog/pg_trigger.h" #include "commands/trigger.h" +#include "commands/vacuum.h" #include "executor/executor.h" #include "executor/spi.h" #include "foreign/fdwapi.h" @@ -38,45 +43,48 @@ #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "nodes/nodes.h" -#include "nodes/pathnodes.h" #include "nodes/print.h" #include "nodes/replnodes.h" -#include "nodes/supportnodes.h" #include "nodes/tidbitmap.h" #include "nodes/value.h" -#include "optimizer/cost.h" #include "optimizer/clauses.h" +#include "optimizer/cost.h" #include "optimizer/optimizer.h" -#include "optimizer/paths.h" #include "optimizer/pathnode.h" +#include "optimizer/paths.h" +#include "optimizer/planmain.h" #include "optimizer/planner.h" #include "optimizer/restrictinfo.h" +#include "optimizer/tlist.h" #include "parser/parse_func.h" #include "parser/parse_type.h" #include "parser/parser.h" +#include "parser/parsetree.h" #include "postmaster/bgworker.h" #include "replication/output_plugin.h" #include "rewrite/rewriteHandler.h" #include "storage/block.h" #include "storage/bufmgr.h" +#include "storage/ipc.h" +#include "storage/itemptr.h" #include "storage/lwlock.h" #include "storage/procarray.h" -#include "storage/itemptr.h" -#include "storage/ipc.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "utils/builtins.h" #include "utils/date.h" +#include "utils/float.h" #include "utils/geo_decls.h" #include "utils/guc.h" #include "utils/json.h" #include "utils/jsonb.h" -#include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/syscache.h" #include "utils/typcache.h" diff --git a/pgx-pg-sys/include/pg13.h b/pgx-pg-sys/include/pg13.h index 25746bc7b..48fca8da7 100644 --- a/pgx-pg-sys/include/pg13.h +++ b/pgx-pg-sys/include/pg13.h @@ -3,6 +3,7 @@ #include "funcapi.h" #include "miscadmin.h" #include "pgstat.h" + #include "access/amapi.h" #include "access/genam.h" #include "access/heapam.h" @@ -13,22 +14,26 @@ #include "access/relscan.h" #include "access/skey.h" #include "access/sysattr.h" -#include "access/tableam.h" +#include "access/table.h" #include "access/xact.h" +#include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/namespace.h" +#include "catalog/objectaddress.h" +#include "catalog/pg_class.h" #include "catalog/pg_enum.h" #include "catalog/pg_proc.h" +#include "catalog/pg_trigger.h" #include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/dbcommands.h" +#include "commands/defrem.h" #include "commands/event_trigger.h" +#include "commands/explain.h" #include "commands/proclang.h" #include "commands/tablecmds.h" -#include "catalog/dependency.h" -#include "catalog/objectaddress.h" -#include "catalog/pg_trigger.h" #include "commands/trigger.h" +#include "commands/vacuum.h" #include "executor/executor.h" #include "executor/spi.h" #include "foreign/fdwapi.h" @@ -38,45 +43,48 @@ #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "nodes/nodes.h" -#include "nodes/pathnodes.h" #include "nodes/print.h" #include "nodes/replnodes.h" -#include "nodes/supportnodes.h" #include "nodes/tidbitmap.h" #include "nodes/value.h" -#include "optimizer/cost.h" #include "optimizer/clauses.h" +#include "optimizer/cost.h" #include "optimizer/optimizer.h" -#include "optimizer/paths.h" #include "optimizer/pathnode.h" +#include "optimizer/paths.h" +#include "optimizer/planmain.h" #include "optimizer/planner.h" #include "optimizer/restrictinfo.h" +#include "optimizer/tlist.h" #include "parser/parse_func.h" #include "parser/parse_type.h" #include "parser/parser.h" +#include "parser/parsetree.h" #include "postmaster/bgworker.h" #include "replication/output_plugin.h" #include "rewrite/rewriteHandler.h" #include "storage/block.h" #include "storage/bufmgr.h" +#include "storage/ipc.h" +#include "storage/itemptr.h" #include "storage/lwlock.h" #include "storage/procarray.h" -#include "storage/itemptr.h" -#include "storage/ipc.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "utils/builtins.h" #include "utils/date.h" +#include "utils/float.h" #include "utils/geo_decls.h" #include "utils/guc.h" #include "utils/json.h" #include "utils/jsonb.h" -#include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/memutils.h" #include "utils/palloc.h" #include "utils/rel.h" #include "utils/relcache.h" +#include "utils/sampling.h" #include "utils/selfuncs.h" #include "utils/snapmgr.h" +#include "utils/syscache.h" #include "utils/typcache.h" diff --git a/pgx-pg-sys/src/pg10.rs b/pgx-pg-sys/src/pg10.rs index a540e19dc..3f18bd63c 100644 --- a/pgx-pg-sys/src/pg10.rs +++ b/pgx-pg-sys/src/pg10.rs @@ -2568,6 +2568,11 @@ pub const XACT_XINFO_HAS_AE_LOCKS: u32 = 64; pub const XACT_COMPLETION_APPLY_FEEDBACK: u32 = 536870912; pub const XACT_COMPLETION_UPDATE_RELCACHE_FILE: u32 = 1073741824; pub const XACT_COMPLETION_FORCE_SYNC_COMMIT: u32 = 2147483648; +pub const PERFORM_DELETION_INTERNAL: u32 = 1; +pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; +pub const PERFORM_DELETION_QUIETLY: u32 = 4; +pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; +pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; pub const DEFAULT_INDEX_TYPE: &'static [u8; 6usize] = b"btree\0"; pub const REINDEX_REL_PROCESS_TOAST: u32 = 1; pub const REINDEX_REL_SUPPRESS_INDEX_USE: u32 = 2; @@ -2622,6 +2627,37 @@ pub const PROARGMODE_OUT: u8 = 111u8; pub const PROARGMODE_INOUT: u8 = 98u8; pub const PROARGMODE_VARIADIC: u8 = 118u8; pub const PROARGMODE_TABLE: u8 = 116u8; +pub const TriggerRelationId: u32 = 2620; +pub const Natts_pg_trigger: u32 = 17; +pub const Anum_pg_trigger_tgrelid: u32 = 1; +pub const Anum_pg_trigger_tgname: u32 = 2; +pub const Anum_pg_trigger_tgfoid: u32 = 3; +pub const Anum_pg_trigger_tgtype: u32 = 4; +pub const Anum_pg_trigger_tgenabled: u32 = 5; +pub const Anum_pg_trigger_tgisinternal: u32 = 6; +pub const Anum_pg_trigger_tgconstrrelid: u32 = 7; +pub const Anum_pg_trigger_tgconstrindid: u32 = 8; +pub const Anum_pg_trigger_tgconstraint: u32 = 9; +pub const Anum_pg_trigger_tgdeferrable: u32 = 10; +pub const Anum_pg_trigger_tginitdeferred: u32 = 11; +pub const Anum_pg_trigger_tgnargs: u32 = 12; +pub const Anum_pg_trigger_tgattr: u32 = 13; +pub const Anum_pg_trigger_tgargs: u32 = 14; +pub const Anum_pg_trigger_tgqual: u32 = 15; +pub const Anum_pg_trigger_tgoldtable: u32 = 16; +pub const Anum_pg_trigger_tgnewtable: u32 = 17; +pub const TRIGGER_TYPE_ROW: u32 = 1; +pub const TRIGGER_TYPE_BEFORE: u32 = 2; +pub const TRIGGER_TYPE_INSERT: u32 = 4; +pub const TRIGGER_TYPE_DELETE: u32 = 8; +pub const TRIGGER_TYPE_UPDATE: u32 = 16; +pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; +pub const TRIGGER_TYPE_INSTEAD: u32 = 64; +pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; +pub const TRIGGER_TYPE_STATEMENT: u32 = 0; +pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; +pub const TRIGGER_TYPE_AFTER: u32 = 0; +pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TypeRelationId: u32 = 1247; pub const TypeRelation_Rowtype_Id: u32 = 71; pub const Natts_pg_type: u32 = 30; @@ -2770,11 +2806,6 @@ pub const TYPCATEGORY_TIMESPAN: u8 = 84u8; pub const TYPCATEGORY_USER: u8 = 85u8; pub const TYPCATEGORY_BITSTRING: u8 = 86u8; pub const TYPCATEGORY_UNKNOWN: u8 = 88u8; -pub const PERFORM_DELETION_INTERNAL: u32 = 1; -pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; -pub const PERFORM_DELETION_QUIETLY: u32 = 4; -pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; -pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; pub const EventTriggerRelationId: u32 = 3466; pub const Natts_pg_event_trigger: u32 = 6; pub const Anum_pg_event_trigger_evtname: u32 = 1; @@ -2787,37 +2818,6 @@ pub const AT_REWRITE_ALTER_PERSISTENCE: u32 = 1; pub const AT_REWRITE_DEFAULT_VAL: u32 = 2; pub const AT_REWRITE_COLUMN_REWRITE: u32 = 4; pub const AT_REWRITE_ALTER_OID: u32 = 8; -pub const TriggerRelationId: u32 = 2620; -pub const Natts_pg_trigger: u32 = 17; -pub const Anum_pg_trigger_tgrelid: u32 = 1; -pub const Anum_pg_trigger_tgname: u32 = 2; -pub const Anum_pg_trigger_tgfoid: u32 = 3; -pub const Anum_pg_trigger_tgtype: u32 = 4; -pub const Anum_pg_trigger_tgenabled: u32 = 5; -pub const Anum_pg_trigger_tgisinternal: u32 = 6; -pub const Anum_pg_trigger_tgconstrrelid: u32 = 7; -pub const Anum_pg_trigger_tgconstrindid: u32 = 8; -pub const Anum_pg_trigger_tgconstraint: u32 = 9; -pub const Anum_pg_trigger_tgdeferrable: u32 = 10; -pub const Anum_pg_trigger_tginitdeferred: u32 = 11; -pub const Anum_pg_trigger_tgnargs: u32 = 12; -pub const Anum_pg_trigger_tgattr: u32 = 13; -pub const Anum_pg_trigger_tgargs: u32 = 14; -pub const Anum_pg_trigger_tgqual: u32 = 15; -pub const Anum_pg_trigger_tgoldtable: u32 = 16; -pub const Anum_pg_trigger_tgnewtable: u32 = 17; -pub const TRIGGER_TYPE_ROW: u32 = 1; -pub const TRIGGER_TYPE_BEFORE: u32 = 2; -pub const TRIGGER_TYPE_INSERT: u32 = 4; -pub const TRIGGER_TYPE_DELETE: u32 = 8; -pub const TRIGGER_TYPE_UPDATE: u32 = 16; -pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; -pub const TRIGGER_TYPE_INSTEAD: u32 = 64; -pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; -pub const TRIGGER_TYPE_STATEMENT: u32 = 0; -pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; -pub const TRIGGER_TYPE_AFTER: u32 = 0; -pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TRIGGER_EVENT_INSERT: u32 = 0; pub const TRIGGER_EVENT_DELETE: u32 = 1; pub const TRIGGER_EVENT_UPDATE: u32 = 2; @@ -2840,6 +2840,42 @@ pub const TRIGGER_DISABLED: u8 = 68u8; pub const RI_TRIGGER_PK: u32 = 1; pub const RI_TRIGGER_FK: u32 = 2; pub const RI_TRIGGER_NONE: u32 = 0; +pub const StatisticRelationId: u32 = 2619; +pub const STATISTIC_NUM_SLOTS: u32 = 5; +pub const Natts_pg_statistic: u32 = 26; +pub const Anum_pg_statistic_starelid: u32 = 1; +pub const Anum_pg_statistic_staattnum: u32 = 2; +pub const Anum_pg_statistic_stainherit: u32 = 3; +pub const Anum_pg_statistic_stanullfrac: u32 = 4; +pub const Anum_pg_statistic_stawidth: u32 = 5; +pub const Anum_pg_statistic_stadistinct: u32 = 6; +pub const Anum_pg_statistic_stakind1: u32 = 7; +pub const Anum_pg_statistic_stakind2: u32 = 8; +pub const Anum_pg_statistic_stakind3: u32 = 9; +pub const Anum_pg_statistic_stakind4: u32 = 10; +pub const Anum_pg_statistic_stakind5: u32 = 11; +pub const Anum_pg_statistic_staop1: u32 = 12; +pub const Anum_pg_statistic_staop2: u32 = 13; +pub const Anum_pg_statistic_staop3: u32 = 14; +pub const Anum_pg_statistic_staop4: u32 = 15; +pub const Anum_pg_statistic_staop5: u32 = 16; +pub const Anum_pg_statistic_stanumbers1: u32 = 17; +pub const Anum_pg_statistic_stanumbers2: u32 = 18; +pub const Anum_pg_statistic_stanumbers3: u32 = 19; +pub const Anum_pg_statistic_stanumbers4: u32 = 20; +pub const Anum_pg_statistic_stanumbers5: u32 = 21; +pub const Anum_pg_statistic_stavalues1: u32 = 22; +pub const Anum_pg_statistic_stavalues2: u32 = 23; +pub const Anum_pg_statistic_stavalues3: u32 = 24; +pub const Anum_pg_statistic_stavalues4: u32 = 25; +pub const Anum_pg_statistic_stavalues5: u32 = 26; +pub const STATISTIC_KIND_MCV: u32 = 1; +pub const STATISTIC_KIND_HISTOGRAM: u32 = 2; +pub const STATISTIC_KIND_CORRELATION: u32 = 3; +pub const STATISTIC_KIND_MCELEM: u32 = 4; +pub const STATISTIC_KIND_DECHIST: u32 = 5; +pub const STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM: u32 = 6; +pub const STATISTIC_KIND_BOUNDS_HISTOGRAM: u32 = 7; pub const CACHEDPLANSOURCE_MAGIC: u32 = 195726186; pub const CACHEDPLAN_MAGIC: u32 = 953717834; pub const SPI_ERROR_CONNECT: i32 = -1; @@ -2898,6 +2934,7 @@ pub const DEFAULT_CPU_OPERATOR_COST: f64 = 0.0025; pub const DEFAULT_PARALLEL_TUPLE_COST: f64 = 0.1; pub const DEFAULT_PARALLEL_SETUP_COST: f64 = 1000.0; pub const DEFAULT_EFFECTIVE_CACHE_SIZE: u32 = 524288; +pub const DEFAULT_CURSOR_TUPLE_FRACTION: f64 = 0.1; pub const OLD_SNAPSHOT_PADDING_ENTRIES: u32 = 10; pub const MAX_IO_CONCURRENCY: u32 = 1000; pub const BUFFER_LOCK_UNLOCK: u32 = 0; @@ -28211,6 +28248,281 @@ extern "C" { extern "C" { pub fn IsInParallelMode() -> bool; } +pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; +pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; +pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; +pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; +pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; +pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; +pub type DependencyType = ::std::os::raw::c_uint; +pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; +pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; +pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; +pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; +pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; +pub type SharedDependencyType = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectAddresses { + _unused: [u8; 0], +} +pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; +pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; +pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; +pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; +pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; +pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; +pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; +pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; +pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; +pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; +pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; +pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; +pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; +pub const ObjectClass_OCLASS_AM: ObjectClass = 13; +pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; +pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; +pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; +pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; +pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; +pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; +pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; +pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; +pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; +pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; +pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; +pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; +pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; +pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; +pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; +pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; +pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; +pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; +pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; +pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; +pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; +pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; +pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; +pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; +pub type ObjectClass = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn ReleaseDeletionLock(object: *const ObjectAddress); +} +#[pg_guard] +extern "C" { + pub fn performDeletion( + object: *const ObjectAddress, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn performMultipleDeletions( + objects: *const ObjectAddresses, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnExpr( + depender: *const ObjectAddress, + expr: *mut Node, + rtable: *mut List, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnSingleRelExpr( + depender: *const ObjectAddress, + expr: *mut Node, + relId: Oid, + behavior: DependencyType, + self_behavior: DependencyType, + reverse_self: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; +} +#[pg_guard] +extern "C" { + pub fn new_object_addresses() -> *mut ObjectAddresses; +} +#[pg_guard] +extern "C" { + pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn object_address_present( + object: *const ObjectAddress, + addrs: *const ObjectAddresses, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn record_object_address_dependencies( + depender: *const ObjectAddress, + referenced: *mut ObjectAddresses, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn free_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOn( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordMultipleDependencies( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + nreferenced: ::std::os::raw::c_int, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsFor( + classId: Oid, + objectId: Oid, + skipExtensionDeps: bool, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsForClass( + classId: Oid, + objectId: Oid, + refclassId: Oid, + deptype: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependencyFor( + classId: Oid, + objectId: Oid, + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn sequenceIsOwned( + seqId: Oid, + deptype: ::std::os::raw::c_char, + tableId: *mut Oid, + colId: *mut int32, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_constraint_index(constraintId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_constraint(indexId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn recordSharedDependencyOn( + depender: *mut ObjectAddress, + referenced: *mut ObjectAddress, + deptype: SharedDependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); +} +#[pg_guard] +extern "C" { + pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); +} +#[pg_guard] +extern "C" { + pub fn updateAclDependencies( + classId: Oid, + objectId: Oid, + objectSubId: int32, + ownerId: Oid, + noldmembers: ::std::os::raw::c_int, + oldmembers: *mut Oid, + nnewmembers: ::std::os::raw::c_int, + newmembers: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn checkSharedDependencies( + classId: Oid, + objectId: Oid, + detail_msg: *mut *mut ::std::os::raw::c_char, + detail_log_msg: *mut *mut ::std::os::raw::c_char, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); +} +#[pg_guard] +extern "C" { + pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); +} +#[pg_guard] +extern "C" { + pub fn dropDatabaseDependencies(databaseId: Oid); +} +#[pg_guard] +extern "C" { + pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); +} +#[pg_guard] +extern "C" { + pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); +} pub type IndexBuildCallback = ::std::option::Option< unsafe extern "C" fn( index: Relation, @@ -28788,6 +29100,28 @@ impl Default for FormData_pg_proc { } pub type Form_pg_proc = *mut FormData_pg_proc; #[repr(C)] +pub struct FormData_pg_trigger { + pub tgrelid: Oid, + pub tgname: NameData, + pub tgfoid: Oid, + pub tgtype: int16, + pub tgenabled: ::std::os::raw::c_char, + pub tgisinternal: bool, + pub tgconstrrelid: Oid, + pub tgconstrindid: Oid, + pub tgconstraint: Oid, + pub tgdeferrable: bool, + pub tginitdeferred: bool, + pub tgnargs: int16, + pub tgattr: int2vector, +} +impl Default for FormData_pg_trigger { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type Form_pg_trigger = *mut FormData_pg_trigger; +#[repr(C)] #[derive(Copy, Clone)] pub struct FormData_pg_type { pub typname: NameData, @@ -28903,280 +29237,429 @@ extern "C" { ctype: *const ::std::os::raw::c_char, ); } -pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; -pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; -pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; -pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; -pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; -pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; -pub type DependencyType = ::std::os::raw::c_uint; -pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; -pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; -pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; -pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; -pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; -pub type SharedDependencyType = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectAddresses { - _unused: [u8; 0], +#[pg_guard] +extern "C" { + pub fn RemoveObjects(stmt: *mut DropStmt); } -pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; -pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; -pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; -pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; -pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; -pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; -pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; -pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; -pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; -pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; -pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; -pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; -pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; -pub const ObjectClass_OCLASS_AM: ObjectClass = 13; -pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; -pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; -pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; -pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; -pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; -pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; -pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; -pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; -pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; -pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; -pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; -pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; -pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; -pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; -pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; -pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; -pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; -pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; -pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; -pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; -pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; -pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; -pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; -pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; -pub type ObjectClass = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); + pub fn DefineIndex( + relationId: Oid, + stmt: *mut IndexStmt, + indexRelationId: Oid, + is_alter_table: bool, + check_rights: bool, + check_not_in_use: bool, + skip_build: bool, + quiet: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn ReleaseDeletionLock(object: *const ObjectAddress); + pub fn ReindexIndex(indexRelation: *mut RangeVar, options: ::std::os::raw::c_int) -> Oid; } #[pg_guard] extern "C" { - pub fn performDeletion( - object: *const ObjectAddress, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, - ); + pub fn ReindexTable(relation: *mut RangeVar, options: ::std::os::raw::c_int) -> Oid; } #[pg_guard] extern "C" { - pub fn performMultipleDeletions( - objects: *const ObjectAddresses, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn ReindexMultipleTables( + objectName: *const ::std::os::raw::c_char, + objectKind: ReindexObjectType, + options: ::std::os::raw::c_int, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnExpr( - depender: *const ObjectAddress, - expr: *mut Node, - rtable: *mut List, - behavior: DependencyType, + pub fn makeObjectName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn ChooseRelationName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + namespaceid: Oid, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn CheckIndexCompatible( + oldId: Oid, + accessMethodName: *mut ::std::os::raw::c_char, + attributeList: *mut List, + exclusionOpNames: *mut List, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetDefaultOpClass(type_id: Oid, am_id: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ResolveOpClass( + opclass: *mut List, + attrType: Oid, + accessMethodName: *mut ::std::os::raw::c_char, + accessMethodId: Oid, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn CreateFunction(pstate: *mut ParseState, stmt: *mut CreateFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveFunctionById(funcOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionReturnType(funcOid: Oid, newRetType: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionArgType(funcOid: Oid, argIndex: ::std::os::raw::c_int, newArgType: Oid); +} +#[pg_guard] +extern "C" { + pub fn AlterFunction(pstate: *mut ParseState, stmt: *mut AlterFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn CreateCast(stmt: *mut CreateCastStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropCastById(castOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateTransform(stmt: *mut CreateTransformStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropTransformById(transformOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereFunctionInNamespace( + proname: *const ::std::os::raw::c_char, + pronargs: ::std::os::raw::c_int, + proargtypes: *mut oidvector, + nspOid: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnSingleRelExpr( - depender: *const ObjectAddress, - expr: *mut Node, - relId: Oid, - behavior: DependencyType, - self_behavior: DependencyType, - reverse_self: bool, + pub fn ExecuteDoStmt(stmt: *mut DoStmt); +} +#[pg_guard] +extern "C" { + pub fn get_cast_oid(sourcetypeid: Oid, targettypeid: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_transform_oid(type_id: Oid, lang_id: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn interpret_function_parameter_list( + pstate: *mut ParseState, + parameters: *mut List, + languageOid: Oid, + is_aggregate: bool, + parameterTypes: *mut *mut oidvector, + allParameterTypes: *mut *mut ArrayType, + parameterModes: *mut *mut ArrayType, + parameterNames: *mut *mut ArrayType, + parameterDefaults: *mut *mut List, + variadicArgType: *mut Oid, + requiredResultType: *mut Oid, ); } #[pg_guard] extern "C" { - pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; + pub fn DefineOperator(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn new_object_addresses() -> *mut ObjectAddresses; + pub fn RemoveOperatorById(operOid: Oid); } #[pg_guard] extern "C" { - pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); + pub fn AlterOperator(stmt: *mut AlterOperatorStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn object_address_present( - object: *const ObjectAddress, - addrs: *const ObjectAddresses, - ) -> bool; + pub fn CreateStatistics(stmt: *mut CreateStatsStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn record_object_address_dependencies( - depender: *const ObjectAddress, - referenced: *mut ObjectAddresses, - behavior: DependencyType, + pub fn RemoveStatisticsById(statsOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn UpdateStatisticsForTypeChange( + statsOid: Oid, + relationOid: Oid, + attnum: ::std::os::raw::c_int, + oldColumnType: Oid, + newColumnType: Oid, ); } #[pg_guard] extern "C" { - pub fn free_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineAggregate( + pstate: *mut ParseState, + name: *mut List, + args: *mut List, + oldstyle: bool, + parameters: *mut List, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordDependencyOn( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - behavior: DependencyType, + pub fn DefineOpClass(stmt: *mut CreateOpClassStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DefineOpFamily(stmt: *mut CreateOpFamilyStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterOpFamily(stmt: *mut AlterOpFamilyStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveOpClassById(opclassOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveOpFamilyById(opfamilyOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmOpEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmProcEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereOpClassInNamespace( + opcname: *const ::std::os::raw::c_char, + opcmethod: Oid, + opcnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordMultipleDependencies( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - nreferenced: ::std::os::raw::c_int, - behavior: DependencyType, + pub fn IsThereOpFamilyInNamespace( + opfname: *const ::std::os::raw::c_char, + opfmethod: Oid, + opfnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); + pub fn get_opclass_oid(amID: Oid, opclassname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsFor( - classId: Oid, - objectId: Oid, - skipExtensionDeps: bool, - ) -> ::std::os::raw::c_long; + pub fn get_opfamily_oid(amID: Oid, opfamilyname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsForClass( - classId: Oid, - objectId: Oid, - refclassId: Oid, - deptype: ::std::os::raw::c_char, - ) -> ::std::os::raw::c_long; + pub fn DefineTSParser(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependencyFor( - classId: Oid, - objectId: Oid, - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSParserById(prsId: Oid); } #[pg_guard] extern "C" { - pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; + pub fn DefineTSDictionary(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; + pub fn RemoveTSDictionaryById(dictId: Oid); } #[pg_guard] extern "C" { - pub fn sequenceIsOwned( - seqId: Oid, - deptype: ::std::os::raw::c_char, - tableId: *mut Oid, - colId: *mut int32, - ) -> bool; + pub fn AlterTSDictionary(stmt: *mut AlterTSDictionaryStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; + pub fn DefineTSTemplate(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; + pub fn RemoveTSTemplateById(tmplId: Oid); } #[pg_guard] extern "C" { - pub fn get_constraint_index(constraintId: Oid) -> Oid; + pub fn DefineTSConfiguration( + names: *mut List, + parameters: *mut List, + copied: *mut ObjectAddress, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn get_index_constraint(indexId: Oid) -> Oid; + pub fn RemoveTSConfigurationById(cfgId: Oid); } #[pg_guard] extern "C" { - pub fn recordSharedDependencyOn( - depender: *mut ObjectAddress, - referenced: *mut ObjectAddress, - deptype: SharedDependencyType, - ); + pub fn AlterTSConfiguration(stmt: *mut AlterTSConfigurationStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); + pub fn serialize_deflist(deflist: *mut List) -> *mut text; } #[pg_guard] extern "C" { - pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); + pub fn deserialize_deflist(txt: Datum) -> *mut List; } #[pg_guard] extern "C" { - pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); + pub fn AlterForeignServerOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn updateAclDependencies( - classId: Oid, - objectId: Oid, - objectSubId: int32, - ownerId: Oid, - noldmembers: ::std::os::raw::c_int, - oldmembers: *mut Oid, - nnewmembers: ::std::os::raw::c_int, - newmembers: *mut Oid, - ); + pub fn AlterForeignServerOwner_oid(arg1: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn checkSharedDependencies( - classId: Oid, - objectId: Oid, - detail_msg: *mut *mut ::std::os::raw::c_char, - detail_log_msg: *mut *mut ::std::os::raw::c_char, - ) -> bool; + pub fn AlterForeignDataWrapperOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); + pub fn AlterForeignDataWrapperOwner_oid(fwdId: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); + pub fn CreateForeignDataWrapper(stmt: *mut CreateFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn dropDatabaseDependencies(databaseId: Oid); + pub fn AlterForeignDataWrapper(stmt: *mut AlterFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); + pub fn RemoveForeignDataWrapperById(fdwId: Oid); } #[pg_guard] extern "C" { - pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); + pub fn CreateForeignServer(stmt: *mut CreateForeignServerStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterForeignServer(stmt: *mut AlterForeignServerStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveForeignServerById(srvId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateUserMapping(stmt: *mut CreateUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterUserMapping(stmt: *mut AlterUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMapping(stmt: *mut DropUserMappingStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMappingById(umId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateForeignTable(stmt: *mut CreateForeignTableStmt, relid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ImportForeignSchema(stmt: *mut ImportForeignSchemaStmt); +} +#[pg_guard] +extern "C" { + pub fn transformGenericOptions( + catalogId: Oid, + oldOptions: Datum, + options: *mut List, + fdwvalidator: Oid, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn CreateAccessMethod(stmt: *mut CreateAmStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveAccessMethodById(amOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn get_index_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_name(amOid: Oid) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetString(def: *mut DefElem) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetNumeric(def: *mut DefElem) -> f64; +} +#[pg_guard] +extern "C" { + pub fn defGetBoolean(def: *mut DefElem) -> bool; +} +#[pg_guard] +extern "C" { + pub fn defGetInt32(def: *mut DefElem) -> int32; +} +#[pg_guard] +extern "C" { + pub fn defGetInt64(def: *mut DefElem) -> int64; +} +#[pg_guard] +extern "C" { + pub fn defGetQualifiedName(def: *mut DefElem) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeName(def: *mut DefElem) -> *mut TypeName; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeLength(def: *mut DefElem) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn defGetStringList(def: *mut DefElem) -> *mut List; } #[repr(C)] #[derive(Copy, Clone)] @@ -29490,145 +29973,295 @@ extern "C" { extern "C" { pub fn EventTriggerCollectAlterDefPrivs(stmt: *mut AlterDefaultPrivilegesStmt); } -#[pg_guard] -extern "C" { - pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; -} -#[pg_guard] -extern "C" { - pub fn DropProceduralLanguageById(langOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn PLTemplateExists(languageName: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn get_language_oid(langname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; -} +pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; +pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; +pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; +pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; +pub type ExplainFormat = ::std::os::raw::c_uint; #[repr(C)] -pub struct FormData_pg_trigger { - pub tgrelid: Oid, - pub tgname: NameData, - pub tgfoid: Oid, - pub tgtype: int16, - pub tgenabled: ::std::os::raw::c_char, - pub tgisinternal: bool, - pub tgconstrrelid: Oid, - pub tgconstrindid: Oid, - pub tgconstraint: Oid, - pub tgdeferrable: bool, - pub tginitdeferred: bool, - pub tgnargs: int16, - pub tgattr: int2vector, +#[derive(Debug, Copy, Clone)] +pub struct ExplainState { + pub str_: StringInfo, + pub verbose: bool, + pub analyze: bool, + pub costs: bool, + pub buffers: bool, + pub timing: bool, + pub summary: bool, + pub format: ExplainFormat, + pub indent: ::std::os::raw::c_int, + pub grouping_stack: *mut List, + pub pstmt: *mut PlannedStmt, + pub rtable: *mut List, + pub rtable_names: *mut List, + pub deparse_cxt: *mut List, + pub printed_subplans: *mut Bitmapset, } -impl Default for FormData_pg_trigger { +impl Default for ExplainState { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type Form_pg_trigger = *mut FormData_pg_trigger; -#[pg_guard] -extern "C" { - pub fn DefineRelation( - stmt: *mut CreateStmt, - relkind: ::std::os::raw::c_char, - ownerId: Oid, - typaddress: *mut ObjectAddress, +pub type ExplainOneQuery_hook_type = ::std::option::Option< + unsafe extern "C" fn( + query: *mut Query, + cursorOptions: ::std::os::raw::c_int, + into: *mut IntoClause, + es: *mut ExplainState, queryString: *const ::std::os::raw::c_char, - ) -> ObjectAddress; -} -#[pg_guard] -extern "C" { - pub fn RemoveRelations(drop: *mut DropStmt); -} -#[pg_guard] -extern "C" { - pub fn AlterTableLookupRelation(stmt: *mut AlterTableStmt, lockmode: LOCKMODE) -> Oid; -} + params: ParamListInfo, + ), +>; #[pg_guard] extern "C" { - pub fn AlterTable(relid: Oid, lockmode: LOCKMODE, stmt: *mut AlterTableStmt); + pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; } +pub type explain_get_index_name_hook_type = + ::std::option::Option *const ::std::os::raw::c_char>; #[pg_guard] extern "C" { - pub fn AlterTableGetLockLevel(cmds: *mut List) -> LOCKMODE; + pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; } #[pg_guard] extern "C" { - pub fn ATExecChangeOwner( - relationOid: Oid, - newOwnerId: Oid, - recursing: bool, - lockmode: LOCKMODE, + pub fn ExplainQuery( + pstate: *mut ParseState, + stmt: *mut ExplainStmt, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + dest: *mut DestReceiver, ); } #[pg_guard] extern "C" { - pub fn AlterTableInternal(relid: Oid, cmds: *mut List, recurse: bool); -} -#[pg_guard] -extern "C" { - pub fn AlterTableMoveAll(stmt: *mut AlterTableMoveAllStmt) -> Oid; + pub fn NewExplainState() -> *mut ExplainState; } #[pg_guard] extern "C" { - pub fn AlterTableNamespace( - stmt: *mut AlterObjectSchemaStmt, - oldschema: *mut Oid, - ) -> ObjectAddress; + pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; } #[pg_guard] extern "C" { - pub fn AlterTableNamespaceInternal( - rel: Relation, - oldNspOid: Oid, - nspOid: Oid, - objsMoved: *mut ObjectAddresses, + pub fn ExplainOneUtility( + utilityStmt: *mut Node, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, ); } #[pg_guard] extern "C" { - pub fn AlterRelationNamespaceInternal( - classRel: Relation, - relOid: Oid, - oldNspOid: Oid, - newNspOid: Oid, - hasDependEntry: bool, - objsMoved: *mut ObjectAddresses, + pub fn ExplainOnePlan( + plannedstmt: *mut PlannedStmt, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + planduration: *const instr_time, ); } #[pg_guard] extern "C" { - pub fn CheckTableNotInUse(rel: Relation, stmt: *const ::std::os::raw::c_char); + pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); } #[pg_guard] extern "C" { - pub fn ExecuteTruncate(stmt: *mut TruncateStmt); + pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); } #[pg_guard] extern "C" { - pub fn SetRelationHasSubclass(relationId: Oid, relhassubclass: bool); + pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); } #[pg_guard] extern "C" { - pub fn renameatt(stmt: *mut RenameStmt) -> ObjectAddress; + pub fn ExplainBeginOutput(es: *mut ExplainState); } #[pg_guard] extern "C" { - pub fn renameatt_type(stmt: *mut RenameStmt) -> ObjectAddress; + pub fn ExplainEndOutput(es: *mut ExplainState); } #[pg_guard] extern "C" { - pub fn RenameConstraint(stmt: *mut RenameStmt) -> ObjectAddress; + pub fn ExplainSeparatePlans(es: *mut ExplainState); } #[pg_guard] extern "C" { - pub fn RenameRelation(stmt: *mut RenameStmt) -> ObjectAddress; + pub fn ExplainPropertyList( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); } #[pg_guard] extern "C" { - pub fn RenameRelationInternal( + pub fn ExplainPropertyListNested( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyText( + qlabel: *const ::std::os::raw::c_char, + value: *const ::std::os::raw::c_char, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyInteger( + qlabel: *const ::std::os::raw::c_char, + value: ::std::os::raw::c_int, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyLong( + qlabel: *const ::std::os::raw::c_char, + value: ::std::os::raw::c_long, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyFloat( + qlabel: *const ::std::os::raw::c_char, + value: f64, + ndigits: ::std::os::raw::c_int, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyBool( + qlabel: *const ::std::os::raw::c_char, + value: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropProceduralLanguageById(langOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn PLTemplateExists(languageName: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_language_oid(langname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn DefineRelation( + stmt: *mut CreateStmt, + relkind: ::std::os::raw::c_char, + ownerId: Oid, + typaddress: *mut ObjectAddress, + queryString: *const ::std::os::raw::c_char, + ) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveRelations(drop: *mut DropStmt); +} +#[pg_guard] +extern "C" { + pub fn AlterTableLookupRelation(stmt: *mut AlterTableStmt, lockmode: LOCKMODE) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn AlterTable(relid: Oid, lockmode: LOCKMODE, stmt: *mut AlterTableStmt); +} +#[pg_guard] +extern "C" { + pub fn AlterTableGetLockLevel(cmds: *mut List) -> LOCKMODE; +} +#[pg_guard] +extern "C" { + pub fn ATExecChangeOwner( + relationOid: Oid, + newOwnerId: Oid, + recursing: bool, + lockmode: LOCKMODE, + ); +} +#[pg_guard] +extern "C" { + pub fn AlterTableInternal(relid: Oid, cmds: *mut List, recurse: bool); +} +#[pg_guard] +extern "C" { + pub fn AlterTableMoveAll(stmt: *mut AlterTableMoveAllStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn AlterTableNamespace( + stmt: *mut AlterObjectSchemaStmt, + oldschema: *mut Oid, + ) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterTableNamespaceInternal( + rel: Relation, + oldNspOid: Oid, + nspOid: Oid, + objsMoved: *mut ObjectAddresses, + ); +} +#[pg_guard] +extern "C" { + pub fn AlterRelationNamespaceInternal( + classRel: Relation, + relOid: Oid, + oldNspOid: Oid, + newNspOid: Oid, + hasDependEntry: bool, + objsMoved: *mut ObjectAddresses, + ); +} +#[pg_guard] +extern "C" { + pub fn CheckTableNotInUse(rel: Relation, stmt: *const ::std::os::raw::c_char); +} +#[pg_guard] +extern "C" { + pub fn ExecuteTruncate(stmt: *mut TruncateStmt); +} +#[pg_guard] +extern "C" { + pub fn SetRelationHasSubclass(relationId: Oid, relhassubclass: bool); +} +#[pg_guard] +extern "C" { + pub fn renameatt(stmt: *mut RenameStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn renameatt_type(stmt: *mut RenameStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RenameConstraint(stmt: *mut RenameStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RenameRelation(stmt: *mut RenameStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RenameRelationInternal( myrelid: Oid, newrelname: *const ::std::os::raw::c_char, is_internal: bool, @@ -29989,6 +30622,226 @@ extern "C" { pub fn RI_FKey_trigger_type(tgfoid: Oid) -> ::std::os::raw::c_int; } #[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct FormData_pg_statistic { + pub starelid: Oid, + pub staattnum: int16, + pub stainherit: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind1: int16, + pub stakind2: int16, + pub stakind3: int16, + pub stakind4: int16, + pub stakind5: int16, + pub staop1: Oid, + pub staop2: Oid, + pub staop3: Oid, + pub staop4: Oid, + pub staop5: Oid, +} +pub type Form_pg_statistic = *mut FormData_pg_statistic; +pub type VacAttrStatsP = *mut VacAttrStats; +pub type AnalyzeAttrFetchFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + rownum: ::std::os::raw::c_int, + isNull: *mut bool, + ) -> Datum, +>; +pub type AnalyzeAttrComputeStatsFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + fetchfunc: AnalyzeAttrFetchFunc, + samplerows: ::std::os::raw::c_int, + totalrows: f64, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacAttrStats { + pub attr: Form_pg_attribute, + pub attrtypid: Oid, + pub attrtypmod: int32, + pub attrtype: Form_pg_type, + pub anl_context: MemoryContext, + pub compute_stats: AnalyzeAttrComputeStatsFunc, + pub minrows: ::std::os::raw::c_int, + pub extra_data: *mut ::std::os::raw::c_void, + pub stats_valid: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind: [int16; 5usize], + pub staop: [Oid; 5usize], + pub numnumbers: [::std::os::raw::c_int; 5usize], + pub stanumbers: [*mut float4; 5usize], + pub numvalues: [::std::os::raw::c_int; 5usize], + pub stavalues: [*mut Datum; 5usize], + pub statypid: [Oid; 5usize], + pub statyplen: [int16; 5usize], + pub statypbyval: [bool; 5usize], + pub statypalign: [::std::os::raw::c_char; 5usize], + pub tupattnum: ::std::os::raw::c_int, + pub rows: *mut HeapTuple, + pub tupDesc: TupleDesc, + pub exprvals: *mut Datum, + pub exprnulls: *mut bool, + pub rowstride: ::std::os::raw::c_int, +} +impl Default for VacAttrStats { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct VacuumParams { + pub freeze_min_age: ::std::os::raw::c_int, + pub freeze_table_age: ::std::os::raw::c_int, + pub multixact_freeze_min_age: ::std::os::raw::c_int, + pub multixact_freeze_table_age: ::std::os::raw::c_int, + pub is_wraparound: bool, + pub log_min_duration: ::std::os::raw::c_int, +} +#[pg_guard] +extern "C" { + pub static mut default_statistics_target: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn ExecVacuum(vacstmt: *mut VacuumStmt, isTopLevel: bool); +} +#[pg_guard] +extern "C" { + pub fn vacuum( + options: ::std::os::raw::c_int, + relation: *mut RangeVar, + relid: Oid, + params: *mut VacuumParams, + va_cols: *mut List, + bstrategy: BufferAccessStrategy, + isTopLevel: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_open_indexes( + relation: Relation, + lockmode: LOCKMODE, + nindexes: *mut ::std::os::raw::c_int, + Irel: *mut *mut Relation, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_close_indexes( + nindexes: ::std::os::raw::c_int, + Irel: *mut Relation, + lockmode: LOCKMODE, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_estimate_reltuples( + relation: Relation, + is_analyze: bool, + total_pages: BlockNumber, + scanned_pages: BlockNumber, + scanned_tuples: f64, + ) -> f64; +} +#[pg_guard] +extern "C" { + pub fn vac_update_relstats( + relation: Relation, + num_pages: BlockNumber, + num_tuples: f64, + num_all_visible_pages: BlockNumber, + hasindex: bool, + frozenxid: TransactionId, + minmulti: MultiXactId, + in_outer_xact: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vacuum_set_xid_limits( + rel: Relation, + freeze_min_age: ::std::os::raw::c_int, + freeze_table_age: ::std::os::raw::c_int, + multixact_freeze_min_age: ::std::os::raw::c_int, + multixact_freeze_table_age: ::std::os::raw::c_int, + oldestXmin: *mut TransactionId, + freezeLimit: *mut TransactionId, + xidFullScanLimit: *mut TransactionId, + multiXactCutoff: *mut MultiXactId, + mxactFullScanLimit: *mut MultiXactId, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_update_datfrozenxid(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_delay_point(); +} +#[pg_guard] +extern "C" { + pub fn lazy_vacuum_rel( + onerel: Relation, + options: ::std::os::raw::c_int, + params: *mut VacuumParams, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn analyze_rel( + relid: Oid, + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + params: *mut VacuumParams, + va_cols: *mut List, + in_outer_xact: bool, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn std_typanalyze(stats: *mut VacAttrStats) -> bool; +} +#[pg_guard] +extern "C" { + pub fn anl_random_fract() -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_init_selection_state(n: ::std::os::raw::c_int) -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_get_next_S(t: f64, n: ::std::os::raw::c_int, stateptr: *mut f64) -> f64; +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CachedPlanSource { pub magic: ::std::os::raw::c_int, @@ -32444,178 +33297,6 @@ extern "C" { missing_ok: bool, ) -> Oid; } -pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; -pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; -pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; -pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; -pub type ExplainFormat = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExplainState { - pub str_: StringInfo, - pub verbose: bool, - pub analyze: bool, - pub costs: bool, - pub buffers: bool, - pub timing: bool, - pub summary: bool, - pub format: ExplainFormat, - pub indent: ::std::os::raw::c_int, - pub grouping_stack: *mut List, - pub pstmt: *mut PlannedStmt, - pub rtable: *mut List, - pub rtable_names: *mut List, - pub deparse_cxt: *mut List, - pub printed_subplans: *mut Bitmapset, -} -impl Default for ExplainState { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type ExplainOneQuery_hook_type = ::std::option::Option< - unsafe extern "C" fn( - query: *mut Query, - cursorOptions: ::std::os::raw::c_int, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - ), ->; -#[pg_guard] -extern "C" { - pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; -} -pub type explain_get_index_name_hook_type = - ::std::option::Option *const ::std::os::raw::c_char>; -#[pg_guard] -extern "C" { - pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; -} -#[pg_guard] -extern "C" { - pub fn ExplainQuery( - pstate: *mut ParseState, - stmt: *mut ExplainStmt, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - dest: *mut DestReceiver, - ); -} -#[pg_guard] -extern "C" { - pub fn NewExplainState() -> *mut ExplainState; -} -#[pg_guard] -extern "C" { - pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; -} -#[pg_guard] -extern "C" { - pub fn ExplainOneUtility( - utilityStmt: *mut Node, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOnePlan( - plannedstmt: *mut PlannedStmt, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - planduration: *const instr_time, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainBeginOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainEndOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainSeparatePlans(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyList( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyListNested( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyText( - qlabel: *const ::std::os::raw::c_char, - value: *const ::std::os::raw::c_char, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyInteger( - qlabel: *const ::std::os::raw::c_char, - value: ::std::os::raw::c_int, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyLong( - qlabel: *const ::std::os::raw::c_char, - value: ::std::os::raw::c_long, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyFloat( - qlabel: *const ::std::os::raw::c_char, - value: f64, - ndigits: ::std::os::raw::c_int, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyBool( - qlabel: *const ::std::os::raw::c_char, - value: bool, - es: *mut ExplainState, - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExtensibleNode { @@ -33205,6 +33886,186 @@ impl Default for SQLCmd { unsafe { ::std::mem::zeroed() } } } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct WindowFuncLists { + pub numWindowFuncs: ::std::os::raw::c_int, + pub maxWinRef: Index, + pub windowFuncs: *mut *mut List, +} +impl Default for WindowFuncLists { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[pg_guard] +extern "C" { + pub fn make_opclause( + opno: Oid, + opresulttype: Oid, + opretset: bool, + leftop: *mut Expr, + rightop: *mut Expr, + opcollid: Oid, + inputcollid: Oid, + ) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn get_leftop(clause: *const Expr) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn get_rightop(clause: *const Expr) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn not_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_notclause(notclause: *mut Expr) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn get_notclausearg(notclause: *mut Expr) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn or_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_orclause(orclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn and_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_andclause(andclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn make_and_qual(qual1: *mut Node, qual2: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn make_ands_explicit(andclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn make_ands_implicit(clause: *mut Expr) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn contain_agg_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_agg_clause_costs( + root: *mut PlannerInfo, + clause: *mut Node, + aggsplit: AggSplit, + costs: *mut AggClauseCosts, + ); +} +#[pg_guard] +extern "C" { + pub fn contain_window_function(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; +} +#[pg_guard] +extern "C" { + pub fn expression_returns_set_rows(clause: *mut Node) -> f64; +} +#[pg_guard] +extern "C" { + pub fn contain_subplans(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_mutable_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_volatile_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_volatile_functions_not_nextval(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_leaked_vars(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; +} +#[pg_guard] +extern "C" { + pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CommuteOpExpr(clause: *mut OpExpr); +} +#[pg_guard] +extern "C" { + pub fn CommuteRowCompareExpr(clause: *mut RowCompareExpr); +} +#[pg_guard] +extern "C" { + pub fn eval_const_expressions(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn estimate_expression_value(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn inline_set_returning_function( + root: *mut PlannerInfo, + rte: *mut RangeTblEntry, + ) -> *mut Query; +} pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_OFF: ConstraintExclusionType = 0; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_ON: ConstraintExclusionType = 1; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_PARTITION: ConstraintExclusionType = 2; @@ -33726,185 +34587,605 @@ extern "C" { rows: *mut f64, ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WindowFuncLists { - pub numWindowFuncs: ::std::os::raw::c_int, - pub maxWinRef: Index, - pub windowFuncs: *mut *mut List, +#[pg_guard] +extern "C" { + pub fn compare_path_costs( + path1: *mut Path, + path2: *mut Path, + criterion: CostSelector, + ) -> ::std::os::raw::c_int; } -impl Default for WindowFuncLists { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn compare_fractional_path_costs( + path1: *mut Path, + path2: *mut Path, + fraction: f64, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn make_opclause( - opno: Oid, - opresulttype: Oid, - opretset: bool, - leftop: *mut Expr, - rightop: *mut Expr, - opcollid: Oid, - inputcollid: Oid, - ) -> *mut Expr; + pub fn set_cheapest(parent_rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn get_leftop(clause: *const Expr) -> *mut Node; + pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } #[pg_guard] extern "C" { - pub fn get_rightop(clause: *const Expr) -> *mut Node; + pub fn add_path_precheck( + parent_rel: *mut RelOptInfo, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + ) -> bool; } #[pg_guard] extern "C" { - pub fn not_clause(clause: *mut Node) -> bool; + pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } #[pg_guard] extern "C" { - pub fn make_notclause(notclause: *mut Expr) -> *mut Expr; + pub fn add_partial_path_precheck( + parent_rel: *mut RelOptInfo, + total_cost: Cost, + pathkeys: *mut List, + ) -> bool; } #[pg_guard] extern "C" { - pub fn get_notclausearg(notclause: *mut Expr) -> *mut Expr; + pub fn create_seqscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn or_clause(clause: *mut Node) -> bool; + pub fn create_samplescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn make_orclause(orclauses: *mut List) -> *mut Expr; + pub fn create_index_path( + root: *mut PlannerInfo, + index: *mut IndexOptInfo, + indexclauses: *mut List, + indexclausecols: *mut List, + indexorderbys: *mut List, + indexorderbycols: *mut List, + pathkeys: *mut List, + indexscandir: ScanDirection, + indexonly: bool, + required_outer: Relids, + loop_count: f64, + partial_path: bool, + ) -> *mut IndexPath; } #[pg_guard] extern "C" { - pub fn and_clause(clause: *mut Node) -> bool; + pub fn create_bitmap_heap_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapqual: *mut Path, + required_outer: Relids, + loop_count: f64, + parallel_degree: ::std::os::raw::c_int, + ) -> *mut BitmapHeapPath; } #[pg_guard] extern "C" { - pub fn make_andclause(andclauses: *mut List) -> *mut Expr; + pub fn create_bitmap_and_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapAndPath; } #[pg_guard] extern "C" { - pub fn make_and_qual(qual1: *mut Node, qual2: *mut Node) -> *mut Node; + pub fn create_bitmap_or_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapOrPath; } #[pg_guard] extern "C" { - pub fn make_ands_explicit(andclauses: *mut List) -> *mut Expr; + pub fn create_tidscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + tidquals: *mut List, + required_outer: Relids, + ) -> *mut TidPath; } #[pg_guard] extern "C" { - pub fn make_ands_implicit(clause: *mut Expr) -> *mut List; + pub fn create_append_path( + rel: *mut RelOptInfo, + subpaths: *mut List, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + partitioned_rels: *mut List, + ) -> *mut AppendPath; } #[pg_guard] extern "C" { - pub fn contain_agg_clause(clause: *mut Node) -> bool; + pub fn create_merge_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + partitioned_rels: *mut List, + ) -> *mut MergeAppendPath; } #[pg_guard] extern "C" { - pub fn get_agg_clause_costs( + pub fn create_result_path( root: *mut PlannerInfo, - clause: *mut Node, - aggsplit: AggSplit, - costs: *mut AggClauseCosts, - ); + rel: *mut RelOptInfo, + target: *mut PathTarget, + resconstantqual: *mut List, + ) -> *mut ResultPath; } #[pg_guard] extern "C" { - pub fn contain_window_function(clause: *mut Node) -> bool; + pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; } #[pg_guard] extern "C" { - pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; + pub fn create_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + sjinfo: *mut SpecialJoinInfo, + ) -> *mut UniquePath; } #[pg_guard] extern "C" { - pub fn expression_returns_set_rows(clause: *mut Node) -> f64; + pub fn create_gather_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherPath; } #[pg_guard] extern "C" { - pub fn contain_subplans(clause: *mut Node) -> bool; + pub fn create_gather_merge_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + pathkeys: *mut List, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherMergePath; } #[pg_guard] extern "C" { - pub fn contain_mutable_functions(clause: *mut Node) -> bool; + pub fn create_subqueryscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut SubqueryScanPath; } #[pg_guard] extern "C" { - pub fn contain_volatile_functions(clause: *mut Node) -> bool; + pub fn create_functionscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_volatile_functions_not_nextval(clause: *mut Node) -> bool; + pub fn create_tablexprscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; + pub fn create_valuesscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; + pub fn create_tablefuncscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; + pub fn create_ctescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_leaked_vars(clause: *mut Node) -> bool; + pub fn create_namedtuplestorescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; + pub fn create_worktablescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; + pub fn create_foreignscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; + pub fn calc_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) -> Relids; } #[pg_guard] extern "C" { - pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; + pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) + -> Relids; } #[pg_guard] extern "C" { - pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; + pub fn create_nestloop_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut NestPath; } #[pg_guard] extern "C" { - pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; + pub fn create_mergejoin_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + mergeclauses: *mut List, + outersortkeys: *mut List, + innersortkeys: *mut List, + ) -> *mut MergePath; } #[pg_guard] extern "C" { - pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; + pub fn create_hashjoin_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + required_outer: Relids, + hashclauses: *mut List, + ) -> *mut HashPath; } #[pg_guard] extern "C" { - pub fn CommuteOpExpr(clause: *mut OpExpr); + pub fn create_projection_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectionPath; } #[pg_guard] extern "C" { - pub fn CommuteRowCompareExpr(clause: *mut RowCompareExpr); + pub fn apply_projection_to_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + path: *mut Path, + target: *mut PathTarget, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn eval_const_expressions(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; + pub fn create_set_projection_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectSetPath; } #[pg_guard] extern "C" { - pub fn estimate_expression_value(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; + pub fn create_sort_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + limit_tuples: f64, + ) -> *mut SortPath; } #[pg_guard] extern "C" { - pub fn inline_set_returning_function( + pub fn create_group_path( root: *mut PlannerInfo, - rte: *mut RangeTblEntry, - ) -> *mut Query; + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + groupClause: *mut List, + qual: *mut List, + numGroups: f64, + ) -> *mut GroupPath; +} +#[pg_guard] +extern "C" { + pub fn create_upper_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + numCols: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut UpperUniquePath; +} +#[pg_guard] +extern "C" { + pub fn create_agg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + groupClause: *mut List, + qual: *mut List, + aggcosts: *const AggClauseCosts, + numGroups: f64, + ) -> *mut AggPath; +} +#[pg_guard] +extern "C" { + pub fn create_groupingsets_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + having_qual: *mut List, + aggstrategy: AggStrategy, + rollups: *mut List, + agg_costs: *const AggClauseCosts, + numGroups: f64, + ) -> *mut GroupingSetsPath; +} +#[pg_guard] +extern "C" { + pub fn create_minmaxagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + mmaggregates: *mut List, + quals: *mut List, + ) -> *mut MinMaxAggPath; +} +#[pg_guard] +extern "C" { + pub fn create_windowagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + windowFuncs: *mut List, + winclause: *mut WindowClause, + winpathkeys: *mut List, + ) -> *mut WindowAggPath; +} +#[pg_guard] +extern "C" { + pub fn create_setop_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + cmd: SetOpCmd, + strategy: SetOpStrategy, + distinctList: *mut List, + flagColIdx: AttrNumber, + firstFlag: ::std::os::raw::c_int, + numGroups: f64, + outputRows: f64, + ) -> *mut SetOpPath; +} +#[pg_guard] +extern "C" { + pub fn create_recursiveunion_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + leftpath: *mut Path, + rightpath: *mut Path, + target: *mut PathTarget, + distinctList: *mut List, + wtParam: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut RecursiveUnionPath; +} +#[pg_guard] +extern "C" { + pub fn create_lockrows_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + rowMarks: *mut List, + epqParam: ::std::os::raw::c_int, + ) -> *mut LockRowsPath; +} +#[pg_guard] +extern "C" { + pub fn create_modifytable_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + operation: CmdType, + canSetTag: bool, + nominalRelation: Index, + partitioned_rels: *mut List, + resultRelations: *mut List, + subpaths: *mut List, + subroots: *mut List, + withCheckOptionLists: *mut List, + returningLists: *mut List, + rowMarks: *mut List, + onconflict: *mut OnConflictExpr, + epqParam: ::std::os::raw::c_int, + ) -> *mut ModifyTablePath; +} +#[pg_guard] +extern "C" { + pub fn create_limit_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + limitOffset: *mut Node, + limitCount: *mut Node, + offset_est: int64, + count_est: int64, + ) -> *mut LimitPath; +} +#[pg_guard] +extern "C" { + pub fn reparameterize_path( + root: *mut PlannerInfo, + path: *mut Path, + required_outer: Relids, + loop_count: f64, + ) -> *mut Path; +} +#[pg_guard] +extern "C" { + pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn build_simple_rel( + root: *mut PlannerInfo, + relid: ::std::os::raw::c_int, + parent: *mut RelOptInfo, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn build_join_rel( + root: *mut PlannerInfo, + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + sjinfo: *mut SpecialJoinInfo, + restrictlist_ptr: *mut *mut List, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn min_join_parameterization( + root: *mut PlannerInfo, + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + ) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn build_empty_join_rel(root: *mut PlannerInfo) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn fetch_upper_rel( + root: *mut PlannerInfo, + kind: UpperRelationKind, + relids: Relids, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_childrel_appendrelinfo( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + ) -> *mut AppendRelInfo; +} +#[pg_guard] +extern "C" { + pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn get_baserel_parampathinfo( + root: *mut PlannerInfo, + baserel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_joinrel_parampathinfo( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outer_path: *mut Path, + inner_path: *mut Path, + sjinfo: *mut SpecialJoinInfo, + required_outer: Relids, + restrict_clauses: *mut *mut List, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_appendrel_parampathinfo( + appendrel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; } #[pg_guard] extern "C" { @@ -34308,653 +35589,262 @@ extern "C" { root: *mut PlannerInfo, pathkeys: *mut List, restrictinfos: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn select_outer_pathkeys_for_merge( - root: *mut PlannerInfo, - mergeclauses: *mut List, - joinrel: *mut RelOptInfo, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn make_inner_pathkeys_for_merge( - root: *mut PlannerInfo, - mergeclauses: *mut List, - outer_pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn trim_mergeclauses_for_inner_pathkeys( - root: *mut PlannerInfo, - mergeclauses: *mut List, - pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn truncate_useless_pathkeys( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; -} -#[pg_guard] -extern "C" { - pub fn make_canonical_pathkey( - root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, - opfamily: Oid, - strategy: ::std::os::raw::c_int, - nulls_first: bool, - ) -> *mut PathKey; -} -#[pg_guard] -extern "C" { - pub fn compare_path_costs( - path1: *mut Path, - path2: *mut Path, - criterion: CostSelector, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn compare_fractional_path_costs( - path1: *mut Path, - path2: *mut Path, - fraction: f64, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn set_cheapest(parent_rel: *mut RelOptInfo); -} -#[pg_guard] -extern "C" { - pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); -} -#[pg_guard] -extern "C" { - pub fn add_path_precheck( - parent_rel: *mut RelOptInfo, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); -} -#[pg_guard] -extern "C" { - pub fn add_partial_path_precheck( - parent_rel: *mut RelOptInfo, - total_cost: Cost, - pathkeys: *mut List, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn create_seqscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_samplescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_index_path( - root: *mut PlannerInfo, - index: *mut IndexOptInfo, - indexclauses: *mut List, - indexclausecols: *mut List, - indexorderbys: *mut List, - indexorderbycols: *mut List, - pathkeys: *mut List, - indexscandir: ScanDirection, - indexonly: bool, - required_outer: Relids, - loop_count: f64, - partial_path: bool, - ) -> *mut IndexPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_heap_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapqual: *mut Path, - required_outer: Relids, - loop_count: f64, - parallel_degree: ::std::os::raw::c_int, - ) -> *mut BitmapHeapPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_and_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapAndPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_or_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapOrPath; -} -#[pg_guard] -extern "C" { - pub fn create_tidscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - tidquals: *mut List, - required_outer: Relids, - ) -> *mut TidPath; -} -#[pg_guard] -extern "C" { - pub fn create_append_path( - rel: *mut RelOptInfo, - subpaths: *mut List, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - partitioned_rels: *mut List, - ) -> *mut AppendPath; -} -#[pg_guard] -extern "C" { - pub fn create_merge_append_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - partitioned_rels: *mut List, - ) -> *mut MergeAppendPath; -} -#[pg_guard] -extern "C" { - pub fn create_result_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - resconstantqual: *mut List, - ) -> *mut ResultPath; -} -#[pg_guard] -extern "C" { - pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; -} -#[pg_guard] -extern "C" { - pub fn create_unique_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - sjinfo: *mut SpecialJoinInfo, - ) -> *mut UniquePath; -} -#[pg_guard] -extern "C" { - pub fn create_gather_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherPath; -} -#[pg_guard] -extern "C" { - pub fn create_gather_merge_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - pathkeys: *mut List, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherMergePath; -} -#[pg_guard] -extern "C" { - pub fn create_subqueryscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut SubqueryScanPath; -} -#[pg_guard] -extern "C" { - pub fn create_functionscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_tablexprscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_valuesscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_tablefuncscan_path( + pub fn select_outer_pathkeys_for_merge( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + mergeclauses: *mut List, + joinrel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_ctescan_path( + pub fn make_inner_pathkeys_for_merge( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + mergeclauses: *mut List, + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_namedtuplestorescan_path( + pub fn trim_mergeclauses_for_inner_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + mergeclauses: *mut List, + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_worktablescan_path( + pub fn truncate_useless_pathkeys( root: *mut PlannerInfo, rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreignscan_path( + pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_canonical_pathkey( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + eclass: *mut EquivalenceClass, + opfamily: Oid, + strategy: ::std::os::raw::c_int, + nulls_first: bool, + ) -> *mut PathKey; } +pub const ForceParallelMode_FORCE_PARALLEL_OFF: ForceParallelMode = 0; +pub const ForceParallelMode_FORCE_PARALLEL_ON: ForceParallelMode = 1; +pub const ForceParallelMode_FORCE_PARALLEL_REGRESS: ForceParallelMode = 2; +pub type ForceParallelMode = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn calc_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) -> Relids; + pub static mut cursor_tuple_fraction: f64; } #[pg_guard] extern "C" { - pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) - -> Relids; + pub static mut force_parallel_mode: ::std::os::raw::c_int; } +pub type query_pathkeys_callback = ::std::option::Option< + unsafe extern "C" fn(root: *mut PlannerInfo, extra: *mut ::std::os::raw::c_void), +>; #[pg_guard] extern "C" { - pub fn create_nestloop_path( + pub fn query_planner( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut NestPath; + tlist: *mut List, + qp_callback: query_pathkeys_callback, + qp_extra: *mut ::std::os::raw::c_void, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_mergejoin_path( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, - mergeclauses: *mut List, - outersortkeys: *mut List, - innersortkeys: *mut List, - ) -> *mut MergePath; + pub fn preprocess_minmax_aggregates(root: *mut PlannerInfo, tlist: *mut List); } #[pg_guard] extern "C" { - pub fn create_hashjoin_path( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - required_outer: Relids, - hashclauses: *mut List, - ) -> *mut HashPath; + pub fn create_plan(root: *mut PlannerInfo, best_path: *mut Path) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_projection_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectionPath; + pub fn make_foreignscan( + qptlist: *mut List, + qpqual: *mut List, + scanrelid: Index, + fdw_exprs: *mut List, + fdw_private: *mut List, + fdw_scan_tlist: *mut List, + fdw_recheck_quals: *mut List, + outer_plan: *mut Plan, + ) -> *mut ForeignScan; } #[pg_guard] extern "C" { - pub fn apply_projection_to_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - path: *mut Path, - target: *mut PathTarget, - ) -> *mut Path; + pub fn change_plan_targetlist( + subplan: *mut Plan, + tlist: *mut List, + tlist_parallel_safe: bool, + ) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_set_projection_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectSetPath; + pub fn materialize_finished_plan(subplan: *mut Plan) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_sort_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - limit_tuples: f64, - ) -> *mut SortPath; + pub fn is_projection_capable_path(path: *mut Path) -> bool; } #[pg_guard] extern "C" { - pub fn create_group_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - groupClause: *mut List, - qual: *mut List, - numGroups: f64, - ) -> *mut GroupPath; + pub fn is_projection_capable_plan(plan: *mut Plan) -> bool; } #[pg_guard] extern "C" { - pub fn create_upper_unique_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - numCols: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut UpperUniquePath; + pub fn make_sort_from_sortclauses(sortcls: *mut List, lefttree: *mut Plan) -> *mut Sort; } #[pg_guard] extern "C" { - pub fn create_agg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, + pub fn make_agg( + tlist: *mut List, + qual: *mut List, aggstrategy: AggStrategy, aggsplit: AggSplit, - groupClause: *mut List, - qual: *mut List, - aggcosts: *const AggClauseCosts, - numGroups: f64, - ) -> *mut AggPath; + numGroupCols: ::std::os::raw::c_int, + grpColIdx: *mut AttrNumber, + grpOperators: *mut Oid, + groupingSets: *mut List, + chain: *mut List, + dNumGroups: f64, + lefttree: *mut Plan, + ) -> *mut Agg; } #[pg_guard] extern "C" { - pub fn create_groupingsets_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - having_qual: *mut List, - aggstrategy: AggStrategy, - rollups: *mut List, - agg_costs: *const AggClauseCosts, - numGroups: f64, - ) -> *mut GroupingSetsPath; + pub fn make_limit( + lefttree: *mut Plan, + limitOffset: *mut Node, + limitCount: *mut Node, + ) -> *mut Limit; } #[pg_guard] extern "C" { - pub fn create_minmaxagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - mmaggregates: *mut List, - quals: *mut List, - ) -> *mut MinMaxAggPath; + pub static mut from_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn create_windowagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - windowFuncs: *mut List, - winclause: *mut WindowClause, - winpathkeys: *mut List, - ) -> *mut WindowAggPath; + pub static mut join_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn create_setop_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - cmd: SetOpCmd, - strategy: SetOpStrategy, - distinctList: *mut List, - flagColIdx: AttrNumber, - firstFlag: ::std::os::raw::c_int, - numGroups: f64, - outputRows: f64, - ) -> *mut SetOpPath; + pub fn add_base_rels_to_query(root: *mut PlannerInfo, jtnode: *mut Node); } #[pg_guard] extern "C" { - pub fn create_recursiveunion_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - leftpath: *mut Path, - rightpath: *mut Path, - target: *mut PathTarget, - distinctList: *mut List, - wtParam: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut RecursiveUnionPath; + pub fn build_base_rel_tlists(root: *mut PlannerInfo, final_tlist: *mut List); } #[pg_guard] extern "C" { - pub fn create_lockrows_path( + pub fn add_vars_to_targetlist( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - rowMarks: *mut List, - epqParam: ::std::os::raw::c_int, - ) -> *mut LockRowsPath; + vars: *mut List, + where_needed: Relids, + create_new_ph: bool, + ); } #[pg_guard] extern "C" { - pub fn create_modifytable_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - operation: CmdType, - canSetTag: bool, - nominalRelation: Index, - partitioned_rels: *mut List, - resultRelations: *mut List, - subpaths: *mut List, - subroots: *mut List, - withCheckOptionLists: *mut List, - returningLists: *mut List, - rowMarks: *mut List, - onconflict: *mut OnConflictExpr, - epqParam: ::std::os::raw::c_int, - ) -> *mut ModifyTablePath; + pub fn find_lateral_references(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn create_limit_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - limitOffset: *mut Node, - limitCount: *mut Node, - offset_est: int64, - count_est: int64, - ) -> *mut LimitPath; + pub fn create_lateral_join_info(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn reparameterize_path( - root: *mut PlannerInfo, - path: *mut Path, - required_outer: Relids, - loop_count: f64, - ) -> *mut Path; + pub fn deconstruct_jointree(root: *mut PlannerInfo) -> *mut List; } #[pg_guard] extern "C" { - pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); + pub fn distribute_restrictinfo_to_rels(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn build_simple_rel( + pub fn process_implied_equality( root: *mut PlannerInfo, - relid: ::std::os::raw::c_int, - parent: *mut RelOptInfo, - ) -> *mut RelOptInfo; + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + below_outer_join: bool, + both_const: bool, + ); } #[pg_guard] extern "C" { - pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; + pub fn build_implied_join_equality( + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + ) -> *mut RestrictInfo; } #[pg_guard] extern "C" { - pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; + pub fn match_foreign_keys_to_quals(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn build_join_rel( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - sjinfo: *mut SpecialJoinInfo, - restrictlist_ptr: *mut *mut List, - ) -> *mut RelOptInfo; + pub fn remove_useless_joins(root: *mut PlannerInfo, joinlist: *mut List) -> *mut List; } #[pg_guard] extern "C" { - pub fn min_join_parameterization( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - ) -> Relids; + pub fn reduce_unique_semijoins(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn build_empty_join_rel(root: *mut PlannerInfo) -> *mut RelOptInfo; + pub fn query_supports_distinctness(query: *mut Query) -> bool; } #[pg_guard] extern "C" { - pub fn fetch_upper_rel( - root: *mut PlannerInfo, - kind: UpperRelationKind, - relids: Relids, - ) -> *mut RelOptInfo; + pub fn query_is_distinct_for(query: *mut Query, colnos: *mut List, opids: *mut List) -> bool; } #[pg_guard] extern "C" { - pub fn find_childrel_appendrelinfo( + pub fn innerrel_is_unique( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - ) -> *mut AppendRelInfo; -} -#[pg_guard] -extern "C" { - pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; + outerrelids: Relids, + innerrel: *mut RelOptInfo, + jointype: JoinType, + restrictlist: *mut List, + force_cache: bool, + ) -> bool; } #[pg_guard] extern "C" { - pub fn get_baserel_parampathinfo( - root: *mut PlannerInfo, - baserel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn set_plan_references(root: *mut PlannerInfo, plan: *mut Plan) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn get_joinrel_parampathinfo( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outer_path: *mut Path, - inner_path: *mut Path, - sjinfo: *mut SpecialJoinInfo, - required_outer: Relids, - restrict_clauses: *mut *mut List, - ) -> *mut ParamPathInfo; + pub fn record_plan_function_dependency(root: *mut PlannerInfo, funcid: Oid); } #[pg_guard] extern "C" { - pub fn get_appendrel_parampathinfo( - appendrel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn extract_query_dependencies( + query: *mut Node, + relationOids: *mut *mut List, + invalItems: *mut *mut List, + hasRowSecurity: *mut bool, + ); } pub type planner_hook_type = ::std::option::Option< unsafe extern "C" fn( @@ -35097,6 +35987,133 @@ extern "C" { current_and_outer: Relids, ) -> bool; } +#[pg_guard] +extern "C" { + pub fn tlist_member(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn tlist_member_ignore_relabel(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn add_to_flat_tlist(tlist: *mut List, exprs: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_tlist_exprs(tlist: *mut List, includeJunk: bool) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn count_nonjunk_tlist_entries(tlist: *mut List) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_exprs(tlist1: *mut List, tlist2: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_datatypes(tlist: *mut List, colTypes: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_collations(tlist: *mut List, colCollations: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn apply_tlist_labeling(dest_tlist: *mut List, src_tlist: *mut List); +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_tle(sortref: Index, targetList: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupclause_tle( + sgClause: *mut SortGroupClause, + targetList: *mut List, + ) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupclause_expr( + sgClause: *mut SortGroupClause, + targetList: *mut List, + ) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn get_sortgrouplist_exprs(sgClauses: *mut List, targetList: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_clause(sortref: Index, clauses: *mut List) -> *mut SortGroupClause; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_clause_noerr( + sortref: Index, + clauses: *mut List, + ) -> *mut SortGroupClause; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_ops(groupClause: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_cols(groupClause: *mut List, tlist: *mut List) -> *mut AttrNumber; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_sortable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_hashable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_pathtarget_from_tlist(tlist: *mut List) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn make_tlist_from_pathtarget(target: *mut PathTarget) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn copy_pathtarget(src: *mut PathTarget) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn create_empty_pathtarget() -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn add_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr, sortgroupref: Index); +} +#[pg_guard] +extern "C" { + pub fn add_new_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr); +} +#[pg_guard] +extern "C" { + pub fn add_new_columns_to_pathtarget(target: *mut PathTarget, exprs: *mut List); +} +#[pg_guard] +extern "C" { + pub fn apply_pathtarget_labeling_to_tlist(tlist: *mut List, target: *mut PathTarget); +} +#[pg_guard] +extern "C" { + pub fn split_pathtarget_at_srfs( + root: *mut PlannerInfo, + target: *mut PathTarget, + input_target: *mut PathTarget, + targets: *mut *mut List, + targets_contain_srfs: *mut *mut List, + ); +} pub const FuncDetailCode_FUNCDETAIL_NOTFOUND: FuncDetailCode = 0; pub const FuncDetailCode_FUNCDETAIL_MULTIPLE: FuncDetailCode = 1; pub const FuncDetailCode_FUNCDETAIL_NORMAL: FuncDetailCode = 2; @@ -35357,6 +36374,35 @@ extern "C" { extern "C" { pub fn SystemTypeName(name: *mut ::std::os::raw::c_char) -> *mut TypeName; } +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_name( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_type( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + vartype: *mut Oid, + vartypmod: *mut int32, + varcollid: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_is_dropped(rte: *mut RangeTblEntry, attnum: AttrNumber) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_tle_by_resno(tlist: *mut List, resno: AttrNumber) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_parse_rowmark(qry: *mut Query, rtindex: Index) -> *mut RowMarkClause; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ReorderBufferTupleBuf { @@ -36401,6 +37447,49 @@ extern "C" { extern "C" { pub fn FreeAccessStrategy(strategy: BufferAccessStrategy); } +pub type pg_on_exit_callback = + ::std::option::Option; +pub type shmem_startup_hook_type = ::std::option::Option; +#[pg_guard] +extern "C" { + pub static mut proc_exit_inprogress: bool; +} +#[pg_guard] +extern "C" { + pub fn proc_exit(code: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn shmem_exit(code: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn on_proc_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn on_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn before_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn cancel_before_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn on_exit_reset(); +} +#[pg_guard] +extern "C" { + pub static mut shmem_startup_hook: shmem_startup_hook_type; +} +#[pg_guard] +extern "C" { + pub fn CreateSharedMemoryAndSemaphores(port: ::std::os::raw::c_int); +} #[pg_guard] extern "C" { pub fn standby_redo(record: *mut XLogReaderState); @@ -36814,49 +37903,6 @@ extern "C" { catalog_xmin: *mut TransactionId, ); } -pub type pg_on_exit_callback = - ::std::option::Option; -pub type shmem_startup_hook_type = ::std::option::Option; -#[pg_guard] -extern "C" { - pub static mut proc_exit_inprogress: bool; -} -#[pg_guard] -extern "C" { - pub fn proc_exit(code: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn shmem_exit(code: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn on_proc_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn on_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn before_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn cancel_before_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn on_exit_reset(); -} -#[pg_guard] -extern "C" { - pub static mut shmem_startup_hook: shmem_startup_hook_type; -} -#[pg_guard] -extern "C" { - pub fn CreateSharedMemoryAndSemaphores(port: ::std::os::raw::c_int); -} pub const GucContext_PGC_INTERNAL: GucContext = 0; pub const GucContext_PGC_POSTMASTER: GucContext = 1; pub const GucContext_PGC_SIGHUP: GucContext = 2; @@ -49157,202 +50203,6 @@ extern "C" { estimated_len: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; -pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; -pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; -pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; -pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; -pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; -pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; -pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; -pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; -pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; -pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; -pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; -pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; -pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; -pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; -pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; -pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; -pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; -pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; -pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; -pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; -pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; -pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; -pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; -pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; -pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; -pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; -pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; -pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; -pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; -pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; -pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; -pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; -pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; -pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; -pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; -pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; -pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; -pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; -pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; -pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; -pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; -pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; -pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; -pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; -pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; -pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; -pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; -pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; -pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; -pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; -pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; -pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; -pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 55; -pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 56; -pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 57; -pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 58; -pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 59; -pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 60; -pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 61; -pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 62; -pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 63; -pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 64; -pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 65; -pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 66; -pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 67; -pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 68; -pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 69; -pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 70; -pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 71; -pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 72; -pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 73; -pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 74; -pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 75; -pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 76; -pub type SysCacheIdentifier = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn InitCatalogCache(); -} -#[pg_guard] -extern "C" { - pub fn InitCatalogCachePhase2(); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn ReleaseSysCache(tuple: HeapTuple); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopy( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExists( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheOid( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> Oid; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttName( - relid: Oid, - attname: *const ::std::os::raw::c_char, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn SysCacheGetAttr( - cacheId: ::std::os::raw::c_int, - tup: HeapTuple, - attributeNumber: AttrNumber, - isNull: *mut bool, - ) -> Datum; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheHashValue( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> uint32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct catclist { - _unused: [u8; 0], -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheList( - cacheId: ::std::os::raw::c_int, - nkeys: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> *mut catclist; -} -#[pg_guard] -extern "C" { - pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); -} -#[pg_guard] -extern "C" { - pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationHasSysCache(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationSupportsSysCache(relid: Oid) -> bool; -} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OpBtreeInterpretation { @@ -50025,6 +50875,60 @@ extern "C" { chunkSize: Size, ) -> MemoryContext; } +pub type SamplerRandomState = [::std::os::raw::c_ushort; 3usize]; +#[pg_guard] +extern "C" { + pub fn sampler_random_init_state( + seed: ::std::os::raw::c_long, + randstate: *mut ::std::os::raw::c_ushort, + ); +} +#[pg_guard] +extern "C" { + pub fn sampler_random_fract(randstate: *mut ::std::os::raw::c_ushort) -> f64; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BlockSamplerData { + pub N: BlockNumber, + pub n: ::std::os::raw::c_int, + pub t: BlockNumber, + pub m: ::std::os::raw::c_int, + pub randstate: SamplerRandomState, +} +pub type BlockSampler = *mut BlockSamplerData; +#[pg_guard] +extern "C" { + pub fn BlockSampler_Init( + bs: BlockSampler, + nblocks: BlockNumber, + samplesize: ::std::os::raw::c_int, + randseed: ::std::os::raw::c_long, + ); +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_HasMore(bs: BlockSampler) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_Next(bs: BlockSampler) -> BlockNumber; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ReservoirStateData { + pub W: f64, + pub randstate: SamplerRandomState, +} +pub type ReservoirState = *mut ReservoirStateData; +#[pg_guard] +extern "C" { + pub fn reservoir_init_selection_state(rs: ReservoirState, n: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn reservoir_get_next_S(rs: ReservoirState, t: f64, n: ::std::os::raw::c_int) -> f64; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VariableStatData { @@ -50293,6 +51197,202 @@ extern "C" { varRelid: ::std::os::raw::c_int, ) -> Selectivity; } +pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; +pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; +pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; +pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; +pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; +pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; +pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; +pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; +pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; +pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; +pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; +pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; +pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; +pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; +pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; +pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; +pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; +pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; +pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; +pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; +pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; +pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; +pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; +pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; +pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; +pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; +pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; +pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; +pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; +pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; +pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; +pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; +pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; +pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; +pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; +pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; +pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; +pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; +pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; +pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; +pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; +pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; +pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; +pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; +pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; +pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; +pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; +pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; +pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; +pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; +pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; +pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; +pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; +pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 55; +pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 56; +pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 57; +pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 58; +pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 59; +pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 60; +pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 61; +pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 62; +pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 63; +pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 64; +pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 65; +pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 66; +pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 67; +pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 68; +pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 69; +pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 70; +pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 71; +pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 72; +pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 73; +pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 74; +pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 75; +pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 76; +pub type SysCacheIdentifier = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn InitCatalogCache(); +} +#[pg_guard] +extern "C" { + pub fn InitCatalogCachePhase2(); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn ReleaseSysCache(tuple: HeapTuple); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopy( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExists( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheOid( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttName( + relid: Oid, + attname: *const ::std::os::raw::c_char, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn SysCacheGetAttr( + cacheId: ::std::os::raw::c_int, + tup: HeapTuple, + attributeNumber: AttrNumber, + isNull: *mut bool, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheHashValue( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> uint32; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct catclist { + _unused: [u8; 0], +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheList( + cacheId: ::std::os::raw::c_int, + nkeys: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> *mut catclist; +} +#[pg_guard] +extern "C" { + pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); +} +#[pg_guard] +extern "C" { + pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationHasSysCache(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationSupportsSysCache(relid: Oid) -> bool; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DomainConstraintCache { diff --git a/pgx-pg-sys/src/pg11.rs b/pgx-pg-sys/src/pg11.rs index 7415cbb62..0ce35d198 100644 --- a/pgx-pg-sys/src/pg11.rs +++ b/pgx-pg-sys/src/pg11.rs @@ -2547,6 +2547,11 @@ pub const ACL_ALL_RIGHTS_LARGEOBJECT: u32 = 6; pub const ACL_ALL_RIGHTS_SCHEMA: u32 = 768; pub const ACL_ALL_RIGHTS_TABLESPACE: u32 = 512; pub const ACL_ALL_RIGHTS_TYPE: u32 = 256; +pub const PERFORM_DELETION_INTERNAL: u32 = 1; +pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; +pub const PERFORM_DELETION_QUIETLY: u32 = 4; +pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; +pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; pub const DEFAULT_INDEX_TYPE: &'static [u8; 6usize] = b"btree\0"; pub const INDEX_CREATE_IS_PRIMARY: u32 = 1; pub const INDEX_CREATE_ADD_CONSTRAINT: u32 = 2; @@ -2565,6 +2570,59 @@ pub const REINDEX_REL_SUPPRESS_INDEX_USE: u32 = 2; pub const REINDEX_REL_CHECK_CONSTRAINTS: u32 = 4; pub const REINDEX_REL_FORCE_INDEXES_UNLOGGED: u32 = 8; pub const REINDEX_REL_FORCE_INDEXES_PERMANENT: u32 = 16; +pub const RelationRelationId: u32 = 1259; +pub const RelationRelation_Rowtype_Id: u32 = 83; +pub const Anum_pg_class_relname: u32 = 1; +pub const Anum_pg_class_relnamespace: u32 = 2; +pub const Anum_pg_class_reltype: u32 = 3; +pub const Anum_pg_class_reloftype: u32 = 4; +pub const Anum_pg_class_relowner: u32 = 5; +pub const Anum_pg_class_relam: u32 = 6; +pub const Anum_pg_class_relfilenode: u32 = 7; +pub const Anum_pg_class_reltablespace: u32 = 8; +pub const Anum_pg_class_relpages: u32 = 9; +pub const Anum_pg_class_reltuples: u32 = 10; +pub const Anum_pg_class_relallvisible: u32 = 11; +pub const Anum_pg_class_reltoastrelid: u32 = 12; +pub const Anum_pg_class_relhasindex: u32 = 13; +pub const Anum_pg_class_relisshared: u32 = 14; +pub const Anum_pg_class_relpersistence: u32 = 15; +pub const Anum_pg_class_relkind: u32 = 16; +pub const Anum_pg_class_relnatts: u32 = 17; +pub const Anum_pg_class_relchecks: u32 = 18; +pub const Anum_pg_class_relhasoids: u32 = 19; +pub const Anum_pg_class_relhasrules: u32 = 20; +pub const Anum_pg_class_relhastriggers: u32 = 21; +pub const Anum_pg_class_relhassubclass: u32 = 22; +pub const Anum_pg_class_relrowsecurity: u32 = 23; +pub const Anum_pg_class_relforcerowsecurity: u32 = 24; +pub const Anum_pg_class_relispopulated: u32 = 25; +pub const Anum_pg_class_relreplident: u32 = 26; +pub const Anum_pg_class_relispartition: u32 = 27; +pub const Anum_pg_class_relrewrite: u32 = 28; +pub const Anum_pg_class_relfrozenxid: u32 = 29; +pub const Anum_pg_class_relminmxid: u32 = 30; +pub const Anum_pg_class_relacl: u32 = 31; +pub const Anum_pg_class_reloptions: u32 = 32; +pub const Anum_pg_class_relpartbound: u32 = 33; +pub const Natts_pg_class: u32 = 33; +pub const RELKIND_RELATION: u8 = 114u8; +pub const RELKIND_INDEX: u8 = 105u8; +pub const RELKIND_SEQUENCE: u8 = 83u8; +pub const RELKIND_TOASTVALUE: u8 = 116u8; +pub const RELKIND_VIEW: u8 = 118u8; +pub const RELKIND_MATVIEW: u8 = 109u8; +pub const RELKIND_COMPOSITE_TYPE: u8 = 99u8; +pub const RELKIND_FOREIGN_TABLE: u8 = 102u8; +pub const RELKIND_PARTITIONED_TABLE: u8 = 112u8; +pub const RELKIND_PARTITIONED_INDEX: u8 = 73u8; +pub const RELPERSISTENCE_PERMANENT: u8 = 112u8; +pub const RELPERSISTENCE_UNLOGGED: u8 = 117u8; +pub const RELPERSISTENCE_TEMP: u8 = 116u8; +pub const REPLICA_IDENTITY_DEFAULT: u8 = 100u8; +pub const REPLICA_IDENTITY_NOTHING: u8 = 110u8; +pub const REPLICA_IDENTITY_FULL: u8 = 102u8; +pub const REPLICA_IDENTITY_INDEX: u8 = 105u8; pub const EnumRelationId: u32 = 3501; pub const Anum_pg_enum_enumtypid: u32 = 1; pub const Anum_pg_enum_enumsortorder: u32 = 2; @@ -2616,6 +2674,37 @@ pub const PROARGMODE_OUT: u8 = 111u8; pub const PROARGMODE_INOUT: u8 = 98u8; pub const PROARGMODE_VARIADIC: u8 = 118u8; pub const PROARGMODE_TABLE: u8 = 116u8; +pub const TriggerRelationId: u32 = 2620; +pub const Anum_pg_trigger_tgrelid: u32 = 1; +pub const Anum_pg_trigger_tgname: u32 = 2; +pub const Anum_pg_trigger_tgfoid: u32 = 3; +pub const Anum_pg_trigger_tgtype: u32 = 4; +pub const Anum_pg_trigger_tgenabled: u32 = 5; +pub const Anum_pg_trigger_tgisinternal: u32 = 6; +pub const Anum_pg_trigger_tgconstrrelid: u32 = 7; +pub const Anum_pg_trigger_tgconstrindid: u32 = 8; +pub const Anum_pg_trigger_tgconstraint: u32 = 9; +pub const Anum_pg_trigger_tgdeferrable: u32 = 10; +pub const Anum_pg_trigger_tginitdeferred: u32 = 11; +pub const Anum_pg_trigger_tgnargs: u32 = 12; +pub const Anum_pg_trigger_tgattr: u32 = 13; +pub const Anum_pg_trigger_tgargs: u32 = 14; +pub const Anum_pg_trigger_tgqual: u32 = 15; +pub const Anum_pg_trigger_tgoldtable: u32 = 16; +pub const Anum_pg_trigger_tgnewtable: u32 = 17; +pub const Natts_pg_trigger: u32 = 17; +pub const TRIGGER_TYPE_ROW: u32 = 1; +pub const TRIGGER_TYPE_BEFORE: u32 = 2; +pub const TRIGGER_TYPE_INSERT: u32 = 4; +pub const TRIGGER_TYPE_DELETE: u32 = 8; +pub const TRIGGER_TYPE_UPDATE: u32 = 16; +pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; +pub const TRIGGER_TYPE_INSTEAD: u32 = 64; +pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; +pub const TRIGGER_TYPE_STATEMENT: u32 = 0; +pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; +pub const TRIGGER_TYPE_AFTER: u32 = 0; +pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TypeRelationId: u32 = 1247; pub const TypeRelation_Rowtype_Id: u32 = 71; pub const Anum_pg_type_typname: u32 = 1; @@ -2834,11 +2923,6 @@ pub const FDW_HANDLEROID: u32 = 3115; pub const INDEX_AM_HANDLEROID: u32 = 325; pub const TSM_HANDLEROID: u32 = 3310; pub const ANYRANGEOID: u32 = 3831; -pub const PERFORM_DELETION_INTERNAL: u32 = 1; -pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; -pub const PERFORM_DELETION_QUIETLY: u32 = 4; -pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; -pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; pub const EventTriggerRelationId: u32 = 3466; pub const Anum_pg_event_trigger_evtname: u32 = 1; pub const Anum_pg_event_trigger_evtevent: u32 = 2; @@ -2851,37 +2935,6 @@ pub const AT_REWRITE_ALTER_PERSISTENCE: u32 = 1; pub const AT_REWRITE_DEFAULT_VAL: u32 = 2; pub const AT_REWRITE_COLUMN_REWRITE: u32 = 4; pub const AT_REWRITE_ALTER_OID: u32 = 8; -pub const TriggerRelationId: u32 = 2620; -pub const Anum_pg_trigger_tgrelid: u32 = 1; -pub const Anum_pg_trigger_tgname: u32 = 2; -pub const Anum_pg_trigger_tgfoid: u32 = 3; -pub const Anum_pg_trigger_tgtype: u32 = 4; -pub const Anum_pg_trigger_tgenabled: u32 = 5; -pub const Anum_pg_trigger_tgisinternal: u32 = 6; -pub const Anum_pg_trigger_tgconstrrelid: u32 = 7; -pub const Anum_pg_trigger_tgconstrindid: u32 = 8; -pub const Anum_pg_trigger_tgconstraint: u32 = 9; -pub const Anum_pg_trigger_tgdeferrable: u32 = 10; -pub const Anum_pg_trigger_tginitdeferred: u32 = 11; -pub const Anum_pg_trigger_tgnargs: u32 = 12; -pub const Anum_pg_trigger_tgattr: u32 = 13; -pub const Anum_pg_trigger_tgargs: u32 = 14; -pub const Anum_pg_trigger_tgqual: u32 = 15; -pub const Anum_pg_trigger_tgoldtable: u32 = 16; -pub const Anum_pg_trigger_tgnewtable: u32 = 17; -pub const Natts_pg_trigger: u32 = 17; -pub const TRIGGER_TYPE_ROW: u32 = 1; -pub const TRIGGER_TYPE_BEFORE: u32 = 2; -pub const TRIGGER_TYPE_INSERT: u32 = 4; -pub const TRIGGER_TYPE_DELETE: u32 = 8; -pub const TRIGGER_TYPE_UPDATE: u32 = 16; -pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; -pub const TRIGGER_TYPE_INSTEAD: u32 = 64; -pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; -pub const TRIGGER_TYPE_STATEMENT: u32 = 0; -pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; -pub const TRIGGER_TYPE_AFTER: u32 = 0; -pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TRIGGER_EVENT_INSERT: u32 = 0; pub const TRIGGER_EVENT_DELETE: u32 = 1; pub const TRIGGER_EVENT_UPDATE: u32 = 2; @@ -2904,6 +2957,42 @@ pub const TRIGGER_DISABLED: u8 = 68u8; pub const RI_TRIGGER_PK: u32 = 1; pub const RI_TRIGGER_FK: u32 = 2; pub const RI_TRIGGER_NONE: u32 = 0; +pub const StatisticRelationId: u32 = 2619; +pub const Anum_pg_statistic_starelid: u32 = 1; +pub const Anum_pg_statistic_staattnum: u32 = 2; +pub const Anum_pg_statistic_stainherit: u32 = 3; +pub const Anum_pg_statistic_stanullfrac: u32 = 4; +pub const Anum_pg_statistic_stawidth: u32 = 5; +pub const Anum_pg_statistic_stadistinct: u32 = 6; +pub const Anum_pg_statistic_stakind1: u32 = 7; +pub const Anum_pg_statistic_stakind2: u32 = 8; +pub const Anum_pg_statistic_stakind3: u32 = 9; +pub const Anum_pg_statistic_stakind4: u32 = 10; +pub const Anum_pg_statistic_stakind5: u32 = 11; +pub const Anum_pg_statistic_staop1: u32 = 12; +pub const Anum_pg_statistic_staop2: u32 = 13; +pub const Anum_pg_statistic_staop3: u32 = 14; +pub const Anum_pg_statistic_staop4: u32 = 15; +pub const Anum_pg_statistic_staop5: u32 = 16; +pub const Anum_pg_statistic_stanumbers1: u32 = 17; +pub const Anum_pg_statistic_stanumbers2: u32 = 18; +pub const Anum_pg_statistic_stanumbers3: u32 = 19; +pub const Anum_pg_statistic_stanumbers4: u32 = 20; +pub const Anum_pg_statistic_stanumbers5: u32 = 21; +pub const Anum_pg_statistic_stavalues1: u32 = 22; +pub const Anum_pg_statistic_stavalues2: u32 = 23; +pub const Anum_pg_statistic_stavalues3: u32 = 24; +pub const Anum_pg_statistic_stavalues4: u32 = 25; +pub const Anum_pg_statistic_stavalues5: u32 = 26; +pub const Natts_pg_statistic: u32 = 26; +pub const STATISTIC_KIND_MCV: u32 = 1; +pub const STATISTIC_KIND_HISTOGRAM: u32 = 2; +pub const STATISTIC_KIND_CORRELATION: u32 = 3; +pub const STATISTIC_KIND_MCELEM: u32 = 4; +pub const STATISTIC_KIND_DECHIST: u32 = 5; +pub const STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM: u32 = 6; +pub const STATISTIC_KIND_BOUNDS_HISTOGRAM: u32 = 7; +pub const STATISTIC_NUM_SLOTS: u32 = 5; pub const CACHEDPLANSOURCE_MAGIC: u32 = 195726186; pub const CACHEDPLAN_MAGIC: u32 = 953717834; pub const SPI_ERROR_CONNECT: i32 = -1; @@ -2967,6 +3056,7 @@ pub const DEFAULT_CPU_OPERATOR_COST: f64 = 0.0025; pub const DEFAULT_PARALLEL_TUPLE_COST: f64 = 0.1; pub const DEFAULT_PARALLEL_SETUP_COST: f64 = 1000.0; pub const DEFAULT_EFFECTIVE_CACHE_SIZE: u32 = 524288; +pub const DEFAULT_CURSOR_TUPLE_FRACTION: f64 = 0.1; pub const OLD_SNAPSHOT_PADDING_ENTRIES: u32 = 10; pub const MAX_IO_CONCURRENCY: u32 = 1000; pub const BUFFER_LOCK_UNLOCK: u32 = 0; @@ -3074,59 +3164,6 @@ pub const BACKUP_LABEL_FILE: &'static [u8; 13usize] = b"backup_label\0"; pub const BACKUP_LABEL_OLD: &'static [u8; 17usize] = b"backup_label.old\0"; pub const TABLESPACE_MAP: &'static [u8; 15usize] = b"tablespace_map\0"; pub const TABLESPACE_MAP_OLD: &'static [u8; 19usize] = b"tablespace_map.old\0"; -pub const RelationRelationId: u32 = 1259; -pub const RelationRelation_Rowtype_Id: u32 = 83; -pub const Anum_pg_class_relname: u32 = 1; -pub const Anum_pg_class_relnamespace: u32 = 2; -pub const Anum_pg_class_reltype: u32 = 3; -pub const Anum_pg_class_reloftype: u32 = 4; -pub const Anum_pg_class_relowner: u32 = 5; -pub const Anum_pg_class_relam: u32 = 6; -pub const Anum_pg_class_relfilenode: u32 = 7; -pub const Anum_pg_class_reltablespace: u32 = 8; -pub const Anum_pg_class_relpages: u32 = 9; -pub const Anum_pg_class_reltuples: u32 = 10; -pub const Anum_pg_class_relallvisible: u32 = 11; -pub const Anum_pg_class_reltoastrelid: u32 = 12; -pub const Anum_pg_class_relhasindex: u32 = 13; -pub const Anum_pg_class_relisshared: u32 = 14; -pub const Anum_pg_class_relpersistence: u32 = 15; -pub const Anum_pg_class_relkind: u32 = 16; -pub const Anum_pg_class_relnatts: u32 = 17; -pub const Anum_pg_class_relchecks: u32 = 18; -pub const Anum_pg_class_relhasoids: u32 = 19; -pub const Anum_pg_class_relhasrules: u32 = 20; -pub const Anum_pg_class_relhastriggers: u32 = 21; -pub const Anum_pg_class_relhassubclass: u32 = 22; -pub const Anum_pg_class_relrowsecurity: u32 = 23; -pub const Anum_pg_class_relforcerowsecurity: u32 = 24; -pub const Anum_pg_class_relispopulated: u32 = 25; -pub const Anum_pg_class_relreplident: u32 = 26; -pub const Anum_pg_class_relispartition: u32 = 27; -pub const Anum_pg_class_relrewrite: u32 = 28; -pub const Anum_pg_class_relfrozenxid: u32 = 29; -pub const Anum_pg_class_relminmxid: u32 = 30; -pub const Anum_pg_class_relacl: u32 = 31; -pub const Anum_pg_class_reloptions: u32 = 32; -pub const Anum_pg_class_relpartbound: u32 = 33; -pub const Natts_pg_class: u32 = 33; -pub const RELKIND_RELATION: u8 = 114u8; -pub const RELKIND_INDEX: u8 = 105u8; -pub const RELKIND_SEQUENCE: u8 = 83u8; -pub const RELKIND_TOASTVALUE: u8 = 116u8; -pub const RELKIND_VIEW: u8 = 118u8; -pub const RELKIND_MATVIEW: u8 = 109u8; -pub const RELKIND_COMPOSITE_TYPE: u8 = 99u8; -pub const RELKIND_FOREIGN_TABLE: u8 = 102u8; -pub const RELKIND_PARTITIONED_TABLE: u8 = 112u8; -pub const RELKIND_PARTITIONED_INDEX: u8 = 73u8; -pub const RELPERSISTENCE_PERMANENT: u8 = 112u8; -pub const RELPERSISTENCE_UNLOGGED: u8 = 117u8; -pub const RELPERSISTENCE_TEMP: u8 = 116u8; -pub const REPLICA_IDENTITY_DEFAULT: u8 = 100u8; -pub const REPLICA_IDENTITY_NOTHING: u8 = 110u8; -pub const REPLICA_IDENTITY_FULL: u8 = 102u8; -pub const REPLICA_IDENTITY_INDEX: u8 = 105u8; pub const IndexRelationId: u32 = 2610; pub const Anum_pg_index_indexrelid: u32 = 1; pub const Anum_pg_index_indrelid: u32 = 2; @@ -29253,6 +29290,282 @@ extern "C" { extern "C" { pub fn get_relkind_objtype(relkind: ::std::os::raw::c_char) -> ObjectType; } +pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; +pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; +pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; +pub const DependencyType_DEPENDENCY_INTERNAL_AUTO: DependencyType = 73; +pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; +pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; +pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; +pub type DependencyType = ::std::os::raw::c_uint; +pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; +pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; +pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; +pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; +pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; +pub type SharedDependencyType = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectAddresses { + _unused: [u8; 0], +} +pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; +pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; +pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; +pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; +pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; +pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; +pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; +pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; +pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; +pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; +pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; +pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; +pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; +pub const ObjectClass_OCLASS_AM: ObjectClass = 13; +pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; +pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; +pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; +pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; +pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; +pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; +pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; +pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; +pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; +pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; +pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; +pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; +pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; +pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; +pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; +pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; +pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; +pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; +pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; +pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; +pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; +pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; +pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; +pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; +pub type ObjectClass = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn ReleaseDeletionLock(object: *const ObjectAddress); +} +#[pg_guard] +extern "C" { + pub fn performDeletion( + object: *const ObjectAddress, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn performMultipleDeletions( + objects: *const ObjectAddresses, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnExpr( + depender: *const ObjectAddress, + expr: *mut Node, + rtable: *mut List, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnSingleRelExpr( + depender: *const ObjectAddress, + expr: *mut Node, + relId: Oid, + behavior: DependencyType, + self_behavior: DependencyType, + reverse_self: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; +} +#[pg_guard] +extern "C" { + pub fn new_object_addresses() -> *mut ObjectAddresses; +} +#[pg_guard] +extern "C" { + pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn object_address_present( + object: *const ObjectAddress, + addrs: *const ObjectAddresses, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn record_object_address_dependencies( + depender: *const ObjectAddress, + referenced: *mut ObjectAddresses, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn free_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOn( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordMultipleDependencies( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + nreferenced: ::std::os::raw::c_int, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsFor( + classId: Oid, + objectId: Oid, + skipExtensionDeps: bool, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsForClass( + classId: Oid, + objectId: Oid, + refclassId: Oid, + deptype: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependencyFor( + classId: Oid, + objectId: Oid, + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn sequenceIsOwned( + seqId: Oid, + deptype: ::std::os::raw::c_char, + tableId: *mut Oid, + colId: *mut int32, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_constraint_index(constraintId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_constraint(indexId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn recordSharedDependencyOn( + depender: *mut ObjectAddress, + referenced: *mut ObjectAddress, + deptype: SharedDependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); +} +#[pg_guard] +extern "C" { + pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); +} +#[pg_guard] +extern "C" { + pub fn updateAclDependencies( + classId: Oid, + objectId: Oid, + objectSubId: int32, + ownerId: Oid, + noldmembers: ::std::os::raw::c_int, + oldmembers: *mut Oid, + nnewmembers: ::std::os::raw::c_int, + newmembers: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn checkSharedDependencies( + classId: Oid, + objectId: Oid, + detail_msg: *mut *mut ::std::os::raw::c_char, + detail_log_msg: *mut *mut ::std::os::raw::c_char, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); +} +#[pg_guard] +extern "C" { + pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); +} +#[pg_guard] +extern "C" { + pub fn dropDatabaseDependencies(databaseId: Oid); +} +#[pg_guard] +extern "C" { + pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); +} +#[pg_guard] +extern "C" { + pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); +} pub type IndexBuildCallback = ::std::option::Option< unsafe extern "C" fn( index: Relation, @@ -29805,6 +30118,46 @@ extern "C" { } #[repr(C)] #[derive(Copy, Clone)] +pub struct FormData_pg_class { + pub relname: NameData, + pub relnamespace: Oid, + pub reltype: Oid, + pub reloftype: Oid, + pub relowner: Oid, + pub relam: Oid, + pub relfilenode: Oid, + pub reltablespace: Oid, + pub relpages: int32, + pub reltuples: float4, + pub relallvisible: int32, + pub reltoastrelid: Oid, + pub relhasindex: bool, + pub relisshared: bool, + pub relpersistence: ::std::os::raw::c_char, + pub relkind: ::std::os::raw::c_char, + pub relnatts: int16, + pub relchecks: int16, + pub relhasoids: bool, + pub relhasrules: bool, + pub relhastriggers: bool, + pub relhassubclass: bool, + pub relrowsecurity: bool, + pub relforcerowsecurity: bool, + pub relispopulated: bool, + pub relreplident: ::std::os::raw::c_char, + pub relispartition: bool, + pub relrewrite: Oid, + pub relfrozenxid: TransactionId, + pub relminmxid: TransactionId, +} +impl Default for FormData_pg_class { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type Form_pg_class = *mut FormData_pg_class; +#[repr(C)] +#[derive(Copy, Clone)] pub struct FormData_pg_enum { pub enumtypid: Oid, pub enumsortorder: float4, @@ -29909,6 +30262,28 @@ extern "C" { pub fn oid_array_to_list(datum: Datum) -> *mut List; } #[repr(C)] +pub struct FormData_pg_trigger { + pub tgrelid: Oid, + pub tgname: NameData, + pub tgfoid: Oid, + pub tgtype: int16, + pub tgenabled: ::std::os::raw::c_char, + pub tgisinternal: bool, + pub tgconstrrelid: Oid, + pub tgconstrindid: Oid, + pub tgconstraint: Oid, + pub tgdeferrable: bool, + pub tginitdeferred: bool, + pub tgnargs: int16, + pub tgattr: int2vector, +} +impl Default for FormData_pg_trigger { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type Form_pg_trigger = *mut FormData_pg_trigger; +#[repr(C)] #[derive(Copy, Clone)] pub struct FormData_pg_type { pub typname: NameData, @@ -30104,281 +30479,445 @@ extern "C" { ctype: *const ::std::os::raw::c_char, ); } -pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; -pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; -pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; -pub const DependencyType_DEPENDENCY_INTERNAL_AUTO: DependencyType = 73; -pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; -pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; -pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; -pub type DependencyType = ::std::os::raw::c_uint; -pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; -pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; -pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; -pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; -pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; -pub type SharedDependencyType = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectAddresses { - _unused: [u8; 0], +#[pg_guard] +extern "C" { + pub fn RemoveObjects(stmt: *mut DropStmt); } -pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; -pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; -pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; -pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; -pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; -pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; -pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; -pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; -pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; -pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; -pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; -pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; -pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; -pub const ObjectClass_OCLASS_AM: ObjectClass = 13; -pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; -pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; -pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; -pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; -pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; -pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; -pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; -pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; -pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; -pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; -pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; -pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; -pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; -pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; -pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; -pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; -pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; -pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; -pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; -pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; -pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; -pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; -pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; -pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; -pub type ObjectClass = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); + pub fn DefineIndex( + relationId: Oid, + stmt: *mut IndexStmt, + indexRelationId: Oid, + parentIndexId: Oid, + parentConstraintId: Oid, + is_alter_table: bool, + check_rights: bool, + check_not_in_use: bool, + skip_build: bool, + quiet: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn ReleaseDeletionLock(object: *const ObjectAddress); + pub fn ReindexIndex(indexRelation: *mut RangeVar, options: ::std::os::raw::c_int); } #[pg_guard] extern "C" { - pub fn performDeletion( - object: *const ObjectAddress, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn ReindexTable(relation: *mut RangeVar, options: ::std::os::raw::c_int) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ReindexMultipleTables( + objectName: *const ::std::os::raw::c_char, + objectKind: ReindexObjectType, + options: ::std::os::raw::c_int, ); } #[pg_guard] extern "C" { - pub fn performMultipleDeletions( - objects: *const ObjectAddresses, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn makeObjectName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn ChooseRelationName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + namespaceid: Oid, + isconstraint: bool, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn CheckIndexCompatible( + oldId: Oid, + accessMethodName: *const ::std::os::raw::c_char, + attributeList: *mut List, + exclusionOpNames: *mut List, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetDefaultOpClass(type_id: Oid, am_id: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ResolveOpClass( + opclass: *mut List, + attrType: Oid, + accessMethodName: *const ::std::os::raw::c_char, + accessMethodId: Oid, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn CreateFunction(pstate: *mut ParseState, stmt: *mut CreateFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveFunctionById(funcOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionReturnType(funcOid: Oid, newRetType: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionArgType(funcOid: Oid, argIndex: ::std::os::raw::c_int, newArgType: Oid); +} +#[pg_guard] +extern "C" { + pub fn AlterFunction(pstate: *mut ParseState, stmt: *mut AlterFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn CreateCast(stmt: *mut CreateCastStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropCastById(castOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateTransform(stmt: *mut CreateTransformStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropTransformById(transformOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereFunctionInNamespace( + proname: *const ::std::os::raw::c_char, + pronargs: ::std::os::raw::c_int, + proargtypes: *mut oidvector, + nspOid: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnExpr( - depender: *const ObjectAddress, - expr: *mut Node, - rtable: *mut List, - behavior: DependencyType, + pub fn ExecuteDoStmt(stmt: *mut DoStmt, atomic: bool); +} +#[pg_guard] +extern "C" { + pub fn ExecuteCallStmt( + stmt: *mut CallStmt, + params: ParamListInfo, + atomic: bool, + dest: *mut DestReceiver, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnSingleRelExpr( - depender: *const ObjectAddress, - expr: *mut Node, - relId: Oid, - behavior: DependencyType, - self_behavior: DependencyType, - reverse_self: bool, + pub fn CallStmtResultDesc(stmt: *mut CallStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn get_cast_oid(sourcetypeid: Oid, targettypeid: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_transform_oid(type_id: Oid, lang_id: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn interpret_function_parameter_list( + pstate: *mut ParseState, + parameters: *mut List, + languageOid: Oid, + objtype: ObjectType, + parameterTypes: *mut *mut oidvector, + allParameterTypes: *mut *mut ArrayType, + parameterModes: *mut *mut ArrayType, + parameterNames: *mut *mut ArrayType, + parameterDefaults: *mut *mut List, + variadicArgType: *mut Oid, + requiredResultType: *mut Oid, ); } #[pg_guard] extern "C" { - pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; + pub fn DefineOperator(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn new_object_addresses() -> *mut ObjectAddresses; + pub fn RemoveOperatorById(operOid: Oid); } #[pg_guard] extern "C" { - pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); + pub fn AlterOperator(stmt: *mut AlterOperatorStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn object_address_present( - object: *const ObjectAddress, - addrs: *const ObjectAddresses, - ) -> bool; + pub fn CreateStatistics(stmt: *mut CreateStatsStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn record_object_address_dependencies( - depender: *const ObjectAddress, - referenced: *mut ObjectAddresses, - behavior: DependencyType, + pub fn RemoveStatisticsById(statsOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn UpdateStatisticsForTypeChange( + statsOid: Oid, + relationOid: Oid, + attnum: ::std::os::raw::c_int, + oldColumnType: Oid, + newColumnType: Oid, ); } #[pg_guard] extern "C" { - pub fn free_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineAggregate( + pstate: *mut ParseState, + name: *mut List, + args: *mut List, + oldstyle: bool, + parameters: *mut List, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordDependencyOn( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - behavior: DependencyType, + pub fn DefineOpClass(stmt: *mut CreateOpClassStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DefineOpFamily(stmt: *mut CreateOpFamilyStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterOpFamily(stmt: *mut AlterOpFamilyStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveOpClassById(opclassOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveOpFamilyById(opfamilyOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmOpEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmProcEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereOpClassInNamespace( + opcname: *const ::std::os::raw::c_char, + opcmethod: Oid, + opcnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordMultipleDependencies( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - nreferenced: ::std::os::raw::c_int, - behavior: DependencyType, + pub fn IsThereOpFamilyInNamespace( + opfname: *const ::std::os::raw::c_char, + opfmethod: Oid, + opfnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); + pub fn get_opclass_oid(amID: Oid, opclassname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsFor( - classId: Oid, - objectId: Oid, - skipExtensionDeps: bool, - ) -> ::std::os::raw::c_long; + pub fn get_opfamily_oid(amID: Oid, opfamilyname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsForClass( - classId: Oid, - objectId: Oid, - refclassId: Oid, - deptype: ::std::os::raw::c_char, - ) -> ::std::os::raw::c_long; + pub fn DefineTSParser(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependencyFor( - classId: Oid, - objectId: Oid, - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSParserById(prsId: Oid); } #[pg_guard] extern "C" { - pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; + pub fn DefineTSDictionary(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; + pub fn RemoveTSDictionaryById(dictId: Oid); } #[pg_guard] extern "C" { - pub fn sequenceIsOwned( - seqId: Oid, - deptype: ::std::os::raw::c_char, - tableId: *mut Oid, - colId: *mut int32, - ) -> bool; + pub fn AlterTSDictionary(stmt: *mut AlterTSDictionaryStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; + pub fn DefineTSTemplate(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; + pub fn RemoveTSTemplateById(tmplId: Oid); } #[pg_guard] extern "C" { - pub fn get_constraint_index(constraintId: Oid) -> Oid; + pub fn DefineTSConfiguration( + names: *mut List, + parameters: *mut List, + copied: *mut ObjectAddress, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn get_index_constraint(indexId: Oid) -> Oid; + pub fn RemoveTSConfigurationById(cfgId: Oid); } #[pg_guard] extern "C" { - pub fn recordSharedDependencyOn( - depender: *mut ObjectAddress, - referenced: *mut ObjectAddress, - deptype: SharedDependencyType, - ); + pub fn AlterTSConfiguration(stmt: *mut AlterTSConfigurationStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); + pub fn serialize_deflist(deflist: *mut List) -> *mut text; } #[pg_guard] extern "C" { - pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); + pub fn deserialize_deflist(txt: Datum) -> *mut List; } #[pg_guard] extern "C" { - pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); + pub fn AlterForeignServerOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn updateAclDependencies( - classId: Oid, - objectId: Oid, - objectSubId: int32, - ownerId: Oid, - noldmembers: ::std::os::raw::c_int, - oldmembers: *mut Oid, - nnewmembers: ::std::os::raw::c_int, - newmembers: *mut Oid, - ); + pub fn AlterForeignServerOwner_oid(arg1: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn checkSharedDependencies( - classId: Oid, - objectId: Oid, - detail_msg: *mut *mut ::std::os::raw::c_char, - detail_log_msg: *mut *mut ::std::os::raw::c_char, - ) -> bool; + pub fn AlterForeignDataWrapperOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); + pub fn AlterForeignDataWrapperOwner_oid(fwdId: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); + pub fn CreateForeignDataWrapper(stmt: *mut CreateFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn dropDatabaseDependencies(databaseId: Oid); + pub fn AlterForeignDataWrapper(stmt: *mut AlterFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); + pub fn RemoveForeignDataWrapperById(fdwId: Oid); } #[pg_guard] extern "C" { - pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); + pub fn CreateForeignServer(stmt: *mut CreateForeignServerStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterForeignServer(stmt: *mut AlterForeignServerStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveForeignServerById(srvId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateUserMapping(stmt: *mut CreateUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterUserMapping(stmt: *mut AlterUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMapping(stmt: *mut DropUserMappingStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMappingById(umId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateForeignTable(stmt: *mut CreateForeignTableStmt, relid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ImportForeignSchema(stmt: *mut ImportForeignSchemaStmt); +} +#[pg_guard] +extern "C" { + pub fn transformGenericOptions( + catalogId: Oid, + oldOptions: Datum, + options: *mut List, + fdwvalidator: Oid, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn CreateAccessMethod(stmt: *mut CreateAmStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveAccessMethodById(amOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn get_index_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_name(amOid: Oid) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetString(def: *mut DefElem) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetNumeric(def: *mut DefElem) -> f64; +} +#[pg_guard] +extern "C" { + pub fn defGetBoolean(def: *mut DefElem) -> bool; +} +#[pg_guard] +extern "C" { + pub fn defGetInt32(def: *mut DefElem) -> int32; +} +#[pg_guard] +extern "C" { + pub fn defGetInt64(def: *mut DefElem) -> int64; +} +#[pg_guard] +extern "C" { + pub fn defGetQualifiedName(def: *mut DefElem) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeName(def: *mut DefElem) -> *mut TypeName; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeLength(def: *mut DefElem) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn defGetStringList(def: *mut DefElem) -> *mut List; } #[repr(C)] #[derive(Copy, Clone)] @@ -30688,6 +31227,220 @@ extern "C" { extern "C" { pub fn EventTriggerCollectAlterDefPrivs(stmt: *mut AlterDefaultPrivilegesStmt); } +pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; +pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; +pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; +pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; +pub type ExplainFormat = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExplainState { + pub str_: StringInfo, + pub verbose: bool, + pub analyze: bool, + pub costs: bool, + pub buffers: bool, + pub timing: bool, + pub summary: bool, + pub format: ExplainFormat, + pub indent: ::std::os::raw::c_int, + pub grouping_stack: *mut List, + pub pstmt: *mut PlannedStmt, + pub rtable: *mut List, + pub rtable_names: *mut List, + pub deparse_cxt: *mut List, + pub printed_subplans: *mut Bitmapset, +} +impl Default for ExplainState { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type ExplainOneQuery_hook_type = ::std::option::Option< + unsafe extern "C" fn( + query: *mut Query, + cursorOptions: ::std::os::raw::c_int, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ), +>; +#[pg_guard] +extern "C" { + pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; +} +pub type explain_get_index_name_hook_type = + ::std::option::Option *const ::std::os::raw::c_char>; +#[pg_guard] +extern "C" { + pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; +} +#[pg_guard] +extern "C" { + pub fn ExplainQuery( + pstate: *mut ParseState, + stmt: *mut ExplainStmt, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + dest: *mut DestReceiver, + ); +} +#[pg_guard] +extern "C" { + pub fn NewExplainState() -> *mut ExplainState; +} +#[pg_guard] +extern "C" { + pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn ExplainOneUtility( + utilityStmt: *mut Node, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOnePlan( + plannedstmt: *mut PlannedStmt, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + planduration: *const instr_time, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintJIT( + es: *mut ExplainState, + jit_flags: ::std::os::raw::c_int, + jit_instr: *mut JitInstrumentation, + worker_i: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainBeginOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainEndOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainSeparatePlans(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyList( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyListNested( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyText( + qlabel: *const ::std::os::raw::c_char, + value: *const ::std::os::raw::c_char, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyInteger( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: int64, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyFloat( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: f64, + ndigits: ::std::os::raw::c_int, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyBool( + qlabel: *const ::std::os::raw::c_char, + value: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOpenGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainCloseGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropProceduralLanguageById(langOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn PLTemplateExists(languageName: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_language_oid(langname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} #[pg_guard] extern "C" { pub fn DefineRelation( @@ -30880,44 +31633,6 @@ extern "C" { partConstraint: *mut List, ) -> bool; } -#[pg_guard] -extern "C" { - pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; -} -#[pg_guard] -extern "C" { - pub fn DropProceduralLanguageById(langOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn PLTemplateExists(languageName: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn get_language_oid(langname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; -} -#[repr(C)] -pub struct FormData_pg_trigger { - pub tgrelid: Oid, - pub tgname: NameData, - pub tgfoid: Oid, - pub tgtype: int16, - pub tgenabled: ::std::os::raw::c_char, - pub tgisinternal: bool, - pub tgconstrrelid: Oid, - pub tgconstrindid: Oid, - pub tgconstraint: Oid, - pub tgdeferrable: bool, - pub tginitdeferred: bool, - pub tgnargs: int16, - pub tgattr: int2vector, -} -impl Default for FormData_pg_trigger { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type Form_pg_trigger = *mut FormData_pg_trigger; pub type TriggerEvent = uint32; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -31225,6 +31940,223 @@ extern "C" { pub fn RI_FKey_trigger_type(tgfoid: Oid) -> ::std::os::raw::c_int; } #[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct FormData_pg_statistic { + pub starelid: Oid, + pub staattnum: int16, + pub stainherit: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind1: int16, + pub stakind2: int16, + pub stakind3: int16, + pub stakind4: int16, + pub stakind5: int16, + pub staop1: Oid, + pub staop2: Oid, + pub staop3: Oid, + pub staop4: Oid, + pub staop5: Oid, +} +pub type Form_pg_statistic = *mut FormData_pg_statistic; +pub type VacAttrStatsP = *mut VacAttrStats; +pub type AnalyzeAttrFetchFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + rownum: ::std::os::raw::c_int, + isNull: *mut bool, + ) -> Datum, +>; +pub type AnalyzeAttrComputeStatsFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + fetchfunc: AnalyzeAttrFetchFunc, + samplerows: ::std::os::raw::c_int, + totalrows: f64, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacAttrStats { + pub attr: Form_pg_attribute, + pub attrtypid: Oid, + pub attrtypmod: int32, + pub attrtype: Form_pg_type, + pub anl_context: MemoryContext, + pub compute_stats: AnalyzeAttrComputeStatsFunc, + pub minrows: ::std::os::raw::c_int, + pub extra_data: *mut ::std::os::raw::c_void, + pub stats_valid: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind: [int16; 5usize], + pub staop: [Oid; 5usize], + pub numnumbers: [::std::os::raw::c_int; 5usize], + pub stanumbers: [*mut float4; 5usize], + pub numvalues: [::std::os::raw::c_int; 5usize], + pub stavalues: [*mut Datum; 5usize], + pub statypid: [Oid; 5usize], + pub statyplen: [int16; 5usize], + pub statypbyval: [bool; 5usize], + pub statypalign: [::std::os::raw::c_char; 5usize], + pub tupattnum: ::std::os::raw::c_int, + pub rows: *mut HeapTuple, + pub tupDesc: TupleDesc, + pub exprvals: *mut Datum, + pub exprnulls: *mut bool, + pub rowstride: ::std::os::raw::c_int, +} +impl Default for VacAttrStats { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct VacuumParams { + pub freeze_min_age: ::std::os::raw::c_int, + pub freeze_table_age: ::std::os::raw::c_int, + pub multixact_freeze_min_age: ::std::os::raw::c_int, + pub multixact_freeze_table_age: ::std::os::raw::c_int, + pub is_wraparound: bool, + pub log_min_duration: ::std::os::raw::c_int, +} +#[pg_guard] +extern "C" { + pub static mut default_statistics_target: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn ExecVacuum(vacstmt: *mut VacuumStmt, isTopLevel: bool); +} +#[pg_guard] +extern "C" { + pub fn vacuum( + options: ::std::os::raw::c_int, + relations: *mut List, + params: *mut VacuumParams, + bstrategy: BufferAccessStrategy, + isTopLevel: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_open_indexes( + relation: Relation, + lockmode: LOCKMODE, + nindexes: *mut ::std::os::raw::c_int, + Irel: *mut *mut Relation, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_close_indexes( + nindexes: ::std::os::raw::c_int, + Irel: *mut Relation, + lockmode: LOCKMODE, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_estimate_reltuples( + relation: Relation, + total_pages: BlockNumber, + scanned_pages: BlockNumber, + scanned_tuples: f64, + ) -> f64; +} +#[pg_guard] +extern "C" { + pub fn vac_update_relstats( + relation: Relation, + num_pages: BlockNumber, + num_tuples: f64, + num_all_visible_pages: BlockNumber, + hasindex: bool, + frozenxid: TransactionId, + minmulti: MultiXactId, + in_outer_xact: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vacuum_set_xid_limits( + rel: Relation, + freeze_min_age: ::std::os::raw::c_int, + freeze_table_age: ::std::os::raw::c_int, + multixact_freeze_min_age: ::std::os::raw::c_int, + multixact_freeze_table_age: ::std::os::raw::c_int, + oldestXmin: *mut TransactionId, + freezeLimit: *mut TransactionId, + xidFullScanLimit: *mut TransactionId, + multiXactCutoff: *mut MultiXactId, + mxactFullScanLimit: *mut MultiXactId, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_update_datfrozenxid(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_delay_point(); +} +#[pg_guard] +extern "C" { + pub fn lazy_vacuum_rel( + onerel: Relation, + options: ::std::os::raw::c_int, + params: *mut VacuumParams, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn analyze_rel( + relid: Oid, + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + params: *mut VacuumParams, + va_cols: *mut List, + in_outer_xact: bool, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn std_typanalyze(stats: *mut VacAttrStats) -> bool; +} +#[pg_guard] +extern "C" { + pub fn anl_random_fract() -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_init_selection_state(n: ::std::os::raw::c_int) -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_get_next_S(t: f64, n: ::std::os::raw::c_int, stateptr: *mut f64) -> f64; +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CachedPlanSource { pub magic: ::std::os::raw::c_int, @@ -33804,204 +34736,6 @@ extern "C" { missing_ok: bool, ) -> Oid; } -pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; -pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; -pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; -pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; -pub type ExplainFormat = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExplainState { - pub str_: StringInfo, - pub verbose: bool, - pub analyze: bool, - pub costs: bool, - pub buffers: bool, - pub timing: bool, - pub summary: bool, - pub format: ExplainFormat, - pub indent: ::std::os::raw::c_int, - pub grouping_stack: *mut List, - pub pstmt: *mut PlannedStmt, - pub rtable: *mut List, - pub rtable_names: *mut List, - pub deparse_cxt: *mut List, - pub printed_subplans: *mut Bitmapset, -} -impl Default for ExplainState { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type ExplainOneQuery_hook_type = ::std::option::Option< - unsafe extern "C" fn( - query: *mut Query, - cursorOptions: ::std::os::raw::c_int, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ), ->; -#[pg_guard] -extern "C" { - pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; -} -pub type explain_get_index_name_hook_type = - ::std::option::Option *const ::std::os::raw::c_char>; -#[pg_guard] -extern "C" { - pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; -} -#[pg_guard] -extern "C" { - pub fn ExplainQuery( - pstate: *mut ParseState, - stmt: *mut ExplainStmt, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - dest: *mut DestReceiver, - ); -} -#[pg_guard] -extern "C" { - pub fn NewExplainState() -> *mut ExplainState; -} -#[pg_guard] -extern "C" { - pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; -} -#[pg_guard] -extern "C" { - pub fn ExplainOneUtility( - utilityStmt: *mut Node, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOnePlan( - plannedstmt: *mut PlannedStmt, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - planduration: *const instr_time, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintJIT( - es: *mut ExplainState, - jit_flags: ::std::os::raw::c_int, - jit_instr: *mut JitInstrumentation, - worker_i: ::std::os::raw::c_int, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainBeginOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainEndOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainSeparatePlans(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyList( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyListNested( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyText( - qlabel: *const ::std::os::raw::c_char, - value: *const ::std::os::raw::c_char, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyInteger( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: int64, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyFloat( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: f64, - ndigits: ::std::os::raw::c_int, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyBool( - qlabel: *const ::std::os::raw::c_char, - value: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOpenGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainCloseGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExtensibleNode { @@ -34606,6 +35340,194 @@ impl Default for SQLCmd { unsafe { ::std::mem::zeroed() } } } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct WindowFuncLists { + pub numWindowFuncs: ::std::os::raw::c_int, + pub maxWinRef: Index, + pub windowFuncs: *mut *mut List, +} +impl Default for WindowFuncLists { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[pg_guard] +extern "C" { + pub fn make_opclause( + opno: Oid, + opresulttype: Oid, + opretset: bool, + leftop: *mut Expr, + rightop: *mut Expr, + opcollid: Oid, + inputcollid: Oid, + ) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn get_leftop(clause: *const Expr) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn get_rightop(clause: *const Expr) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn not_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_notclause(notclause: *mut Expr) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn get_notclausearg(notclause: *mut Expr) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn or_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_orclause(orclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn and_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_andclause(andclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn make_and_qual(qual1: *mut Node, qual2: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn make_ands_explicit(andclauses: *mut List) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn make_ands_implicit(clause: *mut Expr) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn contain_agg_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_agg_clause_costs( + root: *mut PlannerInfo, + clause: *mut Node, + aggsplit: AggSplit, + costs: *mut AggClauseCosts, + ); +} +#[pg_guard] +extern "C" { + pub fn contain_window_function(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; +} +#[pg_guard] +extern "C" { + pub fn expression_returns_set_rows(clause: *mut Node) -> f64; +} +#[pg_guard] +extern "C" { + pub fn contain_subplans(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_mutable_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_volatile_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_volatile_functions_not_nextval(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_leaked_vars(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; +} +#[pg_guard] +extern "C" { + pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CommuteOpExpr(clause: *mut OpExpr); +} +#[pg_guard] +extern "C" { + pub fn CommuteRowCompareExpr(clause: *mut RowCompareExpr); +} +#[pg_guard] +extern "C" { + pub fn eval_const_expressions(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn estimate_expression_value(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn inline_set_returning_function( + root: *mut PlannerInfo, + rte: *mut RangeTblEntry, + ) -> *mut Query; +} +#[pg_guard] +extern "C" { + pub fn expand_function_arguments( + args: *mut List, + result_type: Oid, + func_tuple: HeapTuple, + ) -> *mut List; +} pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_OFF: ConstraintExclusionType = 0; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_ON: ConstraintExclusionType = 1; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_PARTITION: ConstraintExclusionType = 2; @@ -35155,193 +36077,635 @@ extern "C" { rows: *mut f64, ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WindowFuncLists { - pub numWindowFuncs: ::std::os::raw::c_int, - pub maxWinRef: Index, - pub windowFuncs: *mut *mut List, +#[pg_guard] +extern "C" { + pub fn compare_path_costs( + path1: *mut Path, + path2: *mut Path, + criterion: CostSelector, + ) -> ::std::os::raw::c_int; } -impl Default for WindowFuncLists { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn compare_fractional_path_costs( + path1: *mut Path, + path2: *mut Path, + fraction: f64, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn make_opclause( - opno: Oid, - opresulttype: Oid, - opretset: bool, - leftop: *mut Expr, - rightop: *mut Expr, - opcollid: Oid, - inputcollid: Oid, - ) -> *mut Expr; + pub fn set_cheapest(parent_rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn get_leftop(clause: *const Expr) -> *mut Node; + pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } #[pg_guard] extern "C" { - pub fn get_rightop(clause: *const Expr) -> *mut Node; + pub fn add_path_precheck( + parent_rel: *mut RelOptInfo, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + ) -> bool; } #[pg_guard] extern "C" { - pub fn not_clause(clause: *mut Node) -> bool; + pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } #[pg_guard] extern "C" { - pub fn make_notclause(notclause: *mut Expr) -> *mut Expr; + pub fn add_partial_path_precheck( + parent_rel: *mut RelOptInfo, + total_cost: Cost, + pathkeys: *mut List, + ) -> bool; } #[pg_guard] extern "C" { - pub fn get_notclausearg(notclause: *mut Expr) -> *mut Expr; + pub fn create_seqscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn or_clause(clause: *mut Node) -> bool; + pub fn create_samplescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn make_orclause(orclauses: *mut List) -> *mut Expr; + pub fn create_index_path( + root: *mut PlannerInfo, + index: *mut IndexOptInfo, + indexclauses: *mut List, + indexclausecols: *mut List, + indexorderbys: *mut List, + indexorderbycols: *mut List, + pathkeys: *mut List, + indexscandir: ScanDirection, + indexonly: bool, + required_outer: Relids, + loop_count: f64, + partial_path: bool, + ) -> *mut IndexPath; } #[pg_guard] extern "C" { - pub fn and_clause(clause: *mut Node) -> bool; + pub fn create_bitmap_heap_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapqual: *mut Path, + required_outer: Relids, + loop_count: f64, + parallel_degree: ::std::os::raw::c_int, + ) -> *mut BitmapHeapPath; } #[pg_guard] extern "C" { - pub fn make_andclause(andclauses: *mut List) -> *mut Expr; + pub fn create_bitmap_and_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapAndPath; } #[pg_guard] extern "C" { - pub fn make_and_qual(qual1: *mut Node, qual2: *mut Node) -> *mut Node; + pub fn create_bitmap_or_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapOrPath; } #[pg_guard] extern "C" { - pub fn make_ands_explicit(andclauses: *mut List) -> *mut Expr; + pub fn create_tidscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + tidquals: *mut List, + required_outer: Relids, + ) -> *mut TidPath; } #[pg_guard] extern "C" { - pub fn make_ands_implicit(clause: *mut Expr) -> *mut List; + pub fn create_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + partial_subpaths: *mut List, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + parallel_aware: bool, + partitioned_rels: *mut List, + rows: f64, + ) -> *mut AppendPath; } #[pg_guard] extern "C" { - pub fn contain_agg_clause(clause: *mut Node) -> bool; + pub fn create_merge_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + partitioned_rels: *mut List, + ) -> *mut MergeAppendPath; } #[pg_guard] extern "C" { - pub fn get_agg_clause_costs( + pub fn create_result_path( root: *mut PlannerInfo, - clause: *mut Node, - aggsplit: AggSplit, - costs: *mut AggClauseCosts, - ); + rel: *mut RelOptInfo, + target: *mut PathTarget, + resconstantqual: *mut List, + ) -> *mut ResultPath; } #[pg_guard] extern "C" { - pub fn contain_window_function(clause: *mut Node) -> bool; + pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; } #[pg_guard] extern "C" { - pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; + pub fn create_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + sjinfo: *mut SpecialJoinInfo, + ) -> *mut UniquePath; } #[pg_guard] extern "C" { - pub fn expression_returns_set_rows(clause: *mut Node) -> f64; + pub fn create_gather_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherPath; } #[pg_guard] extern "C" { - pub fn contain_subplans(clause: *mut Node) -> bool; + pub fn create_gather_merge_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + pathkeys: *mut List, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherMergePath; } #[pg_guard] extern "C" { - pub fn contain_mutable_functions(clause: *mut Node) -> bool; + pub fn create_subqueryscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut SubqueryScanPath; } #[pg_guard] extern "C" { - pub fn contain_volatile_functions(clause: *mut Node) -> bool; + pub fn create_functionscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_volatile_functions_not_nextval(clause: *mut Node) -> bool; + pub fn create_tablexprscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; + pub fn create_valuesscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; + pub fn create_tablefuncscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; + pub fn create_ctescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn contain_leaked_vars(clause: *mut Node) -> bool; + pub fn create_namedtuplestorescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; + pub fn create_worktablescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; + pub fn create_foreignscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; + pub fn calc_nestloop_required_outer( + outerrelids: Relids, + outer_paramrels: Relids, + innerrelids: Relids, + inner_paramrels: Relids, + ) -> Relids; } #[pg_guard] extern "C" { - pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; + pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) + -> Relids; } #[pg_guard] extern "C" { - pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; + pub fn create_nestloop_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut NestPath; } #[pg_guard] extern "C" { - pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; + pub fn create_mergejoin_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + mergeclauses: *mut List, + outersortkeys: *mut List, + innersortkeys: *mut List, + ) -> *mut MergePath; } #[pg_guard] extern "C" { - pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; + pub fn create_hashjoin_path( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + parallel_hash: bool, + restrict_clauses: *mut List, + required_outer: Relids, + hashclauses: *mut List, + ) -> *mut HashPath; } #[pg_guard] extern "C" { - pub fn CommuteOpExpr(clause: *mut OpExpr); + pub fn create_projection_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectionPath; } #[pg_guard] extern "C" { - pub fn CommuteRowCompareExpr(clause: *mut RowCompareExpr); + pub fn apply_projection_to_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + path: *mut Path, + target: *mut PathTarget, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn eval_const_expressions(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; + pub fn create_set_projection_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectSetPath; } #[pg_guard] extern "C" { - pub fn estimate_expression_value(root: *mut PlannerInfo, node: *mut Node) -> *mut Node; + pub fn create_sort_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + limit_tuples: f64, + ) -> *mut SortPath; } #[pg_guard] extern "C" { - pub fn inline_set_returning_function( + pub fn create_group_path( root: *mut PlannerInfo, - rte: *mut RangeTblEntry, - ) -> *mut Query; + rel: *mut RelOptInfo, + subpath: *mut Path, + groupClause: *mut List, + qual: *mut List, + numGroups: f64, + ) -> *mut GroupPath; } #[pg_guard] extern "C" { - pub fn expand_function_arguments( - args: *mut List, - result_type: Oid, - func_tuple: HeapTuple, - ) -> *mut List; + pub fn create_upper_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + numCols: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut UpperUniquePath; +} +#[pg_guard] +extern "C" { + pub fn create_agg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + groupClause: *mut List, + qual: *mut List, + aggcosts: *const AggClauseCosts, + numGroups: f64, + ) -> *mut AggPath; +} +#[pg_guard] +extern "C" { + pub fn create_groupingsets_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + having_qual: *mut List, + aggstrategy: AggStrategy, + rollups: *mut List, + agg_costs: *const AggClauseCosts, + numGroups: f64, + ) -> *mut GroupingSetsPath; +} +#[pg_guard] +extern "C" { + pub fn create_minmaxagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + mmaggregates: *mut List, + quals: *mut List, + ) -> *mut MinMaxAggPath; +} +#[pg_guard] +extern "C" { + pub fn create_windowagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + windowFuncs: *mut List, + winclause: *mut WindowClause, + ) -> *mut WindowAggPath; +} +#[pg_guard] +extern "C" { + pub fn create_setop_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + cmd: SetOpCmd, + strategy: SetOpStrategy, + distinctList: *mut List, + flagColIdx: AttrNumber, + firstFlag: ::std::os::raw::c_int, + numGroups: f64, + outputRows: f64, + ) -> *mut SetOpPath; +} +#[pg_guard] +extern "C" { + pub fn create_recursiveunion_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + leftpath: *mut Path, + rightpath: *mut Path, + target: *mut PathTarget, + distinctList: *mut List, + wtParam: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut RecursiveUnionPath; +} +#[pg_guard] +extern "C" { + pub fn create_lockrows_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + rowMarks: *mut List, + epqParam: ::std::os::raw::c_int, + ) -> *mut LockRowsPath; +} +#[pg_guard] +extern "C" { + pub fn create_modifytable_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + operation: CmdType, + canSetTag: bool, + nominalRelation: Index, + partitioned_rels: *mut List, + partColsUpdated: bool, + resultRelations: *mut List, + subpaths: *mut List, + subroots: *mut List, + withCheckOptionLists: *mut List, + returningLists: *mut List, + rowMarks: *mut List, + onconflict: *mut OnConflictExpr, + epqParam: ::std::os::raw::c_int, + ) -> *mut ModifyTablePath; +} +#[pg_guard] +extern "C" { + pub fn create_limit_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + limitOffset: *mut Node, + limitCount: *mut Node, + offset_est: int64, + count_est: int64, + ) -> *mut LimitPath; +} +#[pg_guard] +extern "C" { + pub fn reparameterize_path( + root: *mut PlannerInfo, + path: *mut Path, + required_outer: Relids, + loop_count: f64, + ) -> *mut Path; +} +#[pg_guard] +extern "C" { + pub fn reparameterize_path_by_child( + root: *mut PlannerInfo, + path: *mut Path, + child_rel: *mut RelOptInfo, + ) -> *mut Path; +} +#[pg_guard] +extern "C" { + pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn setup_append_rel_array(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn build_simple_rel( + root: *mut PlannerInfo, + relid: ::std::os::raw::c_int, + parent: *mut RelOptInfo, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn build_join_rel( + root: *mut PlannerInfo, + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + sjinfo: *mut SpecialJoinInfo, + restrictlist_ptr: *mut *mut List, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn min_join_parameterization( + root: *mut PlannerInfo, + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + ) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn build_empty_join_rel(root: *mut PlannerInfo) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn fetch_upper_rel( + root: *mut PlannerInfo, + kind: UpperRelationKind, + relids: Relids, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn get_baserel_parampathinfo( + root: *mut PlannerInfo, + baserel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_joinrel_parampathinfo( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outer_path: *mut Path, + inner_path: *mut Path, + sjinfo: *mut SpecialJoinInfo, + required_outer: Relids, + restrict_clauses: *mut *mut List, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_appendrel_parampathinfo( + appendrel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) + -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn build_child_join_rel( + root: *mut PlannerInfo, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + parent_joinrel: *mut RelOptInfo, + restrictlist: *mut List, + sjinfo: *mut SpecialJoinInfo, + jointype: JoinType, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { @@ -35772,683 +37136,267 @@ extern "C" { root: *mut PlannerInfo, mergeclauses: *mut List, joinrel: *mut RelOptInfo, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn make_inner_pathkeys_for_merge( - root: *mut PlannerInfo, - mergeclauses: *mut List, - outer_pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn trim_mergeclauses_for_inner_pathkeys( - root: *mut PlannerInfo, - mergeclauses: *mut List, - pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn truncate_useless_pathkeys( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - ) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; -} -#[pg_guard] -extern "C" { - pub fn make_canonical_pathkey( - root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, - opfamily: Oid, - strategy: ::std::os::raw::c_int, - nulls_first: bool, - ) -> *mut PathKey; -} -#[pg_guard] -extern "C" { - pub fn add_paths_to_append_rel( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - live_childrels: *mut List, - ); -} -#[pg_guard] -extern "C" { - pub fn compare_path_costs( - path1: *mut Path, - path2: *mut Path, - criterion: CostSelector, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn compare_fractional_path_costs( - path1: *mut Path, - path2: *mut Path, - fraction: f64, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn set_cheapest(parent_rel: *mut RelOptInfo); -} -#[pg_guard] -extern "C" { - pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); -} -#[pg_guard] -extern "C" { - pub fn add_path_precheck( - parent_rel: *mut RelOptInfo, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); -} -#[pg_guard] -extern "C" { - pub fn add_partial_path_precheck( - parent_rel: *mut RelOptInfo, - total_cost: Cost, - pathkeys: *mut List, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn create_seqscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_samplescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_index_path( - root: *mut PlannerInfo, - index: *mut IndexOptInfo, - indexclauses: *mut List, - indexclausecols: *mut List, - indexorderbys: *mut List, - indexorderbycols: *mut List, - pathkeys: *mut List, - indexscandir: ScanDirection, - indexonly: bool, - required_outer: Relids, - loop_count: f64, - partial_path: bool, - ) -> *mut IndexPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_heap_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapqual: *mut Path, - required_outer: Relids, - loop_count: f64, - parallel_degree: ::std::os::raw::c_int, - ) -> *mut BitmapHeapPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_and_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapAndPath; -} -#[pg_guard] -extern "C" { - pub fn create_bitmap_or_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapOrPath; -} -#[pg_guard] -extern "C" { - pub fn create_tidscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - tidquals: *mut List, - required_outer: Relids, - ) -> *mut TidPath; -} -#[pg_guard] -extern "C" { - pub fn create_append_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - partial_subpaths: *mut List, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - parallel_aware: bool, - partitioned_rels: *mut List, - rows: f64, - ) -> *mut AppendPath; -} -#[pg_guard] -extern "C" { - pub fn create_merge_append_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - partitioned_rels: *mut List, - ) -> *mut MergeAppendPath; -} -#[pg_guard] -extern "C" { - pub fn create_result_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - resconstantqual: *mut List, - ) -> *mut ResultPath; -} -#[pg_guard] -extern "C" { - pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; -} -#[pg_guard] -extern "C" { - pub fn create_unique_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - sjinfo: *mut SpecialJoinInfo, - ) -> *mut UniquePath; -} -#[pg_guard] -extern "C" { - pub fn create_gather_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherPath; -} -#[pg_guard] -extern "C" { - pub fn create_gather_merge_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - pathkeys: *mut List, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherMergePath; -} -#[pg_guard] -extern "C" { - pub fn create_subqueryscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut SubqueryScanPath; -} -#[pg_guard] -extern "C" { - pub fn create_functionscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_tablexprscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_valuesscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_tablefuncscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_ctescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_namedtuplestorescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_worktablescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; -} -#[pg_guard] -extern "C" { - pub fn create_foreignscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn calc_nestloop_required_outer( - outerrelids: Relids, - outer_paramrels: Relids, - innerrelids: Relids, - inner_paramrels: Relids, - ) -> Relids; + pub fn make_inner_pathkeys_for_merge( + root: *mut PlannerInfo, + mergeclauses: *mut List, + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) - -> Relids; + pub fn trim_mergeclauses_for_inner_pathkeys( + root: *mut PlannerInfo, + mergeclauses: *mut List, + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_nestloop_path( + pub fn truncate_useless_pathkeys( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, + rel: *mut RelOptInfo, pathkeys: *mut List, - required_outer: Relids, - ) -> *mut NestPath; + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_mergejoin_path( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, - mergeclauses: *mut List, - outersortkeys: *mut List, - innersortkeys: *mut List, - ) -> *mut MergePath; + pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; } #[pg_guard] extern "C" { - pub fn create_hashjoin_path( + pub fn make_canonical_pathkey( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - parallel_hash: bool, - restrict_clauses: *mut List, - required_outer: Relids, - hashclauses: *mut List, - ) -> *mut HashPath; + eclass: *mut EquivalenceClass, + opfamily: Oid, + strategy: ::std::os::raw::c_int, + nulls_first: bool, + ) -> *mut PathKey; } #[pg_guard] extern "C" { - pub fn create_projection_path( + pub fn add_paths_to_append_rel( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectionPath; + live_childrels: *mut List, + ); } +pub const ForceParallelMode_FORCE_PARALLEL_OFF: ForceParallelMode = 0; +pub const ForceParallelMode_FORCE_PARALLEL_ON: ForceParallelMode = 1; +pub const ForceParallelMode_FORCE_PARALLEL_REGRESS: ForceParallelMode = 2; +pub type ForceParallelMode = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn apply_projection_to_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - path: *mut Path, - target: *mut PathTarget, - ) -> *mut Path; + pub static mut cursor_tuple_fraction: f64; } #[pg_guard] extern "C" { - pub fn create_set_projection_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectSetPath; + pub static mut force_parallel_mode: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn create_sort_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - limit_tuples: f64, - ) -> *mut SortPath; + pub static mut parallel_leader_participation: bool; } +pub type query_pathkeys_callback = ::std::option::Option< + unsafe extern "C" fn(root: *mut PlannerInfo, extra: *mut ::std::os::raw::c_void), +>; #[pg_guard] extern "C" { - pub fn create_group_path( + pub fn query_planner( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - groupClause: *mut List, - qual: *mut List, - numGroups: f64, - ) -> *mut GroupPath; + tlist: *mut List, + qp_callback: query_pathkeys_callback, + qp_extra: *mut ::std::os::raw::c_void, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_upper_unique_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - numCols: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut UpperUniquePath; + pub fn preprocess_minmax_aggregates(root: *mut PlannerInfo, tlist: *mut List); } #[pg_guard] extern "C" { - pub fn create_agg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - aggstrategy: AggStrategy, - aggsplit: AggSplit, - groupClause: *mut List, - qual: *mut List, - aggcosts: *const AggClauseCosts, - numGroups: f64, - ) -> *mut AggPath; + pub fn create_plan(root: *mut PlannerInfo, best_path: *mut Path) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_groupingsets_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - having_qual: *mut List, - aggstrategy: AggStrategy, - rollups: *mut List, - agg_costs: *const AggClauseCosts, - numGroups: f64, - ) -> *mut GroupingSetsPath; + pub fn make_foreignscan( + qptlist: *mut List, + qpqual: *mut List, + scanrelid: Index, + fdw_exprs: *mut List, + fdw_private: *mut List, + fdw_scan_tlist: *mut List, + fdw_recheck_quals: *mut List, + outer_plan: *mut Plan, + ) -> *mut ForeignScan; } #[pg_guard] extern "C" { - pub fn create_minmaxagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - mmaggregates: *mut List, - quals: *mut List, - ) -> *mut MinMaxAggPath; + pub fn change_plan_targetlist( + subplan: *mut Plan, + tlist: *mut List, + tlist_parallel_safe: bool, + ) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_windowagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - windowFuncs: *mut List, - winclause: *mut WindowClause, - ) -> *mut WindowAggPath; + pub fn materialize_finished_plan(subplan: *mut Plan) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_setop_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - cmd: SetOpCmd, - strategy: SetOpStrategy, - distinctList: *mut List, - flagColIdx: AttrNumber, - firstFlag: ::std::os::raw::c_int, - numGroups: f64, - outputRows: f64, - ) -> *mut SetOpPath; + pub fn is_projection_capable_path(path: *mut Path) -> bool; } #[pg_guard] extern "C" { - pub fn create_recursiveunion_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - leftpath: *mut Path, - rightpath: *mut Path, - target: *mut PathTarget, - distinctList: *mut List, - wtParam: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut RecursiveUnionPath; + pub fn is_projection_capable_plan(plan: *mut Plan) -> bool; } #[pg_guard] extern "C" { - pub fn create_lockrows_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - rowMarks: *mut List, - epqParam: ::std::os::raw::c_int, - ) -> *mut LockRowsPath; + pub fn make_sort_from_sortclauses(sortcls: *mut List, lefttree: *mut Plan) -> *mut Sort; } #[pg_guard] extern "C" { - pub fn create_modifytable_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - operation: CmdType, - canSetTag: bool, - nominalRelation: Index, - partitioned_rels: *mut List, - partColsUpdated: bool, - resultRelations: *mut List, - subpaths: *mut List, - subroots: *mut List, - withCheckOptionLists: *mut List, - returningLists: *mut List, - rowMarks: *mut List, - onconflict: *mut OnConflictExpr, - epqParam: ::std::os::raw::c_int, - ) -> *mut ModifyTablePath; + pub fn make_agg( + tlist: *mut List, + qual: *mut List, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + numGroupCols: ::std::os::raw::c_int, + grpColIdx: *mut AttrNumber, + grpOperators: *mut Oid, + groupingSets: *mut List, + chain: *mut List, + dNumGroups: f64, + lefttree: *mut Plan, + ) -> *mut Agg; } #[pg_guard] extern "C" { - pub fn create_limit_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, + pub fn make_limit( + lefttree: *mut Plan, limitOffset: *mut Node, limitCount: *mut Node, - offset_est: int64, - count_est: int64, - ) -> *mut LimitPath; + ) -> *mut Limit; } #[pg_guard] extern "C" { - pub fn reparameterize_path( - root: *mut PlannerInfo, - path: *mut Path, - required_outer: Relids, - loop_count: f64, - ) -> *mut Path; + pub static mut from_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn reparameterize_path_by_child( - root: *mut PlannerInfo, - path: *mut Path, - child_rel: *mut RelOptInfo, - ) -> *mut Path; + pub static mut join_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); + pub fn add_base_rels_to_query(root: *mut PlannerInfo, jtnode: *mut Node); } #[pg_guard] extern "C" { - pub fn setup_append_rel_array(root: *mut PlannerInfo); + pub fn build_base_rel_tlists(root: *mut PlannerInfo, final_tlist: *mut List); } #[pg_guard] extern "C" { - pub fn build_simple_rel( + pub fn add_vars_to_targetlist( root: *mut PlannerInfo, - relid: ::std::os::raw::c_int, - parent: *mut RelOptInfo, - ) -> *mut RelOptInfo; + vars: *mut List, + where_needed: Relids, + create_new_ph: bool, + ); } #[pg_guard] extern "C" { - pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; + pub fn find_lateral_references(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; + pub fn create_lateral_join_info(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn build_join_rel( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - sjinfo: *mut SpecialJoinInfo, - restrictlist_ptr: *mut *mut List, - ) -> *mut RelOptInfo; + pub fn deconstruct_jointree(root: *mut PlannerInfo) -> *mut List; } #[pg_guard] extern "C" { - pub fn min_join_parameterization( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - ) -> Relids; + pub fn distribute_restrictinfo_to_rels(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn build_empty_join_rel(root: *mut PlannerInfo) -> *mut RelOptInfo; + pub fn process_implied_equality( + root: *mut PlannerInfo, + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + below_outer_join: bool, + both_const: bool, + ); } #[pg_guard] extern "C" { - pub fn fetch_upper_rel( - root: *mut PlannerInfo, - kind: UpperRelationKind, - relids: Relids, - ) -> *mut RelOptInfo; + pub fn build_implied_join_equality( + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + ) -> *mut RestrictInfo; } #[pg_guard] extern "C" { - pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; + pub fn match_foreign_keys_to_quals(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn get_baserel_parampathinfo( - root: *mut PlannerInfo, - baserel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn remove_useless_joins(root: *mut PlannerInfo, joinlist: *mut List) -> *mut List; } #[pg_guard] extern "C" { - pub fn get_joinrel_parampathinfo( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outer_path: *mut Path, - inner_path: *mut Path, - sjinfo: *mut SpecialJoinInfo, - required_outer: Relids, - restrict_clauses: *mut *mut List, - ) -> *mut ParamPathInfo; + pub fn reduce_unique_semijoins(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn get_appendrel_parampathinfo( - appendrel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn query_supports_distinctness(query: *mut Query) -> bool; } #[pg_guard] extern "C" { - pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) - -> *mut ParamPathInfo; + pub fn query_is_distinct_for(query: *mut Query, colnos: *mut List, opids: *mut List) -> bool; } #[pg_guard] extern "C" { - pub fn build_child_join_rel( + pub fn innerrel_is_unique( root: *mut PlannerInfo, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - parent_joinrel: *mut RelOptInfo, - restrictlist: *mut List, - sjinfo: *mut SpecialJoinInfo, + joinrelids: Relids, + outerrelids: Relids, + innerrel: *mut RelOptInfo, jointype: JoinType, - ) -> *mut RelOptInfo; + restrictlist: *mut List, + force_cache: bool, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn set_plan_references(root: *mut PlannerInfo, plan: *mut Plan) -> *mut Plan; +} +#[pg_guard] +extern "C" { + pub fn record_plan_function_dependency(root: *mut PlannerInfo, funcid: Oid); +} +#[pg_guard] +extern "C" { + pub fn extract_query_dependencies( + query: *mut Node, + relationOids: *mut *mut List, + invalItems: *mut *mut List, + hasRowSecurity: *mut bool, + ); } pub type planner_hook_type = ::std::option::Option< unsafe extern "C" fn( @@ -36592,6 +37540,133 @@ extern "C" { current_and_outer: Relids, ) -> bool; } +#[pg_guard] +extern "C" { + pub fn tlist_member(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn tlist_member_ignore_relabel(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn add_to_flat_tlist(tlist: *mut List, exprs: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_tlist_exprs(tlist: *mut List, includeJunk: bool) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn count_nonjunk_tlist_entries(tlist: *mut List) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_exprs(tlist1: *mut List, tlist2: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_datatypes(tlist: *mut List, colTypes: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_collations(tlist: *mut List, colCollations: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn apply_tlist_labeling(dest_tlist: *mut List, src_tlist: *mut List); +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_tle(sortref: Index, targetList: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupclause_tle( + sgClause: *mut SortGroupClause, + targetList: *mut List, + ) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupclause_expr( + sgClause: *mut SortGroupClause, + targetList: *mut List, + ) -> *mut Node; +} +#[pg_guard] +extern "C" { + pub fn get_sortgrouplist_exprs(sgClauses: *mut List, targetList: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_clause(sortref: Index, clauses: *mut List) -> *mut SortGroupClause; +} +#[pg_guard] +extern "C" { + pub fn get_sortgroupref_clause_noerr( + sortref: Index, + clauses: *mut List, + ) -> *mut SortGroupClause; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_ops(groupClause: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_cols(groupClause: *mut List, tlist: *mut List) -> *mut AttrNumber; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_sortable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_hashable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_pathtarget_from_tlist(tlist: *mut List) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn make_tlist_from_pathtarget(target: *mut PathTarget) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn copy_pathtarget(src: *mut PathTarget) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn create_empty_pathtarget() -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn add_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr, sortgroupref: Index); +} +#[pg_guard] +extern "C" { + pub fn add_new_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr); +} +#[pg_guard] +extern "C" { + pub fn add_new_columns_to_pathtarget(target: *mut PathTarget, exprs: *mut List); +} +#[pg_guard] +extern "C" { + pub fn apply_pathtarget_labeling_to_tlist(tlist: *mut List, target: *mut PathTarget); +} +#[pg_guard] +extern "C" { + pub fn split_pathtarget_at_srfs( + root: *mut PlannerInfo, + target: *mut PathTarget, + input_target: *mut PathTarget, + targets: *mut *mut List, + targets_contain_srfs: *mut *mut List, + ); +} pub const FuncDetailCode_FUNCDETAIL_NOTFOUND: FuncDetailCode = 0; pub const FuncDetailCode_FUNCDETAIL_MULTIPLE: FuncDetailCode = 1; pub const FuncDetailCode_FUNCDETAIL_NORMAL: FuncDetailCode = 2; @@ -36855,6 +37930,35 @@ extern "C" { extern "C" { pub fn SystemTypeName(name: *mut ::std::os::raw::c_char) -> *mut TypeName; } +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_name( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_type( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + vartype: *mut Oid, + vartypmod: *mut int32, + varcollid: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_is_dropped(rte: *mut RangeTblEntry, attnum: AttrNumber) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_tle_by_resno(tlist: *mut List, resno: AttrNumber) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_parse_rowmark(qry: *mut Query, rtindex: Index) -> *mut RowMarkClause; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ReorderBufferTupleBuf { @@ -37954,6 +39058,53 @@ extern "C" { extern "C" { pub fn FreeAccessStrategy(strategy: BufferAccessStrategy); } +pub type pg_on_exit_callback = + ::std::option::Option; +pub type shmem_startup_hook_type = ::std::option::Option; +#[pg_guard] +extern "C" { + pub static mut proc_exit_inprogress: bool; +} +#[pg_guard] +extern "C" { + pub static mut shmem_exit_inprogress: bool; +} +#[pg_guard] +extern "C" { + pub fn proc_exit(code: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn shmem_exit(code: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn on_proc_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn on_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn before_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn cancel_before_shmem_exit(function: pg_on_exit_callback, arg: Datum); +} +#[pg_guard] +extern "C" { + pub fn on_exit_reset(); +} +#[pg_guard] +extern "C" { + pub static mut shmem_startup_hook: shmem_startup_hook_type; +} +#[pg_guard] +extern "C" { + pub fn CreateSharedMemoryAndSemaphores(port: ::std::os::raw::c_int); +} #[pg_guard] extern "C" { pub fn standby_redo(record: *mut XLogReaderState); @@ -38367,53 +39518,6 @@ extern "C" { catalog_xmin: *mut TransactionId, ); } -pub type pg_on_exit_callback = - ::std::option::Option; -pub type shmem_startup_hook_type = ::std::option::Option; -#[pg_guard] -extern "C" { - pub static mut proc_exit_inprogress: bool; -} -#[pg_guard] -extern "C" { - pub static mut shmem_exit_inprogress: bool; -} -#[pg_guard] -extern "C" { - pub fn proc_exit(code: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn shmem_exit(code: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn on_proc_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn on_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn before_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn cancel_before_shmem_exit(function: pg_on_exit_callback, arg: Datum); -} -#[pg_guard] -extern "C" { - pub fn on_exit_reset(); -} -#[pg_guard] -extern "C" { - pub static mut shmem_startup_hook: shmem_startup_hook_type; -} -#[pg_guard] -extern "C" { - pub fn CreateSharedMemoryAndSemaphores(port: ::std::os::raw::c_int); -} pub const GucContext_PGC_INTERNAL: GucContext = 0; pub const GucContext_PGC_POSTMASTER: GucContext = 1; pub const GucContext_PGC_SIGHUP: GucContext = 2; @@ -50165,236 +51269,6 @@ extern "C" { estimated_len: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; -pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; -pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; -pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; -pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; -pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; -pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; -pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; -pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; -pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; -pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; -pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; -pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; -pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; -pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; -pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; -pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; -pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; -pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; -pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; -pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; -pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; -pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; -pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; -pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; -pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; -pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; -pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; -pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; -pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; -pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; -pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; -pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; -pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; -pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; -pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; -pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; -pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; -pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; -pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; -pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; -pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; -pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; -pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; -pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; -pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; -pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; -pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; -pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; -pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; -pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; -pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; -pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; -pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 55; -pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 56; -pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 57; -pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 58; -pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 59; -pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 60; -pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 61; -pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 62; -pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 63; -pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 64; -pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 65; -pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 66; -pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 67; -pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 68; -pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 69; -pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 70; -pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 71; -pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 72; -pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 73; -pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 74; -pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 75; -pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 76; -pub type SysCacheIdentifier = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn InitCatalogCache(); -} -#[pg_guard] -extern "C" { - pub fn InitCatalogCachePhase2(); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache3( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache4( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn ReleaseSysCache(tuple: HeapTuple); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopy( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExists( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheOid( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> Oid; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttName( - relid: Oid, - attname: *const ::std::os::raw::c_char, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SysCacheGetAttr( - cacheId: ::std::os::raw::c_int, - tup: HeapTuple, - attributeNumber: AttrNumber, - isNull: *mut bool, - ) -> Datum; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheHashValue( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> uint32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct catclist { - _unused: [u8; 0], -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheList( - cacheId: ::std::os::raw::c_int, - nkeys: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> *mut catclist; -} -#[pg_guard] -extern "C" { - pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); -} -#[pg_guard] -extern "C" { - pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationHasSysCache(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationSupportsSysCache(relid: Oid) -> bool; -} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OpBtreeInterpretation { @@ -51401,46 +52275,6 @@ extern "C" { pub fn get_backup_status() -> SessionBackupState; } #[repr(C)] -#[derive(Copy, Clone)] -pub struct FormData_pg_class { - pub relname: NameData, - pub relnamespace: Oid, - pub reltype: Oid, - pub reloftype: Oid, - pub relowner: Oid, - pub relam: Oid, - pub relfilenode: Oid, - pub reltablespace: Oid, - pub relpages: int32, - pub reltuples: float4, - pub relallvisible: int32, - pub reltoastrelid: Oid, - pub relhasindex: bool, - pub relisshared: bool, - pub relpersistence: ::std::os::raw::c_char, - pub relkind: ::std::os::raw::c_char, - pub relnatts: int16, - pub relchecks: int16, - pub relhasoids: bool, - pub relhasrules: bool, - pub relhastriggers: bool, - pub relhassubclass: bool, - pub relrowsecurity: bool, - pub relforcerowsecurity: bool, - pub relispopulated: bool, - pub relreplident: ::std::os::raw::c_char, - pub relispartition: bool, - pub relrewrite: Oid, - pub relfrozenxid: TransactionId, - pub relminmxid: TransactionId, -} -impl Default for FormData_pg_class { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type Form_pg_class = *mut FormData_pg_class; -#[repr(C)] #[derive(Debug, Default)] pub struct FormData_pg_index { pub indexrelid: Oid, @@ -51724,6 +52558,60 @@ extern "C" { extern "C" { pub fn RelationGetRepsetList(rel: Relation) -> *mut List; } +pub type SamplerRandomState = [::std::os::raw::c_ushort; 3usize]; +#[pg_guard] +extern "C" { + pub fn sampler_random_init_state( + seed: ::std::os::raw::c_long, + randstate: *mut ::std::os::raw::c_ushort, + ); +} +#[pg_guard] +extern "C" { + pub fn sampler_random_fract(randstate: *mut ::std::os::raw::c_ushort) -> f64; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BlockSamplerData { + pub N: BlockNumber, + pub n: ::std::os::raw::c_int, + pub t: BlockNumber, + pub m: ::std::os::raw::c_int, + pub randstate: SamplerRandomState, +} +pub type BlockSampler = *mut BlockSamplerData; +#[pg_guard] +extern "C" { + pub fn BlockSampler_Init( + bs: BlockSampler, + nblocks: BlockNumber, + samplesize: ::std::os::raw::c_int, + randseed: ::std::os::raw::c_long, + ); +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_HasMore(bs: BlockSampler) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_Next(bs: BlockSampler) -> BlockNumber; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ReservoirStateData { + pub W: f64, + pub randstate: SamplerRandomState, +} +pub type ReservoirState = *mut ReservoirStateData; +#[pg_guard] +extern "C" { + pub fn reservoir_init_selection_state(rs: ReservoirState, n: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn reservoir_get_next_S(rs: ReservoirState, t: f64, n: ::std::os::raw::c_int) -> f64; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VariableStatData { @@ -51995,6 +52883,236 @@ extern "C" { varRelid: ::std::os::raw::c_int, ) -> Selectivity; } +pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; +pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; +pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; +pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; +pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; +pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; +pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; +pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; +pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; +pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; +pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; +pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; +pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; +pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; +pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; +pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; +pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; +pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; +pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; +pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; +pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; +pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; +pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; +pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; +pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; +pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; +pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; +pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; +pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; +pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; +pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; +pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; +pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; +pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; +pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; +pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; +pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; +pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; +pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; +pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; +pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; +pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; +pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; +pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; +pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; +pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; +pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; +pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; +pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; +pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; +pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; +pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; +pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; +pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 55; +pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 56; +pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 57; +pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 58; +pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 59; +pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 60; +pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 61; +pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 62; +pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 63; +pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 64; +pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 65; +pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 66; +pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 67; +pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 68; +pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 69; +pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 70; +pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 71; +pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 72; +pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 73; +pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 74; +pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 75; +pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 76; +pub type SysCacheIdentifier = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn InitCatalogCache(); +} +#[pg_guard] +extern "C" { + pub fn InitCatalogCachePhase2(); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache3( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache4( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn ReleaseSysCache(tuple: HeapTuple); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopy( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExists( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheOid( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttName( + relid: Oid, + attname: *const ::std::os::raw::c_char, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SysCacheGetAttr( + cacheId: ::std::os::raw::c_int, + tup: HeapTuple, + attributeNumber: AttrNumber, + isNull: *mut bool, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheHashValue( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> uint32; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct catclist { + _unused: [u8; 0], +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheList( + cacheId: ::std::os::raw::c_int, + nkeys: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> *mut catclist; +} +#[pg_guard] +extern "C" { + pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); +} +#[pg_guard] +extern "C" { + pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationHasSysCache(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationSupportsSysCache(relid: Oid) -> bool; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DomainConstraintCache { diff --git a/pgx-pg-sys/src/pg12.rs b/pgx-pg-sys/src/pg12.rs index ed102c5f3..d87a05c40 100644 --- a/pgx-pg-sys/src/pg12.rs +++ b/pgx-pg-sys/src/pg12.rs @@ -2715,6 +2715,12 @@ pub const XACT_XINFO_HAS_GID: u32 = 128; pub const XACT_COMPLETION_APPLY_FEEDBACK: u32 = 536870912; pub const XACT_COMPLETION_UPDATE_RELCACHE_FILE: u32 = 1073741824; pub const XACT_COMPLETION_FORCE_SYNC_COMMIT: u32 = 2147483648; +pub const PERFORM_DELETION_INTERNAL: u32 = 1; +pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; +pub const PERFORM_DELETION_QUIETLY: u32 = 4; +pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; +pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; +pub const PERFORM_DELETION_CONCURRENT_LOCK: u32 = 32; pub const DEFAULT_INDEX_TYPE: &'static [u8; 6usize] = b"btree\0"; pub const INDEX_CREATE_IS_PRIMARY: u32 = 1; pub const INDEX_CREATE_ADD_CONSTRAINT: u32 = 2; @@ -2787,6 +2793,38 @@ pub const PROARGMODE_INOUT: u8 = 98u8; pub const PROARGMODE_VARIADIC: u8 = 118u8; pub const PROARGMODE_TABLE: u8 = 116u8; pub const HEAP_TABLE_AM_HANDLER_OID: u32 = 3; +pub const TriggerRelationId: u32 = 2620; +pub const Anum_pg_trigger_oid: u32 = 1; +pub const Anum_pg_trigger_tgrelid: u32 = 2; +pub const Anum_pg_trigger_tgname: u32 = 3; +pub const Anum_pg_trigger_tgfoid: u32 = 4; +pub const Anum_pg_trigger_tgtype: u32 = 5; +pub const Anum_pg_trigger_tgenabled: u32 = 6; +pub const Anum_pg_trigger_tgisinternal: u32 = 7; +pub const Anum_pg_trigger_tgconstrrelid: u32 = 8; +pub const Anum_pg_trigger_tgconstrindid: u32 = 9; +pub const Anum_pg_trigger_tgconstraint: u32 = 10; +pub const Anum_pg_trigger_tgdeferrable: u32 = 11; +pub const Anum_pg_trigger_tginitdeferred: u32 = 12; +pub const Anum_pg_trigger_tgnargs: u32 = 13; +pub const Anum_pg_trigger_tgattr: u32 = 14; +pub const Anum_pg_trigger_tgargs: u32 = 15; +pub const Anum_pg_trigger_tgqual: u32 = 16; +pub const Anum_pg_trigger_tgoldtable: u32 = 17; +pub const Anum_pg_trigger_tgnewtable: u32 = 18; +pub const Natts_pg_trigger: u32 = 18; +pub const TRIGGER_TYPE_ROW: u32 = 1; +pub const TRIGGER_TYPE_BEFORE: u32 = 2; +pub const TRIGGER_TYPE_INSERT: u32 = 4; +pub const TRIGGER_TYPE_DELETE: u32 = 8; +pub const TRIGGER_TYPE_UPDATE: u32 = 16; +pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; +pub const TRIGGER_TYPE_INSTEAD: u32 = 64; +pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; +pub const TRIGGER_TYPE_STATEMENT: u32 = 0; +pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; +pub const TRIGGER_TYPE_AFTER: u32 = 0; +pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TypeRelationId: u32 = 1247; pub const TypeRelation_Rowtype_Id: u32 = 71; pub const Anum_pg_type_oid: u32 = 1; @@ -3003,12 +3041,6 @@ pub const TSTZRANGEARRAYOID: u32 = 3911; pub const DATERANGEARRAYOID: u32 = 3913; pub const INT8RANGEARRAYOID: u32 = 3927; pub const CSTRINGARRAYOID: u32 = 1263; -pub const PERFORM_DELETION_INTERNAL: u32 = 1; -pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; -pub const PERFORM_DELETION_QUIETLY: u32 = 4; -pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; -pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; -pub const PERFORM_DELETION_CONCURRENT_LOCK: u32 = 32; pub const EventTriggerRelationId: u32 = 3466; pub const Anum_pg_event_trigger_oid: u32 = 1; pub const Anum_pg_event_trigger_evtname: u32 = 2; @@ -3021,38 +3053,6 @@ pub const Natts_pg_event_trigger: u32 = 7; pub const AT_REWRITE_ALTER_PERSISTENCE: u32 = 1; pub const AT_REWRITE_DEFAULT_VAL: u32 = 2; pub const AT_REWRITE_COLUMN_REWRITE: u32 = 4; -pub const TriggerRelationId: u32 = 2620; -pub const Anum_pg_trigger_oid: u32 = 1; -pub const Anum_pg_trigger_tgrelid: u32 = 2; -pub const Anum_pg_trigger_tgname: u32 = 3; -pub const Anum_pg_trigger_tgfoid: u32 = 4; -pub const Anum_pg_trigger_tgtype: u32 = 5; -pub const Anum_pg_trigger_tgenabled: u32 = 6; -pub const Anum_pg_trigger_tgisinternal: u32 = 7; -pub const Anum_pg_trigger_tgconstrrelid: u32 = 8; -pub const Anum_pg_trigger_tgconstrindid: u32 = 9; -pub const Anum_pg_trigger_tgconstraint: u32 = 10; -pub const Anum_pg_trigger_tgdeferrable: u32 = 11; -pub const Anum_pg_trigger_tginitdeferred: u32 = 12; -pub const Anum_pg_trigger_tgnargs: u32 = 13; -pub const Anum_pg_trigger_tgattr: u32 = 14; -pub const Anum_pg_trigger_tgargs: u32 = 15; -pub const Anum_pg_trigger_tgqual: u32 = 16; -pub const Anum_pg_trigger_tgoldtable: u32 = 17; -pub const Anum_pg_trigger_tgnewtable: u32 = 18; -pub const Natts_pg_trigger: u32 = 18; -pub const TRIGGER_TYPE_ROW: u32 = 1; -pub const TRIGGER_TYPE_BEFORE: u32 = 2; -pub const TRIGGER_TYPE_INSERT: u32 = 4; -pub const TRIGGER_TYPE_DELETE: u32 = 8; -pub const TRIGGER_TYPE_UPDATE: u32 = 16; -pub const TRIGGER_TYPE_TRUNCATE: u32 = 32; -pub const TRIGGER_TYPE_INSTEAD: u32 = 64; -pub const TRIGGER_TYPE_LEVEL_MASK: u32 = 1; -pub const TRIGGER_TYPE_STATEMENT: u32 = 0; -pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; -pub const TRIGGER_TYPE_AFTER: u32 = 0; -pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; pub const TRIGGER_EVENT_INSERT: u32 = 0; pub const TRIGGER_EVENT_DELETE: u32 = 1; pub const TRIGGER_EVENT_UPDATE: u32 = 2; @@ -3075,6 +3075,47 @@ pub const TRIGGER_DISABLED: u8 = 68u8; pub const RI_TRIGGER_PK: u32 = 1; pub const RI_TRIGGER_FK: u32 = 2; pub const RI_TRIGGER_NONE: u32 = 0; +pub const StatisticRelationId: u32 = 2619; +pub const Anum_pg_statistic_starelid: u32 = 1; +pub const Anum_pg_statistic_staattnum: u32 = 2; +pub const Anum_pg_statistic_stainherit: u32 = 3; +pub const Anum_pg_statistic_stanullfrac: u32 = 4; +pub const Anum_pg_statistic_stawidth: u32 = 5; +pub const Anum_pg_statistic_stadistinct: u32 = 6; +pub const Anum_pg_statistic_stakind1: u32 = 7; +pub const Anum_pg_statistic_stakind2: u32 = 8; +pub const Anum_pg_statistic_stakind3: u32 = 9; +pub const Anum_pg_statistic_stakind4: u32 = 10; +pub const Anum_pg_statistic_stakind5: u32 = 11; +pub const Anum_pg_statistic_staop1: u32 = 12; +pub const Anum_pg_statistic_staop2: u32 = 13; +pub const Anum_pg_statistic_staop3: u32 = 14; +pub const Anum_pg_statistic_staop4: u32 = 15; +pub const Anum_pg_statistic_staop5: u32 = 16; +pub const Anum_pg_statistic_stacoll1: u32 = 17; +pub const Anum_pg_statistic_stacoll2: u32 = 18; +pub const Anum_pg_statistic_stacoll3: u32 = 19; +pub const Anum_pg_statistic_stacoll4: u32 = 20; +pub const Anum_pg_statistic_stacoll5: u32 = 21; +pub const Anum_pg_statistic_stanumbers1: u32 = 22; +pub const Anum_pg_statistic_stanumbers2: u32 = 23; +pub const Anum_pg_statistic_stanumbers3: u32 = 24; +pub const Anum_pg_statistic_stanumbers4: u32 = 25; +pub const Anum_pg_statistic_stanumbers5: u32 = 26; +pub const Anum_pg_statistic_stavalues1: u32 = 27; +pub const Anum_pg_statistic_stavalues2: u32 = 28; +pub const Anum_pg_statistic_stavalues3: u32 = 29; +pub const Anum_pg_statistic_stavalues4: u32 = 30; +pub const Anum_pg_statistic_stavalues5: u32 = 31; +pub const Natts_pg_statistic: u32 = 31; +pub const STATISTIC_KIND_MCV: u32 = 1; +pub const STATISTIC_KIND_HISTOGRAM: u32 = 2; +pub const STATISTIC_KIND_CORRELATION: u32 = 3; +pub const STATISTIC_KIND_MCELEM: u32 = 4; +pub const STATISTIC_KIND_DECHIST: u32 = 5; +pub const STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM: u32 = 6; +pub const STATISTIC_KIND_BOUNDS_HISTOGRAM: u32 = 7; +pub const STATISTIC_NUM_SLOTS: u32 = 5; pub const CACHEDPLANSOURCE_MAGIC: u32 = 195726186; pub const CACHEDPLAN_MAGIC: u32 = 953717834; pub const CACHEDEXPR_MAGIC: u32 = 838275847; @@ -3151,6 +3192,7 @@ pub const PVC_INCLUDE_WINDOWFUNCS: u32 = 4; pub const PVC_RECURSE_WINDOWFUNCS: u32 = 8; pub const PVC_INCLUDE_PLACEHOLDERS: u32 = 16; pub const PVC_RECURSE_PLACEHOLDERS: u32 = 32; +pub const DEFAULT_CURSOR_TUPLE_FRACTION: f64 = 0.1; pub const OLD_SNAPSHOT_PADDING_ENTRIES: u32 = 10; pub const MAX_IO_CONCURRENCY: u32 = 1000; pub const BUFFER_LOCK_UNLOCK: u32 = 0; @@ -3173,6 +3215,7 @@ pub const FORMAT_TYPE_TYPEMOD_GIVEN: u32 = 1; pub const FORMAT_TYPE_ALLOW_INVALID: u32 = 2; pub const FORMAT_TYPE_FORCE_QUALIFY: u32 = 4; pub const MAX_TIME_PRECISION: u32 = 6; +pub const RADIANS_PER_DEGREE: f64 = 0.017453292519943295; pub const NUMERIC_MAX_PRECISION: u32 = 1000; pub const NUMERIC_MAX_DISPLAY_SCALE: u32 = 1000; pub const NUMERIC_MIN_DISPLAY_SCALE: u32 = 0; @@ -29650,11 +29693,6 @@ extern "C" { pub struct BulkInsertStateData { _unused: [u8; 0], } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VacuumParams { - _unused: [u8; 0], -} pub const ScanOptions_SO_TYPE_SEQSCAN: ScanOptions = 1; pub const ScanOptions_SO_TYPE_BITMAPSCAN: ScanOptions = 2; pub const ScanOptions_SO_TYPE_SAMPLESCAN: ScanOptions = 4; @@ -31696,6 +31734,307 @@ extern "C" { extern "C" { pub fn IsInParallelMode() -> bool; } +pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; +pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; +pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; +pub const DependencyType_DEPENDENCY_PARTITION_PRI: DependencyType = 80; +pub const DependencyType_DEPENDENCY_PARTITION_SEC: DependencyType = 83; +pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; +pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; +pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; +pub type DependencyType = ::std::os::raw::c_uint; +pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; +pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; +pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; +pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; +pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; +pub type SharedDependencyType = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectAddresses { + _unused: [u8; 0], +} +pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; +pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; +pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; +pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; +pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; +pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; +pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; +pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; +pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; +pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; +pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; +pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; +pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; +pub const ObjectClass_OCLASS_AM: ObjectClass = 13; +pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; +pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; +pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; +pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; +pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; +pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; +pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; +pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; +pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; +pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; +pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; +pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; +pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; +pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; +pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; +pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; +pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; +pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; +pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; +pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; +pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; +pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; +pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; +pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; +pub type ObjectClass = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn ReleaseDeletionLock(object: *const ObjectAddress); +} +#[pg_guard] +extern "C" { + pub fn performDeletion( + object: *const ObjectAddress, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn performMultipleDeletions( + objects: *const ObjectAddresses, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnExpr( + depender: *const ObjectAddress, + expr: *mut Node, + rtable: *mut List, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnSingleRelExpr( + depender: *const ObjectAddress, + expr: *mut Node, + relId: Oid, + behavior: DependencyType, + self_behavior: DependencyType, + reverse_self: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; +} +#[pg_guard] +extern "C" { + pub fn new_object_addresses() -> *mut ObjectAddresses; +} +#[pg_guard] +extern "C" { + pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn object_address_present( + object: *const ObjectAddress, + addrs: *const ObjectAddresses, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn record_object_address_dependencies( + depender: *const ObjectAddress, + referenced: *mut ObjectAddresses, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn sort_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn free_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOn( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordMultipleDependencies( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + nreferenced: ::std::os::raw::c_int, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsFor( + classId: Oid, + objectId: Oid, + skipExtensionDeps: bool, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsForClass( + classId: Oid, + objectId: Oid, + refclassId: Oid, + deptype: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependencyFor( + classId: Oid, + objectId: Oid, + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependenciesOf( + classId: Oid, + oldObjectId: Oid, + newObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependenciesOn( + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn sequenceIsOwned( + seqId: Oid, + deptype: ::std::os::raw::c_char, + tableId: *mut Oid, + colId: *mut int32, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_constraint_index(constraintId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_constraint(indexId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_ref_constraints(indexId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn recordSharedDependencyOn( + depender: *mut ObjectAddress, + referenced: *mut ObjectAddress, + deptype: SharedDependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); +} +#[pg_guard] +extern "C" { + pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); +} +#[pg_guard] +extern "C" { + pub fn updateAclDependencies( + classId: Oid, + objectId: Oid, + objectSubId: int32, + ownerId: Oid, + noldmembers: ::std::os::raw::c_int, + oldmembers: *mut Oid, + nnewmembers: ::std::os::raw::c_int, + newmembers: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn checkSharedDependencies( + classId: Oid, + objectId: Oid, + detail_msg: *mut *mut ::std::os::raw::c_char, + detail_log_msg: *mut *mut ::std::os::raw::c_char, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); +} +#[pg_guard] +extern "C" { + pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); +} +#[pg_guard] +extern "C" { + pub fn dropDatabaseDependencies(databaseId: Oid); +} +#[pg_guard] +extern "C" { + pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); +} +#[pg_guard] +extern "C" { + pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); +} pub const IndexStateFlagsAction_INDEX_CREATE_SET_READY: IndexStateFlagsAction = 0; pub const IndexStateFlagsAction_INDEX_CREATE_SET_VALID: IndexStateFlagsAction = 1; pub const IndexStateFlagsAction_INDEX_DROP_CLEAR_VALID: IndexStateFlagsAction = 2; @@ -32374,6 +32713,29 @@ extern "C" { pub fn oid_array_to_list(datum: Datum) -> *mut List; } #[repr(C)] +pub struct FormData_pg_trigger { + pub oid: Oid, + pub tgrelid: Oid, + pub tgname: NameData, + pub tgfoid: Oid, + pub tgtype: int16, + pub tgenabled: ::std::os::raw::c_char, + pub tgisinternal: bool, + pub tgconstrrelid: Oid, + pub tgconstrindid: Oid, + pub tgconstraint: Oid, + pub tgdeferrable: bool, + pub tginitdeferred: bool, + pub tgnargs: int16, + pub tgattr: int2vector, +} +impl Default for FormData_pg_trigger { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type Form_pg_trigger = *mut FormData_pg_trigger; +#[repr(C)] #[derive(Copy, Clone)] pub struct FormData_pg_type { pub oid: Oid, @@ -32570,306 +32932,459 @@ extern "C" { ctype: *const ::std::os::raw::c_char, ); } -pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; -pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; -pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; -pub const DependencyType_DEPENDENCY_PARTITION_PRI: DependencyType = 80; -pub const DependencyType_DEPENDENCY_PARTITION_SEC: DependencyType = 83; -pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; -pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; -pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; -pub type DependencyType = ::std::os::raw::c_uint; -pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; -pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; -pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; -pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; -pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; -pub type SharedDependencyType = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectAddresses { - _unused: [u8; 0], +#[pg_guard] +extern "C" { + pub fn RemoveObjects(stmt: *mut DropStmt); } -pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; -pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; -pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; -pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; -pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; -pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; -pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; -pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; -pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; -pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; -pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; -pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; -pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; -pub const ObjectClass_OCLASS_AM: ObjectClass = 13; -pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; -pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; -pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; -pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; -pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; -pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; -pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; -pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; -pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; -pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; -pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; -pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; -pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; -pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; -pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; -pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; -pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; -pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; -pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; -pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; -pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; -pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; -pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; -pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; -pub type ObjectClass = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); + pub fn DefineIndex( + relationId: Oid, + stmt: *mut IndexStmt, + indexRelationId: Oid, + parentIndexId: Oid, + parentConstraintId: Oid, + is_alter_table: bool, + check_rights: bool, + check_not_in_use: bool, + skip_build: bool, + quiet: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn ReleaseDeletionLock(object: *const ObjectAddress); + pub fn ReindexIndex( + indexRelation: *mut RangeVar, + options: ::std::os::raw::c_int, + concurrent: bool, + ); } #[pg_guard] extern "C" { - pub fn performDeletion( - object: *const ObjectAddress, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn ReindexTable( + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + concurrent: bool, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ReindexMultipleTables( + objectName: *const ::std::os::raw::c_char, + objectKind: ReindexObjectType, + options: ::std::os::raw::c_int, + concurrent: bool, ); } #[pg_guard] extern "C" { - pub fn performMultipleDeletions( - objects: *const ObjectAddresses, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn makeObjectName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn ChooseRelationName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + namespaceid: Oid, + isconstraint: bool, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn CheckIndexCompatible( + oldId: Oid, + accessMethodName: *const ::std::os::raw::c_char, + attributeList: *mut List, + exclusionOpNames: *mut List, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetDefaultOpClass(type_id: Oid, am_id: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ResolveOpClass( + opclass: *mut List, + attrType: Oid, + accessMethodName: *const ::std::os::raw::c_char, + accessMethodId: Oid, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn CreateFunction(pstate: *mut ParseState, stmt: *mut CreateFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveFunctionById(funcOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionReturnType(funcOid: Oid, newRetType: Oid); +} +#[pg_guard] +extern "C" { + pub fn SetFunctionArgType(funcOid: Oid, argIndex: ::std::os::raw::c_int, newArgType: Oid); +} +#[pg_guard] +extern "C" { + pub fn AlterFunction(pstate: *mut ParseState, stmt: *mut AlterFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn CreateCast(stmt: *mut CreateCastStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropCastById(castOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateTransform(stmt: *mut CreateTransformStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropTransformById(transformOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereFunctionInNamespace( + proname: *const ::std::os::raw::c_char, + pronargs: ::std::os::raw::c_int, + proargtypes: *mut oidvector, + nspOid: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnExpr( - depender: *const ObjectAddress, - expr: *mut Node, - rtable: *mut List, - behavior: DependencyType, + pub fn ExecuteDoStmt(stmt: *mut DoStmt, atomic: bool); +} +#[pg_guard] +extern "C" { + pub fn ExecuteCallStmt( + stmt: *mut CallStmt, + params: ParamListInfo, + atomic: bool, + dest: *mut DestReceiver, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnSingleRelExpr( - depender: *const ObjectAddress, - expr: *mut Node, - relId: Oid, - behavior: DependencyType, - self_behavior: DependencyType, - reverse_self: bool, + pub fn CallStmtResultDesc(stmt: *mut CallStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn get_cast_oid(sourcetypeid: Oid, targettypeid: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_transform_oid(type_id: Oid, lang_id: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn interpret_function_parameter_list( + pstate: *mut ParseState, + parameters: *mut List, + languageOid: Oid, + objtype: ObjectType, + parameterTypes: *mut *mut oidvector, + allParameterTypes: *mut *mut ArrayType, + parameterModes: *mut *mut ArrayType, + parameterNames: *mut *mut ArrayType, + parameterDefaults: *mut *mut List, + variadicArgType: *mut Oid, + requiredResultType: *mut Oid, ); } #[pg_guard] extern "C" { - pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; + pub fn DefineOperator(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn new_object_addresses() -> *mut ObjectAddresses; + pub fn RemoveOperatorById(operOid: Oid); } #[pg_guard] extern "C" { - pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); + pub fn AlterOperator(stmt: *mut AlterOperatorStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn object_address_present( - object: *const ObjectAddress, - addrs: *const ObjectAddresses, - ) -> bool; + pub fn CreateStatistics(stmt: *mut CreateStatsStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn record_object_address_dependencies( - depender: *const ObjectAddress, - referenced: *mut ObjectAddresses, - behavior: DependencyType, + pub fn RemoveStatisticsById(statsOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn UpdateStatisticsForTypeChange( + statsOid: Oid, + relationOid: Oid, + attnum: ::std::os::raw::c_int, + oldColumnType: Oid, + newColumnType: Oid, ); } #[pg_guard] extern "C" { - pub fn sort_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineAggregate( + pstate: *mut ParseState, + name: *mut List, + args: *mut List, + oldstyle: bool, + parameters: *mut List, + replace: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn free_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineOpClass(stmt: *mut CreateOpClassStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordDependencyOn( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - behavior: DependencyType, + pub fn DefineOpFamily(stmt: *mut CreateOpFamilyStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterOpFamily(stmt: *mut AlterOpFamilyStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveOpClassById(opclassOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveOpFamilyById(opfamilyOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmOpEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmProcEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereOpClassInNamespace( + opcname: *const ::std::os::raw::c_char, + opcmethod: Oid, + opcnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordMultipleDependencies( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - nreferenced: ::std::os::raw::c_int, - behavior: DependencyType, + pub fn IsThereOpFamilyInNamespace( + opfname: *const ::std::os::raw::c_char, + opfmethod: Oid, + opfnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); + pub fn get_opclass_oid(amID: Oid, opclassname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsFor( - classId: Oid, - objectId: Oid, - skipExtensionDeps: bool, - ) -> ::std::os::raw::c_long; + pub fn get_opfamily_oid(amID: Oid, opfamilyname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsForClass( - classId: Oid, - objectId: Oid, - refclassId: Oid, - deptype: ::std::os::raw::c_char, - ) -> ::std::os::raw::c_long; + pub fn DefineTSParser(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependencyFor( - classId: Oid, - objectId: Oid, - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSParserById(prsId: Oid); } #[pg_guard] extern "C" { - pub fn changeDependenciesOf( - classId: Oid, - oldObjectId: Oid, - newObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn DefineTSDictionary(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependenciesOn( - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSDictionaryById(dictId: Oid); } #[pg_guard] extern "C" { - pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; + pub fn AlterTSDictionary(stmt: *mut AlterTSDictionaryStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; + pub fn DefineTSTemplate(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn sequenceIsOwned( - seqId: Oid, - deptype: ::std::os::raw::c_char, - tableId: *mut Oid, - colId: *mut int32, - ) -> bool; + pub fn RemoveTSTemplateById(tmplId: Oid); } #[pg_guard] extern "C" { - pub fn getOwnedSequences(relid: Oid, attnum: AttrNumber) -> *mut List; + pub fn DefineTSConfiguration( + names: *mut List, + parameters: *mut List, + copied: *mut ObjectAddress, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequence(relid: Oid, attnum: AttrNumber) -> Oid; + pub fn RemoveTSConfigurationById(cfgId: Oid); } #[pg_guard] extern "C" { - pub fn get_constraint_index(constraintId: Oid) -> Oid; + pub fn AlterTSConfiguration(stmt: *mut AlterTSConfigurationStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn get_index_constraint(indexId: Oid) -> Oid; + pub fn serialize_deflist(deflist: *mut List) -> *mut text; } #[pg_guard] extern "C" { - pub fn get_index_ref_constraints(indexId: Oid) -> *mut List; + pub fn deserialize_deflist(txt: Datum) -> *mut List; } #[pg_guard] extern "C" { - pub fn recordSharedDependencyOn( - depender: *mut ObjectAddress, - referenced: *mut ObjectAddress, - deptype: SharedDependencyType, - ); + pub fn AlterForeignServerOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); + pub fn AlterForeignServerOwner_oid(arg1: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); + pub fn AlterForeignDataWrapperOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); + pub fn AlterForeignDataWrapperOwner_oid(fwdId: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn updateAclDependencies( - classId: Oid, - objectId: Oid, - objectSubId: int32, - ownerId: Oid, - noldmembers: ::std::os::raw::c_int, - oldmembers: *mut Oid, - nnewmembers: ::std::os::raw::c_int, - newmembers: *mut Oid, - ); + pub fn CreateForeignDataWrapper(stmt: *mut CreateFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn checkSharedDependencies( - classId: Oid, - objectId: Oid, - detail_msg: *mut *mut ::std::os::raw::c_char, - detail_log_msg: *mut *mut ::std::os::raw::c_char, - ) -> bool; + pub fn AlterForeignDataWrapper(stmt: *mut AlterFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); + pub fn RemoveForeignDataWrapperById(fdwId: Oid); } #[pg_guard] extern "C" { - pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); + pub fn CreateForeignServer(stmt: *mut CreateForeignServerStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn dropDatabaseDependencies(databaseId: Oid); + pub fn AlterForeignServer(stmt: *mut AlterForeignServerStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); + pub fn RemoveForeignServerById(srvId: Oid); } #[pg_guard] extern "C" { - pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); + pub fn CreateUserMapping(stmt: *mut CreateUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterUserMapping(stmt: *mut AlterUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMapping(stmt: *mut DropUserMappingStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMappingById(umId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateForeignTable(stmt: *mut CreateForeignTableStmt, relid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ImportForeignSchema(stmt: *mut ImportForeignSchemaStmt); +} +#[pg_guard] +extern "C" { + pub fn transformGenericOptions( + catalogId: Oid, + oldOptions: Datum, + options: *mut List, + fdwvalidator: Oid, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn CreateAccessMethod(stmt: *mut CreateAmStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveAccessMethodById(amOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn get_index_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_table_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_name(amOid: Oid) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetString(def: *mut DefElem) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetNumeric(def: *mut DefElem) -> f64; +} +#[pg_guard] +extern "C" { + pub fn defGetBoolean(def: *mut DefElem) -> bool; +} +#[pg_guard] +extern "C" { + pub fn defGetInt32(def: *mut DefElem) -> int32; +} +#[pg_guard] +extern "C" { + pub fn defGetInt64(def: *mut DefElem) -> int64; +} +#[pg_guard] +extern "C" { + pub fn defGetQualifiedName(def: *mut DefElem) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeName(def: *mut DefElem) -> *mut TypeName; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeLength(def: *mut DefElem) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn defGetStringList(def: *mut DefElem) -> *mut List; } #[repr(C)] #[derive(Copy, Clone)] @@ -33180,6 +33695,205 @@ extern "C" { extern "C" { pub fn EventTriggerCollectAlterDefPrivs(stmt: *mut AlterDefaultPrivilegesStmt); } +pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; +pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; +pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; +pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; +pub type ExplainFormat = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExplainState { + pub str_: StringInfo, + pub verbose: bool, + pub analyze: bool, + pub costs: bool, + pub buffers: bool, + pub timing: bool, + pub summary: bool, + pub settings: bool, + pub format: ExplainFormat, + pub indent: ::std::os::raw::c_int, + pub grouping_stack: *mut List, + pub pstmt: *mut PlannedStmt, + pub rtable: *mut List, + pub rtable_names: *mut List, + pub deparse_cxt: *mut List, + pub printed_subplans: *mut Bitmapset, +} +impl Default for ExplainState { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type ExplainOneQuery_hook_type = ::std::option::Option< + unsafe extern "C" fn( + query: *mut Query, + cursorOptions: ::std::os::raw::c_int, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ), +>; +#[pg_guard] +extern "C" { + pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; +} +pub type explain_get_index_name_hook_type = + ::std::option::Option *const ::std::os::raw::c_char>; +#[pg_guard] +extern "C" { + pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; +} +#[pg_guard] +extern "C" { + pub fn ExplainQuery( + pstate: *mut ParseState, + stmt: *mut ExplainStmt, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + dest: *mut DestReceiver, + ); +} +#[pg_guard] +extern "C" { + pub fn NewExplainState() -> *mut ExplainState; +} +#[pg_guard] +extern "C" { + pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn ExplainOneUtility( + utilityStmt: *mut Node, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOnePlan( + plannedstmt: *mut PlannedStmt, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + planduration: *const instr_time, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintJIT( + es: *mut ExplainState, + jit_flags: ::std::os::raw::c_int, + jit_instr: *mut JitInstrumentation, + worker_i: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainBeginOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainEndOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainSeparatePlans(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyList( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyListNested( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyText( + qlabel: *const ::std::os::raw::c_char, + value: *const ::std::os::raw::c_char, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyInteger( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: int64, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyFloat( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: f64, + ndigits: ::std::os::raw::c_int, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyBool( + qlabel: *const ::std::os::raw::c_char, + value: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOpenGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainCloseGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} #[pg_guard] extern "C" { pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; @@ -33374,29 +34088,6 @@ extern "C" { partConstraint: *mut List, ) -> bool; } -#[repr(C)] -pub struct FormData_pg_trigger { - pub oid: Oid, - pub tgrelid: Oid, - pub tgname: NameData, - pub tgfoid: Oid, - pub tgtype: int16, - pub tgenabled: ::std::os::raw::c_char, - pub tgisinternal: bool, - pub tgconstrrelid: Oid, - pub tgconstrindid: Oid, - pub tgconstraint: Oid, - pub tgdeferrable: bool, - pub tginitdeferred: bool, - pub tgnargs: int16, - pub tgattr: int2vector, -} -impl Default for FormData_pg_trigger { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type Form_pg_trigger = *mut FormData_pg_trigger; pub type TriggerEvent = uint32; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -33707,6 +34398,258 @@ extern "C" { extern "C" { pub fn RI_FKey_trigger_type(tgfoid: Oid) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct FormData_pg_statistic { + pub starelid: Oid, + pub staattnum: int16, + pub stainherit: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind1: int16, + pub stakind2: int16, + pub stakind3: int16, + pub stakind4: int16, + pub stakind5: int16, + pub staop1: Oid, + pub staop2: Oid, + pub staop3: Oid, + pub staop4: Oid, + pub staop5: Oid, + pub stacoll1: Oid, + pub stacoll2: Oid, + pub stacoll3: Oid, + pub stacoll4: Oid, + pub stacoll5: Oid, +} +pub type Form_pg_statistic = *mut FormData_pg_statistic; +pub type VacAttrStatsP = *mut VacAttrStats; +pub type AnalyzeAttrFetchFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + rownum: ::std::os::raw::c_int, + isNull: *mut bool, + ) -> Datum, +>; +pub type AnalyzeAttrComputeStatsFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + fetchfunc: AnalyzeAttrFetchFunc, + samplerows: ::std::os::raw::c_int, + totalrows: f64, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacAttrStats { + pub attr: Form_pg_attribute, + pub attrtypid: Oid, + pub attrtypmod: int32, + pub attrtype: Form_pg_type, + pub attrcollid: Oid, + pub anl_context: MemoryContext, + pub compute_stats: AnalyzeAttrComputeStatsFunc, + pub minrows: ::std::os::raw::c_int, + pub extra_data: *mut ::std::os::raw::c_void, + pub stats_valid: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind: [int16; 5usize], + pub staop: [Oid; 5usize], + pub stacoll: [Oid; 5usize], + pub numnumbers: [::std::os::raw::c_int; 5usize], + pub stanumbers: [*mut float4; 5usize], + pub numvalues: [::std::os::raw::c_int; 5usize], + pub stavalues: [*mut Datum; 5usize], + pub statypid: [Oid; 5usize], + pub statyplen: [int16; 5usize], + pub statypbyval: [bool; 5usize], + pub statypalign: [::std::os::raw::c_char; 5usize], + pub tupattnum: ::std::os::raw::c_int, + pub rows: *mut HeapTuple, + pub tupDesc: TupleDesc, + pub exprvals: *mut Datum, + pub exprnulls: *mut bool, + pub rowstride: ::std::os::raw::c_int, +} +impl Default for VacAttrStats { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const VacuumOption_VACOPT_VACUUM: VacuumOption = 1; +pub const VacuumOption_VACOPT_ANALYZE: VacuumOption = 2; +pub const VacuumOption_VACOPT_VERBOSE: VacuumOption = 4; +pub const VacuumOption_VACOPT_FREEZE: VacuumOption = 8; +pub const VacuumOption_VACOPT_FULL: VacuumOption = 16; +pub const VacuumOption_VACOPT_SKIP_LOCKED: VacuumOption = 32; +pub const VacuumOption_VACOPT_SKIPTOAST: VacuumOption = 64; +pub const VacuumOption_VACOPT_DISABLE_PAGE_SKIPPING: VacuumOption = 128; +pub type VacuumOption = ::std::os::raw::c_uint; +pub const VacOptTernaryValue_VACOPT_TERNARY_DEFAULT: VacOptTernaryValue = 0; +pub const VacOptTernaryValue_VACOPT_TERNARY_DISABLED: VacOptTernaryValue = 1; +pub const VacOptTernaryValue_VACOPT_TERNARY_ENABLED: VacOptTernaryValue = 2; +pub type VacOptTernaryValue = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacuumParams { + pub options: ::std::os::raw::c_int, + pub freeze_min_age: ::std::os::raw::c_int, + pub freeze_table_age: ::std::os::raw::c_int, + pub multixact_freeze_min_age: ::std::os::raw::c_int, + pub multixact_freeze_table_age: ::std::os::raw::c_int, + pub is_wraparound: bool, + pub log_min_duration: ::std::os::raw::c_int, + pub index_cleanup: VacOptTernaryValue, + pub truncate: VacOptTernaryValue, +} +impl Default for VacuumParams { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[pg_guard] +extern "C" { + pub static mut default_statistics_target: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn ExecVacuum(pstate: *mut ParseState, vacstmt: *mut VacuumStmt, isTopLevel: bool); +} +#[pg_guard] +extern "C" { + pub fn vacuum( + relations: *mut List, + params: *mut VacuumParams, + bstrategy: BufferAccessStrategy, + isTopLevel: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_open_indexes( + relation: Relation, + lockmode: LOCKMODE, + nindexes: *mut ::std::os::raw::c_int, + Irel: *mut *mut Relation, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_close_indexes( + nindexes: ::std::os::raw::c_int, + Irel: *mut Relation, + lockmode: LOCKMODE, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_estimate_reltuples( + relation: Relation, + total_pages: BlockNumber, + scanned_pages: BlockNumber, + scanned_tuples: f64, + ) -> f64; +} +#[pg_guard] +extern "C" { + pub fn vac_update_relstats( + relation: Relation, + num_pages: BlockNumber, + num_tuples: f64, + num_all_visible_pages: BlockNumber, + hasindex: bool, + frozenxid: TransactionId, + minmulti: MultiXactId, + in_outer_xact: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vacuum_set_xid_limits( + rel: Relation, + freeze_min_age: ::std::os::raw::c_int, + freeze_table_age: ::std::os::raw::c_int, + multixact_freeze_min_age: ::std::os::raw::c_int, + multixact_freeze_table_age: ::std::os::raw::c_int, + oldestXmin: *mut TransactionId, + freezeLimit: *mut TransactionId, + xidFullScanLimit: *mut TransactionId, + multiXactCutoff: *mut MultiXactId, + mxactFullScanLimit: *mut MultiXactId, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_update_datfrozenxid(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_delay_point(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_is_relation_owner( + relid: Oid, + reltuple: Form_pg_class, + options: ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn vacuum_open_relation( + relid: Oid, + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + verbose: bool, + lmode: LOCKMODE, + ) -> Relation; +} +#[pg_guard] +extern "C" { + pub fn analyze_rel( + relid: Oid, + relation: *mut RangeVar, + params: *mut VacuumParams, + va_cols: *mut List, + in_outer_xact: bool, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn std_typanalyze(stats: *mut VacAttrStats) -> bool; +} +#[pg_guard] +extern "C" { + pub fn anl_random_fract() -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_init_selection_state(n: ::std::os::raw::c_int) -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_get_next_S(t: f64, n: ::std::os::raw::c_int, stateptr: *mut f64) -> f64; +} pub const PlanCacheMode_PLAN_CACHE_MODE_AUTO: PlanCacheMode = 0; pub const PlanCacheMode_PLAN_CACHE_MODE_FORCE_GENERIC_PLAN: PlanCacheMode = 1; pub const PlanCacheMode_PLAN_CACHE_MODE_FORCE_CUSTOM_PLAN: PlanCacheMode = 2; @@ -36364,205 +37307,6 @@ extern "C" { missing_ok: bool, ) -> Oid; } -pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; -pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; -pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; -pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; -pub type ExplainFormat = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExplainState { - pub str_: StringInfo, - pub verbose: bool, - pub analyze: bool, - pub costs: bool, - pub buffers: bool, - pub timing: bool, - pub summary: bool, - pub settings: bool, - pub format: ExplainFormat, - pub indent: ::std::os::raw::c_int, - pub grouping_stack: *mut List, - pub pstmt: *mut PlannedStmt, - pub rtable: *mut List, - pub rtable_names: *mut List, - pub deparse_cxt: *mut List, - pub printed_subplans: *mut Bitmapset, -} -impl Default for ExplainState { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type ExplainOneQuery_hook_type = ::std::option::Option< - unsafe extern "C" fn( - query: *mut Query, - cursorOptions: ::std::os::raw::c_int, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ), ->; -#[pg_guard] -extern "C" { - pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; -} -pub type explain_get_index_name_hook_type = - ::std::option::Option *const ::std::os::raw::c_char>; -#[pg_guard] -extern "C" { - pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; -} -#[pg_guard] -extern "C" { - pub fn ExplainQuery( - pstate: *mut ParseState, - stmt: *mut ExplainStmt, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - dest: *mut DestReceiver, - ); -} -#[pg_guard] -extern "C" { - pub fn NewExplainState() -> *mut ExplainState; -} -#[pg_guard] -extern "C" { - pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; -} -#[pg_guard] -extern "C" { - pub fn ExplainOneUtility( - utilityStmt: *mut Node, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOnePlan( - plannedstmt: *mut PlannedStmt, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - planduration: *const instr_time, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintJIT( - es: *mut ExplainState, - jit_flags: ::std::os::raw::c_int, - jit_instr: *mut JitInstrumentation, - worker_i: ::std::os::raw::c_int, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainBeginOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainEndOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainSeparatePlans(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyList( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyListNested( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyText( - qlabel: *const ::std::os::raw::c_char, - value: *const ::std::os::raw::c_char, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyInteger( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: int64, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyFloat( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: f64, - ndigits: ::std::os::raw::c_int, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyBool( - qlabel: *const ::std::os::raw::c_char, - value: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOpenGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainCloseGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExtensibleNode { @@ -37227,82 +37971,99 @@ impl Default for SQLCmd { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct SupportRequestSimplify { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub fcall: *mut FuncExpr, +pub struct WindowFuncLists { + pub numWindowFuncs: ::std::os::raw::c_int, + pub maxWinRef: Index, + pub windowFuncs: *mut *mut List, } -impl Default for SupportRequestSimplify { +impl Default for WindowFuncLists { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestSelectivity { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub args: *mut List, - pub inputcollid: Oid, - pub is_join: bool, - pub varRelid: ::std::os::raw::c_int, - pub jointype: JoinType, - pub sjinfo: *mut SpecialJoinInfo, - pub selectivity: Selectivity, +#[pg_guard] +extern "C" { + pub fn contain_agg_clause(clause: *mut Node) -> bool; } -impl Default for SupportRequestSelectivity { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn get_agg_clause_costs( + root: *mut PlannerInfo, + clause: *mut Node, + aggsplit: AggSplit, + costs: *mut AggClauseCosts, + ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestCost { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub startup: Cost, - pub per_tuple: Cost, +#[pg_guard] +extern "C" { + pub fn contain_window_function(clause: *mut Node) -> bool; } -impl Default for SupportRequestCost { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestRows { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub rows: f64, +#[pg_guard] +extern "C" { + pub fn expression_returns_set_rows(root: *mut PlannerInfo, clause: *mut Node) -> f64; } -impl Default for SupportRequestRows { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn contain_subplans(clause: *mut Node) -> bool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestIndexCondition { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub indexarg: ::std::os::raw::c_int, - pub index: *mut IndexOptInfo, - pub indexcol: ::std::os::raw::c_int, - pub opfamily: Oid, - pub indexcollation: Oid, - pub lossy: bool, +#[pg_guard] +extern "C" { + pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; } -impl Default for SupportRequestIndexCondition { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_leaked_vars(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; +} +#[pg_guard] +extern "C" { + pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CommuteOpExpr(clause: *mut OpExpr); +} +#[pg_guard] +extern "C" { + pub fn inline_set_returning_function( + root: *mut PlannerInfo, + rte: *mut RangeTblEntry, + ) -> *mut Query; } pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_OFF: ConstraintExclusionType = 0; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_ON: ConstraintExclusionType = 1; @@ -37801,102 +38562,6 @@ extern "C" { tuple: *mut f64, ) -> f64; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WindowFuncLists { - pub numWindowFuncs: ::std::os::raw::c_int, - pub maxWinRef: Index, - pub windowFuncs: *mut *mut List, -} -impl Default for WindowFuncLists { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[pg_guard] -extern "C" { - pub fn contain_agg_clause(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn get_agg_clause_costs( - root: *mut PlannerInfo, - clause: *mut Node, - aggsplit: AggSplit, - costs: *mut AggClauseCosts, - ); -} -#[pg_guard] -extern "C" { - pub fn contain_window_function(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; -} -#[pg_guard] -extern "C" { - pub fn expression_returns_set_rows(root: *mut PlannerInfo, clause: *mut Node) -> f64; -} -#[pg_guard] -extern "C" { - pub fn contain_subplans(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; -} -#[pg_guard] -extern "C" { - pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn contain_leaked_vars(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; -} -#[pg_guard] -extern "C" { - pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; -} -#[pg_guard] -extern "C" { - pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; -} -#[pg_guard] -extern "C" { - pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CommuteOpExpr(clause: *mut OpExpr); -} -#[pg_guard] -extern "C" { - pub fn inline_set_returning_function( - root: *mut PlannerInfo, - rte: *mut RangeTblEntry, - ) -> *mut Query; -} #[pg_guard] extern "C" { pub fn clause_selectivity( @@ -38157,1150 +38822,1355 @@ extern "C" { } #[pg_guard] extern "C" { - pub static mut enable_geqo: bool; + pub fn compare_path_costs( + path1: *mut Path, + path2: *mut Path, + criterion: CostSelector, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub static mut geqo_threshold: ::std::os::raw::c_int; + pub fn compare_fractional_path_costs( + path1: *mut Path, + path2: *mut Path, + fraction: f64, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub static mut min_parallel_table_scan_size: ::std::os::raw::c_int; + pub fn set_cheapest(parent_rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub static mut min_parallel_index_scan_size: ::std::os::raw::c_int; + pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } -pub type set_rel_pathlist_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - rti: Index, - rte: *mut RangeTblEntry, - ), ->; #[pg_guard] extern "C" { - pub static mut set_rel_pathlist_hook: set_rel_pathlist_hook_type; + pub fn add_path_precheck( + parent_rel: *mut RelOptInfo, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + ) -> bool; } -pub type set_join_pathlist_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outerrel: *mut RelOptInfo, - innerrel: *mut RelOptInfo, - jointype: JoinType, - extra: *mut JoinPathExtraData, - ), ->; #[pg_guard] extern "C" { - pub static mut set_join_pathlist_hook: set_join_pathlist_hook_type; + pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } -pub type join_search_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - levels_needed: ::std::os::raw::c_int, - initial_rels: *mut List, - ) -> *mut RelOptInfo, ->; #[pg_guard] extern "C" { - pub static mut join_search_hook: join_search_hook_type; + pub fn add_partial_path_precheck( + parent_rel: *mut RelOptInfo, + total_cost: Cost, + pathkeys: *mut List, + ) -> bool; } #[pg_guard] extern "C" { - pub fn make_one_rel(root: *mut PlannerInfo, joinlist: *mut List) -> *mut RelOptInfo; + pub fn create_seqscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn standard_join_search( + pub fn create_samplescan_path( root: *mut PlannerInfo, - levels_needed: ::std::os::raw::c_int, - initial_rels: *mut List, - ) -> *mut RelOptInfo; + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn generate_gather_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo, override_rows: bool); + pub fn create_index_path( + root: *mut PlannerInfo, + index: *mut IndexOptInfo, + indexclauses: *mut List, + indexorderbys: *mut List, + indexorderbycols: *mut List, + pathkeys: *mut List, + indexscandir: ScanDirection, + indexonly: bool, + required_outer: Relids, + loop_count: f64, + partial_path: bool, + ) -> *mut IndexPath; } #[pg_guard] extern "C" { - pub fn compute_parallel_worker( + pub fn create_bitmap_heap_path( + root: *mut PlannerInfo, rel: *mut RelOptInfo, - heap_pages: f64, - index_pages: f64, - max_workers: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + bitmapqual: *mut Path, + required_outer: Relids, + loop_count: f64, + parallel_degree: ::std::os::raw::c_int, + ) -> *mut BitmapHeapPath; } #[pg_guard] extern "C" { - pub fn create_partial_bitmap_paths( + pub fn create_bitmap_and_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - bitmapqual: *mut Path, - ); + bitmapquals: *mut List, + ) -> *mut BitmapAndPath; } #[pg_guard] extern "C" { - pub fn generate_partitionwise_join_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_bitmap_or_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapOrPath; } #[pg_guard] extern "C" { - pub fn create_index_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_tidscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + tidquals: *mut List, + required_outer: Relids, + ) -> *mut TidPath; } #[pg_guard] extern "C" { - pub fn relation_has_unique_index_for( + pub fn create_append_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - restrictlist: *mut List, - exprlist: *mut List, - oprlist: *mut List, - ) -> bool; + subpaths: *mut List, + partial_subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + parallel_aware: bool, + partitioned_rels: *mut List, + rows: f64, + ) -> *mut AppendPath; } #[pg_guard] extern "C" { - pub fn indexcol_is_bool_constant_for_query( - index: *mut IndexOptInfo, - indexcol: ::std::os::raw::c_int, - ) -> bool; + pub fn create_merge_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + partitioned_rels: *mut List, + ) -> *mut MergeAppendPath; } #[pg_guard] extern "C" { - pub fn match_index_to_operand( - operand: *mut Node, - indexcol: ::std::os::raw::c_int, - index: *mut IndexOptInfo, - ) -> bool; + pub fn create_group_result_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + havingqual: *mut List, + ) -> *mut GroupResultPath; } #[pg_guard] extern "C" { - pub fn check_index_predicates(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; } #[pg_guard] extern "C" { - pub fn create_tidscan_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + sjinfo: *mut SpecialJoinInfo, + ) -> *mut UniquePath; } #[pg_guard] extern "C" { - pub fn add_paths_to_joinrel( + pub fn create_gather_path( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outerrel: *mut RelOptInfo, - innerrel: *mut RelOptInfo, - jointype: JoinType, - sjinfo: *mut SpecialJoinInfo, - restrictlist: *mut List, - ); + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherPath; } #[pg_guard] extern "C" { - pub fn join_search_one_level(root: *mut PlannerInfo, level: ::std::os::raw::c_int); + pub fn create_gather_merge_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + pathkeys: *mut List, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherMergePath; } #[pg_guard] extern "C" { - pub fn make_join_rel( + pub fn create_subqueryscan_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> *mut RelOptInfo; + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut SubqueryScanPath; } #[pg_guard] extern "C" { - pub fn have_join_order_restriction( + pub fn create_functionscan_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> bool; + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn have_dangerous_phv( + pub fn create_valuesscan_path( root: *mut PlannerInfo, - outer_relids: Relids, - inner_params: Relids, - ) -> bool; + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn mark_dummy_rel(rel: *mut RelOptInfo); + pub fn create_tablefuncscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn have_partkey_equi_join( - joinrel: *mut RelOptInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - jointype: JoinType, - restrictlist: *mut List, - ) -> bool; -} -pub type ec_matches_callback_type = ::std::option::Option< - unsafe extern "C" fn( + pub fn create_ctescan_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - ec: *mut EquivalenceClass, - em: *mut EquivalenceMember, - arg: *mut ::std::os::raw::c_void, - ) -> bool, ->; + required_outer: Relids, + ) -> *mut Path; +} #[pg_guard] extern "C" { - pub fn process_equivalence( + pub fn create_namedtuplestorescan_path( root: *mut PlannerInfo, - p_restrictinfo: *mut *mut RestrictInfo, - below_outer_join: bool, - ) -> bool; + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn canonicalize_ec_expression( - expr: *mut Expr, - req_type: Oid, - req_collation: Oid, - ) -> *mut Expr; + pub fn create_resultscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn reconsider_outer_join_clauses(root: *mut PlannerInfo); + pub fn create_worktablescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn get_eclass_for_sort_expr( + pub fn create_foreignscan_path( root: *mut PlannerInfo, - expr: *mut Expr, - nullable_relids: Relids, - opfamilies: *mut List, - opcintype: Oid, - collation: Oid, - sortref: Index, - rel: Relids, - create_it: bool, - ) -> *mut EquivalenceClass; + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn generate_base_implied_equalities(root: *mut PlannerInfo); + pub fn create_foreign_join_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn generate_join_implied_equalities( + pub fn create_foreign_upper_path( root: *mut PlannerInfo, - join_relids: Relids, - outer_relids: Relids, - inner_rel: *mut RelOptInfo, - ) -> *mut List; + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn generate_join_implied_equalities_for_ecs( - root: *mut PlannerInfo, - eclasses: *mut List, - join_relids: Relids, - outer_relids: Relids, - inner_rel: *mut RelOptInfo, - ) -> *mut List; + pub fn calc_nestloop_required_outer( + outerrelids: Relids, + outer_paramrels: Relids, + innerrelids: Relids, + inner_paramrels: Relids, + ) -> Relids; } #[pg_guard] extern "C" { - pub fn exprs_known_equal(root: *mut PlannerInfo, item1: *mut Node, item2: *mut Node) -> bool; + pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) + -> Relids; } #[pg_guard] extern "C" { - pub fn match_eclasses_to_foreign_key_col( + pub fn create_nestloop_path( root: *mut PlannerInfo, - fkinfo: *mut ForeignKeyOptInfo, - colno: ::std::os::raw::c_int, - ) -> *mut EquivalenceClass; + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut NestPath; } #[pg_guard] extern "C" { - pub fn add_child_rel_equivalences( + pub fn create_mergejoin_path( root: *mut PlannerInfo, - appinfo: *mut AppendRelInfo, - parent_rel: *mut RelOptInfo, - child_rel: *mut RelOptInfo, - ); + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + mergeclauses: *mut List, + outersortkeys: *mut List, + innersortkeys: *mut List, + ) -> *mut MergePath; } #[pg_guard] extern "C" { - pub fn add_child_join_rel_equivalences( + pub fn create_hashjoin_path( root: *mut PlannerInfo, - nappinfos: ::std::os::raw::c_int, - appinfos: *mut *mut AppendRelInfo, - parent_rel: *mut RelOptInfo, - child_rel: *mut RelOptInfo, - ); + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + parallel_hash: bool, + restrict_clauses: *mut List, + required_outer: Relids, + hashclauses: *mut List, + ) -> *mut HashPath; } #[pg_guard] extern "C" { - pub fn generate_implied_equalities_for_column( + pub fn create_projection_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - callback: ec_matches_callback_type, - callback_arg: *mut ::std::os::raw::c_void, - prohibited_rels: Relids, - ) -> *mut List; + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectionPath; } #[pg_guard] extern "C" { - pub fn have_relevant_eclass_joinclause( + pub fn apply_projection_to_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> bool; + rel: *mut RelOptInfo, + path: *mut Path, + target: *mut PathTarget, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn has_relevant_eclass_joinclause(root: *mut PlannerInfo, rel1: *mut RelOptInfo) -> bool; + pub fn create_set_projection_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectSetPath; } #[pg_guard] extern "C" { - pub fn eclass_useful_for_merging( + pub fn create_sort_path( root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, rel: *mut RelOptInfo, - ) -> bool; + subpath: *mut Path, + pathkeys: *mut List, + limit_tuples: f64, + ) -> *mut SortPath; } #[pg_guard] extern "C" { - pub fn is_redundant_derived_clause(rinfo: *mut RestrictInfo, clauselist: *mut List) -> bool; + pub fn create_group_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + groupClause: *mut List, + qual: *mut List, + numGroups: f64, + ) -> *mut GroupPath; } #[pg_guard] extern "C" { - pub fn is_redundant_with_indexclauses( - rinfo: *mut RestrictInfo, - indexclauses: *mut List, - ) -> bool; + pub fn create_upper_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + numCols: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut UpperUniquePath; } -pub const PathKeysComparison_PATHKEYS_EQUAL: PathKeysComparison = 0; -pub const PathKeysComparison_PATHKEYS_BETTER1: PathKeysComparison = 1; -pub const PathKeysComparison_PATHKEYS_BETTER2: PathKeysComparison = 2; -pub const PathKeysComparison_PATHKEYS_DIFFERENT: PathKeysComparison = 3; -pub type PathKeysComparison = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn compare_pathkeys(keys1: *mut List, keys2: *mut List) -> PathKeysComparison; + pub fn create_agg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + groupClause: *mut List, + qual: *mut List, + aggcosts: *const AggClauseCosts, + numGroups: f64, + ) -> *mut AggPath; } #[pg_guard] extern "C" { - pub fn pathkeys_contained_in(keys1: *mut List, keys2: *mut List) -> bool; + pub fn create_groupingsets_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + having_qual: *mut List, + aggstrategy: AggStrategy, + rollups: *mut List, + agg_costs: *const AggClauseCosts, + numGroups: f64, + ) -> *mut GroupingSetsPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_path_for_pathkeys( - paths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - cost_criterion: CostSelector, - require_parallel_safe: bool, - ) -> *mut Path; + pub fn create_minmaxagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + mmaggregates: *mut List, + quals: *mut List, + ) -> *mut MinMaxAggPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_fractional_path_for_pathkeys( - paths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - fraction: f64, - ) -> *mut Path; + pub fn create_windowagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + windowFuncs: *mut List, + winclause: *mut WindowClause, + ) -> *mut WindowAggPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_parallel_safe_total_inner(paths: *mut List) -> *mut Path; + pub fn create_setop_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + cmd: SetOpCmd, + strategy: SetOpStrategy, + distinctList: *mut List, + flagColIdx: AttrNumber, + firstFlag: ::std::os::raw::c_int, + numGroups: f64, + outputRows: f64, + ) -> *mut SetOpPath; } #[pg_guard] extern "C" { - pub fn build_index_pathkeys( + pub fn create_recursiveunion_path( root: *mut PlannerInfo, - index: *mut IndexOptInfo, - scandir: ScanDirection, - ) -> *mut List; + rel: *mut RelOptInfo, + leftpath: *mut Path, + rightpath: *mut Path, + target: *mut PathTarget, + distinctList: *mut List, + wtParam: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut RecursiveUnionPath; } #[pg_guard] extern "C" { - pub fn build_partition_pathkeys( + pub fn create_lockrows_path( root: *mut PlannerInfo, - partrel: *mut RelOptInfo, - scandir: ScanDirection, - partialkeys: *mut bool, - ) -> *mut List; + rel: *mut RelOptInfo, + subpath: *mut Path, + rowMarks: *mut List, + epqParam: ::std::os::raw::c_int, + ) -> *mut LockRowsPath; } #[pg_guard] extern "C" { - pub fn build_expression_pathkey( + pub fn create_modifytable_path( root: *mut PlannerInfo, - expr: *mut Expr, - nullable_relids: Relids, - opno: Oid, - rel: Relids, - create_it: bool, - ) -> *mut List; + rel: *mut RelOptInfo, + operation: CmdType, + canSetTag: bool, + nominalRelation: Index, + rootRelation: Index, + partColsUpdated: bool, + resultRelations: *mut List, + subpaths: *mut List, + subroots: *mut List, + withCheckOptionLists: *mut List, + returningLists: *mut List, + rowMarks: *mut List, + onconflict: *mut OnConflictExpr, + epqParam: ::std::os::raw::c_int, + ) -> *mut ModifyTablePath; } #[pg_guard] extern "C" { - pub fn convert_subquery_pathkeys( + pub fn create_limit_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subquery_pathkeys: *mut List, - subquery_tlist: *mut List, - ) -> *mut List; + subpath: *mut Path, + limitOffset: *mut Node, + limitCount: *mut Node, + offset_est: int64, + count_est: int64, + ) -> *mut LimitPath; } #[pg_guard] extern "C" { - pub fn build_join_pathkeys( + pub fn adjust_limit_rows_costs( + rows: *mut f64, + startup_cost: *mut Cost, + total_cost: *mut Cost, + offset_est: int64, + count_est: int64, + ); +} +#[pg_guard] +extern "C" { + pub fn reparameterize_path( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - outer_pathkeys: *mut List, - ) -> *mut List; + path: *mut Path, + required_outer: Relids, + loop_count: f64, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn make_pathkeys_for_sortclauses( + pub fn reparameterize_path_by_child( root: *mut PlannerInfo, - sortclauses: *mut List, - tlist: *mut List, - ) -> *mut List; + path: *mut Path, + child_rel: *mut RelOptInfo, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn initialize_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); + pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn update_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); + pub fn setup_append_rel_array(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_mergeclauses_for_outer_pathkeys( + pub fn expand_planner_arrays(root: *mut PlannerInfo, add_size: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn build_simple_rel( root: *mut PlannerInfo, - pathkeys: *mut List, - restrictinfos: *mut List, - ) -> *mut List; + relid: ::std::os::raw::c_int, + parent: *mut RelOptInfo, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn select_outer_pathkeys_for_merge( + pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn build_join_rel( root: *mut PlannerInfo, - mergeclauses: *mut List, - joinrel: *mut RelOptInfo, - ) -> *mut List; + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + sjinfo: *mut SpecialJoinInfo, + restrictlist_ptr: *mut *mut List, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn make_inner_pathkeys_for_merge( + pub fn min_join_parameterization( root: *mut PlannerInfo, - mergeclauses: *mut List, - outer_pathkeys: *mut List, - ) -> *mut List; + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + ) -> Relids; } #[pg_guard] extern "C" { - pub fn trim_mergeclauses_for_inner_pathkeys( + pub fn fetch_upper_rel( root: *mut PlannerInfo, - mergeclauses: *mut List, - pathkeys: *mut List, - ) -> *mut List; + kind: UpperRelationKind, + relids: Relids, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn truncate_useless_pathkeys( + pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn get_baserel_parampathinfo( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - ) -> *mut List; + baserel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; } #[pg_guard] extern "C" { - pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; + pub fn get_joinrel_parampathinfo( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outer_path: *mut Path, + inner_path: *mut Path, + sjinfo: *mut SpecialJoinInfo, + required_outer: Relids, + restrict_clauses: *mut *mut List, + ) -> *mut ParamPathInfo; } #[pg_guard] extern "C" { - pub fn make_canonical_pathkey( + pub fn get_appendrel_parampathinfo( + appendrel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) + -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn build_child_join_rel( root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, - opfamily: Oid, - strategy: ::std::os::raw::c_int, - nulls_first: bool, - ) -> *mut PathKey; + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + parent_joinrel: *mut RelOptInfo, + restrictlist: *mut List, + sjinfo: *mut SpecialJoinInfo, + jointype: JoinType, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn add_paths_to_append_rel( + pub static mut enable_geqo: bool; +} +#[pg_guard] +extern "C" { + pub static mut geqo_threshold: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut min_parallel_table_scan_size: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut min_parallel_index_scan_size: ::std::os::raw::c_int; +} +pub type set_rel_pathlist_hook_type = ::std::option::Option< + unsafe extern "C" fn( root: *mut PlannerInfo, rel: *mut RelOptInfo, - live_childrels: *mut List, - ); + rti: Index, + rte: *mut RangeTblEntry, + ), +>; +#[pg_guard] +extern "C" { + pub static mut set_rel_pathlist_hook: set_rel_pathlist_hook_type; } +pub type set_join_pathlist_hook_type = ::std::option::Option< + unsafe extern "C" fn( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outerrel: *mut RelOptInfo, + innerrel: *mut RelOptInfo, + jointype: JoinType, + extra: *mut JoinPathExtraData, + ), +>; #[pg_guard] extern "C" { - pub fn compare_path_costs( - path1: *mut Path, - path2: *mut Path, - criterion: CostSelector, - ) -> ::std::os::raw::c_int; + pub static mut set_join_pathlist_hook: set_join_pathlist_hook_type; +} +pub type join_search_hook_type = ::std::option::Option< + unsafe extern "C" fn( + root: *mut PlannerInfo, + levels_needed: ::std::os::raw::c_int, + initial_rels: *mut List, + ) -> *mut RelOptInfo, +>; +#[pg_guard] +extern "C" { + pub static mut join_search_hook: join_search_hook_type; } #[pg_guard] extern "C" { - pub fn compare_fractional_path_costs( - path1: *mut Path, - path2: *mut Path, - fraction: f64, + pub fn make_one_rel(root: *mut PlannerInfo, joinlist: *mut List) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn standard_join_search( + root: *mut PlannerInfo, + levels_needed: ::std::os::raw::c_int, + initial_rels: *mut List, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn generate_gather_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo, override_rows: bool); +} +#[pg_guard] +extern "C" { + pub fn compute_parallel_worker( + rel: *mut RelOptInfo, + heap_pages: f64, + index_pages: f64, + max_workers: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn set_cheapest(parent_rel: *mut RelOptInfo); + pub fn create_partial_bitmap_paths( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapqual: *mut Path, + ); } #[pg_guard] extern "C" { - pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); + pub fn generate_partitionwise_join_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn add_path_precheck( - parent_rel: *mut RelOptInfo, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, + pub fn create_index_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); +} +#[pg_guard] +extern "C" { + pub fn relation_has_unique_index_for( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + restrictlist: *mut List, + exprlist: *mut List, + oprlist: *mut List, ) -> bool; } #[pg_guard] extern "C" { - pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); + pub fn indexcol_is_bool_constant_for_query( + index: *mut IndexOptInfo, + indexcol: ::std::os::raw::c_int, + ) -> bool; } #[pg_guard] extern "C" { - pub fn add_partial_path_precheck( - parent_rel: *mut RelOptInfo, - total_cost: Cost, - pathkeys: *mut List, + pub fn match_index_to_operand( + operand: *mut Node, + indexcol: ::std::os::raw::c_int, + index: *mut IndexOptInfo, ) -> bool; } #[pg_guard] extern "C" { - pub fn create_seqscan_path( + pub fn check_index_predicates(root: *mut PlannerInfo, rel: *mut RelOptInfo); +} +#[pg_guard] +extern "C" { + pub fn create_tidscan_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); +} +#[pg_guard] +extern "C" { + pub fn add_paths_to_joinrel( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - ) -> *mut Path; + joinrel: *mut RelOptInfo, + outerrel: *mut RelOptInfo, + innerrel: *mut RelOptInfo, + jointype: JoinType, + sjinfo: *mut SpecialJoinInfo, + restrictlist: *mut List, + ); } #[pg_guard] extern "C" { - pub fn create_samplescan_path( + pub fn join_search_one_level(root: *mut PlannerInfo, level: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn make_join_rel( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_index_path( + pub fn have_join_order_restriction( root: *mut PlannerInfo, - index: *mut IndexOptInfo, - indexclauses: *mut List, - indexorderbys: *mut List, - indexorderbycols: *mut List, - pathkeys: *mut List, - indexscandir: ScanDirection, - indexonly: bool, - required_outer: Relids, - loop_count: f64, - partial_path: bool, - ) -> *mut IndexPath; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_bitmap_heap_path( + pub fn have_dangerous_phv( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapqual: *mut Path, - required_outer: Relids, - loop_count: f64, - parallel_degree: ::std::os::raw::c_int, - ) -> *mut BitmapHeapPath; + outer_relids: Relids, + inner_params: Relids, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_bitmap_and_path( + pub fn mark_dummy_rel(rel: *mut RelOptInfo); +} +#[pg_guard] +extern "C" { + pub fn have_partkey_equi_join( + joinrel: *mut RelOptInfo, + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + jointype: JoinType, + restrictlist: *mut List, + ) -> bool; +} +pub type ec_matches_callback_type = ::std::option::Option< + unsafe extern "C" fn( root: *mut PlannerInfo, rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapAndPath; + ec: *mut EquivalenceClass, + em: *mut EquivalenceMember, + arg: *mut ::std::os::raw::c_void, + ) -> bool, +>; +#[pg_guard] +extern "C" { + pub fn process_equivalence( + root: *mut PlannerInfo, + p_restrictinfo: *mut *mut RestrictInfo, + below_outer_join: bool, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_bitmap_or_path( + pub fn canonicalize_ec_expression( + expr: *mut Expr, + req_type: Oid, + req_collation: Oid, + ) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn reconsider_outer_join_clauses(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn get_eclass_for_sort_expr( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapOrPath; + expr: *mut Expr, + nullable_relids: Relids, + opfamilies: *mut List, + opcintype: Oid, + collation: Oid, + sortref: Index, + rel: Relids, + create_it: bool, + ) -> *mut EquivalenceClass; } #[pg_guard] extern "C" { - pub fn create_tidscan_path( + pub fn generate_base_implied_equalities(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn generate_join_implied_equalities( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - tidquals: *mut List, - required_outer: Relids, - ) -> *mut TidPath; + join_relids: Relids, + outer_relids: Relids, + inner_rel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_append_path( + pub fn generate_join_implied_equalities_for_ecs( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - partial_subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - parallel_aware: bool, - partitioned_rels: *mut List, - rows: f64, - ) -> *mut AppendPath; + eclasses: *mut List, + join_relids: Relids, + outer_relids: Relids, + inner_rel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_merge_append_path( + pub fn exprs_known_equal(root: *mut PlannerInfo, item1: *mut Node, item2: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn match_eclasses_to_foreign_key_col( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - partitioned_rels: *mut List, - ) -> *mut MergeAppendPath; + fkinfo: *mut ForeignKeyOptInfo, + colno: ::std::os::raw::c_int, + ) -> *mut EquivalenceClass; } #[pg_guard] extern "C" { - pub fn create_group_result_path( + pub fn add_child_rel_equivalences( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - havingqual: *mut List, - ) -> *mut GroupResultPath; + appinfo: *mut AppendRelInfo, + parent_rel: *mut RelOptInfo, + child_rel: *mut RelOptInfo, + ); } #[pg_guard] extern "C" { - pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; + pub fn add_child_join_rel_equivalences( + root: *mut PlannerInfo, + nappinfos: ::std::os::raw::c_int, + appinfos: *mut *mut AppendRelInfo, + parent_rel: *mut RelOptInfo, + child_rel: *mut RelOptInfo, + ); } #[pg_guard] extern "C" { - pub fn create_unique_path( + pub fn generate_implied_equalities_for_column( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - sjinfo: *mut SpecialJoinInfo, - ) -> *mut UniquePath; + callback: ec_matches_callback_type, + callback_arg: *mut ::std::os::raw::c_void, + prohibited_rels: Relids, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_gather_path( + pub fn have_relevant_eclass_joinclause( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherPath; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_gather_merge_path( + pub fn has_relevant_eclass_joinclause(root: *mut PlannerInfo, rel1: *mut RelOptInfo) -> bool; +} +#[pg_guard] +extern "C" { + pub fn eclass_useful_for_merging( root: *mut PlannerInfo, + eclass: *mut EquivalenceClass, rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - pathkeys: *mut List, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherMergePath; + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_redundant_derived_clause(rinfo: *mut RestrictInfo, clauselist: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_redundant_with_indexclauses( + rinfo: *mut RestrictInfo, + indexclauses: *mut List, + ) -> bool; +} +pub const PathKeysComparison_PATHKEYS_EQUAL: PathKeysComparison = 0; +pub const PathKeysComparison_PATHKEYS_BETTER1: PathKeysComparison = 1; +pub const PathKeysComparison_PATHKEYS_BETTER2: PathKeysComparison = 2; +pub const PathKeysComparison_PATHKEYS_DIFFERENT: PathKeysComparison = 3; +pub type PathKeysComparison = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn compare_pathkeys(keys1: *mut List, keys2: *mut List) -> PathKeysComparison; } #[pg_guard] extern "C" { - pub fn create_subqueryscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut SubqueryScanPath; + pub fn pathkeys_contained_in(keys1: *mut List, keys2: *mut List) -> bool; } #[pg_guard] extern "C" { - pub fn create_functionscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, + pub fn get_cheapest_path_for_pathkeys( + paths: *mut List, pathkeys: *mut List, required_outer: Relids, + cost_criterion: CostSelector, + require_parallel_safe: bool, ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_valuesscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, + pub fn get_cheapest_fractional_path_for_pathkeys( + paths: *mut List, + pathkeys: *mut List, required_outer: Relids, + fraction: f64, ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_tablefuncscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + pub fn get_cheapest_parallel_safe_total_inner(paths: *mut List) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_ctescan_path( + pub fn build_index_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + index: *mut IndexOptInfo, + scandir: ScanDirection, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_namedtuplestorescan_path( + pub fn build_partition_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + partrel: *mut RelOptInfo, + scandir: ScanDirection, + partialkeys: *mut bool, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_resultscan_path( + pub fn build_expression_pathkey( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + expr: *mut Expr, + nullable_relids: Relids, + opno: Oid, + rel: Relids, + create_it: bool, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_worktablescan_path( + pub fn convert_subquery_pathkeys( root: *mut PlannerInfo, rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + subquery_pathkeys: *mut List, + subquery_tlist: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreignscan_path( + pub fn build_join_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + joinrel: *mut RelOptInfo, + jointype: JoinType, + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreign_join_path( + pub fn make_pathkeys_for_sortclauses( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + sortclauses: *mut List, + tlist: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreign_upper_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + pub fn initialize_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn calc_nestloop_required_outer( - outerrelids: Relids, - outer_paramrels: Relids, - innerrelids: Relids, - inner_paramrels: Relids, - ) -> Relids; + pub fn update_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) - -> Relids; + pub fn find_mergeclauses_for_outer_pathkeys( + root: *mut PlannerInfo, + pathkeys: *mut List, + restrictinfos: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_nestloop_path( + pub fn select_outer_pathkeys_for_merge( root: *mut PlannerInfo, + mergeclauses: *mut List, joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut NestPath; + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_mergejoin_path( + pub fn make_inner_pathkeys_for_merge( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, mergeclauses: *mut List, - outersortkeys: *mut List, - innersortkeys: *mut List, - ) -> *mut MergePath; + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_hashjoin_path( + pub fn trim_mergeclauses_for_inner_pathkeys( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - parallel_hash: bool, - restrict_clauses: *mut List, - required_outer: Relids, - hashclauses: *mut List, - ) -> *mut HashPath; + mergeclauses: *mut List, + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_projection_path( + pub fn truncate_useless_pathkeys( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectionPath; + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn apply_projection_to_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - path: *mut Path, - target: *mut PathTarget, - ) -> *mut Path; + pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; } #[pg_guard] extern "C" { - pub fn create_set_projection_path( + pub fn make_canonical_pathkey( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectSetPath; + eclass: *mut EquivalenceClass, + opfamily: Oid, + strategy: ::std::os::raw::c_int, + nulls_first: bool, + ) -> *mut PathKey; } #[pg_guard] extern "C" { - pub fn create_sort_path( + pub fn add_paths_to_append_rel( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - limit_tuples: f64, - ) -> *mut SortPath; + live_childrels: *mut List, + ); } #[pg_guard] extern "C" { - pub fn create_group_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - groupClause: *mut List, - qual: *mut List, - numGroups: f64, - ) -> *mut GroupPath; + pub static mut cursor_tuple_fraction: f64; } +pub type query_pathkeys_callback = ::std::option::Option< + unsafe extern "C" fn(root: *mut PlannerInfo, extra: *mut ::std::os::raw::c_void), +>; #[pg_guard] extern "C" { - pub fn create_upper_unique_path( + pub fn query_planner( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - numCols: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut UpperUniquePath; + qp_callback: query_pathkeys_callback, + qp_extra: *mut ::std::os::raw::c_void, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_agg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - aggstrategy: AggStrategy, - aggsplit: AggSplit, - groupClause: *mut List, - qual: *mut List, - aggcosts: *const AggClauseCosts, - numGroups: f64, - ) -> *mut AggPath; + pub fn preprocess_minmax_aggregates(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn create_groupingsets_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - having_qual: *mut List, - aggstrategy: AggStrategy, - rollups: *mut List, - agg_costs: *const AggClauseCosts, - numGroups: f64, - ) -> *mut GroupingSetsPath; + pub fn create_plan(root: *mut PlannerInfo, best_path: *mut Path) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_minmaxagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - mmaggregates: *mut List, - quals: *mut List, - ) -> *mut MinMaxAggPath; + pub fn make_foreignscan( + qptlist: *mut List, + qpqual: *mut List, + scanrelid: Index, + fdw_exprs: *mut List, + fdw_private: *mut List, + fdw_scan_tlist: *mut List, + fdw_recheck_quals: *mut List, + outer_plan: *mut Plan, + ) -> *mut ForeignScan; } #[pg_guard] extern "C" { - pub fn create_windowagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - windowFuncs: *mut List, - winclause: *mut WindowClause, - ) -> *mut WindowAggPath; + pub fn change_plan_targetlist( + subplan: *mut Plan, + tlist: *mut List, + tlist_parallel_safe: bool, + ) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_setop_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - cmd: SetOpCmd, - strategy: SetOpStrategy, - distinctList: *mut List, - flagColIdx: AttrNumber, - firstFlag: ::std::os::raw::c_int, - numGroups: f64, - outputRows: f64, - ) -> *mut SetOpPath; + pub fn materialize_finished_plan(subplan: *mut Plan) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_recursiveunion_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - leftpath: *mut Path, - rightpath: *mut Path, - target: *mut PathTarget, - distinctList: *mut List, - wtParam: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut RecursiveUnionPath; + pub fn is_projection_capable_path(path: *mut Path) -> bool; } #[pg_guard] extern "C" { - pub fn create_lockrows_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - rowMarks: *mut List, - epqParam: ::std::os::raw::c_int, - ) -> *mut LockRowsPath; + pub fn is_projection_capable_plan(plan: *mut Plan) -> bool; } #[pg_guard] extern "C" { - pub fn create_modifytable_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - operation: CmdType, - canSetTag: bool, - nominalRelation: Index, - rootRelation: Index, - partColsUpdated: bool, - resultRelations: *mut List, - subpaths: *mut List, - subroots: *mut List, - withCheckOptionLists: *mut List, - returningLists: *mut List, - rowMarks: *mut List, - onconflict: *mut OnConflictExpr, - epqParam: ::std::os::raw::c_int, - ) -> *mut ModifyTablePath; + pub fn make_sort_from_sortclauses(sortcls: *mut List, lefttree: *mut Plan) -> *mut Sort; } #[pg_guard] extern "C" { - pub fn create_limit_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, + pub fn make_agg( + tlist: *mut List, + qual: *mut List, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + numGroupCols: ::std::os::raw::c_int, + grpColIdx: *mut AttrNumber, + grpOperators: *mut Oid, + grpCollations: *mut Oid, + groupingSets: *mut List, + chain: *mut List, + dNumGroups: f64, + lefttree: *mut Plan, + ) -> *mut Agg; +} +#[pg_guard] +extern "C" { + pub fn make_limit( + lefttree: *mut Plan, limitOffset: *mut Node, limitCount: *mut Node, - offset_est: int64, - count_est: int64, - ) -> *mut LimitPath; + ) -> *mut Limit; } #[pg_guard] extern "C" { - pub fn adjust_limit_rows_costs( - rows: *mut f64, - startup_cost: *mut Cost, - total_cost: *mut Cost, - offset_est: int64, - count_est: int64, - ); + pub static mut from_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn reparameterize_path( - root: *mut PlannerInfo, - path: *mut Path, - required_outer: Relids, - loop_count: f64, - ) -> *mut Path; + pub static mut join_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn reparameterize_path_by_child( - root: *mut PlannerInfo, - path: *mut Path, - child_rel: *mut RelOptInfo, - ) -> *mut Path; + pub fn add_base_rels_to_query(root: *mut PlannerInfo, jtnode: *mut Node); } #[pg_guard] extern "C" { - pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); + pub fn add_other_rels_to_query(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn setup_append_rel_array(root: *mut PlannerInfo); + pub fn build_base_rel_tlists(root: *mut PlannerInfo, final_tlist: *mut List); } #[pg_guard] extern "C" { - pub fn expand_planner_arrays(root: *mut PlannerInfo, add_size: ::std::os::raw::c_int); + pub fn add_vars_to_targetlist( + root: *mut PlannerInfo, + vars: *mut List, + where_needed: Relids, + create_new_ph: bool, + ); } #[pg_guard] extern "C" { - pub fn build_simple_rel( - root: *mut PlannerInfo, - relid: ::std::os::raw::c_int, - parent: *mut RelOptInfo, - ) -> *mut RelOptInfo; + pub fn find_lateral_references(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; + pub fn create_lateral_join_info(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; + pub fn deconstruct_jointree(root: *mut PlannerInfo) -> *mut List; } #[pg_guard] extern "C" { - pub fn build_join_rel( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - sjinfo: *mut SpecialJoinInfo, - restrictlist_ptr: *mut *mut List, - ) -> *mut RelOptInfo; + pub fn distribute_restrictinfo_to_rels(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn min_join_parameterization( + pub fn process_implied_equality( root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - ) -> Relids; + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + below_outer_join: bool, + both_const: bool, + ); } #[pg_guard] extern "C" { - pub fn fetch_upper_rel( - root: *mut PlannerInfo, - kind: UpperRelationKind, - relids: Relids, - ) -> *mut RelOptInfo; + pub fn build_implied_join_equality( + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + ) -> *mut RestrictInfo; } #[pg_guard] extern "C" { - pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; + pub fn match_foreign_keys_to_quals(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn get_baserel_parampathinfo( - root: *mut PlannerInfo, - baserel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn remove_useless_joins(root: *mut PlannerInfo, joinlist: *mut List) -> *mut List; } #[pg_guard] extern "C" { - pub fn get_joinrel_parampathinfo( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outer_path: *mut Path, - inner_path: *mut Path, - sjinfo: *mut SpecialJoinInfo, - required_outer: Relids, - restrict_clauses: *mut *mut List, - ) -> *mut ParamPathInfo; + pub fn reduce_unique_semijoins(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn get_appendrel_parampathinfo( - appendrel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn query_supports_distinctness(query: *mut Query) -> bool; } #[pg_guard] extern "C" { - pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) - -> *mut ParamPathInfo; + pub fn query_is_distinct_for(query: *mut Query, colnos: *mut List, opids: *mut List) -> bool; } #[pg_guard] extern "C" { - pub fn build_child_join_rel( + pub fn innerrel_is_unique( root: *mut PlannerInfo, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - parent_joinrel: *mut RelOptInfo, - restrictlist: *mut List, - sjinfo: *mut SpecialJoinInfo, + joinrelids: Relids, + outerrelids: Relids, + innerrel: *mut RelOptInfo, jointype: JoinType, - ) -> *mut RelOptInfo; + restrictlist: *mut List, + force_cache: bool, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn set_plan_references(root: *mut PlannerInfo, plan: *mut Plan) -> *mut Plan; +} +#[pg_guard] +extern "C" { + pub fn record_plan_function_dependency(root: *mut PlannerInfo, funcid: Oid); +} +#[pg_guard] +extern "C" { + pub fn record_plan_type_dependency(root: *mut PlannerInfo, typid: Oid); +} +#[pg_guard] +extern "C" { + pub fn extract_query_dependencies_walker(node: *mut Node, root: *mut PlannerInfo) -> bool; } pub type planner_hook_type = ::std::option::Option< unsafe extern "C" fn( @@ -39424,6 +40294,100 @@ extern "C" { current_and_outer: Relids, ) -> bool; } +#[pg_guard] +extern "C" { + pub fn tlist_member(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn tlist_member_ignore_relabel(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn add_to_flat_tlist(tlist: *mut List, exprs: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_tlist_exprs(tlist: *mut List, includeJunk: bool) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_exprs(tlist1: *mut List, tlist2: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_datatypes(tlist: *mut List, colTypes: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_collations(tlist: *mut List, colCollations: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn apply_tlist_labeling(dest_tlist: *mut List, src_tlist: *mut List); +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_ops(groupClause: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_collations(groupClause: *mut List, tlist: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_cols(groupClause: *mut List, tlist: *mut List) -> *mut AttrNumber; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_sortable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_hashable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_pathtarget_from_tlist(tlist: *mut List) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn make_tlist_from_pathtarget(target: *mut PathTarget) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn copy_pathtarget(src: *mut PathTarget) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn create_empty_pathtarget() -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn add_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr, sortgroupref: Index); +} +#[pg_guard] +extern "C" { + pub fn add_new_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr); +} +#[pg_guard] +extern "C" { + pub fn add_new_columns_to_pathtarget(target: *mut PathTarget, exprs: *mut List); +} +#[pg_guard] +extern "C" { + pub fn apply_pathtarget_labeling_to_tlist(tlist: *mut List, target: *mut PathTarget); +} +#[pg_guard] +extern "C" { + pub fn split_pathtarget_at_srfs( + root: *mut PlannerInfo, + target: *mut PathTarget, + input_target: *mut PathTarget, + targets: *mut *mut List, + targets_contain_srfs: *mut *mut List, + ); +} pub const FuncDetailCode_FUNCDETAIL_NOTFOUND: FuncDetailCode = 0; pub const FuncDetailCode_FUNCDETAIL_MULTIPLE: FuncDetailCode = 1; pub const FuncDetailCode_FUNCDETAIL_NORMAL: FuncDetailCode = 2; @@ -39690,6 +40654,35 @@ extern "C" { extern "C" { pub fn SystemTypeName(name: *mut ::std::os::raw::c_char) -> *mut TypeName; } +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_name( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_type( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + vartype: *mut Oid, + vartypmod: *mut int32, + varcollid: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_is_dropped(rte: *mut RangeTblEntry, attnum: AttrNumber) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_tle_by_resno(tlist: *mut List, resno: AttrNumber) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_parse_rowmark(qry: *mut Query, rtindex: Index) -> *mut RowMarkClause; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ReorderBufferTupleBuf { @@ -40703,419 +41696,6 @@ extern "C" { extern "C" { pub fn FreeAccessStrategy(strategy: BufferAccessStrategy); } -#[pg_guard] -extern "C" { - pub fn standby_redo(record: *mut XLogReaderState); -} -#[pg_guard] -extern "C" { - pub fn standby_desc(buf: StringInfo, record: *mut XLogReaderState); -} -#[pg_guard] -extern "C" { - pub fn standby_identify(info: uint8) -> *const ::std::os::raw::c_char; -} -#[pg_guard] -extern "C" { - pub fn standby_desc_invalidations( - buf: StringInfo, - nmsgs: ::std::os::raw::c_int, - msgs: *mut SharedInvalidationMessage, - dbId: Oid, - tsId: Oid, - relcacheInitFileInval: bool, - ); -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct xl_standby_locks { - pub nlocks: ::std::os::raw::c_int, - pub locks: __IncompleteArrayField, -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct xl_running_xacts { - pub xcnt: ::std::os::raw::c_int, - pub subxcnt: ::std::os::raw::c_int, - pub subxid_overflow: bool, - pub nextXid: TransactionId, - pub oldestRunningXid: TransactionId, - pub latestCompletedXid: TransactionId, - pub xids: __IncompleteArrayField, -} -#[repr(C)] -pub struct xl_invalidations { - pub dbId: Oid, - pub tsId: Oid, - pub relcacheInitFileInval: bool, - pub nmsgs: ::std::os::raw::c_int, - pub msgs: __IncompleteArrayField, -} -impl Default for xl_invalidations { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub const ProcSignalReason_PROCSIG_CATCHUP_INTERRUPT: ProcSignalReason = 0; -pub const ProcSignalReason_PROCSIG_NOTIFY_INTERRUPT: ProcSignalReason = 1; -pub const ProcSignalReason_PROCSIG_PARALLEL_MESSAGE: ProcSignalReason = 2; -pub const ProcSignalReason_PROCSIG_WALSND_INIT_STOPPING: ProcSignalReason = 3; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_DATABASE: ProcSignalReason = 4; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_TABLESPACE: ProcSignalReason = 5; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_LOCK: ProcSignalReason = 6; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: ProcSignalReason = 7; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_BUFFERPIN: ProcSignalReason = 8; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: ProcSignalReason = 9; -pub const ProcSignalReason_NUM_PROCSIGNALS: ProcSignalReason = 10; -pub type ProcSignalReason = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn ProcSignalShmemSize() -> Size; -} -#[pg_guard] -extern "C" { - pub fn ProcSignalShmemInit(); -} -#[pg_guard] -extern "C" { - pub fn ProcSignalInit(pss_idx: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn SendProcSignal( - pid: pid_t, - reason: ProcSignalReason, - backendId: BackendId, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn procsignal_sigusr1_handler(postgres_signal_arg: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub static mut vacuum_defer_cleanup_age: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub static mut max_standby_archive_delay: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub static mut max_standby_streaming_delay: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn InitRecoveryTransactionEnvironment(); -} -#[pg_guard] -extern "C" { - pub fn ShutdownRecoveryTransactionEnvironment(); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithSnapshot(latestRemovedXid: TransactionId, node: RelFileNode); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithTablespace(tsid: Oid); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithDatabase(dbid: Oid); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithLock(locktag: LOCKTAG); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithBufferPin(); -} -#[pg_guard] -extern "C" { - pub fn CheckRecoveryConflictDeadlock(); -} -#[pg_guard] -extern "C" { - pub fn StandbyDeadLockHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyTimeoutHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyLockTimeoutHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyAcquireAccessExclusiveLock(xid: TransactionId, dbOid: Oid, relOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseLockTree( - xid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseAllLocks(); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseOldLocks(oldxid: TransactionId); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RunningTransactionsData { - pub xcnt: ::std::os::raw::c_int, - pub subxcnt: ::std::os::raw::c_int, - pub subxid_overflow: bool, - pub nextXid: TransactionId, - pub oldestRunningXid: TransactionId, - pub latestCompletedXid: TransactionId, - pub xids: *mut TransactionId, -} -impl Default for RunningTransactionsData { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type RunningTransactions = *mut RunningTransactionsData; -#[pg_guard] -extern "C" { - pub fn LogAccessExclusiveLock(dbOid: Oid, relOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn LogAccessExclusiveLockPrepare(); -} -#[pg_guard] -extern "C" { - pub fn LogStandbySnapshot() -> XLogRecPtr; -} -#[pg_guard] -extern "C" { - pub fn LogStandbyInvalidations( - nmsgs: ::std::os::raw::c_int, - msgs: *mut SharedInvalidationMessage, - relcacheInitFileInval: bool, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayShmemSize() -> Size; -} -#[pg_guard] -extern "C" { - pub fn CreateSharedProcArray(); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayAdd(proc_: *mut PGPROC); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayRemove(proc_: *mut PGPROC, latestXid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayEndTransaction(proc_: *mut PGPROC, latestXid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayClearTransaction(proc_: *mut PGPROC); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInitRecovery(initializedUptoXID: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayApplyRecoveryInfo(running: RunningTransactions); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayApplyXidAssignment( - topxid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn RecordKnownAssignedTransactionIds(xid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ExpireTreeKnownAssignedTransactionIds( - xid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - max_xid: TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn ExpireAllKnownAssignedTransactionIds(); -} -#[pg_guard] -extern "C" { - pub fn ExpireOldKnownAssignedTransactionIds(xid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn GetMaxSnapshotXidCount() -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn GetMaxSnapshotSubxidCount() -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn GetSnapshotData(snapshot: Snapshot) -> Snapshot; -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInstallImportedXmin( - xmin: TransactionId, - sourcevxid: *mut VirtualTransactionId, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInstallRestoredXmin(xmin: TransactionId, proc_: *mut PGPROC) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetRunningTransactionData() -> RunningTransactions; -} -#[pg_guard] -extern "C" { - pub fn TransactionIdIsInProgress(xid: TransactionId) -> bool; -} -#[pg_guard] -extern "C" { - pub fn TransactionIdIsActive(xid: TransactionId) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetOldestXmin(rel: Relation, flags: ::std::os::raw::c_int) -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetOldestActiveTransactionId() -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetOldestSafeDecodingTransactionId(catalogOnly: bool) -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetVirtualXIDsDelayingChkpt( - nvxids: *mut ::std::os::raw::c_int, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn HaveVirtualXIDsDelayingChkpt( - vxids: *mut VirtualTransactionId, - nvxids: ::std::os::raw::c_int, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn BackendPidGetProc(pid: ::std::os::raw::c_int) -> *mut PGPROC; -} -#[pg_guard] -extern "C" { - pub fn BackendPidGetProcWithLock(pid: ::std::os::raw::c_int) -> *mut PGPROC; -} -#[pg_guard] -extern "C" { - pub fn BackendXidGetPid(xid: TransactionId) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn IsBackendPid(pid: ::std::os::raw::c_int) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetCurrentVirtualXIDs( - limitXmin: TransactionId, - excludeXmin0: bool, - allDbs: bool, - excludeVacuum: ::std::os::raw::c_int, - nvxids: *mut ::std::os::raw::c_int, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetConflictingVirtualXIDs( - limitXmin: TransactionId, - dbOid: Oid, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn CancelVirtualTransaction(vxid: VirtualTransactionId, sigmode: ProcSignalReason) - -> pid_t; -} -#[pg_guard] -extern "C" { - pub fn MinimumActiveBackends(min: ::std::os::raw::c_int) -> bool; -} -#[pg_guard] -extern "C" { - pub fn CountDBBackends(databaseid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CountDBConnections(databaseid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CancelDBBackends(databaseid: Oid, sigmode: ProcSignalReason, conflictPending: bool); -} -#[pg_guard] -extern "C" { - pub fn CountUserBackends(roleid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CountOtherDBBackends( - databaseId: Oid, - nbackends: *mut ::std::os::raw::c_int, - nprepared: *mut ::std::os::raw::c_int, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn XidCacheRemoveRunningXids( - xid: TransactionId, - nxids: ::std::os::raw::c_int, - xids: *const TransactionId, - latestXid: TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArraySetReplicationSlotXmin( - xmin: TransactionId, - catalog_xmin: TransactionId, - already_locked: bool, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayGetReplicationSlotXmin( - xmin: *mut TransactionId, - catalog_xmin: *mut TransactionId, - ); -} pub type pg_on_exit_callback = ::std::option::Option; pub type shmem_startup_hook_type = ::std::option::Option; @@ -41164,6 +41744,419 @@ extern "C" { pub fn CreateSharedMemoryAndSemaphores(port: ::std::os::raw::c_int); } #[pg_guard] +extern "C" { + pub fn standby_redo(record: *mut XLogReaderState); +} +#[pg_guard] +extern "C" { + pub fn standby_desc(buf: StringInfo, record: *mut XLogReaderState); +} +#[pg_guard] +extern "C" { + pub fn standby_identify(info: uint8) -> *const ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn standby_desc_invalidations( + buf: StringInfo, + nmsgs: ::std::os::raw::c_int, + msgs: *mut SharedInvalidationMessage, + dbId: Oid, + tsId: Oid, + relcacheInitFileInval: bool, + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct xl_standby_locks { + pub nlocks: ::std::os::raw::c_int, + pub locks: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct xl_running_xacts { + pub xcnt: ::std::os::raw::c_int, + pub subxcnt: ::std::os::raw::c_int, + pub subxid_overflow: bool, + pub nextXid: TransactionId, + pub oldestRunningXid: TransactionId, + pub latestCompletedXid: TransactionId, + pub xids: __IncompleteArrayField, +} +#[repr(C)] +pub struct xl_invalidations { + pub dbId: Oid, + pub tsId: Oid, + pub relcacheInitFileInval: bool, + pub nmsgs: ::std::os::raw::c_int, + pub msgs: __IncompleteArrayField, +} +impl Default for xl_invalidations { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const ProcSignalReason_PROCSIG_CATCHUP_INTERRUPT: ProcSignalReason = 0; +pub const ProcSignalReason_PROCSIG_NOTIFY_INTERRUPT: ProcSignalReason = 1; +pub const ProcSignalReason_PROCSIG_PARALLEL_MESSAGE: ProcSignalReason = 2; +pub const ProcSignalReason_PROCSIG_WALSND_INIT_STOPPING: ProcSignalReason = 3; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_DATABASE: ProcSignalReason = 4; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_TABLESPACE: ProcSignalReason = 5; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_LOCK: ProcSignalReason = 6; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: ProcSignalReason = 7; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_BUFFERPIN: ProcSignalReason = 8; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: ProcSignalReason = 9; +pub const ProcSignalReason_NUM_PROCSIGNALS: ProcSignalReason = 10; +pub type ProcSignalReason = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn ProcSignalShmemSize() -> Size; +} +#[pg_guard] +extern "C" { + pub fn ProcSignalShmemInit(); +} +#[pg_guard] +extern "C" { + pub fn ProcSignalInit(pss_idx: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn SendProcSignal( + pid: pid_t, + reason: ProcSignalReason, + backendId: BackendId, + ) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn procsignal_sigusr1_handler(postgres_signal_arg: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub static mut vacuum_defer_cleanup_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut max_standby_archive_delay: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut max_standby_streaming_delay: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn InitRecoveryTransactionEnvironment(); +} +#[pg_guard] +extern "C" { + pub fn ShutdownRecoveryTransactionEnvironment(); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithSnapshot(latestRemovedXid: TransactionId, node: RelFileNode); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithTablespace(tsid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithDatabase(dbid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithLock(locktag: LOCKTAG); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithBufferPin(); +} +#[pg_guard] +extern "C" { + pub fn CheckRecoveryConflictDeadlock(); +} +#[pg_guard] +extern "C" { + pub fn StandbyDeadLockHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyTimeoutHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyLockTimeoutHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyAcquireAccessExclusiveLock(xid: TransactionId, dbOid: Oid, relOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseLockTree( + xid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseAllLocks(); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseOldLocks(oldxid: TransactionId); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RunningTransactionsData { + pub xcnt: ::std::os::raw::c_int, + pub subxcnt: ::std::os::raw::c_int, + pub subxid_overflow: bool, + pub nextXid: TransactionId, + pub oldestRunningXid: TransactionId, + pub latestCompletedXid: TransactionId, + pub xids: *mut TransactionId, +} +impl Default for RunningTransactionsData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type RunningTransactions = *mut RunningTransactionsData; +#[pg_guard] +extern "C" { + pub fn LogAccessExclusiveLock(dbOid: Oid, relOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn LogAccessExclusiveLockPrepare(); +} +#[pg_guard] +extern "C" { + pub fn LogStandbySnapshot() -> XLogRecPtr; +} +#[pg_guard] +extern "C" { + pub fn LogStandbyInvalidations( + nmsgs: ::std::os::raw::c_int, + msgs: *mut SharedInvalidationMessage, + relcacheInitFileInval: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayShmemSize() -> Size; +} +#[pg_guard] +extern "C" { + pub fn CreateSharedProcArray(); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayAdd(proc_: *mut PGPROC); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayRemove(proc_: *mut PGPROC, latestXid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayEndTransaction(proc_: *mut PGPROC, latestXid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayClearTransaction(proc_: *mut PGPROC); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInitRecovery(initializedUptoXID: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayApplyRecoveryInfo(running: RunningTransactions); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayApplyXidAssignment( + topxid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn RecordKnownAssignedTransactionIds(xid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ExpireTreeKnownAssignedTransactionIds( + xid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + max_xid: TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn ExpireAllKnownAssignedTransactionIds(); +} +#[pg_guard] +extern "C" { + pub fn ExpireOldKnownAssignedTransactionIds(xid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn GetMaxSnapshotXidCount() -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn GetMaxSnapshotSubxidCount() -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn GetSnapshotData(snapshot: Snapshot) -> Snapshot; +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInstallImportedXmin( + xmin: TransactionId, + sourcevxid: *mut VirtualTransactionId, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInstallRestoredXmin(xmin: TransactionId, proc_: *mut PGPROC) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetRunningTransactionData() -> RunningTransactions; +} +#[pg_guard] +extern "C" { + pub fn TransactionIdIsInProgress(xid: TransactionId) -> bool; +} +#[pg_guard] +extern "C" { + pub fn TransactionIdIsActive(xid: TransactionId) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetOldestXmin(rel: Relation, flags: ::std::os::raw::c_int) -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetOldestActiveTransactionId() -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetOldestSafeDecodingTransactionId(catalogOnly: bool) -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetVirtualXIDsDelayingChkpt( + nvxids: *mut ::std::os::raw::c_int, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn HaveVirtualXIDsDelayingChkpt( + vxids: *mut VirtualTransactionId, + nvxids: ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BackendPidGetProc(pid: ::std::os::raw::c_int) -> *mut PGPROC; +} +#[pg_guard] +extern "C" { + pub fn BackendPidGetProcWithLock(pid: ::std::os::raw::c_int) -> *mut PGPROC; +} +#[pg_guard] +extern "C" { + pub fn BackendXidGetPid(xid: TransactionId) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn IsBackendPid(pid: ::std::os::raw::c_int) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetCurrentVirtualXIDs( + limitXmin: TransactionId, + excludeXmin0: bool, + allDbs: bool, + excludeVacuum: ::std::os::raw::c_int, + nvxids: *mut ::std::os::raw::c_int, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetConflictingVirtualXIDs( + limitXmin: TransactionId, + dbOid: Oid, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn CancelVirtualTransaction(vxid: VirtualTransactionId, sigmode: ProcSignalReason) + -> pid_t; +} +#[pg_guard] +extern "C" { + pub fn MinimumActiveBackends(min: ::std::os::raw::c_int) -> bool; +} +#[pg_guard] +extern "C" { + pub fn CountDBBackends(databaseid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CountDBConnections(databaseid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CancelDBBackends(databaseid: Oid, sigmode: ProcSignalReason, conflictPending: bool); +} +#[pg_guard] +extern "C" { + pub fn CountUserBackends(roleid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CountOtherDBBackends( + databaseId: Oid, + nbackends: *mut ::std::os::raw::c_int, + nprepared: *mut ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn XidCacheRemoveRunningXids( + xid: TransactionId, + nxids: ::std::os::raw::c_int, + xids: *const TransactionId, + latestXid: TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArraySetReplicationSlotXmin( + xmin: TransactionId, + catalog_xmin: TransactionId, + already_locked: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayGetReplicationSlotXmin( + xmin: *mut TransactionId, + catalog_xmin: *mut TransactionId, + ); +} +#[pg_guard] extern "C" { pub static mut whereToSendOutput: CommandDest; } @@ -51951,6 +52944,57 @@ extern "C" { sec: f64, ) -> bool; } +#[pg_guard] +extern "C" { + pub static mut extra_float_digits: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float_overflow_error(); +} +#[pg_guard] +extern "C" { + pub fn float_underflow_error(); +} +#[pg_guard] +extern "C" { + pub fn float_zero_divide_error(); +} +#[pg_guard] +extern "C" { + pub fn is_infinite(val: float8) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float8in_internal( + num: *mut ::std::os::raw::c_char, + endptr_p: *mut *mut ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + orig_string: *const ::std::os::raw::c_char, + ) -> float8; +} +#[pg_guard] +extern "C" { + pub fn float8in_internal_opt_error( + num: *mut ::std::os::raw::c_char, + endptr_p: *mut *mut ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + orig_string: *const ::std::os::raw::c_char, + have_error: *mut bool, + ) -> float8; +} +#[pg_guard] +extern "C" { + pub fn float8out_internal(num: float8) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn float4_cmp_internal(a: float4, b: float4) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float8_cmp_internal(a: float8, b: float8) -> ::std::os::raw::c_int; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Point { @@ -52303,238 +53347,6 @@ extern "C" { extern "C" { pub fn JsonbTypeName(jb: *mut JsonbValue) -> *const ::std::os::raw::c_char; } -pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; -pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; -pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; -pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; -pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; -pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; -pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; -pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; -pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; -pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; -pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; -pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; -pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; -pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; -pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; -pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; -pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; -pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; -pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; -pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; -pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; -pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; -pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; -pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; -pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; -pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; -pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; -pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; -pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; -pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; -pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; -pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; -pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; -pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; -pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; -pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; -pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; -pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; -pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; -pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; -pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; -pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; -pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; -pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; -pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; -pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; -pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; -pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; -pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; -pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; -pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; -pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; -pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; -pub const SysCacheIdentifier_STATEXTDATASTXOID: SysCacheIdentifier = 55; -pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 56; -pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 57; -pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 58; -pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 59; -pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 60; -pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 61; -pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 62; -pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 63; -pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 64; -pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 65; -pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 66; -pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 67; -pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 68; -pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 69; -pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 70; -pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 71; -pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 72; -pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 73; -pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 74; -pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 75; -pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 76; -pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 77; -pub type SysCacheIdentifier = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn InitCatalogCache(); -} -#[pg_guard] -extern "C" { - pub fn InitCatalogCachePhase2(); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache3( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache4( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn ReleaseSysCache(tuple: HeapTuple); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopy( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExists( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheOid( - cacheId: ::std::os::raw::c_int, - oidcol: AttrNumber, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> Oid; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttName( - relid: Oid, - attname: *const ::std::os::raw::c_char, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SysCacheGetAttr( - cacheId: ::std::os::raw::c_int, - tup: HeapTuple, - attributeNumber: AttrNumber, - isNull: *mut bool, - ) -> Datum; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheHashValue( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> uint32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct catclist { - _unused: [u8; 0], -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheList( - cacheId: ::std::os::raw::c_int, - nkeys: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> *mut catclist; -} -#[pg_guard] -extern "C" { - pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); -} -#[pg_guard] -extern "C" { - pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationHasSysCache(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationSupportsSysCache(relid: Oid) -> bool; -} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OpBtreeInterpretation { @@ -53040,6 +53852,60 @@ extern "C" { extern "C" { pub fn get_index_isclustered(index_oid: Oid) -> bool; } +pub type SamplerRandomState = [::std::os::raw::c_ushort; 3usize]; +#[pg_guard] +extern "C" { + pub fn sampler_random_init_state( + seed: ::std::os::raw::c_long, + randstate: *mut ::std::os::raw::c_ushort, + ); +} +#[pg_guard] +extern "C" { + pub fn sampler_random_fract(randstate: *mut ::std::os::raw::c_ushort) -> f64; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BlockSamplerData { + pub N: BlockNumber, + pub n: ::std::os::raw::c_int, + pub t: BlockNumber, + pub m: ::std::os::raw::c_int, + pub randstate: SamplerRandomState, +} +pub type BlockSampler = *mut BlockSamplerData; +#[pg_guard] +extern "C" { + pub fn BlockSampler_Init( + bs: BlockSampler, + nblocks: BlockNumber, + samplesize: ::std::os::raw::c_int, + randseed: ::std::os::raw::c_long, + ); +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_HasMore(bs: BlockSampler) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_Next(bs: BlockSampler) -> BlockNumber; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ReservoirStateData { + pub W: f64, + pub randstate: SamplerRandomState, +} +pub type ReservoirState = *mut ReservoirStateData; +#[pg_guard] +extern "C" { + pub fn reservoir_init_selection_state(rs: ReservoirState, n: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn reservoir_get_next_S(rs: ReservoirState, t: f64, n: ::std::os::raw::c_int) -> f64; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VariableStatData { @@ -53369,6 +54235,238 @@ extern "C" { varRelid: ::std::os::raw::c_int, ) -> Selectivity; } +pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; +pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; +pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; +pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; +pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; +pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; +pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; +pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; +pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; +pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; +pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; +pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; +pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; +pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; +pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; +pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; +pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; +pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; +pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; +pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; +pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; +pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; +pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; +pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; +pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; +pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; +pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; +pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; +pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; +pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; +pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; +pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; +pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; +pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; +pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; +pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; +pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; +pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; +pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; +pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; +pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; +pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; +pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; +pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; +pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; +pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; +pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; +pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; +pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; +pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; +pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; +pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; +pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; +pub const SysCacheIdentifier_STATEXTDATASTXOID: SysCacheIdentifier = 55; +pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 56; +pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 57; +pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 58; +pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 59; +pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 60; +pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 61; +pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 62; +pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 63; +pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 64; +pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 65; +pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 66; +pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 67; +pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 68; +pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 69; +pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 70; +pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 71; +pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 72; +pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 73; +pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 74; +pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 75; +pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 76; +pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 77; +pub type SysCacheIdentifier = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn InitCatalogCache(); +} +#[pg_guard] +extern "C" { + pub fn InitCatalogCachePhase2(); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache3( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache4( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn ReleaseSysCache(tuple: HeapTuple); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopy( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExists( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheOid( + cacheId: ::std::os::raw::c_int, + oidcol: AttrNumber, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttName( + relid: Oid, + attname: *const ::std::os::raw::c_char, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SysCacheGetAttr( + cacheId: ::std::os::raw::c_int, + tup: HeapTuple, + attributeNumber: AttrNumber, + isNull: *mut bool, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheHashValue( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> uint32; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct catclist { + _unused: [u8; 0], +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheList( + cacheId: ::std::os::raw::c_int, + nkeys: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> *mut catclist; +} +#[pg_guard] +extern "C" { + pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); +} +#[pg_guard] +extern "C" { + pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationHasSysCache(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationSupportsSysCache(relid: Oid) -> bool; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DomainConstraintCache { @@ -57845,66 +58943,6 @@ impl std::fmt::Display for SubscriptingRef { ) } } -impl pg_sys::PgNode for SupportRequestCost { - type NodeType = SupportRequestCost; -} -impl std::fmt::Display for SupportRequestCost { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestIndexCondition { - type NodeType = SupportRequestIndexCondition; -} -impl std::fmt::Display for SupportRequestIndexCondition { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestRows { - type NodeType = SupportRequestRows; -} -impl std::fmt::Display for SupportRequestRows { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestSelectivity { - type NodeType = SupportRequestSelectivity; -} -impl std::fmt::Display for SupportRequestSelectivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestSimplify { - type NodeType = SupportRequestSimplify; -} -impl std::fmt::Display for SupportRequestSimplify { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} impl pg_sys::PgNode for TableAmRoutine { type NodeType = TableAmRoutine; } diff --git a/pgx-pg-sys/src/pg13.rs b/pgx-pg-sys/src/pg13.rs index 44f267cf4..80cf9b3fd 100644 --- a/pgx-pg-sys/src/pg13.rs +++ b/pgx-pg-sys/src/pg13.rs @@ -2910,6 +2910,12 @@ pub const XACT_XINFO_HAS_GID: u32 = 128; pub const XACT_COMPLETION_APPLY_FEEDBACK: u32 = 536870912; pub const XACT_COMPLETION_UPDATE_RELCACHE_FILE: u32 = 1073741824; pub const XACT_COMPLETION_FORCE_SYNC_COMMIT: u32 = 2147483648; +pub const PERFORM_DELETION_INTERNAL: u32 = 1; +pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; +pub const PERFORM_DELETION_QUIETLY: u32 = 4; +pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; +pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; +pub const PERFORM_DELETION_CONCURRENT_LOCK: u32 = 32; pub const DEFAULT_INDEX_TYPE: &'static [u8; 6usize] = b"btree\0"; pub const INDEX_CREATE_IS_PRIMARY: u32 = 1; pub const INDEX_CREATE_ADD_CONSTRAINT: u32 = 2; @@ -2982,24 +2988,6 @@ pub const PROARGMODE_INOUT: u8 = 98u8; pub const PROARGMODE_VARIADIC: u8 = 118u8; pub const PROARGMODE_TABLE: u8 = 116u8; pub const HEAP_TABLE_AM_HANDLER_OID: u32 = 3; -pub const PERFORM_DELETION_INTERNAL: u32 = 1; -pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2; -pub const PERFORM_DELETION_QUIETLY: u32 = 4; -pub const PERFORM_DELETION_SKIP_ORIGINAL: u32 = 8; -pub const PERFORM_DELETION_SKIP_EXTENSIONS: u32 = 16; -pub const PERFORM_DELETION_CONCURRENT_LOCK: u32 = 32; -pub const EventTriggerRelationId: u32 = 3466; -pub const Anum_pg_event_trigger_oid: u32 = 1; -pub const Anum_pg_event_trigger_evtname: u32 = 2; -pub const Anum_pg_event_trigger_evtevent: u32 = 3; -pub const Anum_pg_event_trigger_evtowner: u32 = 4; -pub const Anum_pg_event_trigger_evtfoid: u32 = 5; -pub const Anum_pg_event_trigger_evtenabled: u32 = 6; -pub const Anum_pg_event_trigger_evttags: u32 = 7; -pub const Natts_pg_event_trigger: u32 = 7; -pub const AT_REWRITE_ALTER_PERSISTENCE: u32 = 1; -pub const AT_REWRITE_DEFAULT_VAL: u32 = 2; -pub const AT_REWRITE_COLUMN_REWRITE: u32 = 4; pub const TriggerRelationId: u32 = 2620; pub const Anum_pg_trigger_oid: u32 = 1; pub const Anum_pg_trigger_tgrelid: u32 = 2; @@ -3033,6 +3021,18 @@ pub const TRIGGER_TYPE_STATEMENT: u32 = 0; pub const TRIGGER_TYPE_TIMING_MASK: u32 = 66; pub const TRIGGER_TYPE_AFTER: u32 = 0; pub const TRIGGER_TYPE_EVENT_MASK: u32 = 60; +pub const EventTriggerRelationId: u32 = 3466; +pub const Anum_pg_event_trigger_oid: u32 = 1; +pub const Anum_pg_event_trigger_evtname: u32 = 2; +pub const Anum_pg_event_trigger_evtevent: u32 = 3; +pub const Anum_pg_event_trigger_evtowner: u32 = 4; +pub const Anum_pg_event_trigger_evtfoid: u32 = 5; +pub const Anum_pg_event_trigger_evtenabled: u32 = 6; +pub const Anum_pg_event_trigger_evttags: u32 = 7; +pub const Natts_pg_event_trigger: u32 = 7; +pub const AT_REWRITE_ALTER_PERSISTENCE: u32 = 1; +pub const AT_REWRITE_DEFAULT_VAL: u32 = 2; +pub const AT_REWRITE_COLUMN_REWRITE: u32 = 4; pub const TRIGGER_EVENT_INSERT: u32 = 0; pub const TRIGGER_EVENT_DELETE: u32 = 1; pub const TRIGGER_EVENT_UPDATE: u32 = 2; @@ -3055,6 +3055,52 @@ pub const TRIGGER_DISABLED: u8 = 68u8; pub const RI_TRIGGER_PK: u32 = 1; pub const RI_TRIGGER_FK: u32 = 2; pub const RI_TRIGGER_NONE: u32 = 0; +pub const StatisticRelationId: u32 = 2619; +pub const Anum_pg_statistic_starelid: u32 = 1; +pub const Anum_pg_statistic_staattnum: u32 = 2; +pub const Anum_pg_statistic_stainherit: u32 = 3; +pub const Anum_pg_statistic_stanullfrac: u32 = 4; +pub const Anum_pg_statistic_stawidth: u32 = 5; +pub const Anum_pg_statistic_stadistinct: u32 = 6; +pub const Anum_pg_statistic_stakind1: u32 = 7; +pub const Anum_pg_statistic_stakind2: u32 = 8; +pub const Anum_pg_statistic_stakind3: u32 = 9; +pub const Anum_pg_statistic_stakind4: u32 = 10; +pub const Anum_pg_statistic_stakind5: u32 = 11; +pub const Anum_pg_statistic_staop1: u32 = 12; +pub const Anum_pg_statistic_staop2: u32 = 13; +pub const Anum_pg_statistic_staop3: u32 = 14; +pub const Anum_pg_statistic_staop4: u32 = 15; +pub const Anum_pg_statistic_staop5: u32 = 16; +pub const Anum_pg_statistic_stacoll1: u32 = 17; +pub const Anum_pg_statistic_stacoll2: u32 = 18; +pub const Anum_pg_statistic_stacoll3: u32 = 19; +pub const Anum_pg_statistic_stacoll4: u32 = 20; +pub const Anum_pg_statistic_stacoll5: u32 = 21; +pub const Anum_pg_statistic_stanumbers1: u32 = 22; +pub const Anum_pg_statistic_stanumbers2: u32 = 23; +pub const Anum_pg_statistic_stanumbers3: u32 = 24; +pub const Anum_pg_statistic_stanumbers4: u32 = 25; +pub const Anum_pg_statistic_stanumbers5: u32 = 26; +pub const Anum_pg_statistic_stavalues1: u32 = 27; +pub const Anum_pg_statistic_stavalues2: u32 = 28; +pub const Anum_pg_statistic_stavalues3: u32 = 29; +pub const Anum_pg_statistic_stavalues4: u32 = 30; +pub const Anum_pg_statistic_stavalues5: u32 = 31; +pub const Natts_pg_statistic: u32 = 31; +pub const STATISTIC_KIND_MCV: u32 = 1; +pub const STATISTIC_KIND_HISTOGRAM: u32 = 2; +pub const STATISTIC_KIND_CORRELATION: u32 = 3; +pub const STATISTIC_KIND_MCELEM: u32 = 4; +pub const STATISTIC_KIND_DECHIST: u32 = 5; +pub const STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM: u32 = 6; +pub const STATISTIC_KIND_BOUNDS_HISTOGRAM: u32 = 7; +pub const STATISTIC_NUM_SLOTS: u32 = 5; +pub const VACUUM_OPTION_NO_PARALLEL: u32 = 0; +pub const VACUUM_OPTION_PARALLEL_BULKDEL: u32 = 1; +pub const VACUUM_OPTION_PARALLEL_COND_CLEANUP: u32 = 2; +pub const VACUUM_OPTION_PARALLEL_CLEANUP: u32 = 4; +pub const VACUUM_OPTION_MAX_VALID_VALUE: u32 = 7; pub const CACHEDPLANSOURCE_MAGIC: u32 = 195726186; pub const CACHEDPLAN_MAGIC: u32 = 953717834; pub const CACHEDEXPR_MAGIC: u32 = 838275847; @@ -3131,6 +3177,7 @@ pub const PVC_INCLUDE_WINDOWFUNCS: u32 = 4; pub const PVC_RECURSE_WINDOWFUNCS: u32 = 8; pub const PVC_INCLUDE_PLACEHOLDERS: u32 = 16; pub const PVC_RECURSE_PLACEHOLDERS: u32 = 32; +pub const DEFAULT_CURSOR_TUPLE_FRACTION: f64 = 0.1; pub const RBTXN_HAS_CATALOG_CHANGES: u32 = 1; pub const RBTXN_IS_SUBXACT: u32 = 2; pub const RBTXN_IS_SERIALIZED: u32 = 4; @@ -3162,6 +3209,7 @@ pub const FORMAT_TYPE_TYPEMOD_GIVEN: u32 = 1; pub const FORMAT_TYPE_ALLOW_INVALID: u32 = 2; pub const FORMAT_TYPE_FORCE_QUALIFY: u32 = 4; pub const MAX_TIME_PRECISION: u32 = 6; +pub const RADIANS_PER_DEGREE: f64 = 0.017453292519943295; pub const NUMERIC_MAX_PRECISION: u32 = 1000; pub const NUMERIC_MAX_DISPLAY_SCALE: u32 = 1000; pub const NUMERIC_MIN_DISPLAY_SCALE: u32 = 0; @@ -29957,11 +30005,6 @@ extern "C" { pub struct BulkInsertStateData { _unused: [u8; 0], } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VacuumParams { - _unused: [u8; 0], -} pub const ScanOptions_SO_TYPE_SEQSCAN: ScanOptions = 1; pub const ScanOptions_SO_TYPE_BITMAPSCAN: ScanOptions = 2; pub const ScanOptions_SO_TYPE_SAMPLESCAN: ScanOptions = 4; @@ -32272,6 +32315,317 @@ extern "C" { extern "C" { pub fn IsInParallelMode() -> bool; } +pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; +pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; +pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; +pub const DependencyType_DEPENDENCY_PARTITION_PRI: DependencyType = 80; +pub const DependencyType_DEPENDENCY_PARTITION_SEC: DependencyType = 83; +pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; +pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; +pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; +pub type DependencyType = ::std::os::raw::c_uint; +pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; +pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; +pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; +pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; +pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; +pub type SharedDependencyType = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectAddresses { + _unused: [u8; 0], +} +pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; +pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; +pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; +pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; +pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; +pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; +pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; +pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; +pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; +pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; +pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; +pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; +pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; +pub const ObjectClass_OCLASS_AM: ObjectClass = 13; +pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; +pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; +pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; +pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; +pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; +pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; +pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; +pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; +pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; +pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; +pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; +pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; +pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; +pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; +pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; +pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; +pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; +pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; +pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; +pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; +pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; +pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; +pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; +pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; +pub type ObjectClass = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn ReleaseDeletionLock(object: *const ObjectAddress); +} +#[pg_guard] +extern "C" { + pub fn performDeletion( + object: *const ObjectAddress, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn performMultipleDeletions( + objects: *const ObjectAddresses, + behavior: DropBehavior, + flags: ::std::os::raw::c_int, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnExpr( + depender: *const ObjectAddress, + expr: *mut Node, + rtable: *mut List, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnSingleRelExpr( + depender: *const ObjectAddress, + expr: *mut Node, + relId: Oid, + behavior: DependencyType, + self_behavior: DependencyType, + reverse_self: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; +} +#[pg_guard] +extern "C" { + pub fn new_object_addresses() -> *mut ObjectAddresses; +} +#[pg_guard] +extern "C" { + pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn object_address_present( + object: *const ObjectAddress, + addrs: *const ObjectAddresses, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn record_object_address_dependencies( + depender: *const ObjectAddress, + referenced: *mut ObjectAddresses, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn sort_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn free_object_addresses(addrs: *mut ObjectAddresses); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOn( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordMultipleDependencies( + depender: *const ObjectAddress, + referenced: *const ObjectAddress, + nreferenced: ::std::os::raw::c_int, + behavior: DependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsFor( + classId: Oid, + objectId: Oid, + skipExtensionDeps: bool, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsForClass( + classId: Oid, + objectId: Oid, + refclassId: Oid, + deptype: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn deleteDependencyRecordsForSpecific( + classId: Oid, + objectId: Oid, + deptype: ::std::os::raw::c_char, + refclassId: Oid, + refobjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependencyFor( + classId: Oid, + objectId: Oid, + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependenciesOf( + classId: Oid, + oldObjectId: Oid, + newObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn changeDependenciesOn( + refClassId: Oid, + oldRefObjectId: Oid, + newRefObjectId: Oid, + ) -> ::std::os::raw::c_long; +} +#[pg_guard] +extern "C" { + pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn sequenceIsOwned( + seqId: Oid, + deptype: ::std::os::raw::c_char, + tableId: *mut Oid, + colId: *mut int32, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn getOwnedSequences(relid: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn getIdentitySequence(relid: Oid, attnum: AttrNumber, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_constraint_index(constraintId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_constraint(indexId: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_index_ref_constraints(indexId: Oid) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn recordSharedDependencyOn( + depender: *mut ObjectAddress, + referenced: *mut ObjectAddress, + deptype: SharedDependencyType, + ); +} +#[pg_guard] +extern "C" { + pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); +} +#[pg_guard] +extern "C" { + pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); +} +#[pg_guard] +extern "C" { + pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); +} +#[pg_guard] +extern "C" { + pub fn updateAclDependencies( + classId: Oid, + objectId: Oid, + objectSubId: int32, + ownerId: Oid, + noldmembers: ::std::os::raw::c_int, + oldmembers: *mut Oid, + nnewmembers: ::std::os::raw::c_int, + newmembers: *mut Oid, + ); +} +#[pg_guard] +extern "C" { + pub fn checkSharedDependencies( + classId: Oid, + objectId: Oid, + detail_msg: *mut *mut ::std::os::raw::c_char, + detail_log_msg: *mut *mut ::std::os::raw::c_char, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); +} +#[pg_guard] +extern "C" { + pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); +} +#[pg_guard] +extern "C" { + pub fn dropDatabaseDependencies(databaseId: Oid); +} +#[pg_guard] +extern "C" { + pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); +} +#[pg_guard] +extern "C" { + pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); +} pub const IndexStateFlagsAction_INDEX_CREATE_SET_READY: IndexStateFlagsAction = 0; pub const IndexStateFlagsAction_INDEX_CREATE_SET_VALID: IndexStateFlagsAction = 1; pub const IndexStateFlagsAction_INDEX_DROP_CLEAR_VALID: IndexStateFlagsAction = 2; @@ -32946,6 +33300,30 @@ extern "C" { pub fn oid_array_to_list(datum: Datum) -> *mut List; } #[repr(C)] +pub struct FormData_pg_trigger { + pub oid: Oid, + pub tgrelid: Oid, + pub tgparentid: Oid, + pub tgname: NameData, + pub tgfoid: Oid, + pub tgtype: int16, + pub tgenabled: ::std::os::raw::c_char, + pub tgisinternal: bool, + pub tgconstrrelid: Oid, + pub tgconstrindid: Oid, + pub tgconstraint: Oid, + pub tgdeferrable: bool, + pub tginitdeferred: bool, + pub tgnargs: int16, + pub tgattr: int2vector, +} +impl Default for FormData_pg_trigger { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type Form_pg_trigger = *mut FormData_pg_trigger; +#[repr(C)] #[derive(Copy, Clone)] pub struct FormData_pg_type { pub oid: Oid, @@ -33341,316 +33719,451 @@ extern "C" { ctype: *const ::std::os::raw::c_char, ); } -pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110; -pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97; -pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105; -pub const DependencyType_DEPENDENCY_PARTITION_PRI: DependencyType = 80; -pub const DependencyType_DEPENDENCY_PARTITION_SEC: DependencyType = 83; -pub const DependencyType_DEPENDENCY_EXTENSION: DependencyType = 101; -pub const DependencyType_DEPENDENCY_AUTO_EXTENSION: DependencyType = 120; -pub const DependencyType_DEPENDENCY_PIN: DependencyType = 112; -pub type DependencyType = ::std::os::raw::c_uint; -pub const SharedDependencyType_SHARED_DEPENDENCY_PIN: SharedDependencyType = 112; -pub const SharedDependencyType_SHARED_DEPENDENCY_OWNER: SharedDependencyType = 111; -pub const SharedDependencyType_SHARED_DEPENDENCY_ACL: SharedDependencyType = 97; -pub const SharedDependencyType_SHARED_DEPENDENCY_POLICY: SharedDependencyType = 114; -pub const SharedDependencyType_SHARED_DEPENDENCY_INVALID: SharedDependencyType = 0; -pub type SharedDependencyType = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectAddresses { - _unused: [u8; 0], +#[pg_guard] +extern "C" { + pub fn RemoveObjects(stmt: *mut DropStmt); } -pub const ObjectClass_OCLASS_CLASS: ObjectClass = 0; -pub const ObjectClass_OCLASS_PROC: ObjectClass = 1; -pub const ObjectClass_OCLASS_TYPE: ObjectClass = 2; -pub const ObjectClass_OCLASS_CAST: ObjectClass = 3; -pub const ObjectClass_OCLASS_COLLATION: ObjectClass = 4; -pub const ObjectClass_OCLASS_CONSTRAINT: ObjectClass = 5; -pub const ObjectClass_OCLASS_CONVERSION: ObjectClass = 6; -pub const ObjectClass_OCLASS_DEFAULT: ObjectClass = 7; -pub const ObjectClass_OCLASS_LANGUAGE: ObjectClass = 8; -pub const ObjectClass_OCLASS_LARGEOBJECT: ObjectClass = 9; -pub const ObjectClass_OCLASS_OPERATOR: ObjectClass = 10; -pub const ObjectClass_OCLASS_OPCLASS: ObjectClass = 11; -pub const ObjectClass_OCLASS_OPFAMILY: ObjectClass = 12; -pub const ObjectClass_OCLASS_AM: ObjectClass = 13; -pub const ObjectClass_OCLASS_AMOP: ObjectClass = 14; -pub const ObjectClass_OCLASS_AMPROC: ObjectClass = 15; -pub const ObjectClass_OCLASS_REWRITE: ObjectClass = 16; -pub const ObjectClass_OCLASS_TRIGGER: ObjectClass = 17; -pub const ObjectClass_OCLASS_SCHEMA: ObjectClass = 18; -pub const ObjectClass_OCLASS_STATISTIC_EXT: ObjectClass = 19; -pub const ObjectClass_OCLASS_TSPARSER: ObjectClass = 20; -pub const ObjectClass_OCLASS_TSDICT: ObjectClass = 21; -pub const ObjectClass_OCLASS_TSTEMPLATE: ObjectClass = 22; -pub const ObjectClass_OCLASS_TSCONFIG: ObjectClass = 23; -pub const ObjectClass_OCLASS_ROLE: ObjectClass = 24; -pub const ObjectClass_OCLASS_DATABASE: ObjectClass = 25; -pub const ObjectClass_OCLASS_TBLSPACE: ObjectClass = 26; -pub const ObjectClass_OCLASS_FDW: ObjectClass = 27; -pub const ObjectClass_OCLASS_FOREIGN_SERVER: ObjectClass = 28; -pub const ObjectClass_OCLASS_USER_MAPPING: ObjectClass = 29; -pub const ObjectClass_OCLASS_DEFACL: ObjectClass = 30; -pub const ObjectClass_OCLASS_EXTENSION: ObjectClass = 31; -pub const ObjectClass_OCLASS_EVENT_TRIGGER: ObjectClass = 32; -pub const ObjectClass_OCLASS_POLICY: ObjectClass = 33; -pub const ObjectClass_OCLASS_PUBLICATION: ObjectClass = 34; -pub const ObjectClass_OCLASS_PUBLICATION_REL: ObjectClass = 35; -pub const ObjectClass_OCLASS_SUBSCRIPTION: ObjectClass = 36; -pub const ObjectClass_OCLASS_TRANSFORM: ObjectClass = 37; -pub type ObjectClass = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn AcquireDeletionLock(object: *const ObjectAddress, flags: ::std::os::raw::c_int); + pub fn DefineIndex( + relationId: Oid, + stmt: *mut IndexStmt, + indexRelationId: Oid, + parentIndexId: Oid, + parentConstraintId: Oid, + is_alter_table: bool, + check_rights: bool, + check_not_in_use: bool, + skip_build: bool, + quiet: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn ReleaseDeletionLock(object: *const ObjectAddress); + pub fn ReindexIndex( + indexRelation: *mut RangeVar, + options: ::std::os::raw::c_int, + concurrent: bool, + ); } #[pg_guard] extern "C" { - pub fn performDeletion( - object: *const ObjectAddress, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn ReindexTable( + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + concurrent: bool, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ReindexMultipleTables( + objectName: *const ::std::os::raw::c_char, + objectKind: ReindexObjectType, + options: ::std::os::raw::c_int, + concurrent: bool, ); } #[pg_guard] extern "C" { - pub fn performMultipleDeletions( - objects: *const ObjectAddresses, - behavior: DropBehavior, - flags: ::std::os::raw::c_int, + pub fn makeObjectName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn ChooseRelationName( + name1: *const ::std::os::raw::c_char, + name2: *const ::std::os::raw::c_char, + label: *const ::std::os::raw::c_char, + namespaceid: Oid, + isconstraint: bool, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn CheckIndexCompatible( + oldId: Oid, + accessMethodName: *const ::std::os::raw::c_char, + attributeList: *mut List, + exclusionOpNames: *mut List, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetDefaultOpClass(type_id: Oid, am_id: Oid) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn ResolveOpClass( + opclass: *mut List, + attrType: Oid, + accessMethodName: *const ::std::os::raw::c_char, + accessMethodId: Oid, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn CreateFunction(pstate: *mut ParseState, stmt: *mut CreateFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveFunctionById(funcOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn AlterFunction(pstate: *mut ParseState, stmt: *mut AlterFunctionStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn CreateCast(stmt: *mut CreateCastStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropCastById(castOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateTransform(stmt: *mut CreateTransformStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn DropTransformById(transformOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereFunctionInNamespace( + proname: *const ::std::os::raw::c_char, + pronargs: ::std::os::raw::c_int, + proargtypes: *mut oidvector, + nspOid: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnExpr( - depender: *const ObjectAddress, - expr: *mut Node, - rtable: *mut List, - behavior: DependencyType, + pub fn ExecuteDoStmt(stmt: *mut DoStmt, atomic: bool); +} +#[pg_guard] +extern "C" { + pub fn ExecuteCallStmt( + stmt: *mut CallStmt, + params: ParamListInfo, + atomic: bool, + dest: *mut DestReceiver, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnSingleRelExpr( - depender: *const ObjectAddress, - expr: *mut Node, - relId: Oid, - behavior: DependencyType, - self_behavior: DependencyType, - reverse_self: bool, + pub fn CallStmtResultDesc(stmt: *mut CallStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn get_transform_oid(type_id: Oid, lang_id: Oid, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn interpret_function_parameter_list( + pstate: *mut ParseState, + parameters: *mut List, + languageOid: Oid, + objtype: ObjectType, + parameterTypes: *mut *mut oidvector, + allParameterTypes: *mut *mut ArrayType, + parameterModes: *mut *mut ArrayType, + parameterNames: *mut *mut ArrayType, + parameterDefaults: *mut *mut List, + variadicArgType: *mut Oid, + requiredResultType: *mut Oid, ); } #[pg_guard] extern "C" { - pub fn getObjectClass(object: *const ObjectAddress) -> ObjectClass; + pub fn DefineOperator(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn new_object_addresses() -> *mut ObjectAddresses; + pub fn RemoveOperatorById(operOid: Oid); } #[pg_guard] extern "C" { - pub fn add_exact_object_address(object: *const ObjectAddress, addrs: *mut ObjectAddresses); + pub fn AlterOperator(stmt: *mut AlterOperatorStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn object_address_present( - object: *const ObjectAddress, - addrs: *const ObjectAddresses, - ) -> bool; + pub fn CreateStatistics(stmt: *mut CreateStatsStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn record_object_address_dependencies( - depender: *const ObjectAddress, - referenced: *mut ObjectAddresses, - behavior: DependencyType, + pub fn AlterStatistics(stmt: *mut AlterStatsStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveStatisticsById(statsOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn UpdateStatisticsForTypeChange( + statsOid: Oid, + relationOid: Oid, + attnum: ::std::os::raw::c_int, + oldColumnType: Oid, + newColumnType: Oid, ); } #[pg_guard] extern "C" { - pub fn sort_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineAggregate( + pstate: *mut ParseState, + name: *mut List, + args: *mut List, + oldstyle: bool, + parameters: *mut List, + replace: bool, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn free_object_addresses(addrs: *mut ObjectAddresses); + pub fn DefineOpClass(stmt: *mut CreateOpClassStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordDependencyOn( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - behavior: DependencyType, + pub fn DefineOpFamily(stmt: *mut CreateOpFamilyStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn AlterOpFamily(stmt: *mut AlterOpFamilyStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveOpClassById(opclassOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveOpFamilyById(opfamilyOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmOpEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn RemoveAmProcEntryById(entryOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn IsThereOpClassInNamespace( + opcname: *const ::std::os::raw::c_char, + opcmethod: Oid, + opcnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordMultipleDependencies( - depender: *const ObjectAddress, - referenced: *const ObjectAddress, - nreferenced: ::std::os::raw::c_int, - behavior: DependencyType, + pub fn IsThereOpFamilyInNamespace( + opfname: *const ::std::os::raw::c_char, + opfmethod: Oid, + opfnamespace: Oid, ); } #[pg_guard] extern "C" { - pub fn recordDependencyOnCurrentExtension(object: *const ObjectAddress, isReplace: bool); + pub fn get_opclass_oid(amID: Oid, opclassname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsFor( - classId: Oid, - objectId: Oid, - skipExtensionDeps: bool, - ) -> ::std::os::raw::c_long; + pub fn get_opfamily_oid(amID: Oid, opfamilyname: *mut List, missing_ok: bool) -> Oid; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsForClass( - classId: Oid, - objectId: Oid, - refclassId: Oid, - deptype: ::std::os::raw::c_char, - ) -> ::std::os::raw::c_long; + pub fn DefineTSParser(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn deleteDependencyRecordsForSpecific( - classId: Oid, - objectId: Oid, - deptype: ::std::os::raw::c_char, - refclassId: Oid, - refobjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSParserById(prsId: Oid); } #[pg_guard] extern "C" { - pub fn changeDependencyFor( - classId: Oid, - objectId: Oid, - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn DefineTSDictionary(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn changeDependenciesOf( - classId: Oid, - oldObjectId: Oid, - newObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn RemoveTSDictionaryById(dictId: Oid); } #[pg_guard] extern "C" { - pub fn changeDependenciesOn( - refClassId: Oid, - oldRefObjectId: Oid, - newRefObjectId: Oid, - ) -> ::std::os::raw::c_long; + pub fn AlterTSDictionary(stmt: *mut AlterTSDictionaryStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getExtensionOfObject(classId: Oid, objectId: Oid) -> Oid; + pub fn DefineTSTemplate(names: *mut List, parameters: *mut List) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getAutoExtensionsOfObject(classId: Oid, objectId: Oid) -> *mut List; + pub fn RemoveTSTemplateById(tmplId: Oid); } #[pg_guard] extern "C" { - pub fn sequenceIsOwned( - seqId: Oid, - deptype: ::std::os::raw::c_char, - tableId: *mut Oid, - colId: *mut int32, - ) -> bool; + pub fn DefineTSConfiguration( + names: *mut List, + parameters: *mut List, + copied: *mut ObjectAddress, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn getOwnedSequences(relid: Oid) -> *mut List; + pub fn RemoveTSConfigurationById(cfgId: Oid); } #[pg_guard] extern "C" { - pub fn getIdentitySequence(relid: Oid, attnum: AttrNumber, missing_ok: bool) -> Oid; + pub fn AlterTSConfiguration(stmt: *mut AlterTSConfigurationStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn get_constraint_index(constraintId: Oid) -> Oid; + pub fn serialize_deflist(deflist: *mut List) -> *mut text; } #[pg_guard] extern "C" { - pub fn get_index_constraint(indexId: Oid) -> Oid; + pub fn deserialize_deflist(txt: Datum) -> *mut List; } #[pg_guard] extern "C" { - pub fn get_index_ref_constraints(indexId: Oid) -> *mut List; + pub fn AlterForeignServerOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordSharedDependencyOn( - depender: *mut ObjectAddress, - referenced: *mut ObjectAddress, - deptype: SharedDependencyType, - ); + pub fn AlterForeignServerOwner_oid(arg1: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn deleteSharedDependencyRecordsFor(classId: Oid, objectId: Oid, objectSubId: int32); + pub fn AlterForeignDataWrapperOwner( + name: *const ::std::os::raw::c_char, + newOwnerId: Oid, + ) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn recordDependencyOnOwner(classId: Oid, objectId: Oid, owner: Oid); + pub fn AlterForeignDataWrapperOwner_oid(fwdId: Oid, newOwnerId: Oid); } #[pg_guard] extern "C" { - pub fn changeDependencyOnOwner(classId: Oid, objectId: Oid, newOwnerId: Oid); + pub fn CreateForeignDataWrapper(stmt: *mut CreateFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn updateAclDependencies( - classId: Oid, - objectId: Oid, - objectSubId: int32, - ownerId: Oid, - noldmembers: ::std::os::raw::c_int, - oldmembers: *mut Oid, - nnewmembers: ::std::os::raw::c_int, - newmembers: *mut Oid, - ); + pub fn AlterForeignDataWrapper(stmt: *mut AlterFdwStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn checkSharedDependencies( - classId: Oid, - objectId: Oid, - detail_msg: *mut *mut ::std::os::raw::c_char, - detail_log_msg: *mut *mut ::std::os::raw::c_char, - ) -> bool; + pub fn RemoveForeignDataWrapperById(fdwId: Oid); } #[pg_guard] extern "C" { - pub fn shdepLockAndCheckObject(classId: Oid, objectId: Oid); + pub fn CreateForeignServer(stmt: *mut CreateForeignServerStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn copyTemplateDependencies(templateDbId: Oid, newDbId: Oid); + pub fn AlterForeignServer(stmt: *mut AlterForeignServerStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn dropDatabaseDependencies(databaseId: Oid); + pub fn RemoveForeignServerById(srvId: Oid); } #[pg_guard] extern "C" { - pub fn shdepDropOwned(relids: *mut List, behavior: DropBehavior); + pub fn CreateUserMapping(stmt: *mut CreateUserMappingStmt) -> ObjectAddress; } #[pg_guard] extern "C" { - pub fn shdepReassignOwned(relids: *mut List, newrole: Oid); + pub fn AlterUserMapping(stmt: *mut AlterUserMappingStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMapping(stmt: *mut DropUserMappingStmt) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn RemoveUserMappingById(umId: Oid); +} +#[pg_guard] +extern "C" { + pub fn CreateForeignTable(stmt: *mut CreateForeignTableStmt, relid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ImportForeignSchema(stmt: *mut ImportForeignSchemaStmt); +} +#[pg_guard] +extern "C" { + pub fn transformGenericOptions( + catalogId: Oid, + oldOptions: Datum, + options: *mut List, + fdwvalidator: Oid, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn CreateAccessMethod(stmt: *mut CreateAmStmt) -> ObjectAddress; +} +#[pg_guard] +extern "C" { + pub fn RemoveAccessMethodById(amOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn get_index_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_table_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_oid(amname: *const ::std::os::raw::c_char, missing_ok: bool) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn get_am_name(amOid: Oid) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetString(def: *mut DefElem) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn defGetNumeric(def: *mut DefElem) -> f64; +} +#[pg_guard] +extern "C" { + pub fn defGetBoolean(def: *mut DefElem) -> bool; +} +#[pg_guard] +extern "C" { + pub fn defGetInt32(def: *mut DefElem) -> int32; +} +#[pg_guard] +extern "C" { + pub fn defGetInt64(def: *mut DefElem) -> int64; +} +#[pg_guard] +extern "C" { + pub fn defGetQualifiedName(def: *mut DefElem) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeName(def: *mut DefElem) -> *mut TypeName; +} +#[pg_guard] +extern "C" { + pub fn defGetTypeLength(def: *mut DefElem) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn defGetStringList(def: *mut DefElem) -> *mut List; } #[repr(C)] #[derive(Copy, Clone)] @@ -33961,6 +34474,221 @@ extern "C" { extern "C" { pub fn EventTriggerCollectAlterDefPrivs(stmt: *mut AlterDefaultPrivilegesStmt); } +pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; +pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; +pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; +pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; +pub type ExplainFormat = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExplainWorkersState { + pub num_workers: ::std::os::raw::c_int, + pub worker_inited: *mut bool, + pub worker_str: *mut StringInfoData, + pub worker_state_save: *mut ::std::os::raw::c_int, + pub prev_str: StringInfo, +} +impl Default for ExplainWorkersState { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExplainState { + pub str_: StringInfo, + pub verbose: bool, + pub analyze: bool, + pub costs: bool, + pub buffers: bool, + pub wal: bool, + pub timing: bool, + pub summary: bool, + pub settings: bool, + pub format: ExplainFormat, + pub indent: ::std::os::raw::c_int, + pub grouping_stack: *mut List, + pub pstmt: *mut PlannedStmt, + pub rtable: *mut List, + pub rtable_names: *mut List, + pub deparse_cxt: *mut List, + pub printed_subplans: *mut Bitmapset, + pub hide_workers: bool, + pub workers_state: *mut ExplainWorkersState, +} +impl Default for ExplainState { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type ExplainOneQuery_hook_type = ::std::option::Option< + unsafe extern "C" fn( + query: *mut Query, + cursorOptions: ::std::os::raw::c_int, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ), +>; +#[pg_guard] +extern "C" { + pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; +} +pub type explain_get_index_name_hook_type = + ::std::option::Option *const ::std::os::raw::c_char>; +#[pg_guard] +extern "C" { + pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; +} +#[pg_guard] +extern "C" { + pub fn ExplainQuery( + pstate: *mut ParseState, + stmt: *mut ExplainStmt, + params: ParamListInfo, + dest: *mut DestReceiver, + ); +} +#[pg_guard] +extern "C" { + pub fn NewExplainState() -> *mut ExplainState; +} +#[pg_guard] +extern "C" { + pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; +} +#[pg_guard] +extern "C" { + pub fn ExplainOneUtility( + utilityStmt: *mut Node, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOnePlan( + plannedstmt: *mut PlannedStmt, + into: *mut IntoClause, + es: *mut ExplainState, + queryString: *const ::std::os::raw::c_char, + params: ParamListInfo, + queryEnv: *mut QueryEnvironment, + planduration: *const instr_time, + bufusage: *const BufferUsage, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); +} +#[pg_guard] +extern "C" { + pub fn ExplainBeginOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainEndOutput(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainSeparatePlans(es: *mut ExplainState); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyList( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyListNested( + qlabel: *const ::std::os::raw::c_char, + data: *mut List, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyText( + qlabel: *const ::std::os::raw::c_char, + value: *const ::std::os::raw::c_char, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyInteger( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: int64, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyUInteger( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: uint64, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyFloat( + qlabel: *const ::std::os::raw::c_char, + unit: *const ::std::os::raw::c_char, + value: f64, + ndigits: ::std::os::raw::c_int, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainPropertyBool( + qlabel: *const ::std::os::raw::c_char, + value: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainOpenGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} +#[pg_guard] +extern "C" { + pub fn ExplainCloseGroup( + objtype: *const ::std::os::raw::c_char, + labelname: *const ::std::os::raw::c_char, + labeled: bool, + es: *mut ExplainState, + ); +} #[pg_guard] extern "C" { pub fn CreateProceduralLanguage(stmt: *mut CreatePLangStmt) -> ObjectAddress; @@ -34151,30 +34879,6 @@ extern "C" { partConstraint: *mut List, ) -> bool; } -#[repr(C)] -pub struct FormData_pg_trigger { - pub oid: Oid, - pub tgrelid: Oid, - pub tgparentid: Oid, - pub tgname: NameData, - pub tgfoid: Oid, - pub tgtype: int16, - pub tgenabled: ::std::os::raw::c_char, - pub tgisinternal: bool, - pub tgconstrrelid: Oid, - pub tgconstrindid: Oid, - pub tgconstraint: Oid, - pub tgdeferrable: bool, - pub tginitdeferred: bool, - pub tgnargs: int16, - pub tgattr: int2vector, -} -impl Default for FormData_pg_trigger { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type Form_pg_trigger = *mut FormData_pg_trigger; pub type TriggerEvent = uint32; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -34486,6 +35190,271 @@ extern "C" { extern "C" { pub fn RI_FKey_trigger_type(tgfoid: Oid) -> ::std::os::raw::c_int; } +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct FormData_pg_statistic { + pub starelid: Oid, + pub staattnum: int16, + pub stainherit: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind1: int16, + pub stakind2: int16, + pub stakind3: int16, + pub stakind4: int16, + pub stakind5: int16, + pub staop1: Oid, + pub staop2: Oid, + pub staop3: Oid, + pub staop4: Oid, + pub staop5: Oid, + pub stacoll1: Oid, + pub stacoll2: Oid, + pub stacoll3: Oid, + pub stacoll4: Oid, + pub stacoll5: Oid, +} +pub type Form_pg_statistic = *mut FormData_pg_statistic; +pub type VacAttrStatsP = *mut VacAttrStats; +pub type AnalyzeAttrFetchFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + rownum: ::std::os::raw::c_int, + isNull: *mut bool, + ) -> Datum, +>; +pub type AnalyzeAttrComputeStatsFunc = ::std::option::Option< + unsafe extern "C" fn( + stats: VacAttrStatsP, + fetchfunc: AnalyzeAttrFetchFunc, + samplerows: ::std::os::raw::c_int, + totalrows: f64, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacAttrStats { + pub attr: Form_pg_attribute, + pub attrtypid: Oid, + pub attrtypmod: int32, + pub attrtype: Form_pg_type, + pub attrcollid: Oid, + pub anl_context: MemoryContext, + pub compute_stats: AnalyzeAttrComputeStatsFunc, + pub minrows: ::std::os::raw::c_int, + pub extra_data: *mut ::std::os::raw::c_void, + pub stats_valid: bool, + pub stanullfrac: float4, + pub stawidth: int32, + pub stadistinct: float4, + pub stakind: [int16; 5usize], + pub staop: [Oid; 5usize], + pub stacoll: [Oid; 5usize], + pub numnumbers: [::std::os::raw::c_int; 5usize], + pub stanumbers: [*mut float4; 5usize], + pub numvalues: [::std::os::raw::c_int; 5usize], + pub stavalues: [*mut Datum; 5usize], + pub statypid: [Oid; 5usize], + pub statyplen: [int16; 5usize], + pub statypbyval: [bool; 5usize], + pub statypalign: [::std::os::raw::c_char; 5usize], + pub tupattnum: ::std::os::raw::c_int, + pub rows: *mut HeapTuple, + pub tupDesc: TupleDesc, + pub exprvals: *mut Datum, + pub exprnulls: *mut bool, + pub rowstride: ::std::os::raw::c_int, +} +impl Default for VacAttrStats { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const VacuumOption_VACOPT_VACUUM: VacuumOption = 1; +pub const VacuumOption_VACOPT_ANALYZE: VacuumOption = 2; +pub const VacuumOption_VACOPT_VERBOSE: VacuumOption = 4; +pub const VacuumOption_VACOPT_FREEZE: VacuumOption = 8; +pub const VacuumOption_VACOPT_FULL: VacuumOption = 16; +pub const VacuumOption_VACOPT_SKIP_LOCKED: VacuumOption = 32; +pub const VacuumOption_VACOPT_SKIPTOAST: VacuumOption = 64; +pub const VacuumOption_VACOPT_DISABLE_PAGE_SKIPPING: VacuumOption = 128; +pub type VacuumOption = ::std::os::raw::c_uint; +pub const VacOptTernaryValue_VACOPT_TERNARY_DEFAULT: VacOptTernaryValue = 0; +pub const VacOptTernaryValue_VACOPT_TERNARY_DISABLED: VacOptTernaryValue = 1; +pub const VacOptTernaryValue_VACOPT_TERNARY_ENABLED: VacOptTernaryValue = 2; +pub type VacOptTernaryValue = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VacuumParams { + pub options: ::std::os::raw::c_int, + pub freeze_min_age: ::std::os::raw::c_int, + pub freeze_table_age: ::std::os::raw::c_int, + pub multixact_freeze_min_age: ::std::os::raw::c_int, + pub multixact_freeze_table_age: ::std::os::raw::c_int, + pub is_wraparound: bool, + pub log_min_duration: ::std::os::raw::c_int, + pub index_cleanup: VacOptTernaryValue, + pub truncate: VacOptTernaryValue, + pub nworkers: ::std::os::raw::c_int, +} +impl Default for VacuumParams { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[pg_guard] +extern "C" { + pub static mut default_statistics_target: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_min_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut vacuum_multixact_freeze_table_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut VacuumSharedCostBalance: *mut pg_atomic_uint32; +} +#[pg_guard] +extern "C" { + pub static mut VacuumActiveNWorkers: *mut pg_atomic_uint32; +} +#[pg_guard] +extern "C" { + pub static mut VacuumCostBalanceLocal: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn ExecVacuum(pstate: *mut ParseState, vacstmt: *mut VacuumStmt, isTopLevel: bool); +} +#[pg_guard] +extern "C" { + pub fn vacuum( + relations: *mut List, + params: *mut VacuumParams, + bstrategy: BufferAccessStrategy, + isTopLevel: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_open_indexes( + relation: Relation, + lockmode: LOCKMODE, + nindexes: *mut ::std::os::raw::c_int, + Irel: *mut *mut Relation, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_close_indexes( + nindexes: ::std::os::raw::c_int, + Irel: *mut Relation, + lockmode: LOCKMODE, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_estimate_reltuples( + relation: Relation, + total_pages: BlockNumber, + scanned_pages: BlockNumber, + scanned_tuples: f64, + ) -> f64; +} +#[pg_guard] +extern "C" { + pub fn vac_update_relstats( + relation: Relation, + num_pages: BlockNumber, + num_tuples: f64, + num_all_visible_pages: BlockNumber, + hasindex: bool, + frozenxid: TransactionId, + minmulti: MultiXactId, + in_outer_xact: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn vacuum_set_xid_limits( + rel: Relation, + freeze_min_age: ::std::os::raw::c_int, + freeze_table_age: ::std::os::raw::c_int, + multixact_freeze_min_age: ::std::os::raw::c_int, + multixact_freeze_table_age: ::std::os::raw::c_int, + oldestXmin: *mut TransactionId, + freezeLimit: *mut TransactionId, + xidFullScanLimit: *mut TransactionId, + multiXactCutoff: *mut MultiXactId, + mxactFullScanLimit: *mut MultiXactId, + ); +} +#[pg_guard] +extern "C" { + pub fn vac_update_datfrozenxid(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_delay_point(); +} +#[pg_guard] +extern "C" { + pub fn vacuum_is_relation_owner( + relid: Oid, + reltuple: Form_pg_class, + options: ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn vacuum_open_relation( + relid: Oid, + relation: *mut RangeVar, + options: ::std::os::raw::c_int, + verbose: bool, + lmode: LOCKMODE, + ) -> Relation; +} +#[pg_guard] +extern "C" { + pub fn analyze_rel( + relid: Oid, + relation: *mut RangeVar, + params: *mut VacuumParams, + va_cols: *mut List, + in_outer_xact: bool, + bstrategy: BufferAccessStrategy, + ); +} +#[pg_guard] +extern "C" { + pub fn std_typanalyze(stats: *mut VacAttrStats) -> bool; +} +#[pg_guard] +extern "C" { + pub fn anl_random_fract() -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_init_selection_state(n: ::std::os::raw::c_int) -> f64; +} +#[pg_guard] +extern "C" { + pub fn anl_get_next_S(t: f64, n: ::std::os::raw::c_int, stateptr: *mut f64) -> f64; +} pub type ResourceOwner = *mut ResourceOwnerData; #[pg_guard] extern "C" { @@ -37143,221 +38112,6 @@ extern "C" { missing_ok: bool, ) -> Oid; } -pub const ExplainFormat_EXPLAIN_FORMAT_TEXT: ExplainFormat = 0; -pub const ExplainFormat_EXPLAIN_FORMAT_XML: ExplainFormat = 1; -pub const ExplainFormat_EXPLAIN_FORMAT_JSON: ExplainFormat = 2; -pub const ExplainFormat_EXPLAIN_FORMAT_YAML: ExplainFormat = 3; -pub type ExplainFormat = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExplainWorkersState { - pub num_workers: ::std::os::raw::c_int, - pub worker_inited: *mut bool, - pub worker_str: *mut StringInfoData, - pub worker_state_save: *mut ::std::os::raw::c_int, - pub prev_str: StringInfo, -} -impl Default for ExplainWorkersState { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExplainState { - pub str_: StringInfo, - pub verbose: bool, - pub analyze: bool, - pub costs: bool, - pub buffers: bool, - pub wal: bool, - pub timing: bool, - pub summary: bool, - pub settings: bool, - pub format: ExplainFormat, - pub indent: ::std::os::raw::c_int, - pub grouping_stack: *mut List, - pub pstmt: *mut PlannedStmt, - pub rtable: *mut List, - pub rtable_names: *mut List, - pub deparse_cxt: *mut List, - pub printed_subplans: *mut Bitmapset, - pub hide_workers: bool, - pub workers_state: *mut ExplainWorkersState, -} -impl Default for ExplainState { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type ExplainOneQuery_hook_type = ::std::option::Option< - unsafe extern "C" fn( - query: *mut Query, - cursorOptions: ::std::os::raw::c_int, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ), ->; -#[pg_guard] -extern "C" { - pub static mut ExplainOneQuery_hook: ExplainOneQuery_hook_type; -} -pub type explain_get_index_name_hook_type = - ::std::option::Option *const ::std::os::raw::c_char>; -#[pg_guard] -extern "C" { - pub static mut explain_get_index_name_hook: explain_get_index_name_hook_type; -} -#[pg_guard] -extern "C" { - pub fn ExplainQuery( - pstate: *mut ParseState, - stmt: *mut ExplainStmt, - params: ParamListInfo, - dest: *mut DestReceiver, - ); -} -#[pg_guard] -extern "C" { - pub fn NewExplainState() -> *mut ExplainState; -} -#[pg_guard] -extern "C" { - pub fn ExplainResultDesc(stmt: *mut ExplainStmt) -> TupleDesc; -} -#[pg_guard] -extern "C" { - pub fn ExplainOneUtility( - utilityStmt: *mut Node, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOnePlan( - plannedstmt: *mut PlannedStmt, - into: *mut IntoClause, - es: *mut ExplainState, - queryString: *const ::std::os::raw::c_char, - params: ParamListInfo, - queryEnv: *mut QueryEnvironment, - planduration: *const instr_time, - bufusage: *const BufferUsage, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintPlan(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintTriggers(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainPrintJITSummary(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainQueryText(es: *mut ExplainState, queryDesc: *mut QueryDesc); -} -#[pg_guard] -extern "C" { - pub fn ExplainBeginOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainEndOutput(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainSeparatePlans(es: *mut ExplainState); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyList( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyListNested( - qlabel: *const ::std::os::raw::c_char, - data: *mut List, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyText( - qlabel: *const ::std::os::raw::c_char, - value: *const ::std::os::raw::c_char, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyInteger( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: int64, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyUInteger( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: uint64, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyFloat( - qlabel: *const ::std::os::raw::c_char, - unit: *const ::std::os::raw::c_char, - value: f64, - ndigits: ::std::os::raw::c_int, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainPropertyBool( - qlabel: *const ::std::os::raw::c_char, - value: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainOpenGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} -#[pg_guard] -extern "C" { - pub fn ExplainCloseGroup( - objtype: *const ::std::os::raw::c_char, - labelname: *const ::std::os::raw::c_char, - labeled: bool, - es: *mut ExplainState, - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExtensibleNode { @@ -38034,82 +38788,103 @@ impl Default for SQLCmd { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct SupportRequestSimplify { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub fcall: *mut FuncExpr, +pub struct WindowFuncLists { + pub numWindowFuncs: ::std::os::raw::c_int, + pub maxWinRef: Index, + pub windowFuncs: *mut *mut List, } -impl Default for SupportRequestSimplify { +impl Default for WindowFuncLists { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestSelectivity { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub args: *mut List, - pub inputcollid: Oid, - pub is_join: bool, - pub varRelid: ::std::os::raw::c_int, - pub jointype: JoinType, - pub sjinfo: *mut SpecialJoinInfo, - pub selectivity: Selectivity, +#[pg_guard] +extern "C" { + pub fn contain_agg_clause(clause: *mut Node) -> bool; } -impl Default for SupportRequestSelectivity { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn get_agg_clause_costs( + root: *mut PlannerInfo, + clause: *mut Node, + aggsplit: AggSplit, + costs: *mut AggClauseCosts, + ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestCost { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub startup: Cost, - pub per_tuple: Cost, +#[pg_guard] +extern "C" { + pub fn contain_window_function(clause: *mut Node) -> bool; } -impl Default for SupportRequestCost { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestRows { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub rows: f64, +#[pg_guard] +extern "C" { + pub fn expression_returns_set_rows(root: *mut PlannerInfo, clause: *mut Node) -> f64; } -impl Default for SupportRequestRows { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn contain_subplans(clause: *mut Node) -> bool; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SupportRequestIndexCondition { - pub type_: NodeTag, - pub root: *mut PlannerInfo, - pub funcid: Oid, - pub node: *mut Node, - pub indexarg: ::std::os::raw::c_int, - pub index: *mut IndexOptInfo, - pub indexcol: ::std::os::raw::c_int, - pub opfamily: Oid, - pub indexcollation: Oid, - pub lossy: bool, +#[pg_guard] +extern "C" { + pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; } -impl Default for SupportRequestIndexCondition { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[pg_guard] +extern "C" { + pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_exec_param(clause: *mut Node, param_ids: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn contain_leaked_vars(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; +} +#[pg_guard] +extern "C" { + pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CommuteOpExpr(clause: *mut OpExpr); +} +#[pg_guard] +extern "C" { + pub fn inline_set_returning_function( + root: *mut PlannerInfo, + rte: *mut RangeTblEntry, + ) -> *mut Query; } pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_OFF: ConstraintExclusionType = 0; pub const ConstraintExclusionType_CONSTRAINT_EXCLUSION_ON: ConstraintExclusionType = 1; @@ -38629,106 +39404,6 @@ extern "C" { tuple: *mut f64, ) -> f64; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct WindowFuncLists { - pub numWindowFuncs: ::std::os::raw::c_int, - pub maxWinRef: Index, - pub windowFuncs: *mut *mut List, -} -impl Default for WindowFuncLists { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[pg_guard] -extern "C" { - pub fn contain_agg_clause(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn get_agg_clause_costs( - root: *mut PlannerInfo, - clause: *mut Node, - aggsplit: AggSplit, - costs: *mut AggClauseCosts, - ); -} -#[pg_guard] -extern "C" { - pub fn contain_window_function(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn find_window_functions(clause: *mut Node, maxWinRef: Index) -> *mut WindowFuncLists; -} -#[pg_guard] -extern "C" { - pub fn expression_returns_set_rows(root: *mut PlannerInfo, clause: *mut Node) -> f64; -} -#[pg_guard] -extern "C" { - pub fn contain_subplans(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn max_parallel_hazard(parse: *mut Query) -> ::std::os::raw::c_char; -} -#[pg_guard] -extern "C" { - pub fn is_parallel_safe(root: *mut PlannerInfo, node: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn contain_nonstrict_functions(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn contain_exec_param(clause: *mut Node, param_ids: *mut List) -> bool; -} -#[pg_guard] -extern "C" { - pub fn contain_leaked_vars(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn find_nonnullable_rels(clause: *mut Node) -> Relids; -} -#[pg_guard] -extern "C" { - pub fn find_nonnullable_vars(clause: *mut Node) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn find_forced_null_vars(clause: *mut Node) -> *mut List; -} -#[pg_guard] -extern "C" { - pub fn find_forced_null_var(clause: *mut Node) -> *mut Var; -} -#[pg_guard] -extern "C" { - pub fn is_pseudo_constant_clause(clause: *mut Node) -> bool; -} -#[pg_guard] -extern "C" { - pub fn is_pseudo_constant_clause_relids(clause: *mut Node, relids: Relids) -> bool; -} -#[pg_guard] -extern "C" { - pub fn NumRelids(clause: *mut Node) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CommuteOpExpr(clause: *mut OpExpr); -} -#[pg_guard] -extern "C" { - pub fn inline_set_returning_function( - root: *mut PlannerInfo, - rte: *mut RangeTblEntry, - ) -> *mut Query; -} #[pg_guard] extern "C" { pub fn clause_selectivity( @@ -38990,1168 +39665,1379 @@ extern "C" { } #[pg_guard] extern "C" { - pub static mut enable_geqo: bool; -} -#[pg_guard] -extern "C" { - pub static mut geqo_threshold: ::std::os::raw::c_int; + pub fn compare_path_costs( + path1: *mut Path, + path2: *mut Path, + criterion: CostSelector, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub static mut min_parallel_table_scan_size: ::std::os::raw::c_int; + pub fn compare_fractional_path_costs( + path1: *mut Path, + path2: *mut Path, + fraction: f64, + ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub static mut min_parallel_index_scan_size: ::std::os::raw::c_int; + pub fn set_cheapest(parent_rel: *mut RelOptInfo); } -pub type set_rel_pathlist_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - rti: Index, - rte: *mut RangeTblEntry, - ), ->; #[pg_guard] extern "C" { - pub static mut set_rel_pathlist_hook: set_rel_pathlist_hook_type; + pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } -pub type set_join_pathlist_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outerrel: *mut RelOptInfo, - innerrel: *mut RelOptInfo, - jointype: JoinType, - extra: *mut JoinPathExtraData, - ), ->; #[pg_guard] extern "C" { - pub static mut set_join_pathlist_hook: set_join_pathlist_hook_type; + pub fn add_path_precheck( + parent_rel: *mut RelOptInfo, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + ) -> bool; } -pub type join_search_hook_type = ::std::option::Option< - unsafe extern "C" fn( - root: *mut PlannerInfo, - levels_needed: ::std::os::raw::c_int, - initial_rels: *mut List, - ) -> *mut RelOptInfo, ->; #[pg_guard] extern "C" { - pub static mut join_search_hook: join_search_hook_type; + pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); } #[pg_guard] extern "C" { - pub fn make_one_rel(root: *mut PlannerInfo, joinlist: *mut List) -> *mut RelOptInfo; + pub fn add_partial_path_precheck( + parent_rel: *mut RelOptInfo, + total_cost: Cost, + pathkeys: *mut List, + ) -> bool; } #[pg_guard] extern "C" { - pub fn standard_join_search( + pub fn create_seqscan_path( root: *mut PlannerInfo, - levels_needed: ::std::os::raw::c_int, - initial_rels: *mut List, - ) -> *mut RelOptInfo; -} -#[pg_guard] -extern "C" { - pub fn generate_gather_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo, override_rows: bool); + rel: *mut RelOptInfo, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn generate_useful_gather_paths( + pub fn create_samplescan_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - override_rows: bool, - ); + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn compute_parallel_worker( - rel: *mut RelOptInfo, - heap_pages: f64, - index_pages: f64, - max_workers: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn create_index_path( + root: *mut PlannerInfo, + index: *mut IndexOptInfo, + indexclauses: *mut List, + indexorderbys: *mut List, + indexorderbycols: *mut List, + pathkeys: *mut List, + indexscandir: ScanDirection, + indexonly: bool, + required_outer: Relids, + loop_count: f64, + partial_path: bool, + ) -> *mut IndexPath; } #[pg_guard] extern "C" { - pub fn create_partial_bitmap_paths( + pub fn create_bitmap_heap_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, bitmapqual: *mut Path, - ); + required_outer: Relids, + loop_count: f64, + parallel_degree: ::std::os::raw::c_int, + ) -> *mut BitmapHeapPath; } #[pg_guard] extern "C" { - pub fn generate_partitionwise_join_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_bitmap_and_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapAndPath; } #[pg_guard] extern "C" { - pub fn create_index_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_bitmap_or_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapquals: *mut List, + ) -> *mut BitmapOrPath; } #[pg_guard] extern "C" { - pub fn relation_has_unique_index_for( + pub fn create_tidscan_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - restrictlist: *mut List, - exprlist: *mut List, - oprlist: *mut List, - ) -> bool; + tidquals: *mut List, + required_outer: Relids, + ) -> *mut TidPath; } #[pg_guard] extern "C" { - pub fn indexcol_is_bool_constant_for_query( - index: *mut IndexOptInfo, - indexcol: ::std::os::raw::c_int, - ) -> bool; + pub fn create_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + partial_subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + parallel_workers: ::std::os::raw::c_int, + parallel_aware: bool, + partitioned_rels: *mut List, + rows: f64, + ) -> *mut AppendPath; } #[pg_guard] extern "C" { - pub fn match_index_to_operand( - operand: *mut Node, - indexcol: ::std::os::raw::c_int, - index: *mut IndexOptInfo, - ) -> bool; + pub fn create_merge_append_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpaths: *mut List, + pathkeys: *mut List, + required_outer: Relids, + partitioned_rels: *mut List, + ) -> *mut MergeAppendPath; } #[pg_guard] extern "C" { - pub fn check_index_predicates(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_group_result_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + havingqual: *mut List, + ) -> *mut GroupResultPath; } #[pg_guard] extern "C" { - pub fn create_tidscan_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); + pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; } #[pg_guard] extern "C" { - pub fn add_paths_to_joinrel( + pub fn create_unique_path( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outerrel: *mut RelOptInfo, - innerrel: *mut RelOptInfo, - jointype: JoinType, + rel: *mut RelOptInfo, + subpath: *mut Path, sjinfo: *mut SpecialJoinInfo, - restrictlist: *mut List, - ); + ) -> *mut UniquePath; } #[pg_guard] extern "C" { - pub fn join_search_one_level(root: *mut PlannerInfo, level: ::std::os::raw::c_int); + pub fn create_gather_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherPath; } #[pg_guard] extern "C" { - pub fn make_join_rel( + pub fn create_gather_merge_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> *mut RelOptInfo; + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + pathkeys: *mut List, + required_outer: Relids, + rows: *mut f64, + ) -> *mut GatherMergePath; } #[pg_guard] extern "C" { - pub fn have_join_order_restriction( + pub fn create_subqueryscan_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> bool; + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut SubqueryScanPath; } #[pg_guard] extern "C" { - pub fn have_dangerous_phv( + pub fn create_functionscan_path( root: *mut PlannerInfo, - outer_relids: Relids, - inner_params: Relids, - ) -> bool; + rel: *mut RelOptInfo, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn mark_dummy_rel(rel: *mut RelOptInfo); -} -pub type ec_matches_callback_type = ::std::option::Option< - unsafe extern "C" fn( + pub fn create_valuesscan_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - ec: *mut EquivalenceClass, - em: *mut EquivalenceMember, - arg: *mut ::std::os::raw::c_void, - ) -> bool, ->; + required_outer: Relids, + ) -> *mut Path; +} #[pg_guard] extern "C" { - pub fn process_equivalence( + pub fn create_tablefuncscan_path( root: *mut PlannerInfo, - p_restrictinfo: *mut *mut RestrictInfo, - below_outer_join: bool, - ) -> bool; + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn canonicalize_ec_expression( - expr: *mut Expr, - req_type: Oid, - req_collation: Oid, - ) -> *mut Expr; + pub fn create_ctescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn reconsider_outer_join_clauses(root: *mut PlannerInfo); + pub fn create_namedtuplestorescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn get_eclass_for_sort_expr( + pub fn create_resultscan_path( root: *mut PlannerInfo, - expr: *mut Expr, - nullable_relids: Relids, - opfamilies: *mut List, - opcintype: Oid, - collation: Oid, - sortref: Index, - rel: Relids, - create_it: bool, - ) -> *mut EquivalenceClass; + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn find_em_expr_for_rel(ec: *mut EquivalenceClass, rel: *mut RelOptInfo) -> *mut Expr; + pub fn create_worktablescan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn generate_base_implied_equalities(root: *mut PlannerInfo); + pub fn create_foreignscan_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn generate_join_implied_equalities( + pub fn create_foreign_join_path( root: *mut PlannerInfo, - join_relids: Relids, - outer_relids: Relids, - inner_rel: *mut RelOptInfo, - ) -> *mut List; + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + required_outer: Relids, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn generate_join_implied_equalities_for_ecs( + pub fn create_foreign_upper_path( root: *mut PlannerInfo, - eclasses: *mut List, - join_relids: Relids, - outer_relids: Relids, - inner_rel: *mut RelOptInfo, - ) -> *mut List; + rel: *mut RelOptInfo, + target: *mut PathTarget, + rows: f64, + startup_cost: Cost, + total_cost: Cost, + pathkeys: *mut List, + fdw_outerpath: *mut Path, + fdw_private: *mut List, + ) -> *mut ForeignPath; } #[pg_guard] extern "C" { - pub fn exprs_known_equal(root: *mut PlannerInfo, item1: *mut Node, item2: *mut Node) -> bool; + pub fn calc_nestloop_required_outer( + outerrelids: Relids, + outer_paramrels: Relids, + innerrelids: Relids, + inner_paramrels: Relids, + ) -> Relids; } #[pg_guard] extern "C" { - pub fn match_eclasses_to_foreign_key_col( - root: *mut PlannerInfo, - fkinfo: *mut ForeignKeyOptInfo, - colno: ::std::os::raw::c_int, - ) -> *mut EquivalenceClass; + pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) + -> Relids; } #[pg_guard] extern "C" { - pub fn add_child_rel_equivalences( + pub fn create_nestloop_path( root: *mut PlannerInfo, - appinfo: *mut AppendRelInfo, - parent_rel: *mut RelOptInfo, - child_rel: *mut RelOptInfo, - ); + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + ) -> *mut NestPath; } #[pg_guard] extern "C" { - pub fn add_child_join_rel_equivalences( + pub fn create_mergejoin_path( root: *mut PlannerInfo, - nappinfos: ::std::os::raw::c_int, - appinfos: *mut *mut AppendRelInfo, - parent_rel: *mut RelOptInfo, - child_rel: *mut RelOptInfo, - ); + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + restrict_clauses: *mut List, + pathkeys: *mut List, + required_outer: Relids, + mergeclauses: *mut List, + outersortkeys: *mut List, + innersortkeys: *mut List, + ) -> *mut MergePath; } #[pg_guard] extern "C" { - pub fn generate_implied_equalities_for_column( + pub fn create_hashjoin_path( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - callback: ec_matches_callback_type, - callback_arg: *mut ::std::os::raw::c_void, - prohibited_rels: Relids, - ) -> *mut List; + joinrel: *mut RelOptInfo, + jointype: JoinType, + workspace: *mut JoinCostWorkspace, + extra: *mut JoinPathExtraData, + outer_path: *mut Path, + inner_path: *mut Path, + parallel_hash: bool, + restrict_clauses: *mut List, + required_outer: Relids, + hashclauses: *mut List, + ) -> *mut HashPath; } #[pg_guard] extern "C" { - pub fn have_relevant_eclass_joinclause( + pub fn create_projection_path( root: *mut PlannerInfo, - rel1: *mut RelOptInfo, - rel2: *mut RelOptInfo, - ) -> bool; + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectionPath; } #[pg_guard] extern "C" { - pub fn has_relevant_eclass_joinclause(root: *mut PlannerInfo, rel1: *mut RelOptInfo) -> bool; + pub fn apply_projection_to_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + path: *mut Path, + target: *mut PathTarget, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn eclass_useful_for_merging( + pub fn create_set_projection_path( root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, rel: *mut RelOptInfo, - ) -> bool; + subpath: *mut Path, + target: *mut PathTarget, + ) -> *mut ProjectSetPath; } #[pg_guard] extern "C" { - pub fn is_redundant_derived_clause(rinfo: *mut RestrictInfo, clauselist: *mut List) -> bool; -} -#[pg_guard] + pub fn create_incremental_sort_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + presorted_keys: ::std::os::raw::c_int, + limit_tuples: f64, + ) -> *mut SortPath; +} +#[pg_guard] extern "C" { - pub fn is_redundant_with_indexclauses( - rinfo: *mut RestrictInfo, - indexclauses: *mut List, - ) -> bool; + pub fn create_sort_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + pathkeys: *mut List, + limit_tuples: f64, + ) -> *mut SortPath; } -pub const PathKeysComparison_PATHKEYS_EQUAL: PathKeysComparison = 0; -pub const PathKeysComparison_PATHKEYS_BETTER1: PathKeysComparison = 1; -pub const PathKeysComparison_PATHKEYS_BETTER2: PathKeysComparison = 2; -pub const PathKeysComparison_PATHKEYS_DIFFERENT: PathKeysComparison = 3; -pub type PathKeysComparison = ::std::os::raw::c_uint; #[pg_guard] extern "C" { - pub fn compare_pathkeys(keys1: *mut List, keys2: *mut List) -> PathKeysComparison; + pub fn create_group_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + groupClause: *mut List, + qual: *mut List, + numGroups: f64, + ) -> *mut GroupPath; } #[pg_guard] extern "C" { - pub fn pathkeys_contained_in(keys1: *mut List, keys2: *mut List) -> bool; + pub fn create_upper_unique_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + numCols: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut UpperUniquePath; } #[pg_guard] extern "C" { - pub fn pathkeys_count_contained_in( - keys1: *mut List, - keys2: *mut List, - n_common: *mut ::std::os::raw::c_int, - ) -> bool; + pub fn create_agg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + groupClause: *mut List, + qual: *mut List, + aggcosts: *const AggClauseCosts, + numGroups: f64, + ) -> *mut AggPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_path_for_pathkeys( - paths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - cost_criterion: CostSelector, - require_parallel_safe: bool, - ) -> *mut Path; + pub fn create_groupingsets_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + having_qual: *mut List, + aggstrategy: AggStrategy, + rollups: *mut List, + agg_costs: *const AggClauseCosts, + numGroups: f64, + ) -> *mut GroupingSetsPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_fractional_path_for_pathkeys( - paths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - fraction: f64, - ) -> *mut Path; + pub fn create_minmaxagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + target: *mut PathTarget, + mmaggregates: *mut List, + quals: *mut List, + ) -> *mut MinMaxAggPath; } #[pg_guard] extern "C" { - pub fn get_cheapest_parallel_safe_total_inner(paths: *mut List) -> *mut Path; + pub fn create_windowagg_path( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + subpath: *mut Path, + target: *mut PathTarget, + windowFuncs: *mut List, + winclause: *mut WindowClause, + ) -> *mut WindowAggPath; } #[pg_guard] extern "C" { - pub fn build_index_pathkeys( + pub fn create_setop_path( root: *mut PlannerInfo, - index: *mut IndexOptInfo, - scandir: ScanDirection, - ) -> *mut List; + rel: *mut RelOptInfo, + subpath: *mut Path, + cmd: SetOpCmd, + strategy: SetOpStrategy, + distinctList: *mut List, + flagColIdx: AttrNumber, + firstFlag: ::std::os::raw::c_int, + numGroups: f64, + outputRows: f64, + ) -> *mut SetOpPath; } #[pg_guard] extern "C" { - pub fn build_partition_pathkeys( + pub fn create_recursiveunion_path( root: *mut PlannerInfo, - partrel: *mut RelOptInfo, - scandir: ScanDirection, - partialkeys: *mut bool, - ) -> *mut List; + rel: *mut RelOptInfo, + leftpath: *mut Path, + rightpath: *mut Path, + target: *mut PathTarget, + distinctList: *mut List, + wtParam: ::std::os::raw::c_int, + numGroups: f64, + ) -> *mut RecursiveUnionPath; } #[pg_guard] extern "C" { - pub fn build_expression_pathkey( + pub fn create_lockrows_path( root: *mut PlannerInfo, - expr: *mut Expr, - nullable_relids: Relids, - opno: Oid, - rel: Relids, - create_it: bool, - ) -> *mut List; + rel: *mut RelOptInfo, + subpath: *mut Path, + rowMarks: *mut List, + epqParam: ::std::os::raw::c_int, + ) -> *mut LockRowsPath; } #[pg_guard] extern "C" { - pub fn convert_subquery_pathkeys( + pub fn create_modifytable_path( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subquery_pathkeys: *mut List, - subquery_tlist: *mut List, - ) -> *mut List; + operation: CmdType, + canSetTag: bool, + nominalRelation: Index, + rootRelation: Index, + partColsUpdated: bool, + resultRelations: *mut List, + subpaths: *mut List, + subroots: *mut List, + withCheckOptionLists: *mut List, + returningLists: *mut List, + rowMarks: *mut List, + onconflict: *mut OnConflictExpr, + epqParam: ::std::os::raw::c_int, + ) -> *mut ModifyTablePath; } #[pg_guard] extern "C" { - pub fn build_join_pathkeys( + pub fn create_limit_path( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - outer_pathkeys: *mut List, - ) -> *mut List; + rel: *mut RelOptInfo, + subpath: *mut Path, + limitOffset: *mut Node, + limitCount: *mut Node, + limitOption: LimitOption, + offset_est: int64, + count_est: int64, + ) -> *mut LimitPath; } #[pg_guard] extern "C" { - pub fn make_pathkeys_for_sortclauses( + pub fn adjust_limit_rows_costs( + rows: *mut f64, + startup_cost: *mut Cost, + total_cost: *mut Cost, + offset_est: int64, + count_est: int64, + ); +} +#[pg_guard] +extern "C" { + pub fn reparameterize_path( root: *mut PlannerInfo, - sortclauses: *mut List, - tlist: *mut List, - ) -> *mut List; + path: *mut Path, + required_outer: Relids, + loop_count: f64, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn initialize_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); + pub fn reparameterize_path_by_child( + root: *mut PlannerInfo, + path: *mut Path, + child_rel: *mut RelOptInfo, + ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn update_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); + pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_mergeclauses_for_outer_pathkeys( + pub fn expand_planner_arrays(root: *mut PlannerInfo, add_size: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn build_simple_rel( root: *mut PlannerInfo, - pathkeys: *mut List, - restrictinfos: *mut List, - ) -> *mut List; + relid: ::std::os::raw::c_int, + parent: *mut RelOptInfo, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn select_outer_pathkeys_for_merge( + pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn build_join_rel( root: *mut PlannerInfo, - mergeclauses: *mut List, - joinrel: *mut RelOptInfo, - ) -> *mut List; + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + sjinfo: *mut SpecialJoinInfo, + restrictlist_ptr: *mut *mut List, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn make_inner_pathkeys_for_merge( + pub fn min_join_parameterization( root: *mut PlannerInfo, - mergeclauses: *mut List, - outer_pathkeys: *mut List, - ) -> *mut List; + joinrelids: Relids, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + ) -> Relids; } #[pg_guard] extern "C" { - pub fn trim_mergeclauses_for_inner_pathkeys( + pub fn fetch_upper_rel( root: *mut PlannerInfo, - mergeclauses: *mut List, - pathkeys: *mut List, - ) -> *mut List; + kind: UpperRelationKind, + relids: Relids, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn truncate_useless_pathkeys( + pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; +} +#[pg_guard] +extern "C" { + pub fn get_baserel_parampathinfo( + root: *mut PlannerInfo, + baserel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_joinrel_parampathinfo( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outer_path: *mut Path, + inner_path: *mut Path, + sjinfo: *mut SpecialJoinInfo, + required_outer: Relids, + restrict_clauses: *mut *mut List, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn get_appendrel_parampathinfo( + appendrel: *mut RelOptInfo, + required_outer: Relids, + ) -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) + -> *mut ParamPathInfo; +} +#[pg_guard] +extern "C" { + pub fn build_child_join_rel( + root: *mut PlannerInfo, + outer_rel: *mut RelOptInfo, + inner_rel: *mut RelOptInfo, + parent_joinrel: *mut RelOptInfo, + restrictlist: *mut List, + sjinfo: *mut SpecialJoinInfo, + jointype: JoinType, + ) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub static mut enable_geqo: bool; +} +#[pg_guard] +extern "C" { + pub static mut geqo_threshold: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut min_parallel_table_scan_size: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut min_parallel_index_scan_size: ::std::os::raw::c_int; +} +pub type set_rel_pathlist_hook_type = ::std::option::Option< + unsafe extern "C" fn( root: *mut PlannerInfo, rel: *mut RelOptInfo, - pathkeys: *mut List, - ) -> *mut List; + rti: Index, + rte: *mut RangeTblEntry, + ), +>; +#[pg_guard] +extern "C" { + pub static mut set_rel_pathlist_hook: set_rel_pathlist_hook_type; +} +pub type set_join_pathlist_hook_type = ::std::option::Option< + unsafe extern "C" fn( + root: *mut PlannerInfo, + joinrel: *mut RelOptInfo, + outerrel: *mut RelOptInfo, + innerrel: *mut RelOptInfo, + jointype: JoinType, + extra: *mut JoinPathExtraData, + ), +>; +#[pg_guard] +extern "C" { + pub static mut set_join_pathlist_hook: set_join_pathlist_hook_type; } +pub type join_search_hook_type = ::std::option::Option< + unsafe extern "C" fn( + root: *mut PlannerInfo, + levels_needed: ::std::os::raw::c_int, + initial_rels: *mut List, + ) -> *mut RelOptInfo, +>; #[pg_guard] extern "C" { - pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; + pub static mut join_search_hook: join_search_hook_type; } #[pg_guard] extern "C" { - pub fn make_canonical_pathkey( + pub fn make_one_rel(root: *mut PlannerInfo, joinlist: *mut List) -> *mut RelOptInfo; +} +#[pg_guard] +extern "C" { + pub fn standard_join_search( root: *mut PlannerInfo, - eclass: *mut EquivalenceClass, - opfamily: Oid, - strategy: ::std::os::raw::c_int, - nulls_first: bool, - ) -> *mut PathKey; + levels_needed: ::std::os::raw::c_int, + initial_rels: *mut List, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn add_paths_to_append_rel( + pub fn generate_gather_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo, override_rows: bool); +} +#[pg_guard] +extern "C" { + pub fn generate_useful_gather_paths( root: *mut PlannerInfo, rel: *mut RelOptInfo, - live_childrels: *mut List, + override_rows: bool, ); } #[pg_guard] extern "C" { - pub fn compare_path_costs( - path1: *mut Path, - path2: *mut Path, - criterion: CostSelector, + pub fn compute_parallel_worker( + rel: *mut RelOptInfo, + heap_pages: f64, + index_pages: f64, + max_workers: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn compare_fractional_path_costs( - path1: *mut Path, - path2: *mut Path, - fraction: f64, - ) -> ::std::os::raw::c_int; + pub fn create_partial_bitmap_paths( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + bitmapqual: *mut Path, + ); } #[pg_guard] extern "C" { - pub fn set_cheapest(parent_rel: *mut RelOptInfo); + pub fn generate_partitionwise_join_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn add_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); + pub fn create_index_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn add_path_precheck( - parent_rel: *mut RelOptInfo, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, + pub fn relation_has_unique_index_for( + root: *mut PlannerInfo, + rel: *mut RelOptInfo, + restrictlist: *mut List, + exprlist: *mut List, + oprlist: *mut List, ) -> bool; } #[pg_guard] extern "C" { - pub fn add_partial_path(parent_rel: *mut RelOptInfo, new_path: *mut Path); + pub fn indexcol_is_bool_constant_for_query( + index: *mut IndexOptInfo, + indexcol: ::std::os::raw::c_int, + ) -> bool; } #[pg_guard] extern "C" { - pub fn add_partial_path_precheck( - parent_rel: *mut RelOptInfo, - total_cost: Cost, - pathkeys: *mut List, + pub fn match_index_to_operand( + operand: *mut Node, + indexcol: ::std::os::raw::c_int, + index: *mut IndexOptInfo, ) -> bool; } #[pg_guard] extern "C" { - pub fn create_seqscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - ) -> *mut Path; + pub fn check_index_predicates(root: *mut PlannerInfo, rel: *mut RelOptInfo); } #[pg_guard] extern "C" { - pub fn create_samplescan_path( + pub fn create_tidscan_paths(root: *mut PlannerInfo, rel: *mut RelOptInfo); +} +#[pg_guard] +extern "C" { + pub fn add_paths_to_joinrel( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + joinrel: *mut RelOptInfo, + outerrel: *mut RelOptInfo, + innerrel: *mut RelOptInfo, + jointype: JoinType, + sjinfo: *mut SpecialJoinInfo, + restrictlist: *mut List, + ); } #[pg_guard] extern "C" { - pub fn create_index_path( + pub fn join_search_one_level(root: *mut PlannerInfo, level: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn make_join_rel( root: *mut PlannerInfo, - index: *mut IndexOptInfo, - indexclauses: *mut List, - indexorderbys: *mut List, - indexorderbycols: *mut List, - pathkeys: *mut List, - indexscandir: ScanDirection, - indexonly: bool, - required_outer: Relids, - loop_count: f64, - partial_path: bool, - ) -> *mut IndexPath; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_bitmap_heap_path( + pub fn have_join_order_restriction( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapqual: *mut Path, - required_outer: Relids, - loop_count: f64, - parallel_degree: ::std::os::raw::c_int, - ) -> *mut BitmapHeapPath; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_bitmap_and_path( + pub fn have_dangerous_phv( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapAndPath; + outer_relids: Relids, + inner_params: Relids, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_bitmap_or_path( + pub fn mark_dummy_rel(rel: *mut RelOptInfo); +} +pub type ec_matches_callback_type = ::std::option::Option< + unsafe extern "C" fn( root: *mut PlannerInfo, rel: *mut RelOptInfo, - bitmapquals: *mut List, - ) -> *mut BitmapOrPath; + ec: *mut EquivalenceClass, + em: *mut EquivalenceMember, + arg: *mut ::std::os::raw::c_void, + ) -> bool, +>; +#[pg_guard] +extern "C" { + pub fn process_equivalence( + root: *mut PlannerInfo, + p_restrictinfo: *mut *mut RestrictInfo, + below_outer_join: bool, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_tidscan_path( + pub fn canonicalize_ec_expression( + expr: *mut Expr, + req_type: Oid, + req_collation: Oid, + ) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn reconsider_outer_join_clauses(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn get_eclass_for_sort_expr( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - tidquals: *mut List, - required_outer: Relids, - ) -> *mut TidPath; + expr: *mut Expr, + nullable_relids: Relids, + opfamilies: *mut List, + opcintype: Oid, + collation: Oid, + sortref: Index, + rel: Relids, + create_it: bool, + ) -> *mut EquivalenceClass; } #[pg_guard] extern "C" { - pub fn create_append_path( + pub fn find_em_expr_for_rel(ec: *mut EquivalenceClass, rel: *mut RelOptInfo) -> *mut Expr; +} +#[pg_guard] +extern "C" { + pub fn generate_base_implied_equalities(root: *mut PlannerInfo); +} +#[pg_guard] +extern "C" { + pub fn generate_join_implied_equalities( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - partial_subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - parallel_workers: ::std::os::raw::c_int, - parallel_aware: bool, - partitioned_rels: *mut List, - rows: f64, - ) -> *mut AppendPath; + join_relids: Relids, + outer_relids: Relids, + inner_rel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_merge_append_path( + pub fn generate_join_implied_equalities_for_ecs( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpaths: *mut List, - pathkeys: *mut List, - required_outer: Relids, - partitioned_rels: *mut List, - ) -> *mut MergeAppendPath; + eclasses: *mut List, + join_relids: Relids, + outer_relids: Relids, + inner_rel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_group_result_path( + pub fn exprs_known_equal(root: *mut PlannerInfo, item1: *mut Node, item2: *mut Node) -> bool; +} +#[pg_guard] +extern "C" { + pub fn match_eclasses_to_foreign_key_col( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - havingqual: *mut List, - ) -> *mut GroupResultPath; + fkinfo: *mut ForeignKeyOptInfo, + colno: ::std::os::raw::c_int, + ) -> *mut EquivalenceClass; } #[pg_guard] extern "C" { - pub fn create_material_path(rel: *mut RelOptInfo, subpath: *mut Path) -> *mut MaterialPath; + pub fn add_child_rel_equivalences( + root: *mut PlannerInfo, + appinfo: *mut AppendRelInfo, + parent_rel: *mut RelOptInfo, + child_rel: *mut RelOptInfo, + ); } #[pg_guard] extern "C" { - pub fn create_unique_path( + pub fn add_child_join_rel_equivalences( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - sjinfo: *mut SpecialJoinInfo, - ) -> *mut UniquePath; + nappinfos: ::std::os::raw::c_int, + appinfos: *mut *mut AppendRelInfo, + parent_rel: *mut RelOptInfo, + child_rel: *mut RelOptInfo, + ); } #[pg_guard] extern "C" { - pub fn create_gather_path( + pub fn generate_implied_equalities_for_column( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherPath; + callback: ec_matches_callback_type, + callback_arg: *mut ::std::os::raw::c_void, + prohibited_rels: Relids, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_gather_merge_path( + pub fn have_relevant_eclass_joinclause( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - pathkeys: *mut List, - required_outer: Relids, - rows: *mut f64, - ) -> *mut GatherMergePath; + rel1: *mut RelOptInfo, + rel2: *mut RelOptInfo, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_subqueryscan_path( + pub fn has_relevant_eclass_joinclause(root: *mut PlannerInfo, rel1: *mut RelOptInfo) -> bool; +} +#[pg_guard] +extern "C" { + pub fn eclass_useful_for_merging( root: *mut PlannerInfo, + eclass: *mut EquivalenceClass, rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut SubqueryScanPath; + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_redundant_derived_clause(rinfo: *mut RestrictInfo, clauselist: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn is_redundant_with_indexclauses( + rinfo: *mut RestrictInfo, + indexclauses: *mut List, + ) -> bool; +} +pub const PathKeysComparison_PATHKEYS_EQUAL: PathKeysComparison = 0; +pub const PathKeysComparison_PATHKEYS_BETTER1: PathKeysComparison = 1; +pub const PathKeysComparison_PATHKEYS_BETTER2: PathKeysComparison = 2; +pub const PathKeysComparison_PATHKEYS_DIFFERENT: PathKeysComparison = 3; +pub type PathKeysComparison = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn compare_pathkeys(keys1: *mut List, keys2: *mut List) -> PathKeysComparison; +} +#[pg_guard] +extern "C" { + pub fn pathkeys_contained_in(keys1: *mut List, keys2: *mut List) -> bool; } #[pg_guard] extern "C" { - pub fn create_functionscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - pathkeys: *mut List, - required_outer: Relids, - ) -> *mut Path; + pub fn pathkeys_count_contained_in( + keys1: *mut List, + keys2: *mut List, + n_common: *mut ::std::os::raw::c_int, + ) -> bool; } #[pg_guard] extern "C" { - pub fn create_valuesscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, + pub fn get_cheapest_path_for_pathkeys( + paths: *mut List, + pathkeys: *mut List, required_outer: Relids, + cost_criterion: CostSelector, + require_parallel_safe: bool, ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_tablefuncscan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, + pub fn get_cheapest_fractional_path_for_pathkeys( + paths: *mut List, + pathkeys: *mut List, required_outer: Relids, + fraction: f64, ) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_ctescan_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + pub fn get_cheapest_parallel_safe_total_inner(paths: *mut List) -> *mut Path; } #[pg_guard] extern "C" { - pub fn create_namedtuplestorescan_path( + pub fn build_index_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + index: *mut IndexOptInfo, + scandir: ScanDirection, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_resultscan_path( + pub fn build_partition_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + partrel: *mut RelOptInfo, + scandir: ScanDirection, + partialkeys: *mut bool, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_worktablescan_path( + pub fn build_expression_pathkey( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut Path; + expr: *mut Expr, + nullable_relids: Relids, + opno: Oid, + rel: Relids, + create_it: bool, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreignscan_path( + pub fn convert_subquery_pathkeys( root: *mut PlannerInfo, rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + subquery_pathkeys: *mut List, + subquery_tlist: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreign_join_path( + pub fn build_join_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - required_outer: Relids, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + joinrel: *mut RelOptInfo, + jointype: JoinType, + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_foreign_upper_path( + pub fn make_pathkeys_for_sortclauses( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - rows: f64, - startup_cost: Cost, - total_cost: Cost, - pathkeys: *mut List, - fdw_outerpath: *mut Path, - fdw_private: *mut List, - ) -> *mut ForeignPath; + sortclauses: *mut List, + tlist: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn calc_nestloop_required_outer( - outerrelids: Relids, - outer_paramrels: Relids, - innerrelids: Relids, - inner_paramrels: Relids, - ) -> Relids; + pub fn initialize_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn calc_non_nestloop_required_outer(outer_path: *mut Path, inner_path: *mut Path) - -> Relids; + pub fn update_mergeclause_eclasses(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn create_nestloop_path( + pub fn find_mergeclauses_for_outer_pathkeys( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, pathkeys: *mut List, - required_outer: Relids, - ) -> *mut NestPath; + restrictinfos: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_mergejoin_path( + pub fn select_outer_pathkeys_for_merge( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - restrict_clauses: *mut List, - pathkeys: *mut List, - required_outer: Relids, mergeclauses: *mut List, - outersortkeys: *mut List, - innersortkeys: *mut List, - ) -> *mut MergePath; + joinrel: *mut RelOptInfo, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_hashjoin_path( + pub fn make_inner_pathkeys_for_merge( root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - jointype: JoinType, - workspace: *mut JoinCostWorkspace, - extra: *mut JoinPathExtraData, - outer_path: *mut Path, - inner_path: *mut Path, - parallel_hash: bool, - restrict_clauses: *mut List, - required_outer: Relids, - hashclauses: *mut List, - ) -> *mut HashPath; + mergeclauses: *mut List, + outer_pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_projection_path( + pub fn trim_mergeclauses_for_inner_pathkeys( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectionPath; + mergeclauses: *mut List, + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn apply_projection_to_path( + pub fn truncate_useless_pathkeys( root: *mut PlannerInfo, rel: *mut RelOptInfo, - path: *mut Path, - target: *mut PathTarget, - ) -> *mut Path; + pathkeys: *mut List, + ) -> *mut List; } #[pg_guard] extern "C" { - pub fn create_set_projection_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - ) -> *mut ProjectSetPath; + pub fn has_useful_pathkeys(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> bool; } #[pg_guard] extern "C" { - pub fn create_incremental_sort_path( + pub fn make_canonical_pathkey( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - presorted_keys: ::std::os::raw::c_int, - limit_tuples: f64, - ) -> *mut SortPath; + eclass: *mut EquivalenceClass, + opfamily: Oid, + strategy: ::std::os::raw::c_int, + nulls_first: bool, + ) -> *mut PathKey; } #[pg_guard] extern "C" { - pub fn create_sort_path( + pub fn add_paths_to_append_rel( root: *mut PlannerInfo, rel: *mut RelOptInfo, - subpath: *mut Path, - pathkeys: *mut List, - limit_tuples: f64, - ) -> *mut SortPath; + live_childrels: *mut List, + ); } #[pg_guard] extern "C" { - pub fn create_group_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - groupClause: *mut List, - qual: *mut List, - numGroups: f64, - ) -> *mut GroupPath; + pub static mut cursor_tuple_fraction: f64; } +pub type query_pathkeys_callback = ::std::option::Option< + unsafe extern "C" fn(root: *mut PlannerInfo, extra: *mut ::std::os::raw::c_void), +>; #[pg_guard] extern "C" { - pub fn create_upper_unique_path( + pub fn query_planner( root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - numCols: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut UpperUniquePath; + qp_callback: query_pathkeys_callback, + qp_extra: *mut ::std::os::raw::c_void, + ) -> *mut RelOptInfo; } #[pg_guard] extern "C" { - pub fn create_agg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - aggstrategy: AggStrategy, - aggsplit: AggSplit, - groupClause: *mut List, - qual: *mut List, - aggcosts: *const AggClauseCosts, - numGroups: f64, - ) -> *mut AggPath; + pub fn preprocess_minmax_aggregates(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn create_groupingsets_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - having_qual: *mut List, - aggstrategy: AggStrategy, - rollups: *mut List, - agg_costs: *const AggClauseCosts, - numGroups: f64, - ) -> *mut GroupingSetsPath; + pub fn create_plan(root: *mut PlannerInfo, best_path: *mut Path) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_minmaxagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - target: *mut PathTarget, - mmaggregates: *mut List, - quals: *mut List, - ) -> *mut MinMaxAggPath; + pub fn make_foreignscan( + qptlist: *mut List, + qpqual: *mut List, + scanrelid: Index, + fdw_exprs: *mut List, + fdw_private: *mut List, + fdw_scan_tlist: *mut List, + fdw_recheck_quals: *mut List, + outer_plan: *mut Plan, + ) -> *mut ForeignScan; } #[pg_guard] extern "C" { - pub fn create_windowagg_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - target: *mut PathTarget, - windowFuncs: *mut List, - winclause: *mut WindowClause, - ) -> *mut WindowAggPath; + pub fn change_plan_targetlist( + subplan: *mut Plan, + tlist: *mut List, + tlist_parallel_safe: bool, + ) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_setop_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - cmd: SetOpCmd, - strategy: SetOpStrategy, - distinctList: *mut List, - flagColIdx: AttrNumber, - firstFlag: ::std::os::raw::c_int, - numGroups: f64, - outputRows: f64, - ) -> *mut SetOpPath; + pub fn materialize_finished_plan(subplan: *mut Plan) -> *mut Plan; } #[pg_guard] extern "C" { - pub fn create_recursiveunion_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - leftpath: *mut Path, - rightpath: *mut Path, - target: *mut PathTarget, - distinctList: *mut List, - wtParam: ::std::os::raw::c_int, - numGroups: f64, - ) -> *mut RecursiveUnionPath; + pub fn is_projection_capable_path(path: *mut Path) -> bool; } #[pg_guard] extern "C" { - pub fn create_lockrows_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, - rowMarks: *mut List, - epqParam: ::std::os::raw::c_int, - ) -> *mut LockRowsPath; + pub fn is_projection_capable_plan(plan: *mut Plan) -> bool; } #[pg_guard] extern "C" { - pub fn create_modifytable_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - operation: CmdType, - canSetTag: bool, - nominalRelation: Index, - rootRelation: Index, - partColsUpdated: bool, - resultRelations: *mut List, - subpaths: *mut List, - subroots: *mut List, - withCheckOptionLists: *mut List, - returningLists: *mut List, - rowMarks: *mut List, - onconflict: *mut OnConflictExpr, - epqParam: ::std::os::raw::c_int, - ) -> *mut ModifyTablePath; + pub fn make_sort_from_sortclauses(sortcls: *mut List, lefttree: *mut Plan) -> *mut Sort; } #[pg_guard] extern "C" { - pub fn create_limit_path( - root: *mut PlannerInfo, - rel: *mut RelOptInfo, - subpath: *mut Path, + pub fn make_agg( + tlist: *mut List, + qual: *mut List, + aggstrategy: AggStrategy, + aggsplit: AggSplit, + numGroupCols: ::std::os::raw::c_int, + grpColIdx: *mut AttrNumber, + grpOperators: *mut Oid, + grpCollations: *mut Oid, + groupingSets: *mut List, + chain: *mut List, + dNumGroups: f64, + transitionSpace: Size, + lefttree: *mut Plan, + ) -> *mut Agg; +} +#[pg_guard] +extern "C" { + pub fn make_limit( + lefttree: *mut Plan, limitOffset: *mut Node, limitCount: *mut Node, limitOption: LimitOption, - offset_est: int64, - count_est: int64, - ) -> *mut LimitPath; + uniqNumCols: ::std::os::raw::c_int, + uniqColIdx: *mut AttrNumber, + uniqOperators: *mut Oid, + uniqCollations: *mut Oid, + ) -> *mut Limit; } #[pg_guard] extern "C" { - pub fn adjust_limit_rows_costs( - rows: *mut f64, - startup_cost: *mut Cost, - total_cost: *mut Cost, - offset_est: int64, - count_est: int64, - ); + pub static mut from_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn reparameterize_path( - root: *mut PlannerInfo, - path: *mut Path, - required_outer: Relids, - loop_count: f64, - ) -> *mut Path; + pub static mut join_collapse_limit: ::std::os::raw::c_int; } #[pg_guard] extern "C" { - pub fn reparameterize_path_by_child( - root: *mut PlannerInfo, - path: *mut Path, - child_rel: *mut RelOptInfo, - ) -> *mut Path; + pub fn add_base_rels_to_query(root: *mut PlannerInfo, jtnode: *mut Node); } #[pg_guard] extern "C" { - pub fn setup_simple_rel_arrays(root: *mut PlannerInfo); + pub fn add_other_rels_to_query(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn expand_planner_arrays(root: *mut PlannerInfo, add_size: ::std::os::raw::c_int); + pub fn build_base_rel_tlists(root: *mut PlannerInfo, final_tlist: *mut List); } #[pg_guard] extern "C" { - pub fn build_simple_rel( + pub fn add_vars_to_targetlist( root: *mut PlannerInfo, - relid: ::std::os::raw::c_int, - parent: *mut RelOptInfo, - ) -> *mut RelOptInfo; + vars: *mut List, + where_needed: Relids, + create_new_ph: bool, + ); } #[pg_guard] extern "C" { - pub fn find_base_rel(root: *mut PlannerInfo, relid: ::std::os::raw::c_int) -> *mut RelOptInfo; + pub fn find_lateral_references(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_join_rel(root: *mut PlannerInfo, relids: Relids) -> *mut RelOptInfo; + pub fn create_lateral_join_info(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn build_join_rel( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - sjinfo: *mut SpecialJoinInfo, - restrictlist_ptr: *mut *mut List, - ) -> *mut RelOptInfo; + pub fn deconstruct_jointree(root: *mut PlannerInfo) -> *mut List; } #[pg_guard] extern "C" { - pub fn min_join_parameterization( - root: *mut PlannerInfo, - joinrelids: Relids, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - ) -> Relids; + pub fn distribute_restrictinfo_to_rels(root: *mut PlannerInfo, restrictinfo: *mut RestrictInfo); } #[pg_guard] extern "C" { - pub fn fetch_upper_rel( + pub fn process_implied_equality( root: *mut PlannerInfo, - kind: UpperRelationKind, - relids: Relids, - ) -> *mut RelOptInfo; + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + below_outer_join: bool, + both_const: bool, + ); } #[pg_guard] extern "C" { - pub fn find_childrel_parents(root: *mut PlannerInfo, rel: *mut RelOptInfo) -> Relids; + pub fn build_implied_join_equality( + opno: Oid, + collation: Oid, + item1: *mut Expr, + item2: *mut Expr, + qualscope: Relids, + nullable_relids: Relids, + security_level: Index, + ) -> *mut RestrictInfo; } #[pg_guard] extern "C" { - pub fn get_baserel_parampathinfo( - root: *mut PlannerInfo, - baserel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn match_foreign_keys_to_quals(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn get_joinrel_parampathinfo( - root: *mut PlannerInfo, - joinrel: *mut RelOptInfo, - outer_path: *mut Path, - inner_path: *mut Path, - sjinfo: *mut SpecialJoinInfo, - required_outer: Relids, - restrict_clauses: *mut *mut List, - ) -> *mut ParamPathInfo; + pub fn remove_useless_joins(root: *mut PlannerInfo, joinlist: *mut List) -> *mut List; } #[pg_guard] extern "C" { - pub fn get_appendrel_parampathinfo( - appendrel: *mut RelOptInfo, - required_outer: Relids, - ) -> *mut ParamPathInfo; + pub fn reduce_unique_semijoins(root: *mut PlannerInfo); } #[pg_guard] extern "C" { - pub fn find_param_path_info(rel: *mut RelOptInfo, required_outer: Relids) - -> *mut ParamPathInfo; + pub fn query_supports_distinctness(query: *mut Query) -> bool; } #[pg_guard] extern "C" { - pub fn build_child_join_rel( + pub fn query_is_distinct_for(query: *mut Query, colnos: *mut List, opids: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn innerrel_is_unique( root: *mut PlannerInfo, - outer_rel: *mut RelOptInfo, - inner_rel: *mut RelOptInfo, - parent_joinrel: *mut RelOptInfo, - restrictlist: *mut List, - sjinfo: *mut SpecialJoinInfo, + joinrelids: Relids, + outerrelids: Relids, + innerrel: *mut RelOptInfo, jointype: JoinType, - ) -> *mut RelOptInfo; + restrictlist: *mut List, + force_cache: bool, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn set_plan_references(root: *mut PlannerInfo, plan: *mut Plan) -> *mut Plan; +} +#[pg_guard] +extern "C" { + pub fn record_plan_function_dependency(root: *mut PlannerInfo, funcid: Oid); +} +#[pg_guard] +extern "C" { + pub fn record_plan_type_dependency(root: *mut PlannerInfo, typid: Oid); +} +#[pg_guard] +extern "C" { + pub fn extract_query_dependencies_walker(node: *mut Node, root: *mut PlannerInfo) -> bool; } pub type planner_hook_type = ::std::option::Option< unsafe extern "C" fn( @@ -40277,6 +41163,100 @@ extern "C" { current_and_outer: Relids, ) -> bool; } +#[pg_guard] +extern "C" { + pub fn tlist_member(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn tlist_member_ignore_relabel(node: *mut Expr, targetlist: *mut List) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn add_to_flat_tlist(tlist: *mut List, exprs: *mut List) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn get_tlist_exprs(tlist: *mut List, includeJunk: bool) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_exprs(tlist1: *mut List, tlist2: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_datatypes(tlist: *mut List, colTypes: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn tlist_same_collations(tlist: *mut List, colCollations: *mut List, junkOK: bool) -> bool; +} +#[pg_guard] +extern "C" { + pub fn apply_tlist_labeling(dest_tlist: *mut List, src_tlist: *mut List); +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_ops(groupClause: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_collations(groupClause: *mut List, tlist: *mut List) -> *mut Oid; +} +#[pg_guard] +extern "C" { + pub fn extract_grouping_cols(groupClause: *mut List, tlist: *mut List) -> *mut AttrNumber; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_sortable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn grouping_is_hashable(groupClause: *mut List) -> bool; +} +#[pg_guard] +extern "C" { + pub fn make_pathtarget_from_tlist(tlist: *mut List) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn make_tlist_from_pathtarget(target: *mut PathTarget) -> *mut List; +} +#[pg_guard] +extern "C" { + pub fn copy_pathtarget(src: *mut PathTarget) -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn create_empty_pathtarget() -> *mut PathTarget; +} +#[pg_guard] +extern "C" { + pub fn add_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr, sortgroupref: Index); +} +#[pg_guard] +extern "C" { + pub fn add_new_column_to_pathtarget(target: *mut PathTarget, expr: *mut Expr); +} +#[pg_guard] +extern "C" { + pub fn add_new_columns_to_pathtarget(target: *mut PathTarget, exprs: *mut List); +} +#[pg_guard] +extern "C" { + pub fn apply_pathtarget_labeling_to_tlist(tlist: *mut List, target: *mut PathTarget); +} +#[pg_guard] +extern "C" { + pub fn split_pathtarget_at_srfs( + root: *mut PlannerInfo, + target: *mut PathTarget, + input_target: *mut PathTarget, + targets: *mut *mut List, + targets_contain_srfs: *mut *mut List, + ); +} pub const FuncDetailCode_FUNCDETAIL_NOTFOUND: FuncDetailCode = 0; pub const FuncDetailCode_FUNCDETAIL_MULTIPLE: FuncDetailCode = 1; pub const FuncDetailCode_FUNCDETAIL_NORMAL: FuncDetailCode = 2; @@ -40544,6 +41524,25 @@ extern "C" { pub fn SystemTypeName(name: *mut ::std::os::raw::c_char) -> *mut TypeName; } #[pg_guard] +extern "C" { + pub fn get_rte_attribute_name( + rte: *mut RangeTblEntry, + attnum: AttrNumber, + ) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn get_rte_attribute_is_dropped(rte: *mut RangeTblEntry, attnum: AttrNumber) -> bool; +} +#[pg_guard] +extern "C" { + pub fn get_tle_by_resno(tlist: *mut List, resno: AttrNumber) -> *mut TargetEntry; +} +#[pg_guard] +extern "C" { + pub fn get_parse_rowmark(qry: *mut Query, rtindex: Index) -> *mut RowMarkClause; +} +#[pg_guard] extern "C" { pub static mut logical_decoding_work_mem: ::std::os::raw::c_int; } @@ -41588,438 +42587,6 @@ extern "C" { extern "C" { pub fn FreeAccessStrategy(strategy: BufferAccessStrategy); } -pub const ProcSignalReason_PROCSIG_CATCHUP_INTERRUPT: ProcSignalReason = 0; -pub const ProcSignalReason_PROCSIG_NOTIFY_INTERRUPT: ProcSignalReason = 1; -pub const ProcSignalReason_PROCSIG_PARALLEL_MESSAGE: ProcSignalReason = 2; -pub const ProcSignalReason_PROCSIG_WALSND_INIT_STOPPING: ProcSignalReason = 3; -pub const ProcSignalReason_PROCSIG_BARRIER: ProcSignalReason = 4; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_DATABASE: ProcSignalReason = 5; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_TABLESPACE: ProcSignalReason = 6; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_LOCK: ProcSignalReason = 7; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: ProcSignalReason = 8; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_BUFFERPIN: ProcSignalReason = 9; -pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: ProcSignalReason = 10; -pub const ProcSignalReason_NUM_PROCSIGNALS: ProcSignalReason = 11; -pub type ProcSignalReason = ::std::os::raw::c_uint; -pub const ProcSignalBarrierType_PROCSIGNAL_BARRIER_PLACEHOLDER: ProcSignalBarrierType = 0; -pub type ProcSignalBarrierType = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn ProcSignalShmemSize() -> Size; -} -#[pg_guard] -extern "C" { - pub fn ProcSignalShmemInit(); -} -#[pg_guard] -extern "C" { - pub fn ProcSignalInit(pss_idx: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn SendProcSignal( - pid: pid_t, - reason: ProcSignalReason, - backendId: BackendId, - ) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn EmitProcSignalBarrier(type_: ProcSignalBarrierType) -> uint64; -} -#[pg_guard] -extern "C" { - pub fn WaitForProcSignalBarrier(generation: uint64); -} -#[pg_guard] -extern "C" { - pub fn ProcessProcSignalBarrier(); -} -#[pg_guard] -extern "C" { - pub fn procsignal_sigusr1_handler(postgres_signal_arg: ::std::os::raw::c_int); -} -#[pg_guard] -extern "C" { - pub fn standby_redo(record: *mut XLogReaderState); -} -#[pg_guard] -extern "C" { - pub fn standby_desc(buf: StringInfo, record: *mut XLogReaderState); -} -#[pg_guard] -extern "C" { - pub fn standby_identify(info: uint8) -> *const ::std::os::raw::c_char; -} -#[pg_guard] -extern "C" { - pub fn standby_desc_invalidations( - buf: StringInfo, - nmsgs: ::std::os::raw::c_int, - msgs: *mut SharedInvalidationMessage, - dbId: Oid, - tsId: Oid, - relcacheInitFileInval: bool, - ); -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct xl_standby_locks { - pub nlocks: ::std::os::raw::c_int, - pub locks: __IncompleteArrayField, -} -#[repr(C)] -#[derive(Debug, Default)] -pub struct xl_running_xacts { - pub xcnt: ::std::os::raw::c_int, - pub subxcnt: ::std::os::raw::c_int, - pub subxid_overflow: bool, - pub nextXid: TransactionId, - pub oldestRunningXid: TransactionId, - pub latestCompletedXid: TransactionId, - pub xids: __IncompleteArrayField, -} -#[repr(C)] -pub struct xl_invalidations { - pub dbId: Oid, - pub tsId: Oid, - pub relcacheInitFileInval: bool, - pub nmsgs: ::std::os::raw::c_int, - pub msgs: __IncompleteArrayField, -} -impl Default for xl_invalidations { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[pg_guard] -extern "C" { - pub static mut vacuum_defer_cleanup_age: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub static mut max_standby_archive_delay: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub static mut max_standby_streaming_delay: ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn InitRecoveryTransactionEnvironment(); -} -#[pg_guard] -extern "C" { - pub fn ShutdownRecoveryTransactionEnvironment(); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithSnapshot(latestRemovedXid: TransactionId, node: RelFileNode); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithTablespace(tsid: Oid); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithDatabase(dbid: Oid); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithLock(locktag: LOCKTAG); -} -#[pg_guard] -extern "C" { - pub fn ResolveRecoveryConflictWithBufferPin(); -} -#[pg_guard] -extern "C" { - pub fn CheckRecoveryConflictDeadlock(); -} -#[pg_guard] -extern "C" { - pub fn StandbyDeadLockHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyTimeoutHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyLockTimeoutHandler(); -} -#[pg_guard] -extern "C" { - pub fn StandbyAcquireAccessExclusiveLock(xid: TransactionId, dbOid: Oid, relOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseLockTree( - xid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseAllLocks(); -} -#[pg_guard] -extern "C" { - pub fn StandbyReleaseOldLocks(oldxid: TransactionId); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RunningTransactionsData { - pub xcnt: ::std::os::raw::c_int, - pub subxcnt: ::std::os::raw::c_int, - pub subxid_overflow: bool, - pub nextXid: TransactionId, - pub oldestRunningXid: TransactionId, - pub latestCompletedXid: TransactionId, - pub xids: *mut TransactionId, -} -impl Default for RunningTransactionsData { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type RunningTransactions = *mut RunningTransactionsData; -#[pg_guard] -extern "C" { - pub fn LogAccessExclusiveLock(dbOid: Oid, relOid: Oid); -} -#[pg_guard] -extern "C" { - pub fn LogAccessExclusiveLockPrepare(); -} -#[pg_guard] -extern "C" { - pub fn LogStandbySnapshot() -> XLogRecPtr; -} -#[pg_guard] -extern "C" { - pub fn LogStandbyInvalidations( - nmsgs: ::std::os::raw::c_int, - msgs: *mut SharedInvalidationMessage, - relcacheInitFileInval: bool, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayShmemSize() -> Size; -} -#[pg_guard] -extern "C" { - pub fn CreateSharedProcArray(); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayAdd(proc_: *mut PGPROC); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayRemove(proc_: *mut PGPROC, latestXid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayEndTransaction(proc_: *mut PGPROC, latestXid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayClearTransaction(proc_: *mut PGPROC); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInitRecovery(initializedUptoXID: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayApplyRecoveryInfo(running: RunningTransactions); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayApplyXidAssignment( - topxid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn RecordKnownAssignedTransactionIds(xid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn ExpireTreeKnownAssignedTransactionIds( - xid: TransactionId, - nsubxids: ::std::os::raw::c_int, - subxids: *mut TransactionId, - max_xid: TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn ExpireAllKnownAssignedTransactionIds(); -} -#[pg_guard] -extern "C" { - pub fn ExpireOldKnownAssignedTransactionIds(xid: TransactionId); -} -#[pg_guard] -extern "C" { - pub fn GetMaxSnapshotXidCount() -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn GetMaxSnapshotSubxidCount() -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn GetSnapshotData(snapshot: Snapshot) -> Snapshot; -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInstallImportedXmin( - xmin: TransactionId, - sourcevxid: *mut VirtualTransactionId, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn ProcArrayInstallRestoredXmin(xmin: TransactionId, proc_: *mut PGPROC) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetRunningTransactionData() -> RunningTransactions; -} -#[pg_guard] -extern "C" { - pub fn TransactionIdIsInProgress(xid: TransactionId) -> bool; -} -#[pg_guard] -extern "C" { - pub fn TransactionIdIsActive(xid: TransactionId) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetOldestXmin(rel: Relation, flags: ::std::os::raw::c_int) -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetOldestActiveTransactionId() -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetOldestSafeDecodingTransactionId(catalogOnly: bool) -> TransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetVirtualXIDsDelayingChkpt( - nvxids: *mut ::std::os::raw::c_int, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn HaveVirtualXIDsDelayingChkpt( - vxids: *mut VirtualTransactionId, - nvxids: ::std::os::raw::c_int, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn BackendPidGetProc(pid: ::std::os::raw::c_int) -> *mut PGPROC; -} -#[pg_guard] -extern "C" { - pub fn BackendPidGetProcWithLock(pid: ::std::os::raw::c_int) -> *mut PGPROC; -} -#[pg_guard] -extern "C" { - pub fn BackendXidGetPid(xid: TransactionId) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn IsBackendPid(pid: ::std::os::raw::c_int) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetCurrentVirtualXIDs( - limitXmin: TransactionId, - excludeXmin0: bool, - allDbs: bool, - excludeVacuum: ::std::os::raw::c_int, - nvxids: *mut ::std::os::raw::c_int, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn GetConflictingVirtualXIDs( - limitXmin: TransactionId, - dbOid: Oid, - ) -> *mut VirtualTransactionId; -} -#[pg_guard] -extern "C" { - pub fn CancelVirtualTransaction(vxid: VirtualTransactionId, sigmode: ProcSignalReason) - -> pid_t; -} -#[pg_guard] -extern "C" { - pub fn MinimumActiveBackends(min: ::std::os::raw::c_int) -> bool; -} -#[pg_guard] -extern "C" { - pub fn CountDBBackends(databaseid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CountDBConnections(databaseid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CancelDBBackends(databaseid: Oid, sigmode: ProcSignalReason, conflictPending: bool); -} -#[pg_guard] -extern "C" { - pub fn CountUserBackends(roleid: Oid) -> ::std::os::raw::c_int; -} -#[pg_guard] -extern "C" { - pub fn CountOtherDBBackends( - databaseId: Oid, - nbackends: *mut ::std::os::raw::c_int, - nprepared: *mut ::std::os::raw::c_int, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn TerminateOtherDBBackends(databaseId: Oid); -} -#[pg_guard] -extern "C" { - pub fn XidCacheRemoveRunningXids( - xid: TransactionId, - nxids: ::std::os::raw::c_int, - xids: *const TransactionId, - latestXid: TransactionId, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArraySetReplicationSlotXmin( - xmin: TransactionId, - catalog_xmin: TransactionId, - already_locked: bool, - ); -} -#[pg_guard] -extern "C" { - pub fn ProcArrayGetReplicationSlotXmin( - xmin: *mut TransactionId, - catalog_xmin: *mut TransactionId, - ); -} pub type pg_on_exit_callback = ::std::option::Option; pub type shmem_startup_hook_type = ::std::option::Option; @@ -42067,6 +42634,438 @@ extern "C" { extern "C" { pub fn CreateSharedMemoryAndSemaphores(); } +pub const ProcSignalReason_PROCSIG_CATCHUP_INTERRUPT: ProcSignalReason = 0; +pub const ProcSignalReason_PROCSIG_NOTIFY_INTERRUPT: ProcSignalReason = 1; +pub const ProcSignalReason_PROCSIG_PARALLEL_MESSAGE: ProcSignalReason = 2; +pub const ProcSignalReason_PROCSIG_WALSND_INIT_STOPPING: ProcSignalReason = 3; +pub const ProcSignalReason_PROCSIG_BARRIER: ProcSignalReason = 4; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_DATABASE: ProcSignalReason = 5; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_TABLESPACE: ProcSignalReason = 6; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_LOCK: ProcSignalReason = 7; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: ProcSignalReason = 8; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_BUFFERPIN: ProcSignalReason = 9; +pub const ProcSignalReason_PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: ProcSignalReason = 10; +pub const ProcSignalReason_NUM_PROCSIGNALS: ProcSignalReason = 11; +pub type ProcSignalReason = ::std::os::raw::c_uint; +pub const ProcSignalBarrierType_PROCSIGNAL_BARRIER_PLACEHOLDER: ProcSignalBarrierType = 0; +pub type ProcSignalBarrierType = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn ProcSignalShmemSize() -> Size; +} +#[pg_guard] +extern "C" { + pub fn ProcSignalShmemInit(); +} +#[pg_guard] +extern "C" { + pub fn ProcSignalInit(pss_idx: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn SendProcSignal( + pid: pid_t, + reason: ProcSignalReason, + backendId: BackendId, + ) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn EmitProcSignalBarrier(type_: ProcSignalBarrierType) -> uint64; +} +#[pg_guard] +extern "C" { + pub fn WaitForProcSignalBarrier(generation: uint64); +} +#[pg_guard] +extern "C" { + pub fn ProcessProcSignalBarrier(); +} +#[pg_guard] +extern "C" { + pub fn procsignal_sigusr1_handler(postgres_signal_arg: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn standby_redo(record: *mut XLogReaderState); +} +#[pg_guard] +extern "C" { + pub fn standby_desc(buf: StringInfo, record: *mut XLogReaderState); +} +#[pg_guard] +extern "C" { + pub fn standby_identify(info: uint8) -> *const ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn standby_desc_invalidations( + buf: StringInfo, + nmsgs: ::std::os::raw::c_int, + msgs: *mut SharedInvalidationMessage, + dbId: Oid, + tsId: Oid, + relcacheInitFileInval: bool, + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct xl_standby_locks { + pub nlocks: ::std::os::raw::c_int, + pub locks: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct xl_running_xacts { + pub xcnt: ::std::os::raw::c_int, + pub subxcnt: ::std::os::raw::c_int, + pub subxid_overflow: bool, + pub nextXid: TransactionId, + pub oldestRunningXid: TransactionId, + pub latestCompletedXid: TransactionId, + pub xids: __IncompleteArrayField, +} +#[repr(C)] +pub struct xl_invalidations { + pub dbId: Oid, + pub tsId: Oid, + pub relcacheInitFileInval: bool, + pub nmsgs: ::std::os::raw::c_int, + pub msgs: __IncompleteArrayField, +} +impl Default for xl_invalidations { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[pg_guard] +extern "C" { + pub static mut vacuum_defer_cleanup_age: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut max_standby_archive_delay: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub static mut max_standby_streaming_delay: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn InitRecoveryTransactionEnvironment(); +} +#[pg_guard] +extern "C" { + pub fn ShutdownRecoveryTransactionEnvironment(); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithSnapshot(latestRemovedXid: TransactionId, node: RelFileNode); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithTablespace(tsid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithDatabase(dbid: Oid); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithLock(locktag: LOCKTAG); +} +#[pg_guard] +extern "C" { + pub fn ResolveRecoveryConflictWithBufferPin(); +} +#[pg_guard] +extern "C" { + pub fn CheckRecoveryConflictDeadlock(); +} +#[pg_guard] +extern "C" { + pub fn StandbyDeadLockHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyTimeoutHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyLockTimeoutHandler(); +} +#[pg_guard] +extern "C" { + pub fn StandbyAcquireAccessExclusiveLock(xid: TransactionId, dbOid: Oid, relOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseLockTree( + xid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseAllLocks(); +} +#[pg_guard] +extern "C" { + pub fn StandbyReleaseOldLocks(oldxid: TransactionId); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RunningTransactionsData { + pub xcnt: ::std::os::raw::c_int, + pub subxcnt: ::std::os::raw::c_int, + pub subxid_overflow: bool, + pub nextXid: TransactionId, + pub oldestRunningXid: TransactionId, + pub latestCompletedXid: TransactionId, + pub xids: *mut TransactionId, +} +impl Default for RunningTransactionsData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type RunningTransactions = *mut RunningTransactionsData; +#[pg_guard] +extern "C" { + pub fn LogAccessExclusiveLock(dbOid: Oid, relOid: Oid); +} +#[pg_guard] +extern "C" { + pub fn LogAccessExclusiveLockPrepare(); +} +#[pg_guard] +extern "C" { + pub fn LogStandbySnapshot() -> XLogRecPtr; +} +#[pg_guard] +extern "C" { + pub fn LogStandbyInvalidations( + nmsgs: ::std::os::raw::c_int, + msgs: *mut SharedInvalidationMessage, + relcacheInitFileInval: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayShmemSize() -> Size; +} +#[pg_guard] +extern "C" { + pub fn CreateSharedProcArray(); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayAdd(proc_: *mut PGPROC); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayRemove(proc_: *mut PGPROC, latestXid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayEndTransaction(proc_: *mut PGPROC, latestXid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayClearTransaction(proc_: *mut PGPROC); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInitRecovery(initializedUptoXID: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayApplyRecoveryInfo(running: RunningTransactions); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayApplyXidAssignment( + topxid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn RecordKnownAssignedTransactionIds(xid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn ExpireTreeKnownAssignedTransactionIds( + xid: TransactionId, + nsubxids: ::std::os::raw::c_int, + subxids: *mut TransactionId, + max_xid: TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn ExpireAllKnownAssignedTransactionIds(); +} +#[pg_guard] +extern "C" { + pub fn ExpireOldKnownAssignedTransactionIds(xid: TransactionId); +} +#[pg_guard] +extern "C" { + pub fn GetMaxSnapshotXidCount() -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn GetMaxSnapshotSubxidCount() -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn GetSnapshotData(snapshot: Snapshot) -> Snapshot; +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInstallImportedXmin( + xmin: TransactionId, + sourcevxid: *mut VirtualTransactionId, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn ProcArrayInstallRestoredXmin(xmin: TransactionId, proc_: *mut PGPROC) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetRunningTransactionData() -> RunningTransactions; +} +#[pg_guard] +extern "C" { + pub fn TransactionIdIsInProgress(xid: TransactionId) -> bool; +} +#[pg_guard] +extern "C" { + pub fn TransactionIdIsActive(xid: TransactionId) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetOldestXmin(rel: Relation, flags: ::std::os::raw::c_int) -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetOldestActiveTransactionId() -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetOldestSafeDecodingTransactionId(catalogOnly: bool) -> TransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetVirtualXIDsDelayingChkpt( + nvxids: *mut ::std::os::raw::c_int, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn HaveVirtualXIDsDelayingChkpt( + vxids: *mut VirtualTransactionId, + nvxids: ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BackendPidGetProc(pid: ::std::os::raw::c_int) -> *mut PGPROC; +} +#[pg_guard] +extern "C" { + pub fn BackendPidGetProcWithLock(pid: ::std::os::raw::c_int) -> *mut PGPROC; +} +#[pg_guard] +extern "C" { + pub fn BackendXidGetPid(xid: TransactionId) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn IsBackendPid(pid: ::std::os::raw::c_int) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetCurrentVirtualXIDs( + limitXmin: TransactionId, + excludeXmin0: bool, + allDbs: bool, + excludeVacuum: ::std::os::raw::c_int, + nvxids: *mut ::std::os::raw::c_int, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn GetConflictingVirtualXIDs( + limitXmin: TransactionId, + dbOid: Oid, + ) -> *mut VirtualTransactionId; +} +#[pg_guard] +extern "C" { + pub fn CancelVirtualTransaction(vxid: VirtualTransactionId, sigmode: ProcSignalReason) + -> pid_t; +} +#[pg_guard] +extern "C" { + pub fn MinimumActiveBackends(min: ::std::os::raw::c_int) -> bool; +} +#[pg_guard] +extern "C" { + pub fn CountDBBackends(databaseid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CountDBConnections(databaseid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CancelDBBackends(databaseid: Oid, sigmode: ProcSignalReason, conflictPending: bool); +} +#[pg_guard] +extern "C" { + pub fn CountUserBackends(roleid: Oid) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn CountOtherDBBackends( + databaseId: Oid, + nbackends: *mut ::std::os::raw::c_int, + nprepared: *mut ::std::os::raw::c_int, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn TerminateOtherDBBackends(databaseId: Oid); +} +#[pg_guard] +extern "C" { + pub fn XidCacheRemoveRunningXids( + xid: TransactionId, + nxids: ::std::os::raw::c_int, + xids: *const TransactionId, + latestXid: TransactionId, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArraySetReplicationSlotXmin( + xmin: TransactionId, + catalog_xmin: TransactionId, + already_locked: bool, + ); +} +#[pg_guard] +extern "C" { + pub fn ProcArrayGetReplicationSlotXmin( + xmin: *mut TransactionId, + catalog_xmin: *mut TransactionId, + ); +} #[pg_guard] extern "C" { pub static mut whereToSendOutput: CommandDest; @@ -53178,6 +54177,57 @@ extern "C" { extern "C" { pub fn AdjustTimeForTypmod(time: *mut TimeADT, typmod: int32); } +#[pg_guard] +extern "C" { + pub static mut extra_float_digits: ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float_overflow_error(); +} +#[pg_guard] +extern "C" { + pub fn float_underflow_error(); +} +#[pg_guard] +extern "C" { + pub fn float_zero_divide_error(); +} +#[pg_guard] +extern "C" { + pub fn is_infinite(val: float8) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float8in_internal( + num: *mut ::std::os::raw::c_char, + endptr_p: *mut *mut ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + orig_string: *const ::std::os::raw::c_char, + ) -> float8; +} +#[pg_guard] +extern "C" { + pub fn float8in_internal_opt_error( + num: *mut ::std::os::raw::c_char, + endptr_p: *mut *mut ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + orig_string: *const ::std::os::raw::c_char, + have_error: *mut bool, + ) -> float8; +} +#[pg_guard] +extern "C" { + pub fn float8out_internal(num: float8) -> *mut ::std::os::raw::c_char; +} +#[pg_guard] +extern "C" { + pub fn float4_cmp_internal(a: float4, b: float4) -> ::std::os::raw::c_int; +} +#[pg_guard] +extern "C" { + pub fn float8_cmp_internal(a: float8, b: float8) -> ::std::os::raw::c_int; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Point { @@ -53558,238 +54608,6 @@ extern "C" { extern "C" { pub fn JsonbTypeName(jb: *mut JsonbValue) -> *const ::std::os::raw::c_char; } -pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; -pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; -pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; -pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; -pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; -pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; -pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; -pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; -pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; -pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; -pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; -pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; -pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; -pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; -pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; -pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; -pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; -pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; -pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; -pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; -pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; -pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; -pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; -pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; -pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; -pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; -pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; -pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; -pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; -pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; -pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; -pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; -pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; -pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; -pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; -pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; -pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; -pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; -pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; -pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; -pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; -pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; -pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; -pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; -pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; -pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; -pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; -pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; -pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; -pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; -pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; -pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; -pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; -pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; -pub const SysCacheIdentifier_STATEXTDATASTXOID: SysCacheIdentifier = 55; -pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 56; -pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 57; -pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 58; -pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 59; -pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 60; -pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 61; -pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 62; -pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 63; -pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 64; -pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 65; -pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 66; -pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 67; -pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 68; -pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 69; -pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 70; -pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 71; -pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 72; -pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 73; -pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 74; -pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 75; -pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 76; -pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 77; -pub type SysCacheIdentifier = ::std::os::raw::c_uint; -#[pg_guard] -extern "C" { - pub fn InitCatalogCache(); -} -#[pg_guard] -extern "C" { - pub fn InitCatalogCachePhase2(); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache3( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCache4( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn ReleaseSysCache(tuple: HeapTuple); -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopy( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExists( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> bool; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheOid( - cacheId: ::std::os::raw::c_int, - oidcol: AttrNumber, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> Oid; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttName( - relid: Oid, - attname: *const ::std::os::raw::c_char, - ) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; -} -#[pg_guard] -extern "C" { - pub fn SysCacheGetAttr( - cacheId: ::std::os::raw::c_int, - tup: HeapTuple, - attributeNumber: AttrNumber, - isNull: *mut bool, - ) -> Datum; -} -#[pg_guard] -extern "C" { - pub fn GetSysCacheHashValue( - cacheId: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - key4: Datum, - ) -> uint32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct catclist { - _unused: [u8; 0], -} -#[pg_guard] -extern "C" { - pub fn SearchSysCacheList( - cacheId: ::std::os::raw::c_int, - nkeys: ::std::os::raw::c_int, - key1: Datum, - key2: Datum, - key3: Datum, - ) -> *mut catclist; -} -#[pg_guard] -extern "C" { - pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); -} -#[pg_guard] -extern "C" { - pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationHasSysCache(relid: Oid) -> bool; -} -#[pg_guard] -extern "C" { - pub fn RelationSupportsSysCache(relid: Oid) -> bool; -} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OpBtreeInterpretation { @@ -54307,6 +55125,60 @@ extern "C" { extern "C" { pub fn get_index_isclustered(index_oid: Oid) -> bool; } +pub type SamplerRandomState = [::std::os::raw::c_ushort; 3usize]; +#[pg_guard] +extern "C" { + pub fn sampler_random_init_state( + seed: ::std::os::raw::c_long, + randstate: *mut ::std::os::raw::c_ushort, + ); +} +#[pg_guard] +extern "C" { + pub fn sampler_random_fract(randstate: *mut ::std::os::raw::c_ushort) -> f64; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BlockSamplerData { + pub N: BlockNumber, + pub n: ::std::os::raw::c_int, + pub t: BlockNumber, + pub m: ::std::os::raw::c_int, + pub randstate: SamplerRandomState, +} +pub type BlockSampler = *mut BlockSamplerData; +#[pg_guard] +extern "C" { + pub fn BlockSampler_Init( + bs: BlockSampler, + nblocks: BlockNumber, + samplesize: ::std::os::raw::c_int, + randseed: ::std::os::raw::c_long, + ) -> BlockNumber; +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_HasMore(bs: BlockSampler) -> bool; +} +#[pg_guard] +extern "C" { + pub fn BlockSampler_Next(bs: BlockSampler) -> BlockNumber; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ReservoirStateData { + pub W: f64, + pub randstate: SamplerRandomState, +} +pub type ReservoirState = *mut ReservoirStateData; +#[pg_guard] +extern "C" { + pub fn reservoir_init_selection_state(rs: ReservoirState, n: ::std::os::raw::c_int); +} +#[pg_guard] +extern "C" { + pub fn reservoir_get_next_S(rs: ReservoirState, t: f64, n: ::std::os::raw::c_int) -> f64; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VariableStatData { @@ -54604,6 +55476,238 @@ extern "C" { varRelid: ::std::os::raw::c_int, ) -> Selectivity; } +pub const SysCacheIdentifier_AGGFNOID: SysCacheIdentifier = 0; +pub const SysCacheIdentifier_AMNAME: SysCacheIdentifier = 1; +pub const SysCacheIdentifier_AMOID: SysCacheIdentifier = 2; +pub const SysCacheIdentifier_AMOPOPID: SysCacheIdentifier = 3; +pub const SysCacheIdentifier_AMOPSTRATEGY: SysCacheIdentifier = 4; +pub const SysCacheIdentifier_AMPROCNUM: SysCacheIdentifier = 5; +pub const SysCacheIdentifier_ATTNAME: SysCacheIdentifier = 6; +pub const SysCacheIdentifier_ATTNUM: SysCacheIdentifier = 7; +pub const SysCacheIdentifier_AUTHMEMMEMROLE: SysCacheIdentifier = 8; +pub const SysCacheIdentifier_AUTHMEMROLEMEM: SysCacheIdentifier = 9; +pub const SysCacheIdentifier_AUTHNAME: SysCacheIdentifier = 10; +pub const SysCacheIdentifier_AUTHOID: SysCacheIdentifier = 11; +pub const SysCacheIdentifier_CASTSOURCETARGET: SysCacheIdentifier = 12; +pub const SysCacheIdentifier_CLAAMNAMENSP: SysCacheIdentifier = 13; +pub const SysCacheIdentifier_CLAOID: SysCacheIdentifier = 14; +pub const SysCacheIdentifier_COLLNAMEENCNSP: SysCacheIdentifier = 15; +pub const SysCacheIdentifier_COLLOID: SysCacheIdentifier = 16; +pub const SysCacheIdentifier_CONDEFAULT: SysCacheIdentifier = 17; +pub const SysCacheIdentifier_CONNAMENSP: SysCacheIdentifier = 18; +pub const SysCacheIdentifier_CONSTROID: SysCacheIdentifier = 19; +pub const SysCacheIdentifier_CONVOID: SysCacheIdentifier = 20; +pub const SysCacheIdentifier_DATABASEOID: SysCacheIdentifier = 21; +pub const SysCacheIdentifier_DEFACLROLENSPOBJ: SysCacheIdentifier = 22; +pub const SysCacheIdentifier_ENUMOID: SysCacheIdentifier = 23; +pub const SysCacheIdentifier_ENUMTYPOIDNAME: SysCacheIdentifier = 24; +pub const SysCacheIdentifier_EVENTTRIGGERNAME: SysCacheIdentifier = 25; +pub const SysCacheIdentifier_EVENTTRIGGEROID: SysCacheIdentifier = 26; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPERNAME: SysCacheIdentifier = 27; +pub const SysCacheIdentifier_FOREIGNDATAWRAPPEROID: SysCacheIdentifier = 28; +pub const SysCacheIdentifier_FOREIGNSERVERNAME: SysCacheIdentifier = 29; +pub const SysCacheIdentifier_FOREIGNSERVEROID: SysCacheIdentifier = 30; +pub const SysCacheIdentifier_FOREIGNTABLEREL: SysCacheIdentifier = 31; +pub const SysCacheIdentifier_INDEXRELID: SysCacheIdentifier = 32; +pub const SysCacheIdentifier_LANGNAME: SysCacheIdentifier = 33; +pub const SysCacheIdentifier_LANGOID: SysCacheIdentifier = 34; +pub const SysCacheIdentifier_NAMESPACENAME: SysCacheIdentifier = 35; +pub const SysCacheIdentifier_NAMESPACEOID: SysCacheIdentifier = 36; +pub const SysCacheIdentifier_OPERNAMENSP: SysCacheIdentifier = 37; +pub const SysCacheIdentifier_OPEROID: SysCacheIdentifier = 38; +pub const SysCacheIdentifier_OPFAMILYAMNAMENSP: SysCacheIdentifier = 39; +pub const SysCacheIdentifier_OPFAMILYOID: SysCacheIdentifier = 40; +pub const SysCacheIdentifier_PARTRELID: SysCacheIdentifier = 41; +pub const SysCacheIdentifier_PROCNAMEARGSNSP: SysCacheIdentifier = 42; +pub const SysCacheIdentifier_PROCOID: SysCacheIdentifier = 43; +pub const SysCacheIdentifier_PUBLICATIONNAME: SysCacheIdentifier = 44; +pub const SysCacheIdentifier_PUBLICATIONOID: SysCacheIdentifier = 45; +pub const SysCacheIdentifier_PUBLICATIONREL: SysCacheIdentifier = 46; +pub const SysCacheIdentifier_PUBLICATIONRELMAP: SysCacheIdentifier = 47; +pub const SysCacheIdentifier_RANGETYPE: SysCacheIdentifier = 48; +pub const SysCacheIdentifier_RELNAMENSP: SysCacheIdentifier = 49; +pub const SysCacheIdentifier_RELOID: SysCacheIdentifier = 50; +pub const SysCacheIdentifier_REPLORIGIDENT: SysCacheIdentifier = 51; +pub const SysCacheIdentifier_REPLORIGNAME: SysCacheIdentifier = 52; +pub const SysCacheIdentifier_RULERELNAME: SysCacheIdentifier = 53; +pub const SysCacheIdentifier_SEQRELID: SysCacheIdentifier = 54; +pub const SysCacheIdentifier_STATEXTDATASTXOID: SysCacheIdentifier = 55; +pub const SysCacheIdentifier_STATEXTNAMENSP: SysCacheIdentifier = 56; +pub const SysCacheIdentifier_STATEXTOID: SysCacheIdentifier = 57; +pub const SysCacheIdentifier_STATRELATTINH: SysCacheIdentifier = 58; +pub const SysCacheIdentifier_SUBSCRIPTIONNAME: SysCacheIdentifier = 59; +pub const SysCacheIdentifier_SUBSCRIPTIONOID: SysCacheIdentifier = 60; +pub const SysCacheIdentifier_SUBSCRIPTIONRELMAP: SysCacheIdentifier = 61; +pub const SysCacheIdentifier_TABLESPACEOID: SysCacheIdentifier = 62; +pub const SysCacheIdentifier_TRFOID: SysCacheIdentifier = 63; +pub const SysCacheIdentifier_TRFTYPELANG: SysCacheIdentifier = 64; +pub const SysCacheIdentifier_TSCONFIGMAP: SysCacheIdentifier = 65; +pub const SysCacheIdentifier_TSCONFIGNAMENSP: SysCacheIdentifier = 66; +pub const SysCacheIdentifier_TSCONFIGOID: SysCacheIdentifier = 67; +pub const SysCacheIdentifier_TSDICTNAMENSP: SysCacheIdentifier = 68; +pub const SysCacheIdentifier_TSDICTOID: SysCacheIdentifier = 69; +pub const SysCacheIdentifier_TSPARSERNAMENSP: SysCacheIdentifier = 70; +pub const SysCacheIdentifier_TSPARSEROID: SysCacheIdentifier = 71; +pub const SysCacheIdentifier_TSTEMPLATENAMENSP: SysCacheIdentifier = 72; +pub const SysCacheIdentifier_TSTEMPLATEOID: SysCacheIdentifier = 73; +pub const SysCacheIdentifier_TYPENAMENSP: SysCacheIdentifier = 74; +pub const SysCacheIdentifier_TYPEOID: SysCacheIdentifier = 75; +pub const SysCacheIdentifier_USERMAPPINGOID: SysCacheIdentifier = 76; +pub const SysCacheIdentifier_USERMAPPINGUSERSERVER: SysCacheIdentifier = 77; +pub type SysCacheIdentifier = ::std::os::raw::c_uint; +#[pg_guard] +extern "C" { + pub fn InitCatalogCache(); +} +#[pg_guard] +extern "C" { + pub fn InitCatalogCachePhase2(); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache1(cacheId: ::std::os::raw::c_int, key1: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache2(cacheId: ::std::os::raw::c_int, key1: Datum, key2: Datum) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache3( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCache4( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn ReleaseSysCache(tuple: HeapTuple); +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopy( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExists( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> bool; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheOid( + cacheId: ::std::os::raw::c_int, + oidcol: AttrNumber, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> Oid; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttName( + relid: Oid, + attname: *const ::std::os::raw::c_char, + ) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheExistsAttName(relid: Oid, attname: *const ::std::os::raw::c_char) -> bool; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheCopyAttNum(relid: Oid, attnum: int16) -> HeapTuple; +} +#[pg_guard] +extern "C" { + pub fn SysCacheGetAttr( + cacheId: ::std::os::raw::c_int, + tup: HeapTuple, + attributeNumber: AttrNumber, + isNull: *mut bool, + ) -> Datum; +} +#[pg_guard] +extern "C" { + pub fn GetSysCacheHashValue( + cacheId: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + key4: Datum, + ) -> uint32; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct catclist { + _unused: [u8; 0], +} +#[pg_guard] +extern "C" { + pub fn SearchSysCacheList( + cacheId: ::std::os::raw::c_int, + nkeys: ::std::os::raw::c_int, + key1: Datum, + key2: Datum, + key3: Datum, + ) -> *mut catclist; +} +#[pg_guard] +extern "C" { + pub fn SysCacheInvalidate(cacheId: ::std::os::raw::c_int, hashValue: uint32); +} +#[pg_guard] +extern "C" { + pub fn RelationInvalidatesSnapshotsOnly(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationHasSysCache(relid: Oid) -> bool; +} +#[pg_guard] +extern "C" { + pub fn RelationSupportsSysCache(relid: Oid) -> bool; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DomainConstraintCache { @@ -59146,66 +60250,6 @@ impl std::fmt::Display for SubscriptingRef { ) } } -impl pg_sys::PgNode for SupportRequestCost { - type NodeType = SupportRequestCost; -} -impl std::fmt::Display for SupportRequestCost { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestIndexCondition { - type NodeType = SupportRequestIndexCondition; -} -impl std::fmt::Display for SupportRequestIndexCondition { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestRows { - type NodeType = SupportRequestRows; -} -impl std::fmt::Display for SupportRequestRows { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestSelectivity { - type NodeType = SupportRequestSelectivity; -} -impl std::fmt::Display for SupportRequestSelectivity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} -impl pg_sys::PgNode for SupportRequestSimplify { - type NodeType = SupportRequestSimplify; -} -impl std::fmt::Display for SupportRequestSimplify { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - crate::node_to_string_for_display(self.as_node_ptr() as *mut crate::Node) - ) - } -} impl pg_sys::PgNode for TableAmRoutine { type NodeType = TableAmRoutine; } diff --git a/pgx-tests/Cargo.toml b/pgx-tests/Cargo.toml index 08466ef5d..062d950bb 100644 --- a/pgx-tests/Cargo.toml +++ b/pgx-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx-tests" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -29,12 +29,12 @@ no-default-features = true colored = "2.0.0" lazy_static = "1.4.0" libc = "0.2.82" -pgx = { path = "../pgx", default-features = false, version= "0.1.15"} -pgx-macros = { path = "../pgx-macros", version= "0.1.15"} -pgx-utils = { path = "../pgx-utils", version= "0.1.15"} +pgx = { path = "../pgx", default-features = false, version= "0.1.16"} +pgx-macros = { path = "../pgx-macros", version= "0.1.16"} +pgx-utils = { path = "../pgx-utils", version= "0.1.16"} postgres = "0.19.0" regex = "1.4.3" -serde = "1.0.119" +serde = "1.0.120" serde_json = "1.0.61" shutdown_hooks = "0.1.0" time = "0.2.24" diff --git a/pgx-utils/Cargo.toml b/pgx-utils/Cargo.toml index bb551d4cd..563d9339f 100644 --- a/pgx-utils/Cargo.toml +++ b/pgx-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx-utils" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -16,8 +16,8 @@ dirs = "3.0.1" proc-macro2 = "1.0.24" quote = "1.0.8" regex = "1.4.3" -serde = "1.0.119" -serde_derive = "1.0.119" +serde = "1.0.120" +serde_derive = "1.0.120" syn = { version = "1.0.58", features = [ "extra-traits", "full", "fold", "parsing" ] } toml = "0.5.8" unescape = "0.1.0" diff --git a/pgx/Cargo.toml b/pgx/Cargo.toml index beaa798c5..588f2077a 100644 --- a/pgx/Cargo.toml +++ b/pgx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pgx" -version = "0.1.15" +version = "0.1.16" authors = ["ZomboDB, LLC "] edition = "2018" license = "MIT" @@ -29,10 +29,10 @@ no-default-features = true [dependencies] enum-primitive-derive = "0.2.1" num-traits = "0.2.14" -seahash = "4.0.1" -pgx-macros = { path = "../pgx-macros/", version = "0.1.15" } -pgx-pg-sys = { path = "../pgx-pg-sys", version = "0.1.15" } -serde = { version = "1.0.119", features = [ "derive" ] } +seahash = "4.1.0" +pgx-macros = { path = "../pgx-macros/", version = "0.1.16" } +pgx-pg-sys = { path = "../pgx-pg-sys", version = "0.1.16" } +serde = { version = "1.0.120", features = [ "derive" ] } serde_cbor = "0.11.1" serde_json = "1.0.61" time = "0.2.24"