From 2db43e4f53b1c3bcfec1175748fb28ec551de790 Mon Sep 17 00:00:00 2001 From: syvb Date: Fri, 2 Jun 2023 17:01:28 -0400 Subject: [PATCH 1/5] update pgrx version --- .github/workflows/ci.yml | 4 +- Cargo.lock | 1242 +++++++++-------- Readme.md | 16 +- crates/aggregate_builder/Readme.md | 18 +- crates/aggregate_builder/src/lib.rs | 18 +- docker/ci/setup.sh | 20 +- docs/client.md | 4 +- docs/release.md | 12 +- extension/Cargo.toml | 20 +- extension/src/accessors.rs | 2 +- extension/src/accessors/tests.rs | 2 +- extension/src/aggregate_builder_tests.rs | 6 +- extension/src/aggregate_utils.rs | 4 +- extension/src/asap.rs | 6 +- extension/src/candlestick.rs | 4 +- extension/src/counter_agg.rs | 22 +- extension/src/counter_agg/accessors.rs | 2 +- extension/src/countminsketch.rs | 4 +- extension/src/datum_utils.rs | 6 +- extension/src/frequency.rs | 26 +- extension/src/gauge_agg.rs | 8 +- extension/src/heartbeat_agg.rs | 4 +- extension/src/heartbeat_agg/accessors.rs | 2 +- extension/src/hyperloglog.rs | 18 +- extension/src/lib.rs | 8 +- extension/src/lttb.rs | 6 +- extension/src/nmost.rs | 8 +- extension/src/nmost/max_by_float.rs | 4 +- extension/src/nmost/max_by_int.rs | 4 +- extension/src/nmost/max_by_time.rs | 4 +- extension/src/nmost/max_float.rs | 4 +- extension/src/nmost/max_int.rs | 4 +- extension/src/nmost/max_time.rs | 4 +- extension/src/nmost/min_by_float.rs | 4 +- extension/src/nmost/min_by_int.rs | 4 +- extension/src/nmost/min_by_time.rs | 4 +- extension/src/nmost/min_float.rs | 4 +- extension/src/nmost/min_int.rs | 4 +- extension/src/nmost/min_time.rs | 4 +- extension/src/palloc.rs | 10 +- extension/src/pg_any_element.rs | 4 +- extension/src/range.rs | 6 +- extension/src/raw.rs | 6 +- extension/src/saturation.rs | 4 +- extension/src/serialization.rs | 4 +- extension/src/serialization/collations.rs | 10 +- extension/src/serialization/functions.rs | 6 +- extension/src/serialization/types.rs | 8 +- extension/src/stabilization_tests.rs | 8 +- extension/src/state_aggregate.rs | 166 +-- extension/src/state_aggregate/rollup.rs | 2 +- extension/src/stats_agg.rs | 14 +- extension/src/tdigest.rs | 8 +- extension/src/time_vector.rs | 6 +- extension/src/time_vector/pipeline.rs | 12 +- .../src/time_vector/pipeline/aggregation.rs | 6 +- .../src/time_vector/pipeline/arithmetic.rs | 6 +- extension/src/time_vector/pipeline/delta.rs | 6 +- .../src/time_vector/pipeline/expansion.rs | 8 +- extension/src/time_vector/pipeline/fill_to.rs | 6 +- extension/src/time_vector/pipeline/filter.rs | 6 +- extension/src/time_vector/pipeline/lambda.rs | 6 +- .../time_vector/pipeline/lambda/executor.rs | 6 +- .../src/time_vector/pipeline/lambda/parser.rs | 6 +- extension/src/time_vector/pipeline/map.rs | 10 +- extension/src/time_vector/pipeline/sort.rs | 6 +- extension/src/time_weighted_average.rs | 10 +- .../src/time_weighted_average/accessors.rs | 4 +- extension/src/type_builder.rs | 52 +- extension/src/uddsketch.rs | 8 +- extension/src/utilities.rs | 6 +- tools/build | 36 +- tools/dependencies.sh | 4 +- tools/post-install/src/main.rs | 2 +- tools/release | 2 +- tools/testbin | 14 +- tools/update-tester/Readme.md | 6 +- tools/update-tester/src/installer.rs | 28 +- tools/update-tester/src/main.rs | 28 +- 79 files changed, 1055 insertions(+), 1031 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8404f57a..3f85cb9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,10 +121,10 @@ jobs: key: ${{ runner.os }}-test-pg${{ matrix.pgversion }}-target-${{ hashFiles('Cargo.lock', '.github/workflows/ci.yml') }} restore-keys: ${{ runner.os }}-test-pg${{ matrix.pgversion }}-target- - - name: Run pgx tests + - name: Run pgrx tests run: | if [ "${{ matrix.container.version }}" = 7 ]; then - # needed for pgx to find clang + # needed for pgrx to find clang set +e # will succeed but have non-zero exit code . scl_source enable llvm-toolset-7 set -e diff --git a/Cargo.lock b/Cargo.lock index 07ef8b71..35447152 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,23 +8,38 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "approx" @@ -50,20 +65,20 @@ version = "0.1.0" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "atomic-polyfill" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c041a8d9751a520ee19656232a18971f18946a7900f1520ee4400002244dd89" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" dependencies = [ "critical-section", ] @@ -84,7 +99,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -96,25 +111,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "bare-metal" -version = "1.0.0" +name = "base64" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.13.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bincode" @@ -127,40 +133,36 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.60.1" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", "lazycell", "peeking_take_while", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", + "syn 2.0.18", ] [[package]] -name = "bit_field" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" - -[[package]] -name = "bitfield" -version = "0.13.2" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" [[package]] name = "bitvec" @@ -176,20 +178,21 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bstr" -version = "0.2.17" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" dependencies = [ "memchr", + "serde", ] [[package]] @@ -206,9 +209,19 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cargo_toml" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +dependencies = [ + "serde", + "toml", +] [[package]] name = "cauchy" @@ -222,6 +235,12 @@ dependencies = [ "serde", ] +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + [[package]] name = "cexpr" version = "0.6.0" @@ -239,9 +258,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -250,12 +269,12 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.17" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_lex 0.2.4", "indexmap", "strsim", @@ -266,13 +285,12 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex 0.3.1", "once_cell", ] @@ -282,21 +300,31 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eca953650a7350560b61db95a0ab1d9c6f7b74d146a9e08fb258b834f3cf7e2c" dependencies = [ - "clap 4.1.4", + "clap 4.3.1", "doc-comment", ] +[[package]] +name = "clap_builder" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +dependencies = [ + "anstyle", + "bitflags 1.3.2", + "clap_lex 0.5.0", +] + [[package]] name = "clap_derive" -version = "4.1.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -310,12 +338,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "colored" @@ -344,27 +369,18 @@ version = "0.1.0" [[package]] name = "convert_case" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cortex-m" -version = "0.7.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70858629a458fdfd39f9675c4dc309411f2a3f83bede76988d81bf1a0ecee9e0" -dependencies = [ - "bare-metal 0.2.5", - "bitfield", - "embedded-hal", - "volatile-register", -] +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "counter-agg" @@ -388,30 +404,24 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] [[package]] name = "critical-section" -version = "0.2.7" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95da181745b56d4bd339530ec393508910c909c784e8962d15d722bacf0bcbcd" -dependencies = [ - "bare-metal 1.0.0", - "cfg-if", - "cortex-m", - "riscv", -] +checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -419,9 +429,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -430,26 +440,24 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.10" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", - "once_cell", + "memoffset 0.8.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -464,9 +472,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -475,22 +483,23 @@ dependencies = [ [[package]] name = "dirs" -version = "4.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -501,26 +510,36 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] -name = "embedded-hal" -version = "0.2.7" +name = "encodings" +version = "0.1.0" +dependencies = [ + "quickcheck", + "quickcheck_macros", +] + +[[package]] +name = "enum-map" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +checksum = "988f0d17a0fa38291e5f41f71ea8d46a5d5497b9054d5a759fae2cbb819f2356" dependencies = [ - "nb 0.1.3", - "void", + "enum-map-derive", ] [[package]] -name = "encodings" -version = "0.1.0" +name = "enum-map-derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4da76b3b6116d758c7ba93f7ec6a35d2e2cf24feda76c6e38a375f4d5c59f2" dependencies = [ - "quickcheck", - "quickcheck_macros", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -533,6 +552,27 @@ dependencies = [ "regex", ] +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "eyre" version = "0.6.8" @@ -570,7 +610,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -596,9 +636,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-channel" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -606,38 +646,38 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-macro" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "futures-sink" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-macro", @@ -650,9 +690,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -669,9 +709,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -680,17 +720,17 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "bstr", "fnv", "log", @@ -703,7 +743,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "ignore", "walkdir", ] @@ -757,6 +797,21 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hexf" version = "0.2.1" @@ -764,7 +819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6618f4550dcd7d9ddb5126ab18d48dfa31aa952159cb832390bda464d3bc827e" dependencies = [ "hexf-parse", - "syn", + "syn 1.0.109", ] [[package]] @@ -805,11 +860,10 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" dependencies = [ - "crossbeam-utils", "globset", "lazy_static", "log", @@ -829,28 +883,39 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "lazy_static" @@ -866,15 +931,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", "winapi", @@ -882,15 +947,21 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -898,36 +969,25 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "matchers" -version = "0.1.0" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata", -] +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] name = "matrixmultiply" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" dependencies = [ + "autocfg", "rawpointer", ] [[package]] name = "md-5" -version = "0.10.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ "digest", ] @@ -940,9 +1000,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -955,14 +1024,13 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "0.8.4" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -991,29 +1059,14 @@ checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.0.0", + "syn 1.0.109", ] -[[package]] -name = "nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" - [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -1021,28 +1074,18 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" -dependencies = [ - "winapi", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" dependencies = [ - "overload", "winapi", ] [[package]] name = "num-complex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", "rand", @@ -1082,19 +1125,25 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" + +[[package]] +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" @@ -1108,15 +1157,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "owo-colors" @@ -1136,22 +1179,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] name = "paste" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "pathsearch" @@ -1205,7 +1248,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1221,59 +1264,58 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", ] [[package]] -name = "pgx" -version = "0.7.1" +name = "pgrx" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc91f19f84e7c1ba7b25953b042bd487b6e1bbec4c3af09f61a6ac31207ff776" +checksum = "807d11f60735140422c08faf7ae239b21e9f4339bb9e9fde25a5e0a76369a625" dependencies = [ "atomic-traits", - "bitflags", + "bitflags 2.3.1", "bitvec", + "enum-map", "heapless", "libc", "once_cell", - "pgx-macros", - "pgx-pg-sys", - "pgx-sql-entity-graph", + "pgrx-macros", + "pgrx-pg-sys", + "pgrx-sql-entity-graph", "seahash", "seq-macro", "serde", "serde_cbor", "serde_json", "thiserror", - "time", - "tracing", - "tracing-error", - "uuid 1.3.0", + "uuid 1.3.3", ] [[package]] -name = "pgx-macros" -version = "0.7.1" +name = "pgrx-macros" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebfde3c33353d42c2fbcc76bea758b37018b33b1391c93d6402546569914e94" +checksum = "6818d4d69e83673d50b83525c48c298a6d94278af2b73e9eed5c79b3299addbc" dependencies = [ - "pgx-sql-entity-graph", + "pgrx-sql-entity-graph", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "pgx-pg-config" -version = "0.7.1" +name = "pgrx-pg-config" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97c27bab88fdb7b94e549b02267ab9595bd9d1043718d6d72bc2d34cf1e3952" +checksum = "d6ef77b2d9d59b9825f1949d3c3565468672fd11200d4609e9e1ae8afd5c5aca" dependencies = [ + "cargo_toml", "dirs", "eyre", "owo-colors", @@ -1286,68 +1328,62 @@ dependencies = [ ] [[package]] -name = "pgx-pg-sys" -version = "0.7.1" +name = "pgrx-pg-sys" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79c48c564bed305d202b852321603107e5f3ac31f25ea2cc4031475f38d0b3" +checksum = "c790691712b3bf67e0d3a4fc3b92458c9a23f105b5ae472cf11c7dc2ec8ee4ed" dependencies = [ "bindgen", "eyre", "libc", - "memoffset", + "memoffset 0.9.0", "once_cell", - "pgx-macros", - "pgx-pg-config", - "pgx-sql-entity-graph", + "pgrx-macros", + "pgrx-pg-config", + "pgrx-sql-entity-graph", "proc-macro2", "quote", "serde", "shlex", "sptr", - "syn", + "syn 1.0.109", ] [[package]] -name = "pgx-sql-entity-graph" -version = "0.7.1" +name = "pgrx-sql-entity-graph" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573a8d8c23be24c39f7b7fbbc7e15d95aa0327acd61ba95c9c9f237fec51f205" +checksum = "6287a0592c3bca75ceab11eb6b3ab189158e935e08215a708b47503db5b4f848" dependencies = [ "convert_case", "eyre", "petgraph", "proc-macro2", "quote", - "regex", - "seq-macro", - "syn", - "tracing", - "tracing-error", - "tracing-subscriber", + "syn 1.0.109", "unescape", ] [[package]] -name = "pgx-tests" -version = "0.7.1" +name = "pgrx-tests" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc09f25ae560bc4e3308022999416966beda5b60d2957b9ab92bffaf2d6a86c3" +checksum = "36de0f06f2b17e19700527b506c1f1021d651fe52021eaeda623cb39908b0fb3" dependencies = [ "clap-cargo", "eyre", "libc", "once_cell", "owo-colors", - "pgx", - "pgx-macros", - "pgx-pg-config", + "pgrx", + "pgrx-macros", + "pgrx-pg-config", "postgres", "regex", "serde", "serde_json", "sysinfo", "thiserror", - "time", ] [[package]] @@ -1390,9 +1426,9 @@ dependencies = [ [[package]] name = "postgres" -version = "0.19.4" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960c214283ef8f0027974c03e9014517ced5db12f021a9abb66185a5751fab0a" +checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" dependencies = [ "bytes", "fallible-iterator", @@ -1404,11 +1440,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" +checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" dependencies = [ - "base64", + "base64 0.21.2", "byteorder", "bytes", "fallible-iterator", @@ -1422,9 +1458,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" dependencies = [ "bytes", "fallible-iterator", @@ -1437,39 +1473,25 @@ version = "0.1.0" [[package]] name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "prettyplease" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "3b69d39aab54d069e7f2fe8cb970493e7834601ca2d8c65fd7bbd183578080d1" dependencies = [ "proc-macro2", - "quote", - "version_check", + "syn 2.0.18", ] [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -1480,7 +1502,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "getopts", "memchr", "unicase", @@ -1505,14 +1527,14 @@ checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -1546,9 +1568,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] @@ -1571,20 +1593,19 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1598,7 +1619,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1614,50 +1635,20 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.1", "memchr", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "riscv" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6907ccdd7a31012b70faf2af85cd9e5ba97657cc3987c4f13f8e4d2c2a088aba" -dependencies = [ - "bare-metal 1.0.0", - "bit_field", - "riscv-target", -] - -[[package]] -name = "riscv-target" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88aa938cda42a0cf62a20cfe8d139ff1af20c2e681212b5b34adb5a58333f222" -dependencies = [ - "lazy_static", - "regex", -] +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "ron" @@ -1665,8 +1656,8 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86018df177b1beef6c7c8ef949969c4f7cb9a9344181b92486b23c79995bdaa4" dependencies = [ - "base64", - "bitflags", + "base64 0.13.1", + "bitflags 1.3.2", "serde", ] @@ -1676,15 +1667,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.3.3" @@ -1700,14 +1682,28 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.17", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", ] [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "same-file" @@ -1730,35 +1726,20 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] name = "semver" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "semver-parser" @@ -1771,15 +1752,15 @@ dependencies = [ [[package]] name = "seq-macro" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0772c5c30e1a0d91f6834f8e545c69281c099dfa9a3ac58d96a9fd629c8d4898" +checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] @@ -1796,20 +1777,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -1817,21 +1798,19 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "serde_spanned" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ - "cfg-if", - "cpufeatures", - "digest", + "serde", ] [[package]] -name = "sha2" -version = "0.10.2" +name = "sha-1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", @@ -1839,12 +1818,14 @@ dependencies = [ ] [[package]] -name = "sharded-slab" -version = "0.1.4" +name = "sha2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "lazy_static", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] @@ -1873,29 +1854,39 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spfunc" version = "0.1.0" @@ -1909,9 +1900,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -1927,7 +1918,7 @@ name = "sql-doctester" version = "0.1.0" dependencies = [ "bytecount", - "clap 3.2.17", + "clap 3.2.25", "colored", "postgres", "pulldown-cmark", @@ -1985,15 +1976,26 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "1.0.107" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -2002,9 +2004,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.27.7" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "975fe381e0ecba475d4acff52466906d95b153a40324956552e027b2a9eaa89e" +checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2044,9 +2046,9 @@ dependencies = [ [[package]] name = "tera" -version = "1.17.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4685e72cb35f0eb74319c8fe2d3b61e93da5609841cde2cb87fcc3bea56d20" +checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c" dependencies = [ "globwalk", "lazy_static", @@ -2060,88 +2062,62 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" -version = "0.1.17" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "libc", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] name = "textwrap" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" dependencies = [ "terminal_size", ] [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] -[[package]] -name = "time" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" -dependencies = [ - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" - -[[package]] -name = "time-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" -dependencies = [ - "time-core", -] - [[package]] name = "time_weighted_average" version = "0.1.0" @@ -2172,10 +2148,10 @@ dependencies = [ "paste", "pest", "pest_derive", - "pgx", - "pgx-macros", - "pgx-sql-entity-graph", - "pgx-tests", + "pgrx", + "pgrx-macros", + "pgrx-sql-entity-graph", + "pgrx-tests", "rand", "rand_chacha", "rand_distr", @@ -2203,32 +2179,30 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.20.1" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", - "once_cell", "pin-project-lite", - "socket2", - "winapi", + "socket2 0.4.9", + "windows-sys 0.48.0", ] [[package]] name = "tokio-postgres" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a12c1b3e0704ae7dfc25562629798b29c72e6b1d0a681b6f29ab4ae5e7f7bf" +checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" dependencies = [ "async-trait", "byteorder", @@ -2243,16 +2217,16 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2", + "socket2 0.5.3", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -2264,9 +2238,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.10", +] + +[[package]] +name = "toml_datetime" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] @@ -2282,6 +2268,19 @@ dependencies = [ "itertools", ] +[[package]] +name = "toml_edit" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.37" @@ -2290,68 +2289,16 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.16" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ - "matchers", - "nu-ansi-term", "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] @@ -2365,20 +2312,21 @@ dependencies = [ [[package]] name = "twofloat" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eda3d5fa47bbd7c7fa3d2caae7a5ba1a58b1c3fc1c00ac4b1cce05eae85ef93" +checksum = "6bd3efad063a313d3a552efa9350126fa4c00b11f18e3fd87ddeaac20b27f70d" dependencies = [ "hexf", + "libm", "num-traits", "serde", ] [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -2464,44 +2412,50 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "update-tester" version = "0.3.0" dependencies = [ "bytecount", - "clap 3.2.17", + "clap 3.2.25", "colored", "control_file_reader", "postgres", "postgres_connection_configuration", "pulldown-cmark", - "semver 1.0.13", - "toml_edit", + "semver 1.0.17", + "toml_edit 0.14.4", "walkdir", "xshell", ] @@ -2528,54 +2482,26 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ "getrandom", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee8f19f9d74293faf70901bc20ad067dc1ad390d2cbf1e3f75f721ffee908b6" -dependencies = [ - "vcell", -] - [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -2618,52 +2544,150 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] [[package]] name = "wyz" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] diff --git a/Readme.md b/Readme.md index 4ddfed27..ab982970 100644 --- a/Readme.md +++ b/Readme.md @@ -38,7 +38,7 @@ As for other platforms: patches welcome! ### 🔧 Tools Setup ### -Building the extension requires valid [rust](https://www.rust-lang.org/) (we build and test on 1.65), [rustfmt](https://github.com/rust-lang/rustfmt), and clang installs, along with the postgres headers for whichever version of postgres you are running, and pgx. +Building the extension requires valid [rust](https://www.rust-lang.org/) (we build and test on 1.65), [rustfmt](https://github.com/rust-lang/rustfmt), and clang installs, along with the postgres headers for whichever version of postgres you are running, and pgrx. We recommend installing rust using the [official instructions](https://www.rust-lang.org/tools/install): ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh @@ -49,17 +49,17 @@ For Ubuntu you can follow the [postgres install instructions](https://www.postgr sudo apt-get install make gcc pkg-config clang postgresql-server-dev-14 libssl-dev ``` -Next you need [cargo-pgx](https://github.com/tcdi/pgx), which can be installed with +Next you need [cargo-pgrx](https://github.com/tcdi/pgrx), which can be installed with ```bash -cargo install --version '=0.7.1' --force cargo-pgx +cargo install --version '=0.9.1' --force cargo-pgrx ``` -You must reinstall cargo-pgx whenever you update your Rust compiler, since cargo-pgx needs to be built with the same compiler as Toolkit. +You must reinstall cargo-pgrx whenever you update your Rust compiler, since cargo-pgrx needs to be built with the same compiler as Toolkit. -Finally, setup the pgx development environment with +Finally, setup the pgrx development environment with ```bash -cargo pgx init --pg14 pg_config +cargo pgrx init --pg14 pg_config ``` @@ -74,7 +74,7 @@ cd timescaledb-toolkit/extension ``` Then run ``` -cargo pgx install --release && \ +cargo pgrx install --release && \ cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config ``` @@ -99,7 +99,7 @@ See above for prerequisites and installation instructions. You can run tests against a postgres version `pg12`, `pg13`, `pg14`, or `pg15` using ``` -cargo pgx test ${postgres_version} +cargo pgrx test ${postgres_version} ``` diff --git a/crates/aggregate_builder/Readme.md b/crates/aggregate_builder/Readme.md index ba50b41d..864b9811 100644 --- a/crates/aggregate_builder/Readme.md +++ b/crates/aggregate_builder/Readme.md @@ -93,9 +93,9 @@ pub mod aggregate_name { #[allow(dead_code)] pub const PARALLEL_SAFE: bool = true; - #[pgx::pg_extern(immutable, parallel_safe)] + #[pgrx::pg_extern(immutable, parallel_safe)] pub fn aggregate_name_transition_fn_outer( - __inner: pgx::Internal, + __inner: pgrx::Internal, value: RustType, __fcinfo: pg_sys::FunctionCallInfo, ) -> Option { @@ -140,9 +140,9 @@ pub mod aggregate_name { // elided } - #[pgx::pg_extern(immutable, parallel_safe)] + #[pgrx::pg_extern(immutable, parallel_safe)] pub fn aggregate_name_finally_fn_outer( - __internal: pgx::Internal, + __internal: pgrx::Internal, __fcinfo: pg_sys::FunctionCallInfo, ) -> Option { use crate::palloc::InternalAsValue; @@ -166,8 +166,8 @@ pub mod aggregate_name { // elided } - #[pgx::pg_extern(strict, immutable, parallel_safe, schema = "toolkit_experimental")] - pub fn aggregate_name_serialize_fn_outer(__internal: pgx::Internal) -> bytea { + #[pgrx::pg_extern(strict, immutable, parallel_safe, schema = "toolkit_experimental")] + pub fn aggregate_name_serialize_fn_outer(__internal: pgrx::Internal) -> bytea { use crate::palloc::{Inner, InternalAsValue}; // Convert to the rust transition type, see the comment in the // transition function for why we store an `Option` @@ -185,7 +185,7 @@ pub mod aggregate_name { // elided } - #[pgx::pg_extern(strict, immutable, parallel_safe, schema = "toolkit_experimental")] + #[pgrx::pg_extern(strict, immutable, parallel_safe, schema = "toolkit_experimental")] pub fn aggregate_name_deserialize_fn_outer( bytes: crate::raw::bytea, _internal: Internal, @@ -204,7 +204,7 @@ pub mod aggregate_name { // elided } - #[pgx::pg_extern(immutable, parallel_safe, schema = "toolkit_experimental")] + #[pgrx::pg_extern(immutable, parallel_safe, schema = "toolkit_experimental")] pub fn aggregate_name_combine_fn_outer( a: Internal, b: Internal, @@ -235,7 +235,7 @@ pub mod aggregate_name { } // SQL generated for the aggregate - pgx::extension_sql!("\n\ + pgrx::extension_sql!("\n\ CREATE AGGREGATE toolkit_experimental.aggregate_name (value RustType) (\n\ stype = internal,\n\ sfunc = toolkit_experimental.aggregate_name_transition_fn_outer,\n\ diff --git a/crates/aggregate_builder/src/lib.rs b/crates/aggregate_builder/src/lib.rs index 4703dc16..1dc826d5 100644 --- a/crates/aggregate_builder/src/lib.rs +++ b/crates/aggregate_builder/src/lib.rs @@ -581,7 +581,7 @@ fn expand(agg: Aggregate) -> TokenStream2 { #deserialize_fns #combine_fns - pgx::extension_sql!( + pgrx::extension_sql!( #create, name=#extension_sql_name, requires=[#(#extension_sql_reqs),*], @@ -671,9 +671,9 @@ impl AggregateFn { #state_type_check #return_type_check - #[pgx::pg_extern(immutable, parallel_safe #schema)] + #[pgrx::pg_extern(immutable, parallel_safe #schema)] pub fn #outer_ident( - #input_var: pgx::Internal, + #input_var: pgrx::Internal, #(#arg_signatures,)* ) -> Option { use crate::palloc::{Inner, InternalAsValue, ToInternal}; @@ -741,9 +741,9 @@ impl AggregateFn { quote! { #state_type_check - #[pgx::pg_extern(immutable, parallel_safe #schema)] + #[pgrx::pg_extern(immutable, parallel_safe #schema)] pub fn #outer_ident( - __internal: pgx::Internal, + __internal: pgrx::Internal, __fcinfo: pg_sys::FunctionCallInfo ) #ret { use crate::palloc::InternalAsValue; @@ -799,9 +799,9 @@ impl AggregateFn { #return_type_check - #[pgx::pg_extern(strict, immutable, parallel_safe #schema)] + #[pgrx::pg_extern(strict, immutable, parallel_safe #schema)] pub fn #outer_ident( - __internal: pgx::Internal, + __internal: pgrx::Internal, ) -> bytea { use crate::palloc::{Inner, InternalAsValue}; let #input_var: Option>> = unsafe { @@ -859,7 +859,7 @@ impl AggregateFn { #return_type_check - #[pgx::pg_extern(strict, immutable, parallel_safe #schema)] + #[pgrx::pg_extern(strict, immutable, parallel_safe #schema)] pub fn #outer_ident( bytes: crate::raw::bytea, _internal: Internal @@ -921,7 +921,7 @@ impl AggregateFn { #return_type_check #mod_counters - #[pgx::pg_extern(immutable, parallel_safe #schema)] + #[pgrx::pg_extern(immutable, parallel_safe #schema)] pub fn #outer_ident( #a_name: Internal, #b_name: Internal, diff --git a/docker/ci/setup.sh b/docker/ci/setup.sh index 15d6545f..651c0074 100755 --- a/docker/ci/setup.sh +++ b/docker/ci/setup.sh @@ -69,7 +69,7 @@ if $privileged; then # differences here rather than also in package-rpm.sh - # maybe install wrappers in /usr/local/bin or setup ~/.profile . # For now, most the knowledge is split. - # Here, we only need `cc` for installing cargo-pgx below. + # Here, we only need `cc` for installing cargo-pgrx below. set +e # scl_source has unchecked yet harmless errors?! ¯\_(ツ)_/¯ . scl_source enable devtoolset-7 # And rh-ruby26 for gem install fpm below. @@ -99,7 +99,7 @@ if $privileged; then ;; esac - # pgx needs: + # pgrx needs: # - gcc (specifically; clang won't do!) # - openssl-devel # - make @@ -152,7 +152,7 @@ EOF # any of those right now. export DEBIAN_FRONTEND=noninteractive - # pgx needs: + # pgrx needs: # - gcc (specifically; clang won't do!) # - libssl-dev # - make @@ -234,18 +234,18 @@ fi curl -s https://sh.rustup.rs | sh -s -- -q -y --no-modify-path --default-toolchain $RUST_TOOLCHAIN --profile $RUST_PROFILE -c $RUST_COMPONENTS -# Install pgx -cargo install cargo-pgx --version =$PGX_VERSION +# Install pgrx +cargo install cargo-pgrx --version =$PGRX_VERSION -# Configure pgx -## `cargo pgx init` is not additive; must specify all versions in one command. +# Configure pgrx +## `cargo pgrx init` is not additive; must specify all versions in one command. for pg in $PG_VERSIONS; do init_flags="$init_flags --pg$pg $PG_BASE$pg/bin/pg_config" done -cargo pgx init $init_flags -## Initialize pgx-managed databases so we can add the timescaledb load. +cargo pgrx init $init_flags +## Initialize pgrx-managed databases so we can add the timescaledb load. for pg in $PG_VERSIONS; do - echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgx/data-$pg/postgresql.conf + echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgrx/data-$pg/postgresql.conf done # Clone and fetch dependencies so we builds have less work to do. diff --git a/docs/client.md b/docs/client.md index 92b0443b..498eebc0 100644 --- a/docs/client.md +++ b/docs/client.md @@ -59,10 +59,10 @@ send_to_postgres(format!("INSERT INTO digests VALUES ({})", digester.build().for In order to provide that API, we must first reorganize the tdigest implementation so that all business logic is in the tdigest crate. Some is -currently in the pgx extension crate. +currently in the pgrx extension crate. For each aggregate, the transient state is actually a Builder pattern hidden -hidden behind pgx machinery. +hidden behind pgrx machinery. On this branch, I've moved TDigestTransState into tdigest::Builder. diff --git a/docs/release.md b/docs/release.md index 77339d10..a1f0921f 100644 --- a/docs/release.md +++ b/docs/release.md @@ -28,7 +28,7 @@ The latter two are arguably out of place here. Testing upgrades is now handled by `testbin` (below), but the version here was useful for Mac. That has now degraded as it would need to support a third -pgx... +pgrx... Installing is only relevant for local development. @@ -61,7 +61,7 @@ between released binaries (deb and rpm). Installation is a two-step process currently duplicated in three places. The two steps are: -1. `cargo pgx install --release` OR `cargo pgx package` +1. `cargo pgrx install --release` OR `cargo pgrx package` 2. `tools/post-install` These steps are repeated in: @@ -75,8 +75,8 @@ These steps are repeated in: `package-deb.sh` and `package-rpm.sh` could run `tools/build package` (which doesn't yet exist). -`cargo pgx install` installs the extension into the directory specified by -`pg_config`. `cargo pgx package` installs into a directory under +`cargo pgrx install` installs the extension into the directory specified by +`pg_config`. `cargo pgrx package` installs into a directory under `$CARGO_TARGET_DIR` where we pick it up and pack it into deb and rpm packages. `tools/post-install` performs miscellaneous install-time procedures: @@ -244,7 +244,7 @@ do the work: - Install necessary build tools and libraries - Install postgresql and timescaledb - Install `gh` github command-line tool used by `tools/release` -- Install Rust and PGX +- Install Rust and PGRX - Pre-fetch toolkit's crate dependencies to minimize work done at CI time ## Maintenance tasks @@ -257,7 +257,7 @@ of course not; don't be ridiculous. These are the sorts of things we have to do from time to time: - Update Rust. It moves pretty fast. -- Update PGX. It moves even faster. +- Update PGRX. It moves even faster. - Update other crates. `cargo audit` and `cargo update` are our friends. - Update OS versions. Labels such as `rockylinux:9` eventually point to something different or disappear entirely. The former actually surprised us diff --git a/extension/Cargo.toml b/extension/Cargo.toml index 36697b75..38404357 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -8,18 +8,18 @@ crate-type = ["cdylib"] [features] default = ["pg14"] -pg12 = ["pgx/pg12", "pgx-tests/pg12"] -pg13 = ["pgx/pg13", "pgx-tests/pg13"] -pg14 = ["pgx/pg14", "pgx-tests/pg14"] -pg15 = ["pgx/pg15", "pgx-tests/pg15"] +pg12 = ["pgrx/pg12", "pgrx-tests/pg12"] +pg13 = ["pgrx/pg13", "pgrx-tests/pg13"] +pg14 = ["pgrx/pg14", "pgrx-tests/pg14"] +pg15 = ["pgrx/pg15", "pgrx-tests/pg15"] pg_test = ["approx"] [dependencies] -# Keep synchronized with `cargo install --version N.N.N cargo-pgx` in Readme.md and docker/ci/Dockerfile -# Also `pgx-tests` down below in `dev-dependencies`. -pgx = "=0.7.1" -pgx-macros = "=0.7.1" -pgx-sql-entity-graph = "=0.7.1" +# Keep synchronized with `cargo install --version N.N.N cargo-pgrx` in Readme.md and docker/ci/Dockerfile +# Also `pgrx-tests` down below in `dev-dependencies`. +pgrx = "=0.9.1" +pgrx-macros = "=0.9.1" +pgrx-sql-entity-graph = "=0.9.1" encodings = {path="../crates/encodings"} flat_serialize = {path="../crates/flat_serialize/flat_serialize"} flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"} @@ -56,5 +56,5 @@ spfunc = "0.1.0" statrs = "0.15.0" [dev-dependencies] -pgx-tests = "=0.7.1" +pgrx-tests = "=0.9.1" approx = "0.4.0" diff --git a/extension/src/accessors.rs b/extension/src/accessors.rs index 3dc81941..9115a319 100644 --- a/extension/src/accessors.rs +++ b/extension/src/accessors.rs @@ -1,6 +1,6 @@ use std::convert::TryInto as _; -use pgx::*; +use pgrx::*; use counter_agg::range::I64Range; diff --git a/extension/src/accessors/tests.rs b/extension/src/accessors/tests.rs index 8182115d..193071c5 100644 --- a/extension/src/accessors/tests.rs +++ b/extension/src/accessors/tests.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::accessor; diff --git a/extension/src/aggregate_builder_tests.rs b/extension/src/aggregate_builder_tests.rs index 2dbbdcec..56baa4b3 100644 --- a/extension/src/aggregate_builder_tests.rs +++ b/extension/src/aggregate_builder_tests.rs @@ -3,7 +3,7 @@ // function use aggregate_builder::aggregate; -use pgx::*; +use pgrx::*; use crate::{palloc::Inner, raw::bytea}; @@ -82,8 +82,8 @@ impl toolkit_experimental::parallel_anything { #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_anything_in_experimental_and_returns_first() { diff --git a/extension/src/aggregate_utils.rs b/extension/src/aggregate_utils.rs index 211ea9c7..d270b518 100644 --- a/extension/src/aggregate_utils.rs +++ b/extension/src/aggregate_utils.rs @@ -1,6 +1,6 @@ use std::ptr::null_mut; -use pgx::pg_sys; +use pgrx::pg_sys; // TODO move to func_utils once there are enough function to warrant one pub unsafe fn get_collation(fcinfo: pg_sys::FunctionCallInfo) -> Option { @@ -24,7 +24,7 @@ pub unsafe fn in_aggregate_context T>( f: F, ) -> T { let mctx = - aggregate_mctx(fcinfo).unwrap_or_else(|| pgx::error!("cannot call as non-aggregate")); + aggregate_mctx(fcinfo).unwrap_or_else(|| pgrx::error!("cannot call as non-aggregate")); crate::palloc::in_memory_context(mctx, f) } diff --git a/extension/src/asap.rs b/extension/src/asap.rs index d558cd80..e6cd5fe0 100644 --- a/extension/src/asap.rs +++ b/extension/src/asap.rs @@ -1,5 +1,5 @@ use asap::*; -use pgx::*; +use pgrx::*; use serde::{Deserialize, Serialize}; use crate::{ @@ -195,8 +195,8 @@ extension_sql!( #[pg_schema] mod tests { use approx::assert_relative_eq; - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_against_reference() { diff --git a/extension/src/candlestick.rs b/extension/src/candlestick.rs index e11ca16d..2027c750 100644 --- a/extension/src/candlestick.rs +++ b/extension/src/candlestick.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use serde::{Deserialize, Serialize}; use crate::accessors::{ @@ -527,7 +527,7 @@ mod tests { use std::ptr; use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; macro_rules! select_one { ($client:expr, $stmt:expr, $type:ty) => { diff --git a/extension/src/counter_agg.rs b/extension/src/counter_agg.rs index 9fdf7ae8..fa74a72c 100644 --- a/extension/src/counter_agg.rs +++ b/extension/src/counter_agg.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use pgx::*; +use pgrx::*; use crate::{ accessors::{ @@ -189,7 +189,7 @@ impl CounterSummaryTransState { for p in iter { summary .add_point(p) - .unwrap_or_else(|e| pgx::error!("{}", e)); + .unwrap_or_else(|e| pgrx::error!("{}", e)); } self.point_buffer.clear(); // TODO build method should check validity @@ -220,7 +220,7 @@ impl CounterSummaryTransState { for sum in sum_iter { new_summary .combine(sum) - .unwrap_or_else(|e| pgx::error!("{}", e)); + .unwrap_or_else(|e| pgrx::error!("{}", e)); } self.summary_buffer = vec![new_summary.build()]; } @@ -890,7 +890,7 @@ pub enum Method { pub fn method_kind(method: &str) -> Method { match as_method(method) { Some(method) => method, - None => pgx::error!("unknown analysis method. Valid methods are 'prometheus'"), + None => pgrx::error!("unknown analysis method. Valid methods are 'prometheus'"), } } @@ -1195,7 +1195,7 @@ mod tests { let mut control = state.unwrap(); let buffer = counter_summary_trans_serialize(Inner::from(control.clone()).internal().unwrap()); - let buffer = pgx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); + let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); let expected = [ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 96, 194, 134, 7, 62, 2, 0, 0, 0, 0, 0, 0, 0, 36, @@ -1209,7 +1209,7 @@ mod tests { ]; assert_eq!(buffer, expected); - let expected = pgx::varlena::rust_byte_slice_to_bytea(&expected); + let expected = pgrx::varlena::rust_byte_slice_to_bytea(&expected); let new_state = counter_summary_trans_deserialize_inner(bytea(pg_sys::Datum::from( expected.as_ptr(), ))); @@ -1791,7 +1791,7 @@ mod tests { #[cfg(any(test, feature = "pg_test"))] pub(crate) mod testing { - pub fn decrease(client: &mut pgx::spi::SpiClient) { + pub fn decrease(client: &mut pgrx::spi::SpiClient) { client .update( "CREATE TABLE test(ts timestamptz, val DOUBLE PRECISION)", @@ -1811,7 +1811,7 @@ pub(crate) mod testing { .unwrap(); } - pub fn increase(client: &mut pgx::spi::SpiClient) { + pub fn increase(client: &mut pgrx::spi::SpiClient) { client .update( "CREATE TABLE test(ts timestamptz, val DOUBLE PRECISION)", @@ -1831,7 +1831,7 @@ pub(crate) mod testing { .unwrap(); } - pub fn decrease_then_increase_to_same_value(client: &mut pgx::spi::SpiClient) { + pub fn decrease_then_increase_to_same_value(client: &mut pgrx::spi::SpiClient) { client .update( "CREATE TABLE test(ts timestamptz, val DOUBLE PRECISION)", @@ -1852,7 +1852,7 @@ pub(crate) mod testing { .unwrap(); } - pub fn increase_then_decrease_to_same_value(client: &mut pgx::spi::SpiClient) { + pub fn increase_then_decrease_to_same_value(client: &mut pgrx::spi::SpiClient) { client .update( "CREATE TABLE test(ts timestamptz, val DOUBLE PRECISION)", @@ -1873,7 +1873,7 @@ pub(crate) mod testing { .unwrap(); } - pub fn make_test_table(client: &mut pgx::spi::SpiClient, name: &str) { + pub fn make_test_table(client: &mut pgrx::spi::SpiClient, name: &str) { client .update( &format!( diff --git a/extension/src/counter_agg/accessors.rs b/extension/src/counter_agg/accessors.rs index 54ec7041..8f7ff225 100644 --- a/extension/src/counter_agg/accessors.rs +++ b/extension/src/counter_agg/accessors.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use crate::{ counter_agg::{CounterSummary, CounterSummaryData, MetricSummary}, diff --git a/extension/src/countminsketch.rs b/extension/src/countminsketch.rs index da1147c1..ea747b98 100644 --- a/extension/src/countminsketch.rs +++ b/extension/src/countminsketch.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use aggregate_builder::aggregate; use countminsketch::{CountMinHashFn, CountMinSketch as CountMinSketchInternal}; @@ -135,7 +135,7 @@ pub fn approx_count<'a>(item: String, aggregate: Option>) -> #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn test_countminsketch() { diff --git a/extension/src/datum_utils.rs b/extension/src/datum_utils.rs index 65a147f0..fa0d63c4 100644 --- a/extension/src/datum_utils.rs +++ b/extension/src/datum_utils.rs @@ -12,7 +12,7 @@ use serde::{ }; use pg_sys::{Datum, Oid}; -use pgx::*; +use pgrx::*; use crate::serialization::{PgCollationId, ShortTypeId}; @@ -147,7 +147,7 @@ impl DatumHashBuilder { let flinfo = if (*tentry).hash_extended_proc_finfo.fn_addr.is_some() { &(*tentry).hash_extended_proc_finfo } else { - pgx::error!("no hash function"); + pgrx::error!("no hash function"); }; // 1 argument for the key, 1 argument for the seed @@ -646,7 +646,7 @@ mod tests { use super::*; use crate::{build, palloc::Inner, pg_type, ron_inout_funcs}; use aggregate_builder::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_schema] pub mod toolkit_experimental { diff --git a/extension/src/frequency.rs b/extension/src/frequency.rs index c95fb962..94b81e95 100644 --- a/extension/src/frequency.rs +++ b/extension/src/frequency.rs @@ -2,7 +2,7 @@ use std::fmt; -use pgx::{ +use pgrx::{ iter::{SetOfIterator, TableIterator}, *, }; @@ -213,10 +213,10 @@ impl SpaceSavingTransState { collation: Option, ) -> Self { if nval == 0 { - pgx::error!("mcv aggregate requires an n value > 0") + pgrx::error!("mcv aggregate requires an n value > 0") } if skew <= 1.0 { - pgx::error!("mcv aggregate requires a skew factor > 1.0") + pgrx::error!("mcv aggregate requires a skew factor > 1.0") } let prob_eq_n = zeta_eq_n(skew, nval as u64); @@ -741,7 +741,7 @@ pub fn freq_agg_trans( fcinfo: pg_sys::FunctionCallInfo, ) -> Option { if freq <= 0. || freq >= 1.0 { - pgx::error!("frequency aggregate requires a frequency in the range (0.0, 1.0)") + pgrx::error!("frequency aggregate requires a frequency in the range (0.0, 1.0)") } space_saving_trans( @@ -1270,7 +1270,7 @@ pub fn freq_iter<'a>( > { unsafe { if ty.oid().as_u32() != agg.type_oid { - pgx::error!("mischatched types") + pgrx::error!("mischatched types") } let counts = agg.counts.slice().iter().zip(agg.overcounts.slice().iter()); TableIterator::new(agg.datums.clone().into_iter().zip(counts).map_while( @@ -1381,7 +1381,7 @@ fn validate_topn_for_mcv_agg( // TODO: should we allow this if we have enough data? if n > topn as i32 { - pgx::error!( + pgrx::error!( "requested N ({}) exceeds creation parameter of mcv aggregate ({})", n, topn @@ -1392,7 +1392,7 @@ fn validate_topn_for_mcv_agg( // for our zeta curve. let needed_count = (zeta_le_n(skew, n as u64) * total_vals as f64).ceil() as u64; if counts.take(n as usize).sum::() < needed_count { - pgx::error!("data is not skewed enough to find top {} parameters with a skew of {}, try reducing the skew factor", n , skew) + pgrx::error!("data is not skewed enough to find top {} parameters with a skew of {}, try reducing the skew factor", n , skew) } } @@ -1404,7 +1404,7 @@ pub fn topn( ) -> SetOfIterator { // If called with a NULL, assume type matches if ty.is_some() && ty.unwrap().oid().as_u32() != agg.type_oid { - pgx::error!("mischatched types") + pgrx::error!("mischatched types") } validate_topn_for_mcv_agg( @@ -1438,7 +1438,7 @@ pub fn default_topn( ty: Option, ) -> SetOfIterator { if agg.topn == 0 { - pgx::error!("frequency aggregates require a N parameter to topn") + pgrx::error!("frequency aggregates require a N parameter to topn") } let n = agg.topn as i32; topn(agg, n, ty) @@ -1476,7 +1476,7 @@ pub fn arrow_topn_bigint<'a>( #[pg_extern(immutable, parallel_safe, name = "topn")] pub fn default_topn_bigint(agg: SpaceSavingBigIntAggregate<'_>) -> SetOfIterator { if agg.topn == 0 { - pgx::error!("frequency aggregates require a N parameter to topn") + pgrx::error!("frequency aggregates require a N parameter to topn") } let n = agg.topn as i32; topn_bigint(agg, n) @@ -1526,7 +1526,7 @@ pub fn arrow_topn_text<'a>( #[pg_extern(immutable, parallel_safe, name = "topn")] pub fn default_topn_text(agg: SpaceSavingTextAggregate<'_>) -> SetOfIterator { if agg.topn == 0 { - pgx::error!("frequency aggregates require a N parameter to topn") + pgrx::error!("frequency aggregates require a N parameter to topn") } let n = agg.topn as i32; topn_text(agg, n) @@ -1692,7 +1692,7 @@ unsafe fn varlena_to_string(vl: *const pg_sys::varlena) -> String { #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; use rand::distributions::{Distribution, Uniform}; use rand::prelude::SliceRandom; use rand::thread_rng; @@ -2007,7 +2007,7 @@ mod tests { } // Setup environment and create table 'test' with some aggregates in table 'aggs' - fn setup_with_test_table(client: &mut pgx::spi::SpiClient) { + fn setup_with_test_table(client: &mut pgrx::spi::SpiClient) { // using the search path trick for this test to make it easier to stabilize later on let sp = client .update( diff --git a/extension/src/gauge_agg.rs b/extension/src/gauge_agg.rs index 7e499414..2707049d 100644 --- a/extension/src/gauge_agg.rs +++ b/extension/src/gauge_agg.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use serde::{Deserialize, Serialize}; @@ -149,7 +149,7 @@ impl GaugeSummaryTransState { for p in iter { summary .add_point(p) - .unwrap_or_else(|e| pgx::error!("{}", e)); + .unwrap_or_else(|e| pgrx::error!("{}", e)); } self.point_buffer.clear(); // TODO build method should check validity @@ -180,7 +180,7 @@ impl GaugeSummaryTransState { for sum in sum_iter { new_summary .combine(&sum) - .unwrap_or_else(|e| pgx::error!("{}", e)); + .unwrap_or_else(|e| pgrx::error!("{}", e)); } self.summary_buffer.push(new_summary.build()); } @@ -689,7 +689,7 @@ impl From for GaugeSummary<'_> { #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx_macros::pg_test; + use pgrx_macros::pg_test; use crate::counter_agg::testing::*; diff --git a/extension/src/heartbeat_agg.rs b/extension/src/heartbeat_agg.rs index 4690b9b8..cf403ffb 100644 --- a/extension/src/heartbeat_agg.rs +++ b/extension/src/heartbeat_agg.rs @@ -1,5 +1,5 @@ -use pgx::iter::TableIterator; -use pgx::*; +use pgrx::iter::TableIterator; +use pgrx::*; use crate::{ accessors::{ diff --git a/extension/src/heartbeat_agg/accessors.rs b/extension/src/heartbeat_agg/accessors.rs index ea063bf9..33607f04 100644 --- a/extension/src/heartbeat_agg/accessors.rs +++ b/extension/src/heartbeat_agg/accessors.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use crate::{ flatten, diff --git a/extension/src/hyperloglog.rs b/extension/src/hyperloglog.rs index 26d3f0ef..9227c14c 100644 --- a/extension/src/hyperloglog.rs +++ b/extension/src/hyperloglog.rs @@ -8,7 +8,7 @@ use std::{ use serde::{Deserialize, Serialize}; use pg_sys::{Datum, Oid}; -use pgx::*; +use pgrx::*; use crate::{ accessors::{AccessorDistinctCount, AccessorStderror}, @@ -22,7 +22,7 @@ use crate::{ use hyperloglogplusplus::{HyperLogLog as HLL, HyperLogLogStorage}; -// pgx doesn't implement Eq/Hash but it's okay here since we treat Datums as raw bytes +// pgrx doesn't implement Eq/Hash but it's okay here since we treat Datums as raw bytes #[derive(Debug, Copy, Clone, PartialEq)] struct HashableDatum(Datum); impl Eq for HashableDatum {} @@ -50,7 +50,7 @@ pub fn hyperloglog_trans( ) -> Option { // let state: Internal = Internal::from_polymorphic_datum(); hyperloglog_trans_inner(unsafe { state.to_inner() }, size, value, fc, unsafe { - pgx::pg_getarg_type(fc, 2) + pgrx::pg_getarg_type(fc, 2) }) .internal() } @@ -71,7 +71,7 @@ pub fn approx_count_distinct_trans( APPROX_COUNT_DISTINCT_DEFAULT_SIZE, value, fc, - unsafe { pgx::pg_getarg_type(fc, 1) }, + unsafe { pgrx::pg_getarg_type(fc, 1) }, ) .internal() } @@ -483,7 +483,7 @@ fn unflatten_log(hyperloglog: HyperLogLog) -> HLL Timevector_TSTZ_F #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_lttb_equivalence() { diff --git a/extension/src/nmost.rs b/extension/src/nmost.rs index 019c4452..79fd018d 100644 --- a/extension/src/nmost.rs +++ b/extension/src/nmost.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use serde::{Deserialize, Serialize}; @@ -145,7 +145,7 @@ pub struct NMostByTransState { } impl NMostByTransState { - fn new(capacity: usize, first_val: T, first_element: pgx::AnyElement) -> NMostByTransState { + fn new(capacity: usize, first_val: T, first_element: pgrx::AnyElement) -> NMostByTransState { // first entry will always have index 0 let first_val = (first_val, 0); NMostByTransState { @@ -155,7 +155,7 @@ impl NMostByTransState { } } - fn new_entry(&mut self, new_val: T, new_element: pgx::AnyElement) { + fn new_entry(&mut self, new_val: T, new_element: pgrx::AnyElement) { assert!(new_element.oid() == self.oid); if self.data.len() < self.values.capacity { // Not yet full, easy case @@ -216,7 +216,7 @@ impl From<(&[T], &DatumStore<'_>, usize)> for NMostByTransState( state: Option>>, val: T, - data: pgx::AnyElement, + data: pgrx::AnyElement, capacity: usize, fcinfo: pg_sys::FunctionCallInfo, ) -> Option>> { diff --git a/extension/src/nmost/max_by_float.rs b/extension/src/nmost/max_by_float.rs index 0159aca9..873e867a 100644 --- a/extension/src/nmost/max_by_float.rs +++ b/extension/src/nmost/max_by_float.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::max_float::*; use crate::nmost::*; @@ -136,7 +136,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_by_float_correctness() { diff --git a/extension/src/nmost/max_by_int.rs b/extension/src/nmost/max_by_int.rs index bcc35cfa..97533259 100644 --- a/extension/src/nmost/max_by_int.rs +++ b/extension/src/nmost/max_by_int.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::max_int::*; use crate::nmost::*; @@ -135,7 +135,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_by_int_correctness() { diff --git a/extension/src/nmost/max_by_time.rs b/extension/src/nmost/max_by_time.rs index 491fca7b..99abda36 100644 --- a/extension/src/nmost/max_by_time.rs +++ b/extension/src/nmost/max_by_time.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::max_time::*; use crate::nmost::*; @@ -142,7 +142,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_by_time_correctness() { diff --git a/extension/src/nmost/max_float.rs b/extension/src/nmost/max_float.rs index 48ab8e66..2e0b0484 100644 --- a/extension/src/nmost/max_float.rs +++ b/extension/src/nmost/max_float.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -185,7 +185,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_float_correctness() { diff --git a/extension/src/nmost/max_int.rs b/extension/src/nmost/max_int.rs index e23f995f..67cbc963 100644 --- a/extension/src/nmost/max_int.rs +++ b/extension/src/nmost/max_int.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -179,7 +179,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_int_correctness() { diff --git a/extension/src/nmost/max_time.rs b/extension/src/nmost/max_time.rs index 87a90af5..118cf715 100644 --- a/extension/src/nmost/max_time.rs +++ b/extension/src/nmost/max_time.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -189,7 +189,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn max_time_correctness() { diff --git a/extension/src/nmost/min_by_float.rs b/extension/src/nmost/min_by_float.rs index 613fbd90..55f8003a 100644 --- a/extension/src/nmost/min_by_float.rs +++ b/extension/src/nmost/min_by_float.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::min_float::*; use crate::nmost::*; @@ -135,7 +135,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_by_float_correctness() { diff --git a/extension/src/nmost/min_by_int.rs b/extension/src/nmost/min_by_int.rs index a2047a9f..c7e7c211 100644 --- a/extension/src/nmost/min_by_int.rs +++ b/extension/src/nmost/min_by_int.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::min_int::*; use crate::nmost::*; @@ -122,7 +122,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_by_int_correctness() { diff --git a/extension/src/nmost/min_by_time.rs b/extension/src/nmost/min_by_time.rs index 49d8909a..be201b20 100644 --- a/extension/src/nmost/min_by_time.rs +++ b/extension/src/nmost/min_by_time.rs @@ -1,4 +1,4 @@ -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use crate::nmost::min_time::*; use crate::nmost::*; @@ -129,7 +129,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_by_time_correctness() { diff --git a/extension/src/nmost/min_float.rs b/extension/src/nmost/min_float.rs index 8a274f06..d36c51ad 100644 --- a/extension/src/nmost/min_float.rs +++ b/extension/src/nmost/min_float.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -184,7 +184,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_float_correctness() { diff --git a/extension/src/nmost/min_int.rs b/extension/src/nmost/min_int.rs index e50783f9..3bd08f88 100644 --- a/extension/src/nmost/min_int.rs +++ b/extension/src/nmost/min_int.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -171,7 +171,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_int_correctness() { diff --git a/extension/src/nmost/min_time.rs b/extension/src/nmost/min_time.rs index c924d57f..e300ab04 100644 --- a/extension/src/nmost/min_time.rs +++ b/extension/src/nmost/min_time.rs @@ -1,4 +1,4 @@ -use pgx::{iter::SetOfIterator, *}; +use pgrx::{iter::SetOfIterator, *}; use crate::nmost::*; @@ -180,7 +180,7 @@ extension_sql!( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] fn min_time_correctness() { diff --git a/extension/src/palloc.rs b/extension/src/palloc.rs index d93c8d60..9ada4d28 100644 --- a/extension/src/palloc.rs +++ b/extension/src/palloc.rs @@ -4,7 +4,7 @@ use std::{ ptr::NonNull, }; -use pgx::*; +use pgrx::*; pub unsafe fn in_memory_context T>(mctx: pg_sys::MemoryContext, f: F) -> T { let prev_ctx = pg_sys::CurrentMemoryContext; @@ -14,14 +14,14 @@ pub unsafe fn in_memory_context T>(mctx: pg_sys::MemoryContext t } -pub use pgx::Internal; +pub use pgrx::Internal; -/// Extension trait to translate postgres-understood `pgx::Internal` type into +/// Extension trait to translate postgres-understood `pgrx::Internal` type into /// the well-typed pointer type `Option>`. /// /// # Safety /// -/// This trait should only ever be implemented for `pgx::Internal` +/// This trait should only ever be implemented for `pgrx::Internal` /// There is an lifetime constraint on the returned pointer, though this is /// currently implicit. pub unsafe trait InternalAsValue { @@ -46,7 +46,7 @@ unsafe impl InternalAsValue for Internal { } /// Extension trait to turn the typed pointers `Inner<...>` and -/// `Option>` into the postgres-understood `pgx::Internal` type. +/// `Option>` into the postgres-understood `pgrx::Internal` type. /// /// # Safety /// The value input must live as long as postgres expects. TODO more info diff --git a/extension/src/pg_any_element.rs b/extension/src/pg_any_element.rs index 3becdba6..2b7ec42c 100644 --- a/extension/src/pg_any_element.rs +++ b/extension/src/pg_any_element.rs @@ -4,7 +4,7 @@ use std::{ mem::size_of, }; -use pgx::*; +use pgrx::*; use pg_sys::{Datum, Oid}; @@ -43,7 +43,7 @@ impl PartialEq for PgAnyElement { let flinfo = if (*tentry).eq_opr_finfo.fn_addr.is_some() { &(*tentry).eq_opr_finfo } else { - pgx::error!("no equality function"); + pgrx::error!("no equality function"); }; let size = size_of::() diff --git a/extension/src/range.rs b/extension/src/range.rs index c7245701..503fd7c6 100644 --- a/extension/src/range.rs +++ b/extension/src/range.rs @@ -1,5 +1,5 @@ use counter_agg::range::I64Range; -use pgx::{extension_sql, pg_sys}; +use pgrx::{extension_sql, pg_sys}; use serde::{Deserialize, Serialize}; use std::convert::TryInto; use std::slice; @@ -45,10 +45,10 @@ pub unsafe fn get_range(range: tstzrange) -> Option { unsafe fn get_toasted_bytes(ptr: &pg_sys::varlena) -> &[u8] { let mut ptr = pg_sys::pg_detoast_datum_packed(ptr as *const _ as *mut _); - if pgx::varatt_is_1b(ptr) { + if pgrx::varatt_is_1b(ptr) { ptr = pg_sys::pg_detoast_datum_copy(ptr as *const _ as *mut _); } - let data_len = pgx::varsize_any(ptr); + let data_len = pgrx::varsize_any(ptr); slice::from_raw_parts(ptr as *mut u8, data_len) } diff --git a/extension/src/raw.rs b/extension/src/raw.rs index be86084a..d9612209 100644 --- a/extension/src/raw.rs +++ b/extension/src/raw.rs @@ -1,7 +1,7 @@ #![allow(non_camel_case_types)] -use pgx::*; -use pgx_sql_entity_graph::metadata::{ +use pgrx::*; +use pgrx_sql_entity_graph::metadata::{ ArgumentError, Returns, ReturnsError, SqlMapping, SqlTranslatable, }; @@ -145,7 +145,7 @@ impl From for Interval { // IntervalPGetDatum(result))); // So if we want the same behavior, we need to call interval_justify_hours too: let function_args = vec![Some(pg_sys::Datum::from(interval))]; - unsafe { pgx::direct_function_call(pg_sys::interval_justify_hours, function_args) } + unsafe { pgrx::direct_function_call(pg_sys::interval_justify_hours, function_args) } .expect("interval_justify_hours does not return None") } } diff --git a/extension/src/saturation.rs b/extension/src/saturation.rs index 3a5697eb..cb4169fb 100644 --- a/extension/src/saturation.rs +++ b/extension/src/saturation.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; /// Saturating Math for Integers @@ -46,7 +46,7 @@ fn saturating_mul(x: i32, y: i32) -> i32 { #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] #[allow(arithmetic_overflow)] diff --git a/extension/src/serialization.rs b/extension/src/serialization.rs index fc9e6106..32729340 100644 --- a/extension/src/serialization.rs +++ b/extension/src/serialization.rs @@ -6,7 +6,7 @@ use std::{ os::raw::{c_char, c_int}, }; -use pgx::pg_sys; +use pgrx::pg_sys; use std::ffi::CStr; pub(crate) mod collations; @@ -100,7 +100,7 @@ pub extern "C" fn _ts_toolkit_decode_timestamptz(text: &str) -> i64 { let mut result = 0; let err = pg_sys::tm2timestamp(tm, fsec, &mut tz, &mut result); if err != 0 { - // TODO pgx error with correct errcode? + // TODO pgrx error with correct errcode? panic!("timestamptz \"{}\" out of range", text) } result diff --git a/extension/src/serialization/collations.rs b/extension/src/serialization/collations.rs index e2283901..bc52e72b 100644 --- a/extension/src/serialization/collations.rs +++ b/extension/src/serialization/collations.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use once_cell::sync::Lazy; use pg_sys::Oid; -use pgx::*; +use pgrx::*; // TODO short collation serializer? @@ -82,7 +82,7 @@ static DEFAULT_COLLATION_NAME: Lazy = Lazy::new(|| unsafe { pg_sys::Datum::from(pg_sys::MyDatabaseId), ); if tuple.is_null() { - pgx::error!("no database info"); + pgrx::error!("no database info"); } let database_tuple: Form_pg_database = get_struct(tuple); @@ -114,14 +114,14 @@ impl Serialize for PgCollationId { pg_sys::Datum::from(self.0), ); if tuple.is_null() { - pgx::error!("no collation info for oid {}", self.0); + pgrx::error!("no collation info for oid {}", self.0); } let collation_tuple: Form_pg_collation = get_struct(tuple); let namespace = pg_sys::get_namespace_name((*collation_tuple).collnamespace); if namespace.is_null() { - pgx::error!("invalid schema oid {}", (*collation_tuple).collnamespace); + pgrx::error!("invalid schema oid {}", (*collation_tuple).collnamespace); } let namespace_len = CStr::from_ptr(namespace).to_bytes().len(); @@ -254,7 +254,7 @@ unsafe fn get_struct(tuple: pg_sys::HeapTuple) -> *mut T { mod tests { use super::PgCollationId; - use pgx::{pg_sys, pg_test}; + use pgrx::{pg_sys, pg_test}; const COLLATION_ID_950: PgCollationId = PgCollationId(unsafe { pg_sys::Oid::from_u32_unchecked(950) }); diff --git a/extension/src/serialization/functions.rs b/extension/src/serialization/functions.rs index 8ec6fa6d..05e76aac 100644 --- a/extension/src/serialization/functions.rs +++ b/extension/src/serialization/functions.rs @@ -10,7 +10,7 @@ use flat_serialize::{impl_flat_serializable, FlatSerializable, WrapErr}; use serde::{Deserialize, Serialize}; use pg_sys::{Datum, Oid}; -use pgx::*; +use pgrx::*; /// `PgProcId` provides provides the ability to serialize and deserialize /// regprocedures as `namespace.name(args)` @@ -20,7 +20,7 @@ pub struct PgProcId(pub Oid); impl_flat_serializable!(PgProcId); -// FIXME upstream to pgx +// FIXME upstream to pgrx // TODO use this or regprocedureout()? extern "C" { pub fn format_procedure_qualified(procedure_oid: pg_sys::Oid) -> *const c_char; @@ -48,7 +48,7 @@ impl<'de> Deserialize<'de> for PgProcId { where D: serde::Deserializer<'de>, { - // FIXME pgx wraps all functions in rust wrappers, which makes them + // FIXME pgrx wraps all functions in rust wrappers, which makes them // uncallable with DirectFunctionCall(). Is there a way to // export both? extern "C" { diff --git a/extension/src/serialization/types.rs b/extension/src/serialization/types.rs index d53f98f9..b183cddd 100644 --- a/extension/src/serialization/types.rs +++ b/extension/src/serialization/types.rs @@ -9,7 +9,7 @@ use flat_serialize::{impl_flat_serializable, FlatSerializable, WrapErr}; use serde::{Deserialize, Serialize}; use pg_sys::Oid; -use pgx::*; +use pgrx::*; /// Possibly a premature optimization, `ShortTypId` provides the ability to /// serialize and deserialize type Oids as `(namespace, name)` pairs, special @@ -218,14 +218,14 @@ impl Serialize for PgTypId { pg_sys::Datum::from(self.0), ); if tuple.is_null() { - pgx::error!("no type info for oid {}", self.0); + pgrx::error!("no type info for oid {}", self.0); } let type_tuple: pg_sys::Form_pg_type = get_struct(tuple); let namespace = pg_sys::get_namespace_name((*type_tuple).typnamespace); if namespace.is_null() { - pgx::error!("invalid schema oid {}", (*type_tuple).typnamespace); + pgrx::error!("invalid schema oid {}", (*type_tuple).typnamespace); } let namespace_len = CStr::from_ptr(namespace).to_bytes().len(); @@ -320,7 +320,7 @@ unsafe fn get_struct(tuple: pg_sys::HeapTuple) -> *mut T { mod tests { use super::{PgTypId, ShortTypeId}; - use pgx::{ + use pgrx::{ pg_sys::{BOOLOID, CHAROID, CIRCLEOID}, pg_test, }; diff --git a/extension/src/stabilization_tests.rs b/extension/src/stabilization_tests.rs index 2b414280..bb2f6909 100644 --- a/extension/src/stabilization_tests.rs +++ b/extension/src/stabilization_tests.rs @@ -1,13 +1,13 @@ #[cfg(any(test, feature = "pg_test"))] -use pgx::*; +use pgrx::*; #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { use std::collections::HashSet; - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; // Test that any new features are added to the the experimental schema #[pg_test] @@ -40,7 +40,7 @@ mod tests { if let Some(schema) = val.strip_prefix("schema ") { // the only schemas we should define are // `toolkit_experimental` our experimental schema, and - // `tests` which contains our pgx-style regression tests + // `tests` which contains our pgrx-style regression tests // (including the function currently running) match schema { "toolkit_experimental" => return None, diff --git a/extension/src/state_aggregate.rs b/extension/src/state_aggregate.rs index 0a56d735..b191bca9 100644 --- a/extension/src/state_aggregate.rs +++ b/extension/src/state_aggregate.rs @@ -6,7 +6,7 @@ #![allow(non_camel_case_types)] -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; @@ -272,7 +272,7 @@ pub mod toolkit_experimental { prev: Option, ) -> CompactStateAgg { if self.durations.is_empty() { - pgx::error!("unable to interpolate interval on state aggregate with no data"); + pgrx::error!("unable to interpolate interval on state aggregate with no data"); } if let Some(ref prev) = prev { assert_eq!( @@ -345,7 +345,7 @@ pub mod toolkit_experimental { time: interval_start, } } else { - pgx::error!("unable to interpolate interval on state aggregate where previous agg has no data") + pgrx::error!("unable to interpolate interval on state aggregate where previous agg has no data") } } _ => Record { @@ -360,7 +360,7 @@ pub mod toolkit_experimental { let last_interval = interval_start + interval_len - self.last_time; match durations.get_mut(self.last_state as usize) { None => { - pgx::error!("poorly formed state aggregate, last_state out of starts") + pgrx::error!("poorly formed state aggregate, last_state out of starts") } Some(dis) => { dis.duration += last_interval; @@ -540,11 +540,11 @@ extension_sql!( ); #[pg_extern(immutable, parallel_safe, schema = "toolkit_experimental")] fn compact_state_agg_int_trans( - __inner: pgx::Internal, + __inner: pgrx::Internal, ts: TimestampTz, value: Option, __fcinfo: pg_sys::FunctionCallInfo, -) -> Option { +) -> Option { // expanded from #[aggregate] transition function use crate::palloc::{Inner, InternalAsValue, ToInternal}; type State = CompactStateAggTransState; @@ -666,11 +666,11 @@ extension_sql!( ); #[pg_extern(immutable, parallel_safe)] fn state_agg_int_trans( - __inner: pgx::Internal, + __inner: pgrx::Internal, ts: TimestampTz, value: Option, __fcinfo: pg_sys::FunctionCallInfo, -) -> Option { +) -> Option { // expanded from #[aggregate] transition function use crate::palloc::{Inner, InternalAsValue, ToInternal}; type State = CompactStateAggTransState; @@ -957,7 +957,7 @@ fn interpolated_duration_in_inner<'a>( prev: Option>, ) -> crate::raw::Interval { match aggregate { - None => pgx::error!( + None => pgrx::error!( "when interpolating data between grouped data, all groups must contain some data" ), Some(aggregate) => { @@ -1116,7 +1116,7 @@ fn duration_in_bad_args_inner() -> ! { panic!("The start and interval parameters cannot be used for duration_in with a compact state aggregate") } -#[allow(unused_variables)] // can't underscore-prefix since argument names are used by pgx +#[allow(unused_variables)] // can't underscore-prefix since argument names are used by pgrx #[pg_extern( immutable, parallel_safe, @@ -1131,7 +1131,7 @@ pub fn duration_in_bad_args<'a>( ) -> crate::raw::Interval { duration_in_bad_args_inner() } -#[allow(unused_variables)] // can't underscore-prefix since argument names are used by pgx +#[allow(unused_variables)] // can't underscore-prefix since argument names are used by pgrx #[pg_extern( immutable, parallel_safe, @@ -1153,8 +1153,8 @@ pub fn into_values<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, String), + pgrx::name!(duration, crate::raw::Interval), ), > { agg.assert_str(); @@ -1172,8 +1172,8 @@ pub fn into_int_values<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, i64), + pgrx::name!(duration, crate::raw::Interval), ), > { agg.assert_int(); @@ -1192,8 +1192,8 @@ pub fn into_values_tl<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, String), + pgrx::name!(duration, crate::raw::Interval), ), > { agg.assert_str(); @@ -1205,8 +1205,8 @@ pub fn into_values_tl_int<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, i64), + pgrx::name!(duration, crate::raw::Interval), ), > { agg.assert_int(); @@ -1220,8 +1220,8 @@ pub fn arrow_state_agg_into_values<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, String), + pgrx::name!(duration, crate::raw::Interval), ), > { into_values_tl(agg) @@ -1234,8 +1234,8 @@ pub fn arrow_state_agg_into_int_values<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(duration, crate::raw::Interval), + pgrx::name!(state, i64), + pgrx::name!(duration, crate::raw::Interval), ), > { into_values_tl_int(agg) @@ -1246,9 +1246,9 @@ fn state_timeline_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { assert!( @@ -1274,9 +1274,9 @@ fn state_int_timeline_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { assert!( @@ -1305,9 +1305,9 @@ pub fn state_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { agg.assert_str(); @@ -1319,9 +1319,9 @@ pub fn state_int_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { agg.assert_int(); @@ -1336,9 +1336,9 @@ pub fn arrow_state_agg_state_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { state_timeline(agg) @@ -1351,9 +1351,9 @@ pub fn arrow_state_agg_state_int_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { state_int_timeline(agg) @@ -1367,16 +1367,16 @@ fn interpolated_state_timeline_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { if let Some(ref agg) = agg { agg.assert_str() }; match agg { - None => pgx::error!( + None => pgrx::error!( "when interpolating data between grouped data, all groups must contain some data" ), Some(agg) => TableIterator::new( @@ -1398,16 +1398,16 @@ fn interpolated_state_int_timeline_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { if let Some(ref agg) = agg { agg.assert_int() }; match agg { - None => pgx::error!( + None => pgrx::error!( "when interpolating data between grouped data, all groups must contain some data" ), Some(agg) => TableIterator::new( @@ -1430,9 +1430,9 @@ pub fn interpolated_state_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let interval = crate::datum_utils::interval_to_ms(&start, &interval); @@ -1447,9 +1447,9 @@ pub fn interpolated_state_int_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let interval = crate::datum_utils::interval_to_ms(&start, &interval); @@ -1463,9 +1463,9 @@ pub fn arrow_state_agg_interpolated_state_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, String), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, String), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { interpolated_state_timeline_inner( @@ -1487,9 +1487,9 @@ pub fn arrow_state_agg_interpolated_state_int_timeline<'a>( ) -> TableIterator< 'a, ( - pgx::name!(state, i64), - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(state, i64), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { interpolated_state_int_timeline_inner( @@ -1510,8 +1510,8 @@ fn state_periods_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { assert!( @@ -1543,8 +1543,8 @@ pub fn state_periods<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { agg.assert_str(); @@ -1558,8 +1558,8 @@ pub fn state_int_periods<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { agg.assert_int(); @@ -1577,8 +1577,8 @@ pub fn arrow_state_agg_state_periods_string<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let state = MaterializedState::String( @@ -1594,8 +1594,8 @@ pub fn arrow_state_agg_state_periods_int<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let state = MaterializedState::Integer(accessor.state); @@ -1611,12 +1611,12 @@ fn interpolated_state_periods_inner<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { match aggregate { - None => pgx::error!( + None => pgrx::error!( "when interpolating data between grouped data, all groups must contain some data" ), Some(aggregate) => TableIterator::new( @@ -1636,8 +1636,8 @@ pub fn interpolated_state_periods<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { if let Some(ref agg) = agg { @@ -1662,8 +1662,8 @@ pub fn interpolated_state_periods_int<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { if let Some(ref agg) = agg { @@ -1686,8 +1686,8 @@ pub fn arrow_state_agg_interpolated_state_periods_string<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let state = MaterializedState::String( @@ -1713,8 +1713,8 @@ pub fn arrow_state_agg_interpolated_state_periods_int<'a>( ) -> TableIterator< 'a, ( - pgx::name!(start_time, TimestampTz), - pgx::name!(end_time, TimestampTz), + pgrx::name!(start_time, TimestampTz), + pgrx::name!(end_time, TimestampTz), ), > { let state = MaterializedState::Integer(accessor.state); @@ -1847,7 +1847,7 @@ mod tests { use std::sync::atomic::Ordering::Relaxed; use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; macro_rules! select_one { ($client:expr, $stmt:expr, $type:ty) => { diff --git a/extension/src/state_aggregate/rollup.rs b/extension/src/state_aggregate/rollup.rs index 9899aa36..99ed086a 100644 --- a/extension/src/state_aggregate/rollup.rs +++ b/extension/src/state_aggregate/rollup.rs @@ -436,7 +436,7 @@ pub fn state_agg_rollup_combine_inner( #[pg_schema] mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; #[pg_test] #[should_panic = "can't merge overlapping aggregates"] diff --git a/extension/src/stats_agg.rs b/extension/src/stats_agg.rs index 389a1aa7..65dbe212 100644 --- a/extension/src/stats_agg.rs +++ b/extension/src/stats_agg.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use twofloat::TwoFloat; use crate::{ @@ -1385,7 +1385,7 @@ pub enum Method { pub fn method_kind(method: &str) -> Method { match as_method(method) { Some(method) => method, - None => pgx::error!("unknown analysis method. Valid methods are 'population' and 'sample'"), + None => pgrx::error!("unknown analysis method. Valid methods are 'population' and 'sample'"), } } @@ -1402,7 +1402,7 @@ pub fn as_method(method: &str) -> Option { // mod tests { // use approx::assert_relative_eq; -// use pgx::*; +// use pgrx::*; // use super::*; // macro_rules! select_one { @@ -1447,7 +1447,7 @@ mod tests { use super::*; use approx::relative_eq; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; use rand::rngs::SmallRng; use rand::seq::SliceRandom; use rand::{self, Rng, SeedableRng}; @@ -1642,7 +1642,7 @@ mod tests { let control = state.unwrap(); let buffer = stats1d_trans_serialize(Inner::from(control.clone()).internal().unwrap()); - let buffer = pgx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); + let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); let expected = [ 1, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 144, 194, 245, 40, 92, 143, 73, 64, 100, 180, 142, @@ -1651,7 +1651,7 @@ mod tests { ]; assert_eq!(buffer, expected); - let expected = pgx::varlena::rust_byte_slice_to_bytea(&expected); + let expected = pgrx::varlena::rust_byte_slice_to_bytea(&expected); let new_state = stats1d_trans_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr()))); @@ -1734,7 +1734,7 @@ mod tests { #[allow(clippy::float_cmp)] fn check_agg_equivalence( state: &TestState, - client: &mut pgx::spi::SpiClient, + client: &mut pgrx::spi::SpiClient, pg_cmd: &str, tk_cmd: &str, allowed_diff: f64, diff --git a/extension/src/tdigest.rs b/extension/src/tdigest.rs index 3671d459..e305473b 100644 --- a/extension/src/tdigest.rs +++ b/extension/src/tdigest.rs @@ -1,6 +1,6 @@ use std::{convert::TryInto, ops::Deref}; -use pgx::*; +use pgrx::*; use crate::{ accessors::{ @@ -421,7 +421,7 @@ pub fn tdigest_mean<'a>(digest: TDigest<'a>) -> f64 { mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; // Assert equality between two floats, within some fixed error range. fn apx_eql(value: f64, expected: f64, error: f64) { @@ -657,7 +657,7 @@ mod tests { let mut control = state.unwrap(); let buffer = tdigest_serialize(Inner::from(control.clone()).internal().unwrap()); - let buffer = pgx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); + let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); let expected = [ 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 69, 192, 1, 0, 0, 0, 0, 0, 0, 0, @@ -669,7 +669,7 @@ mod tests { ]; assert_eq!(buffer, expected); - let expected = pgx::varlena::rust_byte_slice_to_bytea(&expected); + let expected = pgrx::varlena::rust_byte_slice_to_bytea(&expected); let mut new_state = tdigest_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr()))); diff --git a/extension/src/time_vector.rs b/extension/src/time_vector.rs index e64905ef..5cb50276 100644 --- a/extension/src/time_vector.rs +++ b/extension/src/time_vector.rs @@ -2,7 +2,7 @@ use crate::pg_sys::timestamptz_to_str; use core::str::Utf8Error; -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use std::ffi::CStr; use tera::{Context, Tera}; @@ -523,8 +523,8 @@ pub fn arrow_timevector_asof<'a>( #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] pub fn test_unnest() { diff --git a/extension/src/time_vector/pipeline.rs b/extension/src/time_vector/pipeline.rs index 63fe07e0..a81666ae 100644 --- a/extension/src/time_vector/pipeline.rs +++ b/extension/src/time_vector/pipeline.rs @@ -10,7 +10,7 @@ mod sort; use std::convert::TryInto; -use pgx::*; +use pgrx::*; use super::*; @@ -186,7 +186,7 @@ pub(crate) unsafe fn pipeline_support_helper( let input = input.unwrap().unwrap(); let input: *mut pg_sys::Node = input.cast_mut_ptr(); - if !pgx::is_a(input, pg_sys::NodeTag_T_SupportRequestSimplify) { + if !pgrx::is_a(input, pg_sys::NodeTag_T_SupportRequestSimplify) { return no_change(); } @@ -223,7 +223,7 @@ pub(crate) unsafe fn pipeline_support_helper( pg_sys::fmgr_info(executor_id, &mut flinfo); flinfo.fn_addr }; - // FIXME this cast should not be necessary; pgx is defining the + // FIXME this cast should not be necessary; pgrx is defining the // wrapper functions as // `unsafe fn(fcinfo: pg_sys::FunctionCallInfo) -> pg_sys::Datum` // instead of @@ -280,7 +280,7 @@ pub(crate) unsafe fn pipeline_support_helper( // support functions are spec'd as returning NULL pointer if no simplification // can be made -fn no_change() -> pgx::Internal { +fn no_change() -> pgrx::Internal { Internal::from(Some(pg_sys::Datum::from( std::ptr::null_mut::(), ))) @@ -317,8 +317,8 @@ pub fn lttb_pipeline_element( #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_lttb() { diff --git a/extension/src/time_vector/pipeline/aggregation.rs b/extension/src/time_vector/pipeline/aggregation.rs index bfc7f551..d45a2297 100644 --- a/extension/src/time_vector/pipeline/aggregation.rs +++ b/extension/src/time_vector/pipeline/aggregation.rs @@ -1,6 +1,6 @@ use std::mem::take; -use pgx::*; +use pgrx::*; use counter_agg::CounterSummaryBuilder; @@ -717,8 +717,8 @@ ALTER FUNCTION "arrow_run_pipeline_then_percentile_agg" SUPPORT toolkit_experime #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_stats_agg_finalizer() { diff --git a/extension/src/time_vector/pipeline/arithmetic.rs b/extension/src/time_vector/pipeline/arithmetic.rs index a6659b54..7ddcd903 100644 --- a/extension/src/time_vector/pipeline/arithmetic.rs +++ b/extension/src/time_vector/pipeline/arithmetic.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::*; @@ -288,8 +288,8 @@ pub fn pipeline_trunc<'e>() -> toolkit_experimental::UnstableTimevectorPipeline< #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_simple_arith_binops() { diff --git a/extension/src/time_vector/pipeline/delta.rs b/extension/src/time_vector/pipeline/delta.rs index c434d5a7..44041814 100644 --- a/extension/src/time_vector/pipeline/delta.rs +++ b/extension/src/time_vector/pipeline/delta.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::*; @@ -61,8 +61,8 @@ pub fn timevector_delta<'s>(series: &Timevector_TSTZ_F64<'s>) -> Timevector_TSTZ #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_delta() { diff --git a/extension/src/time_vector/pipeline/expansion.rs b/extension/src/time_vector/pipeline/expansion.rs index ab5bdac9..bbcbb0ef 100644 --- a/extension/src/time_vector/pipeline/expansion.rs +++ b/extension/src/time_vector/pipeline/expansion.rs @@ -1,6 +1,6 @@ use std::mem::take; -use pgx::{iter::TableIterator, *}; +use pgrx::{iter::TableIterator, *}; use super::*; @@ -144,7 +144,7 @@ pub fn arrow_run_pipeline_then_materialize<'a>( } #[pg_extern(immutable, parallel_safe, schema = "toolkit_experimental")] -pub unsafe fn pipeline_materialize_support(input: pgx::Internal) -> pgx::Internal { +pub unsafe fn pipeline_materialize_support(input: pgrx::Internal) -> pgrx::Internal { pipeline_support_helper(input, |old_pipeline, new_element| { let new_element = PipelineForceMaterialize::from_polymorphic_datum( new_element, @@ -169,8 +169,8 @@ ALTER FUNCTION "arrow_run_pipeline_then_materialize" SUPPORT toolkit_experimenta #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_unnest_finalizer() { diff --git a/extension/src/time_vector/pipeline/fill_to.rs b/extension/src/time_vector/pipeline/fill_to.rs index 8b110123..39e9b429 100644 --- a/extension/src/time_vector/pipeline/fill_to.rs +++ b/extension/src/time_vector/pipeline/fill_to.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use flat_serialize_macro::FlatSerializable; @@ -141,8 +141,8 @@ pub fn fill_to<'s>( #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_fill_to() { diff --git a/extension/src/time_vector/pipeline/filter.rs b/extension/src/time_vector/pipeline/filter.rs index 5d3605c2..c2a9d011 100644 --- a/extension/src/time_vector/pipeline/filter.rs +++ b/extension/src/time_vector/pipeline/filter.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::*; @@ -59,8 +59,8 @@ pub fn filter_lambda_over_series( #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_filter_lambda() { diff --git a/extension/src/time_vector/pipeline/lambda.rs b/extension/src/time_vector/pipeline/lambda.rs index dd9c7663..1f82393a 100644 --- a/extension/src/time_vector/pipeline/lambda.rs +++ b/extension/src/time_vector/pipeline/lambda.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use pgx::{ +use pgrx::{ iter::{SetOfIterator, TableIterator}, *, }; @@ -438,8 +438,8 @@ impl<'a> Lambda<'a> { #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; macro_rules! trace_lambda { ($client: expr, $expr:literal) => { diff --git a/extension/src/time_vector/pipeline/lambda/executor.rs b/extension/src/time_vector/pipeline/lambda/executor.rs index 5b4c65fa..20196973 100644 --- a/extension/src/time_vector/pipeline/lambda/executor.rs +++ b/extension/src/time_vector/pipeline/lambda/executor.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::*; @@ -182,10 +182,10 @@ where use BinOp::*; use Type::*; - // FIXME pgx wraps all functions in rust wrappers, which makes them + // FIXME pgrx wraps all functions in rust wrappers, which makes them // uncallable with DirectFunctionCall(). Is there a way to // export both? - // TODO This is fixed in a newer pgx version, should remove after upgrade + // TODO This is fixed in a newer pgrx version, should remove after upgrade extern "C" { fn interval_pl(fcinfo: pg_sys::FunctionCallInfo) -> pg_sys::Datum; fn interval_mi(fcinfo: pg_sys::FunctionCallInfo) -> pg_sys::Datum; diff --git a/extension/src/time_vector/pipeline/lambda/parser.rs b/extension/src/time_vector/pipeline/lambda/parser.rs index 56e7947d..20f25e71 100644 --- a/extension/src/time_vector/pipeline/lambda/parser.rs +++ b/extension/src/time_vector/pipeline/lambda/parser.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, ffi::CString}; -use pgx::*; +use pgrx::*; use super::*; @@ -365,7 +365,7 @@ fn build_binary_op( } fn parse_timestamptz(val: &str) -> i64 { - // FIXME pgx wraps all functions in rust wrappers, which makes them + // FIXME pgrx wraps all functions in rust wrappers, which makes them // uncallable with DirectFunctionCall(). Is there a way to // export both? extern "C" { @@ -386,7 +386,7 @@ fn parse_timestamptz(val: &str) -> i64 { } fn parse_interval(val: &str) -> *mut pg_sys::Interval { - // FIXME pgx wraps all functions in rust wrappers, which makes them + // FIXME pgrx wraps all functions in rust wrappers, which makes them // uncallable with DirectFunctionCall(). Is there a way to // export both? extern "C" { diff --git a/extension/src/time_vector/pipeline/map.rs b/extension/src/time_vector/pipeline/map.rs index 6b3d34d8..5a571d77 100644 --- a/extension/src/time_vector/pipeline/map.rs +++ b/extension/src/time_vector/pipeline/map.rs @@ -3,7 +3,7 @@ use std::{ ptr, }; -use pgx::*; +use pgrx::*; use super::*; @@ -169,11 +169,11 @@ pub fn map_data_pipeline_element<'e>( error!("invalid number of mapping function arguments, expected fn(double precision) RETURNS double precision") } - if unsafe { *argtypes } != pgx::PgBuiltInOids::FLOAT8OID.value() { + if unsafe { *argtypes } != pgrx::PgBuiltInOids::FLOAT8OID.value() { error!("invalid argument type, expected fn(double precision) RETURNS double precision") } - if rettype != pgx::PgBuiltInOids::FLOAT8OID.value() { + if rettype != pgrx::PgBuiltInOids::FLOAT8OID.value() { error!("invalid return type, expected fn(double precision) RETURNS double precision") } @@ -248,8 +248,8 @@ pub fn map_series(series: &mut Timevector_TSTZ_F64<'_>, mut func: impl FnMut(f64 #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_map_lambda() { diff --git a/extension/src/time_vector/pipeline/sort.rs b/extension/src/time_vector/pipeline/sort.rs index f4af26d6..4e331c1a 100644 --- a/extension/src/time_vector/pipeline/sort.rs +++ b/extension/src/time_vector/pipeline/sort.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use super::*; @@ -60,8 +60,8 @@ pub fn sort_timevector(mut series: Timevector_TSTZ_F64<'_>) -> Timevector_TSTZ_F #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_pipeline_sort() { diff --git a/extension/src/time_weighted_average.rs b/extension/src/time_weighted_average.rs index 23d0bc04..639615e8 100644 --- a/extension/src/time_weighted_average.rs +++ b/extension/src/time_weighted_average.rs @@ -1,6 +1,6 @@ #![allow(non_camel_case_types)] -use pgx::*; +use pgrx::*; use serde::{Deserialize, Serialize}; use crate::{ @@ -470,7 +470,7 @@ pub fn time_weighted_average_integral<'a>( ) -> Option { let unit = match DurationUnit::from_str(&unit) { Some(unit) => unit, - None => pgx::error!( + None => pgrx::error!( "Unrecognized duration unit: {}. Valid units are: usecond, msecond, second, minute, hour", unit, ), @@ -589,7 +589,7 @@ pub fn arrow_time_weighted_average_interpolated_integral<'a>( mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; macro_rules! select_one { ($client:expr, $stmt:expr, $type:ty) => { $client @@ -850,7 +850,7 @@ mod tests { let mut control = state.unwrap(); let buffer = time_weight_trans_serialize(Inner::from(control.clone()).internal().unwrap()); - let buffer = pgx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); + let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); let expected = [ 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 96, 194, 134, 7, 62, 2, 0, @@ -859,7 +859,7 @@ mod tests { ]; assert_eq!(buffer, expected); - let expected = pgx::varlena::rust_byte_slice_to_bytea(&expected); + let expected = pgrx::varlena::rust_byte_slice_to_bytea(&expected); let new_state = time_weight_trans_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr()))); diff --git a/extension/src/time_weighted_average/accessors.rs b/extension/src/time_weighted_average/accessors.rs index fc7778c3..460a3da0 100644 --- a/extension/src/time_weighted_average/accessors.rs +++ b/extension/src/time_weighted_average/accessors.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use crate::time_weighted_average::DurationUnit; use crate::{ @@ -92,7 +92,7 @@ fn time_weight_interpolated_integral_accessor<'a>( let unit = match DurationUnit::from_str(&unit) { Some(unit) => unit.microseconds(), - None => pgx::error!( + None => pgrx::error!( "Unrecognized duration unit: {}. Valid units are: usecond, msecond, second, minute, hour", unit, ), diff --git a/extension/src/type_builder.rs b/extension/src/type_builder.rs index 26b509a9..e5766183 100644 --- a/extension/src/type_builder.rs +++ b/extension/src/type_builder.rs @@ -98,7 +98,7 @@ macro_rules! pg_type_impl { ) => { ::paste::paste! { $(#[$attrs])* - #[derive(pgx::PostgresType, Clone)] + #[derive(pgrx::PostgresType, Clone)] #[inoutfuncs] pub struct $name<$lifetemplate>(pub [<$name Data>] $(<$inlife>)?, $crate::type_builder::CachedDatum<$lifetemplate>); @@ -121,7 +121,7 @@ macro_rules! pg_type_impl { } #[allow(clippy::missing_safety_doc)] - pub unsafe fn cached_datum_or_flatten(&mut self) -> pgx::pg_sys::Datum { + pub unsafe fn cached_datum_or_flatten(&mut self) -> pgrx::pg_sys::Datum { use $crate::type_builder::CachedDatum::*; match self.1 { None => { @@ -163,21 +163,21 @@ macro_rules! pg_type_impl { let len = self.num_bytes(); // valena types have a maximum size if len > 0x3FFFFFFF { - pgx::error!("size {} bytes is to large", len) + pgrx::error!("size {} bytes is to large", len) } let memory: *mut MaybeUninit = pg_sys::palloc0(len).cast(); let slice = slice::from_raw_parts_mut(memory, len); let rem = self.fill_slice(slice); debug_assert_eq!(rem.len(), 0); - ::pgx::set_varsize(memory.cast(), len as i32); + ::pgrx::set_varsize(memory.cast(), len as i32); slice::from_raw_parts(memory.cast(), len) } } } - impl<$lifetemplate> pgx::FromDatum for $name<$lifetemplate> { - unsafe fn from_polymorphic_datum(datum: pgx::pg_sys::Datum, is_null: bool, _: pg_sys::Oid) -> Option + impl<$lifetemplate> pgrx::FromDatum for $name<$lifetemplate> { + unsafe fn from_polymorphic_datum(datum: pgrx::pg_sys::Datum, is_null: bool, _: pg_sys::Oid) -> Option where Self: Sized, { @@ -188,10 +188,10 @@ macro_rules! pg_type_impl { let mut ptr = pg_sys::pg_detoast_datum_packed(datum.cast_mut_ptr()); //TODO is there a better way to do this? - if pgx::varatt_is_1b(ptr) { + if pgrx::varatt_is_1b(ptr) { ptr = pg_sys::pg_detoast_datum_copy(ptr); } - let data_len = pgx::varsize_any(ptr); + let data_len = pgrx::varsize_any(ptr); let bytes = std::slice::from_raw_parts(ptr as *mut u8, data_len); let (data, _) = match [<$name Data>]::try_ref(bytes) { Ok(wrapped) => wrapped, @@ -202,8 +202,8 @@ macro_rules! pg_type_impl { } } - impl<$lifetemplate> pgx::IntoDatum for $name<$lifetemplate> { - fn into_datum(self) -> Option { + impl<$lifetemplate> pgrx::IntoDatum for $name<$lifetemplate> { + fn into_datum(self) -> Option { use $crate::type_builder::CachedDatum::*; let datum = match self.1 { Flattened(bytes) => pg_sys::Datum::from(bytes.as_ptr()), @@ -331,36 +331,36 @@ macro_rules! do_serialize { let state = &*$state; let serialized_size = bincode::serialized_size(state) - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); let our_size = serialized_size + 2; // size of serialized data + our version flags let allocated_size = our_size + 4; // size of our data + the varlena header let allocated_size = allocated_size.try_into() - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); // valena types have a maximum size if allocated_size > 0x3FFFFFFF { - pgx::error!("size {} bytes is to large", allocated_size) + pgrx::error!("size {} bytes is to large", allocated_size) } let bytes: &mut [u8] = unsafe { - let bytes = pgx::pg_sys::palloc0(allocated_size); + let bytes = pgrx::pg_sys::palloc0(allocated_size); std::slice::from_raw_parts_mut(bytes.cast(), allocated_size) }; let mut writer = Cursor::new(bytes); // varlena header space let varsize = [0; 4]; writer.write_all(&varsize) - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); // type version writer.write_all(&[$version]) - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); // serialization version; 1 for bincode is currently the only option writer.write_all(&[SerializationType::Default as u8]) - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); bincode::serialize_into(&mut writer, state) - .unwrap_or_else(|e| pgx::error!("serialization error {}", e)); + .unwrap_or_else(|e| pgrx::error!("serialization error {}", e)); unsafe { let len = writer.position().try_into().expect("serialized size too large"); - ::pgx::set_varsize(writer.get_mut().as_mut_ptr() as *mut _, len); + ::pgrx::set_varsize(writer.get_mut().as_mut_ptr() as *mut _, len); } $crate::raw::bytea::from(pg_sys::Datum::from(writer.into_inner().as_mut_ptr())) } @@ -373,28 +373,28 @@ macro_rules! do_deserialize { let state: $t = unsafe { let input: $crate::raw::bytea = $bytes; - let input: pgx::pg_sys::Datum = input.into(); + let input: pgrx::pg_sys::Datum = input.into(); let detoasted = pg_sys::pg_detoast_datum_packed(input.cast_mut_ptr()); - let len = pgx::varsize_any_exhdr(detoasted); - let data = pgx::vardata_any(detoasted); + let len = pgrx::varsize_any_exhdr(detoasted); + let data = pgrx::vardata_any(detoasted); let bytes = std::slice::from_raw_parts(data as *mut u8, len); if bytes.len() < 1 { - pgx::error!("deserialization error, no bytes") + pgrx::error!("deserialization error, no bytes") } if bytes[0] != 1 { - pgx::error!( + pgrx::error!( "deserialization error, invalid serialization version {}", bytes[0] ) } if bytes[1] != SerializationType::Default as u8 { - pgx::error!( + pgrx::error!( "deserialization error, invalid serialization type {}", bytes[1] ) } bincode::deserialize(&bytes[2..]) - .unwrap_or_else(|e| pgx::error!("deserialization error {}", e)) + .unwrap_or_else(|e| pgrx::error!("deserialization error {}", e)) }; state.into() }}; diff --git a/extension/src/uddsketch.rs b/extension/src/uddsketch.rs index 18ca590d..bcf18bbe 100644 --- a/extension/src/uddsketch.rs +++ b/extension/src/uddsketch.rs @@ -1,4 +1,4 @@ -use pgx::*; +use pgrx::*; use encodings::{delta, prefix_varint}; @@ -682,7 +682,7 @@ pub fn uddsketch_error<'a>(sketch: UddSketch<'a>) -> f64 { mod tests { use super::*; - use pgx_macros::pg_test; + use pgrx_macros::pg_test; // Assert equality between two floats, within some fixed error range. fn apx_eql(value: f64, expected: f64, error: f64) { @@ -1269,7 +1269,7 @@ mod tests { let control = state.unwrap(); let buffer = uddsketch_serialize(Inner::from(control.clone()).internal().unwrap()); - let buffer = pgx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); + let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr()); let expected = [ 1, 1, 123, 20, 174, 71, 225, 122, 116, 63, 100, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5, @@ -1279,7 +1279,7 @@ mod tests { ]; assert_eq!(buffer, expected); - let expected = pgx::varlena::rust_byte_slice_to_bytea(&expected); + let expected = pgrx::varlena::rust_byte_slice_to_bytea(&expected); let new_state = uddsketch_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr()))); assert_eq!(&*new_state, &*control); diff --git a/extension/src/utilities.rs b/extension/src/utilities.rs index 63e2ad11..2181b30b 100644 --- a/extension/src/utilities.rs +++ b/extension/src/utilities.rs @@ -1,5 +1,5 @@ use crate::raw::TimestampTz; -use pgx::prelude::*; +use pgrx::prelude::*; #[pg_extern( name = "generate_periodic_normal_series", @@ -126,8 +126,8 @@ $$; #[cfg(any(test, feature = "pg_test"))] #[pg_schema] mod tests { - use pgx::*; - use pgx_macros::pg_test; + use pgrx::*; + use pgrx_macros::pg_test; #[pg_test] fn test_to_epoch() { diff --git a/tools/build b/tools/build index 1efdfdbc..31ebd02a 100755 --- a/tools/build +++ b/tools/build @@ -26,17 +26,17 @@ require_pg_version() { find_pg_config() { if [ -z "$pg_config" ]; then require_pg_version - pg_config=`sed -ne 's/"//g' -e s/^pg$pg_version=//p ~/.pgx/config.toml` + pg_config=`sed -ne 's/"//g' -e s/^pg$pg_version=//p ~/.pgrx/config.toml` fi [ -x "$pg_config" ] || die "$pg_config not executable" } -require_cargo_pgx() { - [ -n "$cargo_pgx" ] || die 'specify path to cargo-pgx (0.4 series or newer)' +require_cargo_pgrx() { + [ -n "$cargo_pgrx" ] || die 'specify path to cargo-pgrx (0.4 series or newer)' } -require_cargo_pgx_old() { - [ -n "$cargo_pgx_old" ] || die 'specify path to cargo-pgx (0.2-0.3 series)' +require_cargo_pgrx_old() { + [ -n "$cargo_pgrx_old" ] || die 'specify path to cargo-pgrx (0.2-0.3 series)' } find_profile() { @@ -58,13 +58,13 @@ while [ $# -gt 0 ]; do shift ;; - -cargo-pgx) - cargo_pgx="$1" + -cargo-pgrx) + cargo_pgrx="$1" shift ;; - -cargo-pgx-old) - cargo_pgx_old="$1" + -cargo-pgrx-old) + cargo_pgrx_old="$1" shift ;; @@ -109,36 +109,36 @@ while [ $# -gt 0 ]; do find_profile require_pg_version find_pg_config - (cd extension && $nop cargo pgx install --profile $profile -c "$pg_config") + (cd extension && $nop cargo pgrx install --profile $profile -c "$pg_config") $nop cargo run --manifest-path tools/post-install/Cargo.toml "$pg_config" ;; test-doc) find_profile require_pg_version - $nop cargo pgx start --package timescaledb_toolkit $pg + $nop cargo pgrx start --package timescaledb_toolkit $pg $nop cargo run --profile $profile -p sql-doctester -- \ -h localhost \ -p $pg_port \ docs - $nop cargo pgx stop --package timescaledb_toolkit $pg + $nop cargo pgrx stop --package timescaledb_toolkit $pg ;; test-updates) find_profile require_pg_version find_pg_config - require_cargo_pgx - require_cargo_pgx_old - $nop cargo pgx start --package timescaledb_toolkit $pg + require_cargo_pgrx + require_cargo_pgrx_old + $nop cargo pgrx start --package timescaledb_toolkit $pg $nop cargo run --profile $profile --manifest-path tools/update-tester/Cargo.toml -- full-update-test-source \ -h localhost \ -p $pg_port \ --cache old-versions \ "$pg_config" \ - "$cargo_pgx" \ - "$cargo_pgx_old" - $nop cargo pgx stop --package timescaledb_toolkit $pg + "$cargo_pgrx" \ + "$cargo_pgrx_old" + $nop cargo pgrx stop --package timescaledb_toolkit $pg ;; *) diff --git a/tools/dependencies.sh b/tools/dependencies.sh index 129ce5bc..9ffc73d0 100644 --- a/tools/dependencies.sh +++ b/tools/dependencies.sh @@ -13,8 +13,8 @@ TSDB_PG_VERSIONS='12 13 14' CARGO_EDIT=0.11.2 -# Keep synchronized with extension/Cargo.toml and `cargo install --version N.N.N cargo-pgx` in Readme.md . -PGX_VERSION=0.7.1 +# Keep synchronized with extension/Cargo.toml and `cargo install --version N.N.N cargo-pgrx` in Readme.md . +PGRX_VERSION=0.9.1 RUST_TOOLCHAIN=1.65.0 RUST_PROFILE=minimal diff --git a/tools/post-install/src/main.rs b/tools/post-install/src/main.rs index 3053e697..6669ff37 100644 --- a/tools/post-install/src/main.rs +++ b/tools/post-install/src/main.rs @@ -211,7 +211,7 @@ fn add_version_to_install_script( transform_file_to(&install_script, &versioned_script, |line| { assert!( !line.contains("CREATE OR REPLACE FUNCTION"), - "pgx should not generate CREATE OR REPLACE in functions" + "pgrx should not generate CREATE OR REPLACE in functions" ); if line.contains("MODULE_PATHNAME") { return line.replace("MODULE_PATHNAME", &module_path); diff --git a/tools/release b/tools/release index a93061b4..6e0dde64 100755 --- a/tools/release +++ b/tools/release @@ -352,7 +352,7 @@ Add two new lines to \`bundles.yaml\` containing the new version tag: tag: $VERSION \`\`\` -And update \`.github/build_bundles.py\` if new pgx is required. +And update \`.github/build_bundles.py\` if new pgrx is required. - [ ] Copy Changelog.md entries for this release into [github release](https://github.com/timescale/timescaledb-toolkit/releases/tag/$VERSION) diff --git a/tools/testbin b/tools/testbin index 27e71a8e..ce4268e5 100755 --- a/tools/testbin +++ b/tools/testbin @@ -28,10 +28,10 @@ set -ex MIN_DEB_ARM=1.10.1 # We added 1: epoch at 1.7.0. MIN_DEB_EPOCH=1.7.0 -# TODO Unfortunate that pgx allows neither specifying nor querying the port it +# TODO Unfortunate that pgrx allows neither specifying nor querying the port it # starts postgres on, so we duplicate that knowledge. Watch out for # that changing! -PGX_PORT_BASE=28800 +PGRX_PORT_BASE=28800 CONTROL=extension/timescaledb_toolkit.control # For PG_VERSIONS default. @@ -55,18 +55,18 @@ usage() { } # Requires: -# - PGX_PORT_BASE +# - PGRX_PORT_BASE # - PG_VERSION # Sets: # - PG_PORT select_pg() { - PG_PORT=$(( $PGX_PORT_BASE + $PG_VERSION )) + PG_PORT=$(( $PGRX_PORT_BASE + $PG_VERSION )) } # Start postgres and run the first half (old toolkit) of the test. # Must select_pg first. start_test() { - $nop cargo pgx start --package timescaledb_toolkit pg$PG_VERSION + $nop cargo pgrx start --package timescaledb_toolkit pg$PG_VERSION $nop cargo run --manifest-path tools/update-tester/Cargo.toml -- create-test-objects -u $LOGNAME -h 127.1 -p $PG_PORT } @@ -74,7 +74,7 @@ start_test() { # Must select_pg first. finish_test() { $nop cargo run --manifest-path tools/update-tester/Cargo.toml -- validate-test-objects -u $LOGNAME -h 127.1 -p $PG_PORT - $nop cargo pgx stop --package timescaledb_toolkit pg$PG_VERSION + $nop cargo pgrx stop --package timescaledb_toolkit pg$PG_VERSION } deb_init() { @@ -234,7 +234,7 @@ cleanup() { set +e for PG_VERSION in $PG_VERSIONS; do select_pg $PG_VERSION - $nop cargo pgx stop --package timescaledb_toolkit pg$PG_VERSION + $nop cargo pgrx stop --package timescaledb_toolkit pg$PG_VERSION done } diff --git a/tools/update-tester/Readme.md b/tools/update-tester/Readme.md index 56139d41..5f72a864 100644 --- a/tools/update-tester/Readme.md +++ b/tools/update-tester/Readme.md @@ -25,7 +25,7 @@ the current version work correctly. At a high level: ``` USAGE: - update-tester [OPTIONS] + update-tester [OPTIONS] FLAGS: --help Prints help information @@ -43,6 +43,6 @@ OPTIONS: ARGS: Path in which to find the timescaledb-toolkit repo Path to pg_config for the DB we are using - Path to cargo-pgx (must be 0.4 series or newer) - Path to cargo-pgx 0.2-0.3 series + Path to cargo-pgrx (must be 0.4 series or newer) + Path to cargo-pgrx 0.2-0.3 series ``` diff --git a/tools/update-tester/src/installer.rs b/tools/update-tester/src/installer.rs index fb10a348..73ba4639 100644 --- a/tools/update-tester/src/installer.rs +++ b/tools/update-tester/src/installer.rs @@ -12,18 +12,18 @@ pub fn install_all_versions( root_dir: &str, cache_dir: Option<&str>, pg_config: &str, - cargo_pgx: &str, - cargo_pgx_old: &str, + cargo_pgrx: &str, + cargo_pgrx_old: &str, current_version: &str, old_versions: &[String], reinstall: &HashSet<&str>, ) -> xshell::Result<()> { let extension_dir = path!(root_dir / "extension"); - let install_toolkit = |pgx_version: Version| -> xshell::Result<()> { + let install_toolkit = |pgrx_version: Version| -> xshell::Result<()> { let _d = pushd(&extension_dir)?; - match pgx_version >= Version::new(0, 4, 0) { - true => quietly_run(cmd!("{cargo_pgx} pgx install -c {pg_config}")), - false => quietly_run(cmd!("{cargo_pgx_old} pgx install -c {pg_config}")), + match pgrx_version >= Version::new(0, 4, 0) { + true => quietly_run(cmd!("{cargo_pgrx} pgrx install -c {pg_config}")), + false => quietly_run(cmd!("{cargo_pgrx_old} pgrx install -c {pg_config}")), } }; let post_install = || -> xshell::Result<()> { @@ -39,7 +39,7 @@ pub fn install_all_versions( { let base_checkout = get_current_checkout()?; - let pgx_version = get_pgx_version( + let pgrx_version = get_pgrx_version( &std::fs::read_to_string("extension/Cargo.toml").expect("unable to read Cargo.toml"), ); // Install the versions in reverse-time order. @@ -56,11 +56,11 @@ pub fn install_all_versions( quietly_run(cmd!("git fetch origin tag {tag_version}"))?; quietly_run(cmd!("git checkout tags/{tag_version}"))?; let _d = defer(|| quietly_run(cmd!("git checkout {base_checkout}"))); - let pgx_version = get_pgx_version( + let pgrx_version = get_pgrx_version( &std::fs::read_to_string("extension/Cargo.toml") .expect("unable to read Cargo.toml"), ); - install_toolkit(pgx_version)?; + install_toolkit(pgrx_version)?; post_install()?; eprintln!("{} {}", "Finished".bold().green(), version); } @@ -75,7 +75,7 @@ pub fn install_all_versions( current_version, base_checkout ); - install_toolkit(pgx_version)?; + install_toolkit(pgrx_version)?; } post_install()?; eprintln!("{}", "Finished Current".bold().green()); @@ -93,17 +93,17 @@ fn get_current_checkout() -> xshell::Result { cmd!("git rev-parse --verify HEAD").read() } -fn get_pgx_version(cargo_toml_contents: &str) -> Version { +fn get_pgrx_version(cargo_toml_contents: &str) -> Version { let cargo = cargo_toml_contents .parse::() .expect("invalid Cargo.toml"); - cargo["dependencies"]["pgx"] + cargo["dependencies"]["pgrx"] .as_str() - .expect("expected pgx to only have a version") + .expect("expected pgrx to only have a version") .trim_start_matches(['=', '^', '~'].as_slice()) .parse() - .expect("cannot parse pgx version") + .expect("cannot parse pgrx version") } // We were unprincipled with some of our old versions, so the version from diff --git a/tools/update-tester/src/main.rs b/tools/update-tester/src/main.rs index 6b4f6916..75ac0e29 100644 --- a/tools/update-tester/src/main.rs +++ b/tools/update-tester/src/main.rs @@ -77,8 +77,8 @@ fn main() { .arg(Arg::new("CACHE").short('c').long("cache").takes_value(true)) .arg(Arg::new("REINSTALL").long("reinstall").takes_value(true)) .arg(Arg::new("PG_CONFIG").takes_value(true)) - .arg(Arg::new("CARGO_PGX").takes_value(true)) - .arg(Arg::new("CARGO_PGX_OLD").takes_value(true)), + .arg(Arg::new("CARGO_PGRX").takes_value(true)) + .arg(Arg::new("CARGO_PGRX_OLD").takes_value(true)), ) .subcommand( Command::new("create-test-objects") @@ -179,12 +179,12 @@ fn main() { let pg_config = full_update_matches .value_of("PG_CONFIG") .expect("missing pg_config"); - let cargo_pgx = full_update_matches - .value_of("CARGO_PGX") - .expect("missing cargo_pgx"); - let cargo_pgx_old = full_update_matches - .value_of("CARGO_PGX_OLD") - .expect("missing cargo_pgx_old"); + let cargo_pgrx = full_update_matches + .value_of("CARGO_PGRX") + .expect("missing cargo_pgrx"); + let cargo_pgrx_old = full_update_matches + .value_of("CARGO_PGRX_OLD") + .expect("missing cargo_pgrx_old"); let mut num_errors = 0; let on_error = |test: parser::Test, error: testrunner::TestError| { @@ -203,8 +203,8 @@ fn main() { cache_dir, &connection_config, pg_config, - cargo_pgx, - cargo_pgx_old, + cargo_pgrx, + cargo_pgrx_old, reinstall, on_error, ); @@ -303,8 +303,8 @@ fn try_main( cache_dir: Option<&str>, db_conn: &ConnectionConfig<'_>, pg_config: &str, - cargo_pgx: &str, - cargo_pgx_old: &str, + cargo_pgrx: &str, + cargo_pgrx_old: &str, reinstall: HashSet<&str>, on_error: OnErr, ) -> xshell::Result<()> { @@ -319,8 +319,8 @@ fn try_main( root_dir, cache_dir, pg_config, - cargo_pgx, - cargo_pgx_old, + cargo_pgrx, + cargo_pgrx_old, ¤t_version, &old_versions, &reinstall, From 4c6fc95b8fa19c7f293d4b43e73ce5b8ea4b77db Mon Sep 17 00:00:00 2001 From: syvb Date: Tue, 27 Jun 2023 11:48:21 -0400 Subject: [PATCH 2/5] Fixes for pgrx update --- extension/src/raw.rs | 2 +- extension/src/serialization.rs | 1 - tools/dependencies.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extension/src/raw.rs b/extension/src/raw.rs index d9612209..66ec05d0 100644 --- a/extension/src/raw.rs +++ b/extension/src/raw.rs @@ -145,7 +145,7 @@ impl From for Interval { // IntervalPGetDatum(result))); // So if we want the same behavior, we need to call interval_justify_hours too: let function_args = vec![Some(pg_sys::Datum::from(interval))]; - unsafe { pgrx::direct_function_call(pg_sys::interval_justify_hours, function_args) } + unsafe { pgrx::direct_function_call(pg_sys::interval_justify_hours, &function_args) } .expect("interval_justify_hours does not return None") } } diff --git a/extension/src/serialization.rs b/extension/src/serialization.rs index 32729340..41d2da4a 100644 --- a/extension/src/serialization.rs +++ b/extension/src/serialization.rs @@ -92,7 +92,6 @@ pub extern "C" fn _ts_toolkit_decode_timestamptz(text: &str) -> i64 { str.as_ptr(), b"timestamptz\0".as_ptr().cast::(), ); - return 0; } match dtype as u32 { diff --git a/tools/dependencies.sh b/tools/dependencies.sh index 9ffc73d0..559b6ca1 100644 --- a/tools/dependencies.sh +++ b/tools/dependencies.sh @@ -16,7 +16,7 @@ CARGO_EDIT=0.11.2 # Keep synchronized with extension/Cargo.toml and `cargo install --version N.N.N cargo-pgrx` in Readme.md . PGRX_VERSION=0.9.1 -RUST_TOOLCHAIN=1.65.0 +RUST_TOOLCHAIN=1.70.0 RUST_PROFILE=minimal RUST_COMPONENTS=clippy,rustfmt From dcaf20ad5ff11a0010d5060009fa1e575335b757 Mon Sep 17 00:00:00 2001 From: syvb Date: Fri, 30 Jun 2023 18:07:52 -0400 Subject: [PATCH 3/5] pgrx 0.9.1 -> 0.9.7 --- Cargo.lock | 143 +++++++++++++++++++++++------------------- Readme.md | 2 +- extension/Cargo.toml | 8 +-- tools/dependencies.sh | 2 +- 4 files changed, 83 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35447152..77ebdfbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,17 +133,16 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.65.1" +version = "0.66.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "cexpr", "clang-sys", "lazy_static", "lazycell", "peeking_take_while", - "prettyplease", "proc-macro2", "quote", "regex", @@ -160,9 +159,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.1" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "bitvec" @@ -276,7 +275,7 @@ dependencies = [ "atty", "bitflags 1.3.2", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "strsim", "termcolor", "terminal_size", @@ -552,6 +551,12 @@ dependencies = [ "regex", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.3.1" @@ -621,9 +626,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -769,6 +774,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heapless" version = "0.7.16" @@ -850,9 +861,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -888,7 +899,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", ] [[package]] @@ -931,9 +952,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -1135,9 +1156,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "option-ext" @@ -1214,9 +1235,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -1269,17 +1290,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "pgrx" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807d11f60735140422c08faf7ae239b21e9f4339bb9e9fde25a5e0a76369a625" +checksum = "6186d4aa5911be4c00b52e555779deece35a7563c87fcfe794407dc2e9cc4dc1" dependencies = [ "atomic-traits", - "bitflags 2.3.1", + "bitflags 2.3.3", "bitvec", "enum-map", "heapless", @@ -1294,14 +1315,14 @@ dependencies = [ "serde_cbor", "serde_json", "thiserror", - "uuid 1.3.3", + "uuid 1.4.0", ] [[package]] name = "pgrx-macros" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6818d4d69e83673d50b83525c48c298a6d94278af2b73e9eed5c79b3299addbc" +checksum = "479a66a8c582e0fdf101178473315cb13eaa10829c154db742c35ec0279cdaec" dependencies = [ "pgrx-sql-entity-graph", "proc-macro2", @@ -1311,9 +1332,9 @@ dependencies = [ [[package]] name = "pgrx-pg-config" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ef77b2d9d59b9825f1949d3c3565468672fd11200d4609e9e1ae8afd5c5aca" +checksum = "1e45c557631217a13859e223899c01d35982ef0c860ee5ab65af496f830b1316" dependencies = [ "cargo_toml", "dirs", @@ -1329,9 +1350,9 @@ dependencies = [ [[package]] name = "pgrx-pg-sys" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c790691712b3bf67e0d3a4fc3b92458c9a23f105b5ae472cf11c7dc2ec8ee4ed" +checksum = "0dde896a17c638b6475d6fc12b571a176013a8486437bbc8a64ac2afb8ba5d58" dependencies = [ "bindgen", "eyre", @@ -1351,9 +1372,9 @@ dependencies = [ [[package]] name = "pgrx-sql-entity-graph" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6287a0592c3bca75ceab11eb6b3ab189158e935e08215a708b47503db5b4f848" +checksum = "b1e9abc71b018d90aa9b7a34fedf48b76da5d55c04d2ed2288096827bebbf403" dependencies = [ "convert_case", "eyre", @@ -1366,9 +1387,9 @@ dependencies = [ [[package]] name = "pgrx-tests" -version = "0.9.1" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36de0f06f2b17e19700527b506c1f1021d651fe52021eaeda623cb39908b0fb3" +checksum = "39ac4ffedfa247f9d51421e4e2ac18c33d8d674350bad730f3fe5736bf298612" dependencies = [ "clap-cargo", "eyre", @@ -1477,21 +1498,11 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "prettyplease" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b69d39aab54d069e7f2fe8cb970493e7834601ca2d8c65fd7bbd183578080d1" -dependencies = [ - "proc-macro2", - "syn 2.0.18", -] - [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -1532,9 +1543,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -1635,9 +1646,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick 1.0.1", "memchr", @@ -1799,9 +1810,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" dependencies = [ "serde", ] @@ -2004,9 +2015,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.0" +version = "0.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1" +checksum = "5bcd0346f90b6bc83526c7b180039a8acd26a5c848cc556d457f6472eb148122" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2238,21 +2249,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.10", + "toml_edit 0.19.11", ] [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -2264,17 +2275,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f" dependencies = [ "combine", - "indexmap", + "indexmap 1.9.3", "itertools", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ - "indexmap", + "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", @@ -2462,9 +2473,9 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna", @@ -2482,9 +2493,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ "getrandom", ] diff --git a/Readme.md b/Readme.md index ab982970..a3ddebee 100644 --- a/Readme.md +++ b/Readme.md @@ -51,7 +51,7 @@ sudo apt-get install make gcc pkg-config clang postgresql-server-dev-14 libssl-d Next you need [cargo-pgrx](https://github.com/tcdi/pgrx), which can be installed with ```bash -cargo install --version '=0.9.1' --force cargo-pgrx +cargo install --version '=0.9.7' --force cargo-pgrx ``` You must reinstall cargo-pgrx whenever you update your Rust compiler, since cargo-pgrx needs to be built with the same compiler as Toolkit. diff --git a/extension/Cargo.toml b/extension/Cargo.toml index 38404357..fbfa5d25 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -17,9 +17,9 @@ pg_test = ["approx"] [dependencies] # Keep synchronized with `cargo install --version N.N.N cargo-pgrx` in Readme.md and docker/ci/Dockerfile # Also `pgrx-tests` down below in `dev-dependencies`. -pgrx = "=0.9.1" -pgrx-macros = "=0.9.1" -pgrx-sql-entity-graph = "=0.9.1" +pgrx = "=0.9.7" +pgrx-macros = "=0.9.7" +pgrx-sql-entity-graph = "=0.9.7" encodings = {path="../crates/encodings"} flat_serialize = {path="../crates/flat_serialize/flat_serialize"} flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"} @@ -56,5 +56,5 @@ spfunc = "0.1.0" statrs = "0.15.0" [dev-dependencies] -pgrx-tests = "=0.9.1" +pgrx-tests = "=0.9.7" approx = "0.4.0" diff --git a/tools/dependencies.sh b/tools/dependencies.sh index 559b6ca1..a32c7d16 100644 --- a/tools/dependencies.sh +++ b/tools/dependencies.sh @@ -14,7 +14,7 @@ TSDB_PG_VERSIONS='12 13 14' CARGO_EDIT=0.11.2 # Keep synchronized with extension/Cargo.toml and `cargo install --version N.N.N cargo-pgrx` in Readme.md . -PGRX_VERSION=0.9.1 +PGRX_VERSION=0.9.7 RUST_TOOLCHAIN=1.70.0 RUST_PROFILE=minimal From 6dd40f6adf53e1146873d731bb4684e2b4fe97e4 Mon Sep 17 00:00:00 2001 From: syvb Date: Tue, 4 Jul 2023 12:01:00 -0400 Subject: [PATCH 4/5] Fix new Clippy lints --- crates/flat_serialize/flat_serialize/src/lib.rs | 4 ++-- .../flat_serialize_macro/src/lib.rs | 1 + .../flat_serialize_macro/src/parser.rs | 4 ++-- crates/hyperloglogplusplus/src/dense.rs | 6 +++--- crates/hyperloglogplusplus/src/lib.rs | 2 +- crates/hyperloglogplusplus/src/registers.rs | 6 +++--- crates/hyperloglogplusplus/src/sparse.rs | 2 +- crates/hyperloglogplusplus/src/sparse/varint.rs | 4 ++-- extension/src/datum_utils.rs | 2 +- extension/src/frequency.rs | 4 ++-- extension/src/heartbeat_agg.rs | 2 +- extension/src/hyperloglog.rs | 4 ++-- extension/src/lib.rs | 4 ++++ extension/src/lttb.rs | 8 ++++---- extension/src/pg_any_element.rs | 2 +- extension/src/state_aggregate/rollup.rs | 16 ++++++++-------- extension/src/stats_agg.rs | 4 +++- 17 files changed, 41 insertions(+), 34 deletions(-) diff --git a/crates/flat_serialize/flat_serialize/src/lib.rs b/crates/flat_serialize/flat_serialize/src/lib.rs index c5327433..58e56604 100644 --- a/crates/flat_serialize/flat_serialize/src/lib.rs +++ b/crates/flat_serialize/flat_serialize/src/lib.rs @@ -573,7 +573,7 @@ where if !::TRIVIAL_COPY { return len_of_iterable::(self.iter(), count); } - ::std::mem::size_of::() * count as usize + ::std::mem::size_of::() * count } } @@ -686,7 +686,7 @@ fn len_of_iterable<'i, T: FlatSerializable<'i>, V: ValOrRef, I: Iterator, align: usize) -> usize { let current_ptr = ptr as usize; - if current_ptr as usize % align == 0 { + if current_ptr % align == 0 { return 0; } align - (current_ptr % align) diff --git a/crates/flat_serialize/flat_serialize_macro/src/lib.rs b/crates/flat_serialize/flat_serialize_macro/src/lib.rs index 28f49fcc..7710adeb 100644 --- a/crates/flat_serialize/flat_serialize_macro/src/lib.rs +++ b/crates/flat_serialize/flat_serialize_macro/src/lib.rs @@ -137,6 +137,7 @@ struct VariableLenFieldInfo { is_optional: bool, } +#[allow(clippy::redundant_clone)] // triggers incorrectly fn flat_serialize_struct(input: FlatSerializeStruct) -> TokenStream2 { let ident = input.ident.clone(); diff --git a/crates/flat_serialize/flat_serialize_macro/src/parser.rs b/crates/flat_serialize/flat_serialize_macro/src/parser.rs index 5d304853..f63645fe 100644 --- a/crates/flat_serialize/flat_serialize_macro/src/parser.rs +++ b/crates/flat_serialize/flat_serialize_macro/src/parser.rs @@ -315,9 +315,9 @@ fn validate_self_fields<'a>(fields: impl Iterator( +fn validate_self_field( expr: &Expr, - seen_fields: &HashSet<&'a Ident>, + seen_fields: &HashSet<&Ident>, ) -> std::result::Result<(), TokenStream2> { let mut validate_fields = ValidateLenFields(None, seen_fields); validate_fields.visit_expr(expr); diff --git a/crates/hyperloglogplusplus/src/dense.rs b/crates/hyperloglogplusplus/src/dense.rs index 871e4271..f7ae2e48 100644 --- a/crates/hyperloglogplusplus/src/dense.rs +++ b/crates/hyperloglogplusplus/src/dense.rs @@ -52,12 +52,12 @@ impl<'s> Storage<'s> { pub fn add_hash(&mut self, hash: u64) { let (idx, count) = self.idx_count_from_hash(hash); - self.registers.set_max(idx as usize, count as u8); + self.registers.set_max(idx, count); } pub fn add_encoded(&mut self, encoded: crate::sparse::Encoded) { let (idx, count) = self.idx_count_from_encoded(encoded); - self.registers.set_max(idx as usize, count); + self.registers.set_max(idx, count); } fn idx_count_from_hash(&self, hash: u64) -> (usize, u8) { @@ -206,7 +206,7 @@ impl<'s> Storage<'s> { } } - pub fn merge_in<'o>(&mut self, other: &Storage<'o>) { + pub fn merge_in(&mut self, other: &Storage<'_>) { assert!( self.precision == other.precision, "precision must be equal (left={}, right={})", diff --git a/crates/hyperloglogplusplus/src/lib.rs b/crates/hyperloglogplusplus/src/lib.rs index a4668e65..a84e53b0 100644 --- a/crates/hyperloglogplusplus/src/lib.rs +++ b/crates/hyperloglogplusplus/src/lib.rs @@ -146,7 +146,7 @@ where } } - pub fn merge_in<'o>(&mut self, other: &HyperLogLog<'o, T, B>) { + pub fn merge_in(&mut self, other: &HyperLogLog<'_, T, B>) { use HyperLogLogStorage::*; match (&mut self.storage, &other.storage) { (Sparse(s), Sparse(o)) => { diff --git a/crates/hyperloglogplusplus/src/registers.rs b/crates/hyperloglogplusplus/src/registers.rs index fbc4db68..028aa3d3 100644 --- a/crates/hyperloglogplusplus/src/registers.rs +++ b/crates/hyperloglogplusplus/src/registers.rs @@ -129,7 +129,7 @@ impl<'s> Registers<'s> { self.0.len() } - pub fn merge<'a, 'b>(a: &Registers<'a>, b: &Registers<'b>) -> Self { + pub fn merge(a: &Registers<'_>, b: &Registers<'_>) -> Self { if a.0.len() != b.0.len() { panic!( "different register size in merge: {} != {}", @@ -254,7 +254,7 @@ mod test { fn quick_test(exp: u8, ops: Vec<(usize, u8)>) -> quickcheck::TestResult { use quickcheck::TestResult; use std::cmp::max; - if exp < 4 || exp > 16 { + if !(4..=16).contains(&exp) { return TestResult::discard(); } @@ -312,7 +312,7 @@ mod test { ops_b: Vec<(usize, u8)>, ) -> quickcheck::TestResult { use quickcheck::TestResult; - if exp < 4 || exp > 16 { + if !(4..=16).contains(&exp) { return TestResult::discard(); } diff --git a/crates/hyperloglogplusplus/src/sparse.rs b/crates/hyperloglogplusplus/src/sparse.rs index 8ca151c9..e9110ee4 100644 --- a/crates/hyperloglogplusplus/src/sparse.rs +++ b/crates/hyperloglogplusplus/src/sparse.rs @@ -173,7 +173,7 @@ impl<'s> Storage<'s> { self.compressed.num_bytes() } - pub fn merge_in<'o>(&mut self, other: &Storage<'o>) -> Overflowing { + pub fn merge_in(&mut self, other: &Storage<'_>) -> Overflowing { assert!( self.precision == other.precision, "precision must be equal (left={}, right={})", diff --git a/crates/hyperloglogplusplus/src/sparse/varint.rs b/crates/hyperloglogplusplus/src/sparse/varint.rs index b52a7b54..aafac0e3 100644 --- a/crates/hyperloglogplusplus/src/sparse/varint.rs +++ b/crates/hyperloglogplusplus/src/sparse/varint.rs @@ -4,8 +4,8 @@ use encodings::{delta, prefix_varint}; use super::Encoded; -pub fn decompression_iter<'a, 'b>( - Compressed(bytes): &'a Compressed<'b>, +pub fn decompression_iter<'a>( + Compressed(bytes): &'a Compressed<'_>, ) -> impl Iterator + 'a { prefix_varint::u64_decompressor(bytes) .map(delta::u64_decoder()) diff --git a/extension/src/datum_utils.rs b/extension/src/datum_utils.rs index fa0d63c4..acea5fdc 100644 --- a/extension/src/datum_utils.rs +++ b/extension/src/datum_utils.rs @@ -153,7 +153,7 @@ impl DatumHashBuilder { // 1 argument for the key, 1 argument for the seed let size = size_of::() + size_of::() * 2; - let mut info = pg_sys::palloc0(size) as pg_sys::FunctionCallInfo; + let info = pg_sys::palloc0(size) as pg_sys::FunctionCallInfo; (*info).flinfo = flinfo as *const pg_sys::FmgrInfo as *mut pg_sys::FmgrInfo; (*info).context = std::ptr::null_mut(); diff --git a/extension/src/frequency.rs b/extension/src/frequency.rs index 94b81e95..16439f19 100644 --- a/extension/src/frequency.rs +++ b/extension/src/frequency.rs @@ -393,7 +393,7 @@ impl SpaceSavingTransState { } // TODO: get this into_iter working without making temp.0 public - let mut entries: Vec = temp.0.into_iter().map(|(_, v)| v).collect(); + let mut entries: Vec = temp.0.into_values().collect(); entries.sort_by(|a, b| b.count.partial_cmp(&a.count).unwrap()); // swap a and b for descending entries.truncate(one.max_size as usize); @@ -545,7 +545,7 @@ impl<'input> } else { SpaceSavingTransState::mcv_agg_from_type_id( agg.freq_param, - agg.topn as u32, + agg.topn, pg_sys::INT8OID, collation, ) diff --git a/extension/src/heartbeat_agg.rs b/extension/src/heartbeat_agg.rs index cf403ffb..c547b443 100644 --- a/extension/src/heartbeat_agg.rs +++ b/extension/src/heartbeat_agg.rs @@ -101,7 +101,7 @@ impl HeartbeatTransState { if self.end < new_end && self.last + self.interval_len > self.end { assert!(!self.liveness.is_empty()); // above condition should be impossible without liveness data - let mut last_interval = self.liveness.last_mut().unwrap(); + let last_interval = self.liveness.last_mut().unwrap(); last_interval.1 = min(self.last + self.interval_len, new_end); } self.end = new_end; diff --git a/extension/src/hyperloglog.rs b/extension/src/hyperloglog.rs index 9227c14c..524b28cb 100644 --- a/extension/src/hyperloglog.rs +++ b/extension/src/hyperloglog.rs @@ -26,7 +26,7 @@ use hyperloglogplusplus::{HyperLogLog as HLL, HyperLogLogStorage}; #[derive(Debug, Copy, Clone, PartialEq)] struct HashableDatum(Datum); impl Eq for HashableDatum {} -#[allow(clippy::derive_hash_xor_eq)] // partialeq and hash implementations match +#[allow(clippy::derived_hash_with_manual_eq)] // partialeq and hash implementations match impl Hash for HashableDatum { fn hash(&self, state: &mut H) { self.0.value().hash(state) @@ -979,7 +979,7 @@ mod tests { const MAX_TRIAL_ERROR: f64 = 0.05; Spi::connect(|mut client| { // This should match THRESHOLD_DATA_VEC from b=12-18 - let thresholds = vec![3100, 6500, 11500, 20000, 50000, 120000, 350000]; + let thresholds = [3100, 6500, 11500, 20000, 50000, 120000, 350000]; let rand_precision: Uniform = Uniform::new_inclusive(12, 18); let mut rng = rand::thread_rng(); for _ in 0..NUM_BIAS_TRIALS { diff --git a/extension/src/lib.rs b/extension/src/lib.rs index 15f20c7d..c5acbcbb 100644 --- a/extension/src/lib.rs +++ b/extension/src/lib.rs @@ -1,3 +1,5 @@ +// so we can allow very new Clippy lints +#![allow(unknown_lints)] // flat_serialize! alignment checks hit this for any single byte field (of which all pg_types! have two by default) #![allow(clippy::modulo_one)] // some disagreement between clippy and the rust compiler about when lifetime are and are not needed @@ -10,6 +12,8 @@ #![allow(clippy::useless_conversion)] // caused by pgrx #![allow(clippy::unnecessary_lazy_evaluations)] +// clippy triggers an internal complier error checking this +#![allow(clippy::unnecessary_literal_unwrap)] pub mod accessors; pub mod asap; diff --git a/extension/src/lttb.rs b/extension/src/lttb.rs index 5463e04f..1860d0e0 100644 --- a/extension/src/lttb.rs +++ b/extension/src/lttb.rs @@ -288,7 +288,7 @@ pub fn lttb(data: &[TSPoint], threshold: usize) -> Cow<'_, [TSPoint]> { let avg_range_length = (avg_range_end - avg_range_start) as f64; for i in 0..(avg_range_end - avg_range_start) { - let idx = (avg_range_start + i) as usize; + let idx = avg_range_start + i; avg_x += data[idx].ts; avg_y += data[idx].val; } @@ -306,7 +306,7 @@ pub fn lttb(data: &[TSPoint], threshold: usize) -> Cow<'_, [TSPoint]> { let mut max_area = -1f64; let mut next_a = range_offs; for i in 0..(range_to - range_offs) { - let idx = (range_offs + i) as usize; + let idx = range_offs + i; // Calculate triangle area over three buckets. let area = ((point_a_x - avg_x) as f64 * (data[idx].val - point_a_y) @@ -375,7 +375,7 @@ pub fn lttb_ts(data: Timevector_TSTZ_F64, threshold: usize) -> Timevector_TSTZ_F let avg_range_length = (avg_range_end - avg_range_start) as f64; for i in 0..(avg_range_end - avg_range_start) { - let idx = (avg_range_start + i) as usize; + let idx = avg_range_start + i; let point = data.get(idx).unwrap(); avg_x += point.ts; avg_y += point.val; @@ -394,7 +394,7 @@ pub fn lttb_ts(data: Timevector_TSTZ_F64, threshold: usize) -> Timevector_TSTZ_F let mut max_area = -1f64; let mut next_a = range_offs; for i in 0..(range_to - range_offs) { - let idx = (range_offs + i) as usize; + let idx = range_offs + i; // Calculate triangle area over three buckets. let area = ((point_a_x - avg_x) as f64 * (data.get(idx).unwrap().val - point_a_y) diff --git a/extension/src/pg_any_element.rs b/extension/src/pg_any_element.rs index 2b7ec42c..b3d86bec 100644 --- a/extension/src/pg_any_element.rs +++ b/extension/src/pg_any_element.rs @@ -48,7 +48,7 @@ impl PartialEq for PgAnyElement { let size = size_of::() + size_of::() * 2; - let mut info = pg_sys::palloc0(size) as pg_sys::FunctionCallInfo; + let info = pg_sys::palloc0(size) as pg_sys::FunctionCallInfo; (*info).flinfo = flinfo as *const pg_sys::FmgrInfo as *mut pg_sys::FmgrInfo; (*info).context = std::ptr::null_mut(); diff --git a/extension/src/state_aggregate/rollup.rs b/extension/src/state_aggregate/rollup.rs index 99ed086a..7ec6cc4c 100644 --- a/extension/src/state_aggregate/rollup.rs +++ b/extension/src/state_aggregate/rollup.rs @@ -472,11 +472,11 @@ mod tests { durations: vec![ DurationInState { duration: 500, - state: StateEntry::from_integer(555_2), + state: StateEntry::from_integer(5_552), }, DurationInState { duration: 400, - state: StateEntry::from_integer(555_1), + state: StateEntry::from_integer(5_551), }, ], combined_durations: vec![], @@ -492,11 +492,11 @@ mod tests { durations: vec![ DurationInState { duration: 500, - state: StateEntry::from_integer(555_2), + state: StateEntry::from_integer(5_552), }, DurationInState { duration: 400, - state: StateEntry::from_integer(555_1), + state: StateEntry::from_integer(5_551), }, ], combined_durations: vec![], @@ -512,11 +512,11 @@ mod tests { durations: vec![ DurationInState { duration: 500, - state: StateEntry::from_integer(555_2), + state: StateEntry::from_integer(5_552), }, DurationInState { duration: 400, - state: StateEntry::from_integer(555_1), + state: StateEntry::from_integer(5_551), }, ], combined_durations: vec![], @@ -532,11 +532,11 @@ mod tests { durations: vec![ DurationInState { duration: 500 * 3 + 12345, - state: StateEntry::from_integer(555_2), + state: StateEntry::from_integer(5_552), }, DurationInState { duration: 400 * 3, - state: StateEntry::from_integer(555_1), + state: StateEntry::from_integer(5_551), }, ], combined_durations: vec![], diff --git a/extension/src/stats_agg.rs b/extension/src/stats_agg.rs index 65dbe212..0f3342f8 100644 --- a/extension/src/stats_agg.rs +++ b/extension/src/stats_agg.rs @@ -1385,7 +1385,9 @@ pub enum Method { pub fn method_kind(method: &str) -> Method { match as_method(method) { Some(method) => method, - None => pgrx::error!("unknown analysis method. Valid methods are 'population' and 'sample'"), + None => { + pgrx::error!("unknown analysis method. Valid methods are 'population' and 'sample'") + } } } From 70508319800cf3965dfcd48e1a4af904b9100089 Mon Sep 17 00:00:00 2001 From: syvb Date: Thu, 6 Jul 2023 11:00:24 -0400 Subject: [PATCH 5/5] Handle old pgx name in update tester --- tools/update-tester/src/installer.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/update-tester/src/installer.rs b/tools/update-tester/src/installer.rs index 73ba4639..f81587cf 100644 --- a/tools/update-tester/src/installer.rs +++ b/tools/update-tester/src/installer.rs @@ -7,6 +7,14 @@ use xshell::{cmd, cp, mkdir_p, pushd, read_dir}; use crate::{defer, quietly_run}; +fn pgrx_name(version: &Version) -> &'static str { + if version >= &Version::new(0, 7, 4) { + "pgx" + } else { + "pgrx" + } +} + #[allow(clippy::too_many_arguments)] pub fn install_all_versions( root_dir: &str, @@ -21,9 +29,10 @@ pub fn install_all_versions( let extension_dir = path!(root_dir / "extension"); let install_toolkit = |pgrx_version: Version| -> xshell::Result<()> { let _d = pushd(&extension_dir)?; + let pgrx_name = pgrx_name(&pgrx_version); match pgrx_version >= Version::new(0, 4, 0) { - true => quietly_run(cmd!("{cargo_pgrx} pgrx install -c {pg_config}")), - false => quietly_run(cmd!("{cargo_pgrx_old} pgrx install -c {pg_config}")), + true => quietly_run(cmd!("{cargo_pgrx} {pgrx_name} install -c {pg_config}")), + false => quietly_run(cmd!("{cargo_pgrx_old} {pgrx_name} install -c {pg_config}")), } }; let post_install = || -> xshell::Result<()> { @@ -98,7 +107,11 @@ fn get_pgrx_version(cargo_toml_contents: &str) -> Version { .parse::() .expect("invalid Cargo.toml"); - cargo["dependencies"]["pgrx"] + let pgrx_dependency = cargo["dependencies"] + .get("pgrx") + // check old name if no pgrx found + .unwrap_or_else(|| &cargo["dependencies"]["pgx"]); + pgrx_dependency .as_str() .expect("expected pgrx to only have a version") .trim_start_matches(['=', '^', '~'].as_slice())