Skip to content

Conversation

@usamoi
Copy link
Contributor

@usamoi usamoi commented Mar 22, 2025

pgrx is switched from "C" to "C-unwind" in #1934 so it's fine to emit an error here

Without this error, someone who updates dependencies without reading changelog, would break extensions silently, if their only usage of #[pg_guard] is _PG_init. It's bad.

@eeeebbbbrrrr
Copy link
Contributor

What's the down-stream impact to users with this change? I'm hesitant to merge because it's not clear to me if extensions out in the wild will need to be updated because of this.

@usamoi
Copy link
Contributor Author

usamoi commented Mar 28, 2025

What's the down-stream impact to users with this change?

The downstream must manually switch the ABI of functions marked with #[pg_guard] from C to C-unwind. Otherwise there are errors.

If we don't emit an error and a downstream function marked with #[pg_guard] uses C ABI, then when the extension is compiled for Windows, all errors will be converted into an abort.

Even if we don't emit an error, downstream cannot simply do nothing, because the ABI of the callback function types generated by bindgen has changed from C to C-unwind.

@eeeebbbbrrrr
Copy link
Contributor

Even if we don't emit an error, downstream cannot simply do nothing, because the ABI of the callback function types generated by bindgen has changed from C to C-unwind.

I think this forces us to move to pgrx v0.14.0. Not that that's a problem, but it seems like a big enough change to warrant that.

What do you think, @usamoi?

@usamoi
Copy link
Contributor Author

usamoi commented Mar 28, 2025

I also think the next version must be 0.14.0. #1934 did another breaking change about shmem API. This is also a reason to bump the minor version.

@eeeebbbbrrrr
Copy link
Contributor

Okay. I'll do that this weekend. I appreciate your time and input!

And I'll just go ahead and merge this now...

@eeeebbbbrrrr eeeebbbbrrrr merged commit 21a70ce into pgcentralfoundation:develop Mar 28, 2025
16 checks passed
KenjiBrown pushed a commit to SoftwareLibreMx/pgrx that referenced this pull request May 27, 2025
…gcentralfoundation#2014)

`pgrx` is switched from "C" to "C-unwind" in pgcentralfoundation#1934 so it's fine to emit
an error here

Without this error, someone who updates dependencies without reading
changelog, would break extensions silently, if their only usage of
`#[pg_guard]` is `_PG_init`. It's bad.
zhjwpku added a commit to zhjwpku/wrappers that referenced this pull request May 27, 2025
PostgreSQL 12 has been unsupported for over half a year,
and pgrx v0.14.0 officially dropped support for it.

The other reason I propose this version bumping is that
pgrx v0.12.9 failed to install pg 12 on my mac.

This patch removes PG12 support from the wrappers by
upgrading pgrx to v0.14.3. Some code adjustments were required
due to changes introduced in the newer pgrx versions.

For reference, see the following updates in pgrx:

- [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1]
- [Made SPI query arguments type safe][2]
- [Added connect_mut for data changing SPI operations][3]
- [Renamed Oid::as_u32 to to_u32][4]

[1] pgcentralfoundation/pgrx#2014
[2] pgcentralfoundation/pgrx#1858
[3] pgcentralfoundation/pgrx#1913
[4] pgcentralfoundation/pgrx#2011

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
zhjwpku added a commit to zhjwpku/wrappers that referenced this pull request May 27, 2025
PostgreSQL 12 has been unsupported for over half a year,
and pgrx v0.14.0 officially dropped support for it.

The other reason I propose this version bumping is that
pgrx v0.12.9 failed to install pg 12 on my mac.

This patch removes PG12 support from the wrappers by
upgrading pgrx to v0.14.3. Some code adjustments were required
due to changes introduced in the newer pgrx versions.

For reference, see the following updates in pgrx:

- [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1]
- [Made SPI query arguments type safe][2]
- [Added connect_mut for data changing SPI operations][3]
- [Renamed Oid::as_u32 to to_u32][4]

[1] pgcentralfoundation/pgrx#2014
[2] pgcentralfoundation/pgrx#1858
[3] pgcentralfoundation/pgrx#1913
[4] pgcentralfoundation/pgrx#2011

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
burmecia pushed a commit to supabase/wrappers that referenced this pull request May 28, 2025
* chore: bump pgrx to v0.14.3

PostgreSQL 12 has been unsupported for over half a year,
and pgrx v0.14.0 officially dropped support for it.

The other reason I propose this version bumping is that
pgrx v0.12.9 failed to install pg 12 on my mac.

This patch removes PG12 support from the wrappers by
upgrading pgrx to v0.14.3. Some code adjustments were required
due to changes introduced in the newer pgrx versions.

For reference, see the following updates in pgrx:

- [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1]
- [Made SPI query arguments type safe][2]
- [Added connect_mut for data changing SPI operations][3]
- [Renamed Oid::as_u32 to to_u32][4]

[1] pgcentralfoundation/pgrx#2014
[2] pgcentralfoundation/pgrx#1858
[3] pgcentralfoundation/pgrx#1913
[4] pgcentralfoundation/pgrx#2011

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>

* run cargo fmt

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>

* bump ci cargp-pgrx version

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>

---------

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
daamien pushed a commit to daamien/pgrx that referenced this pull request Dec 15, 2025
…gcentralfoundation#2014)

`pgrx` is switched from "C" to "C-unwind" in pgcentralfoundation#1934 so it's fine to emit
an error here

Without this error, someone who updates dependencies without reading
changelog, would break extensions silently, if their only usage of
`#[pg_guard]` is `_PG_init`. It's bad.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants