pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

Postgres 15 support

Open syvb opened this issue 3 years ago • 1 comments

Adds support for the PostgreSQL 15 release candidate. If the PGX_USE_PG15_RC1 environment variable is set, the release candidate is used, otherwise pgx tries (and currently fails) to use the final release, which will hopefully be released on October 13.

The image used for GitHub Actions doesn't have PostgreSQL 15 in it yet (since it isn't released yet), so there isn't any testing of PostgreSQL 15 in CI.

Main changes:

  • Existing extension crates need to add a pg15 feature to indicate compatibility with PostgreSQL 15. cargo pgx new automatically adds the feature for new extensions.
  • pg_sys::String now exists, which conflicts with the std String when importing pg_sys::*
  • There is now a abi_extra field in the Pg_magic_func that is always "PostgreSQL", but might be different on PostgreSQL forks with an incompatible ABI
  • pg_sys::Value doesn't exist anymore

syvb avatar Oct 03 '22 16:10 syvb

pg_sys::String now exists, which conflicts with the std String when importing pg_sys::*

use pg_sys::{String as PgString}; is an option for this case. A glob import of pgx-pg-sys is... not recommended, at least in user code. We may have to handle it here, of course...

workingjubilee avatar Oct 03 '22 21:10 workingjubilee

PostgreSQL 15 is released! 🎉

I updated the PR so that it runs PostgreSQL 15 in CI now that APT packages are available. I've also removed the code that used the release candidate version so that it always uses the actual release now.

syvb avatar Oct 14 '22 14:10 syvb

PostgreSQL 15 is released! 🎉

I updated the PR so that it runs PostgreSQL 15 in CI now that APT packages are available. I've also removed the code that used the release candidate version so that it always uses the actual release now.

amazing! Thanks a billion. We'll get this merged next week.

I think we're kinda already heading towards a 0.5.1, so this will be awesome to get included.

Also, it's probably close enough for us to go ahead and remove v10 support. I'm planning on volunteering @BradyBonnette for that.

eeeebbbbrrrr avatar Oct 14 '22 14:10 eeeebbbbrrrr

use pg_sys::{String as PgString}; is an option for this case. A glob import of pgx-pg-sys is... not recommended, at least in user code. We may have to handle it here, of course...

Alternatively, doing nothing here would push folks not to glob import pg_sys, which is kind of a good thing... I suppose that kind of change might be better done over a major bump, though.

thomcc avatar Oct 19 '22 17:10 thomcc

Alternatively, doing nothing here would push folks not to glob import pg_sys, which is kind of a good thing... I suppose that kind of change might be better done over a major bump, though.

The amount of breakage from adding String to pg_sys would probably be minimal – I was only able to find three public uses of such a glob import (and only one, pgx_fdw, would actually break from this change and that isn't maintained anyways).

syvb avatar Oct 19 '22 17:10 syvb

That extension will require more updates to build in any case, unfortunately, since we changed a fair number of API details it relies on.

workingjubilee avatar Oct 20 '22 03:10 workingjubilee

Any update on when we might be able to get this PR in?

syvb avatar Oct 27 '22 15:10 syvb

this looks pretty good.

I hacked @zombodb to use this and after a few tweaks for feature = "pg15" here and there it compiled and passed all its tests. If there was a problem, ZDB would have found it!

eeeebbbbrrrr avatar Oct 31 '22 14:10 eeeebbbbrrrr

Thanks @Smittyvb! We appreciate the contribution.

eeeebbbbrrrr avatar Oct 31 '22 14:10 eeeebbbbrrrr