Skip to content

Add PostgreSQL 19 compatibility - #33

Open
sibowu-aws wants to merge 1 commit into
pgbigm:masterfrom
sibowu-aws:master
Open

Add PostgreSQL 19 compatibility#33
sibowu-aws wants to merge 1 commit into
pgbigm:masterfrom
sibowu-aws:master

Conversation

@sibowu-aws

Copy link
Copy Markdown

PG19 made two changes that broke pg_bigm's existing PG18 fallback for
t_isspace() (originally added in commit which copied the PG17
implementation after PG18 removed t_isspace via core commit d3aad4ac57c - postgres/postgres@d3aad4a):

  • the database_ctype_is_c global flag is gone; the equivalent
    information now lives on pg_locale_t->ctype_is_c, retrievable
    via pg_database_locale().
  • char2wchar() is no longer exported from utils/pg_locale.h
    (it was made static in src/backend/utils/adt/pg_locale_libc.c).

Add a PG_VERSION_NUM >= 190000 branch to t_isspace() that uses the new
public API: pg_database_locale() for the locale, pg_mb2wchar_with_len()
to decode the multibyte character, and pg_iswspace() for the classify
call. This mirrors the pattern PG19 itself uses in
src/backend/tsearch/ts_locale.c for t_isalnum / t_isalpha. The PG18
code path is preserved unchanged.

Also add alternate expected outputs (expected/pg_bigm_2.out,
expected/pg_bigm_ja_2.out) so the regression suite passes on PG19,
where:

  • escape_string_warning was removed (SET errors out).
  • standard_conforming_strings can no longer be turned off
    (SET errors out, and the dependent \-escape tests behave
    differently under standard strings).
  • the "function does not exist" error switched its trailing
    line from HINT to DETAIL with a new message.

The original expected files are kept, so PG <= 18 continues to pass.

@devrimgunduz

Copy link
Copy Markdown

RPM tracker: pgdg-packaging/pgdg-rpms#213

@MasaoFujii

Copy link
Copy Markdown
Member

@sibowu-aws
Thanks for working on PostgreSQL 19 support!

I prepared an alternative patch here:
master...MasaoFujii:pg_bigm:support-pg19

It uses the same basic approach for the PG19 t_isspace() path described in
this PR, but differs in a few points:

  • it fixes the LockBuffer() link failure on PG19 by calling the exported
    LockBufferInternal() function instead
  • it also fixes pg_gin_pending_stats() by calling TupleDescFinalize()
    before BlessTupleDesc() on PG19
  • it avoids adding expected/pg_bigm_2.out and
    expected/pg_bigm_ja_2.out by making the regression SQL output less
    version-dependent
  • it avoids the version-dependent function does not exist error text by
    checking pg_proc
  • it updates the docs and CI matrix for PostgreSQL 19

Regards,

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.

3 participants