Skip to content

Commit 9678aa6

Browse files
authored
Update version to 0.14.2 (#2059)
Welcome to pgrx v0.14.2. This is a minor release that fixes a few bugs and also adds a big new feature: support for `pg_regress`-based regression tests. As always, please update with `cargo install cargo-pgrx --version 0.14.2 --locked` and update your extension `Cargo.toml` files with `cargo pgrx upgrade`. For the `pg_regress` regression test support, there's a new `cargo pgrx regress` subcommand, and it's documented in [cargo-pgrx's readme](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#testing-with-regression-tests). ## What's Changed * Remove the `$libdir/` prefix from module_pathname by @theory in #2051 This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed. * initial support for `pg_regress`-based tests by @eeeebbbbrrrr in #2058 (editor's node: I full expect users to uncover UX nits with this and am more than happy to entertain any ideas that help to improve workflows, either locally during development or in CI. Feel free to open issues about it.) ### More Bindings * Include `pg_statistic_ext` catalog by @ArArgon in #2053 ### Bug Fixes * check `tgnargs` in `extra_args` by @usamoi in #2046 ### Code Cleanup * Added absolute path to call `<Self as ::pgrx::datum::FromDatum>::` by @LucaCappelletti94 in #2050 * Removed duplicate ok check by @YohDeadfall in #2044 ## New Contributors * @LucaCappelletti94 made their first contribution in #2050 * @ArArgon made their first contribution in #2053 ## Thanks Shoutout to @philippemnoel of @paradedb for paying me to implement the `pg_regress` support. ❤️ **Full Changelog**: v0.14.1...v0.14.2
1 parent a903aad commit 9678aa6

File tree

21 files changed

+955
-24
lines changed

21 files changed

+955
-24
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ exclude = [
5555
cargo-pgrx = { path = "cargo-pgrx" }
5656

5757
[workspace.dependencies]
58-
pgrx-macros = { path = "./pgrx-macros", version = "=0.14.1" }
59-
pgrx-pg-sys = { path = "./pgrx-pg-sys", version = "=0.14.1" }
60-
pgrx-sql-entity-graph = { path = "./pgrx-sql-entity-graph", version = "=0.14.1" }
61-
pgrx-pg-config = { path = "./pgrx-pg-config", version = "=0.14.1" }
62-
pgrx-bindgen = { path = "./pgrx-bindgen", version = "=0.14.1" }
58+
pgrx-macros = { path = "./pgrx-macros", version = "=0.14.2" }
59+
pgrx-pg-sys = { path = "./pgrx-pg-sys", version = "=0.14.2" }
60+
pgrx-sql-entity-graph = { path = "./pgrx-sql-entity-graph", version = "=0.14.2" }
61+
pgrx-pg-config = { path = "./pgrx-pg-config", version = "=0.14.2" }
62+
pgrx-bindgen = { path = "./pgrx-bindgen", version = "=0.14.2" }
6363

6464
cargo_metadata = "0.18.0"
6565
cargo-edit = "=0.13.2" # format-preserving edits to cargo.toml

cargo-pgrx/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "cargo-pgrx"
13-
version = "0.14.1"
13+
version = "0.14.2"
1414
authors = ["PgCentral Foundation, Inc. <[email protected]>"]
1515
license = "MIT"
1616
description = "Cargo subcommand for 'pgrx' to make Postgres extension development easy"

cargo-pgrx/src/templates/cargo_toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pg17 = ["pgrx/pg17", "pgrx-tests/pg17" ]
2020
pg_test = []
2121

2222
[dependencies]
23-
pgrx = "=0.14.1"
23+
pgrx = "=0.14.2"
2424

2525
[dev-dependencies]
26-
pgrx-tests = "=0.14.1"
26+
pgrx-tests = "=0.14.2"
2727

2828
[profile.dev]
2929
panic = "unwind"

pgrx-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "pgrx-bindgen"
33
description = "additional bindgen support for pgrx"
4-
version = "0.14.1"
4+
version = "0.14.2"
55
edition = "2021"
66
license = "MIT"
77
homepage = "https://github.com/pgcentralfoundation/pgrx"

pgrx-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "pgrx-macros"
13-
version = "0.14.1"
13+
version = "0.14.2"
1414
authors = ["PgCentral Foundation, Inc. <[email protected]>"]
1515
license = "MIT"
1616
description = "Proc Macros for 'pgrx'"

pgrx-pg-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "pgrx-pg-config"
13-
version = "0.14.1"
13+
version = "0.14.2"
1414
authors = ["PgCentral Foundation, Inc. <[email protected]>"]
1515
license = "MIT"
1616
description = "A Postgres pg_config wrapper for 'pgrx'"

pgrx-pg-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "pgrx-pg-sys"
13-
version = "0.14.1"
13+
version = "0.14.2"
1414
authors = ["PgCentral Foundation, Inc. <[email protected]>"]
1515
license = "MIT"
1616
description = "Generated Rust bindings for Postgres internals, for use with 'pgrx'"

pgrx-pg-sys/src/include/pg13.rs

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,19 @@ pub const Anum_pg_seclabel_objsubid: u32 = 3;
18881888
pub const Anum_pg_seclabel_provider: u32 = 4;
18891889
pub const Anum_pg_seclabel_label: u32 = 5;
18901890
pub const Natts_pg_seclabel: u32 = 5;
1891+
pub const StatisticExtRelationId: Oid = Oid(3381);
1892+
pub const Anum_pg_statistic_ext_oid: u32 = 1;
1893+
pub const Anum_pg_statistic_ext_stxrelid: u32 = 2;
1894+
pub const Anum_pg_statistic_ext_stxname: u32 = 3;
1895+
pub const Anum_pg_statistic_ext_stxnamespace: u32 = 4;
1896+
pub const Anum_pg_statistic_ext_stxowner: u32 = 5;
1897+
pub const Anum_pg_statistic_ext_stxstattarget: u32 = 6;
1898+
pub const Anum_pg_statistic_ext_stxkeys: u32 = 7;
1899+
pub const Anum_pg_statistic_ext_stxkind: u32 = 8;
1900+
pub const Natts_pg_statistic_ext: u32 = 8;
1901+
pub const STATS_EXT_NDISTINCT: u8 = 100u8;
1902+
pub const STATS_EXT_DEPENDENCIES: u8 = 102u8;
1903+
pub const STATS_EXT_MCV: u8 = 109u8;
18911904
pub const TableSpaceRelationId: Oid = Oid(1213);
18921905
pub const Anum_pg_tablespace_oid: u32 = 1;
18931906
pub const Anum_pg_tablespace_spcname: u32 = 2;
@@ -2295,6 +2308,14 @@ pub const LOG_METAINFO_DATAFILE_TMP: &::core::ffi::CStr = c"current_logfiles.tmp
22952308
pub const RBTXN_HAS_CATALOG_CHANGES: u32 = 1;
22962309
pub const RBTXN_IS_SUBXACT: u32 = 2;
22972310
pub const RBTXN_IS_SERIALIZED: u32 = 4;
2311+
pub const STATS_MAX_DIMENSIONS: u32 = 8;
2312+
pub const STATS_NDISTINCT_MAGIC: u32 = 2740109220;
2313+
pub const STATS_NDISTINCT_TYPE_BASIC: u32 = 1;
2314+
pub const STATS_DEPS_MAGIC: u32 = 3025443372;
2315+
pub const STATS_DEPS_TYPE_BASIC: u32 = 1;
2316+
pub const STATS_MCV_MAGIC: u32 = 3785773506;
2317+
pub const STATS_MCV_TYPE_BASIC: u32 = 1;
2318+
pub const STATS_MCVLIST_MAX_ITEMS: u32 = 10000;
22982319
pub const BUF_REFCOUNT_ONE: u32 = 1;
22992320
pub const BUF_REFCOUNT_MASK: u32 = 262143;
23002321
pub const BUF_USAGECOUNT_MASK: u32 = 3932160;
@@ -20934,6 +20955,27 @@ impl Default for FormData_pg_seclabel {
2093420955
}
2093520956
}
2093620957
#[repr(C)]
20958+
#[derive(Debug)]
20959+
pub struct FormData_pg_statistic_ext {
20960+
pub oid: Oid,
20961+
pub stxrelid: Oid,
20962+
pub stxname: NameData,
20963+
pub stxnamespace: Oid,
20964+
pub stxowner: Oid,
20965+
pub stxstattarget: int32,
20966+
pub stxkeys: int2vector,
20967+
}
20968+
impl Default for FormData_pg_statistic_ext {
20969+
fn default() -> Self {
20970+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20971+
unsafe {
20972+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20973+
s.assume_init()
20974+
}
20975+
}
20976+
}
20977+
pub type Form_pg_statistic_ext = *mut FormData_pg_statistic_ext;
20978+
#[repr(C)]
2093720979
#[derive(Debug, Copy, Clone)]
2093820980
pub struct FormData_pg_tablespace {
2093920981
pub oid: Oid,
@@ -27354,6 +27396,98 @@ pub type row_security_policy_hook_type = ::core::option::Option<
2735427396
>;
2735527397
#[repr(C)]
2735627398
#[derive(Debug, Copy, Clone)]
27399+
pub struct MVNDistinctItem {
27400+
pub ndistinct: f64,
27401+
pub attrs: *mut Bitmapset,
27402+
}
27403+
impl Default for MVNDistinctItem {
27404+
fn default() -> Self {
27405+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
27406+
unsafe {
27407+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
27408+
s.assume_init()
27409+
}
27410+
}
27411+
}
27412+
#[repr(C)]
27413+
#[derive(Debug)]
27414+
pub struct MVNDistinct {
27415+
pub magic: uint32,
27416+
pub type_: uint32,
27417+
pub nitems: uint32,
27418+
pub items: __IncompleteArrayField<MVNDistinctItem>,
27419+
}
27420+
impl Default for MVNDistinct {
27421+
fn default() -> Self {
27422+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
27423+
unsafe {
27424+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
27425+
s.assume_init()
27426+
}
27427+
}
27428+
}
27429+
#[repr(C)]
27430+
#[derive(Debug, Default)]
27431+
pub struct MVDependency {
27432+
pub degree: f64,
27433+
pub nattributes: AttrNumber,
27434+
pub attributes: __IncompleteArrayField<AttrNumber>,
27435+
}
27436+
#[repr(C)]
27437+
#[derive(Debug)]
27438+
pub struct MVDependencies {
27439+
pub magic: uint32,
27440+
pub type_: uint32,
27441+
pub ndeps: uint32,
27442+
pub deps: __IncompleteArrayField<*mut MVDependency>,
27443+
}
27444+
impl Default for MVDependencies {
27445+
fn default() -> Self {
27446+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
27447+
unsafe {
27448+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
27449+
s.assume_init()
27450+
}
27451+
}
27452+
}
27453+
#[repr(C)]
27454+
#[derive(Debug, Copy, Clone)]
27455+
pub struct MCVItem {
27456+
pub frequency: f64,
27457+
pub base_frequency: f64,
27458+
pub isnull: *mut bool,
27459+
pub values: *mut Datum,
27460+
}
27461+
impl Default for MCVItem {
27462+
fn default() -> Self {
27463+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
27464+
unsafe {
27465+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
27466+
s.assume_init()
27467+
}
27468+
}
27469+
}
27470+
#[repr(C)]
27471+
#[derive(Debug)]
27472+
pub struct MCVList {
27473+
pub magic: uint32,
27474+
pub type_: uint32,
27475+
pub nitems: uint32,
27476+
pub ndimensions: AttrNumber,
27477+
pub types: [Oid; 8usize],
27478+
pub items: __IncompleteArrayField<MCVItem>,
27479+
}
27480+
impl Default for MCVList {
27481+
fn default() -> Self {
27482+
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
27483+
unsafe {
27484+
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
27485+
s.assume_init()
27486+
}
27487+
}
27488+
}
27489+
#[repr(C)]
27490+
#[derive(Debug, Copy, Clone)]
2735727491
pub struct buftag {
2735827492
pub rnode: RelFileNode,
2735927493
pub forkNum: ForkNumber::Type,
@@ -39777,6 +39911,48 @@ unsafe extern "C-unwind" {
3977739911
hasRowSecurity: *mut bool,
3977839912
hasSubLinks: *mut bool,
3977939913
);
39914+
pub fn statext_ndistinct_load(mvoid: Oid) -> *mut MVNDistinct;
39915+
pub fn statext_dependencies_load(mvoid: Oid) -> *mut MVDependencies;
39916+
pub fn statext_mcv_load(mvoid: Oid) -> *mut MCVList;
39917+
pub fn BuildRelationExtStatistics(
39918+
onerel: Relation,
39919+
totalrows: f64,
39920+
numrows: ::core::ffi::c_int,
39921+
rows: *mut HeapTuple,
39922+
natts: ::core::ffi::c_int,
39923+
vacattrstats: *mut *mut VacAttrStats,
39924+
);
39925+
pub fn ComputeExtStatisticsRows(
39926+
onerel: Relation,
39927+
natts: ::core::ffi::c_int,
39928+
stats: *mut *mut VacAttrStats,
39929+
) -> ::core::ffi::c_int;
39930+
pub fn statext_is_kind_built(htup: HeapTuple, kind: ::core::ffi::c_char) -> bool;
39931+
pub fn dependencies_clauselist_selectivity(
39932+
root: *mut PlannerInfo,
39933+
clauses: *mut List,
39934+
varRelid: ::core::ffi::c_int,
39935+
jointype: JoinType::Type,
39936+
sjinfo: *mut SpecialJoinInfo,
39937+
rel: *mut RelOptInfo,
39938+
estimatedclauses: *mut *mut Bitmapset,
39939+
) -> Selectivity;
39940+
pub fn statext_clauselist_selectivity(
39941+
root: *mut PlannerInfo,
39942+
clauses: *mut List,
39943+
varRelid: ::core::ffi::c_int,
39944+
jointype: JoinType::Type,
39945+
sjinfo: *mut SpecialJoinInfo,
39946+
rel: *mut RelOptInfo,
39947+
estimatedclauses: *mut *mut Bitmapset,
39948+
) -> Selectivity;
39949+
pub fn has_stats_of_kind(stats: *mut List, requiredkind: ::core::ffi::c_char) -> bool;
39950+
pub fn choose_best_statistics(
39951+
stats: *mut List,
39952+
requiredkind: ::core::ffi::c_char,
39953+
clause_attnums: *mut *mut Bitmapset,
39954+
nclauses: ::core::ffi::c_int,
39955+
) -> *mut StatisticExtInfo;
3978039956
pub static mut BufferIOLWLockArray: *mut LWLockMinimallyPadded;
3978139957
pub fn LockBufHdr(desc: *mut BufferDesc) -> uint32;
3978239958
pub static mut BufferDescriptors: *mut BufferDescPadded;

pgrx-pg-sys/src/include/pg13_oids.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ pub enum BuiltinOid {
213213
RelationRelationId = 1259,
214214
SPGIST_AM_OID = 4000,
215215
SecLabelRelationId = 3596,
216+
StatisticExtRelationId = 3381,
216217
StatisticRelationId = 2619,
217218
TABLE_AM_HANDLEROID = 269,
218219
TEXTARRAYOID = 1009,
@@ -478,6 +479,7 @@ impl BuiltinOid {
478479
1259 => Ok(BuiltinOid::RelationRelationId),
479480
4000 => Ok(BuiltinOid::SPGIST_AM_OID),
480481
3596 => Ok(BuiltinOid::SecLabelRelationId),
482+
3381 => Ok(BuiltinOid::StatisticExtRelationId),
481483
2619 => Ok(BuiltinOid::StatisticRelationId),
482484
269 => Ok(BuiltinOid::TABLE_AM_HANDLEROID),
483485
1009 => Ok(BuiltinOid::TEXTARRAYOID),

0 commit comments

Comments
 (0)