Skip to content

Support PG18 beta1 #788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2025
Merged

Support PG18 beta1 #788

merged 3 commits into from
Jun 25, 2025

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented May 12, 2025

Did some of the initial to support PG18 beta1. It definitely needs another self-review, but seems good to at least put it in a draft PR.

@Z-Xiao-M
Copy link
Contributor

Perhaps it needs to be modified like this

PG_MODULE_MAGIC;

#ifdef PG_MODULE_MAGIC_EXT
PG_MODULE_MAGIC_EXT(.name = "pg_duckdb", .version = "1.0.0");
#else
PG_MODULE_MAGIC;
#endif

JelteF added 2 commits June 24, 2025 16:37
Done by taking the diff for PG17 ruleutils, manually changing 17 to 18
in there everywhere and then applying:

To get the diff:

```
git diff e963297 src/vendor/pg_ruleutils_17.c > ruleutils.diff
```

To apply:
```
git apply --3way ruleutils.diff
```
JelteF added a commit that referenced this pull request Jun 24, 2025
Things that this does to make PG18 work:

- Add a bunch of `#if PG_VERSION_NUM` cases for function calls with
  additional/fewer arguments.
- Refactor explain logic to a separate file in `src/pg` because they
  require include new different headers.
- Adds a wrapper to handle differences in C locale checking across
  versions
- Use `TupleDescAttr` instead of manually indexing into the `attrs`
  array. PG18 doesn't use this attrs array anymore.
- Start using `PG_MODULE_MAGIC_EXT`, it's easy and allows people to
  inspect the version of the shared library.
@JelteF JelteF marked this pull request as ready for review June 24, 2025 14:49
JelteF added a commit that referenced this pull request Jun 24, 2025
Things that this does to make PG18 work:

- Add a bunch of `#if PG_VERSION_NUM` cases for function calls with
  additional/fewer arguments.
- Refactor explain logic to a separate file in `src/pg` because they
  require include new different headers.
- Adds a wrapper to handle differences in C locale checking across
  versions
- Use `TupleDescAttr` instead of manually indexing into the `attrs`
  array. PG18 doesn't use this attrs array anymore.
- Start using `PG_MODULE_MAGIC_EXT`, it's easy and allows people to
  inspect the version of the shared library.
Things that this does to make PG18 work:

- Add a bunch of `#if PG_VERSION_NUM` cases for function calls with
  additional/fewer arguments.
- Refactor explain logic to a separate file in `src/pg` because they
  require include new different headers.
- Adds a wrapper to handle differences in C locale checking across
  versions
- Use `TupleDescAttr` instead of manually indexing into the `attrs`
  array. PG18 doesn't use this attrs array anymore.
- Start using `PG_MODULE_MAGIC_EXT`, it's easy and allows people to
  inspect the version of the shared library.
@JelteF JelteF merged commit 213a3d7 into main Jun 25, 2025
7 checks passed
@JelteF JelteF deleted the support-pg18 branch June 25, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants