pgsql: Make unconstify and unvolatize use StaticAssertVariableIsOfTypeM

2026-03-06 Thread Peter Eisentraut
Make unconstify and unvolatize use StaticAssertVariableIsOfTypeMacro The unconstify and unvolatize macros had an almost identical assertion as was already defined in StaticAssertVariableIsOfTypeMacro, only it had a less useful error message and didn't have a sizeof fallback. Author: Jelte Fennema

pgsql: Use typeof everywhere instead of compiler specific spellings

2026-03-06 Thread Peter Eisentraut
Use typeof everywhere instead of compiler specific spellings We define typeof ourselves as __typeof__ if it does not exist. So let's actually use that for consistency. The meson/autoconf checks for __builtin_types_compatible_p still use __typeof__ though, because there we have not redefined it.

pgsql: Portable StaticAssertExpr

2026-03-06 Thread Peter Eisentraut
Portable StaticAssertExpr Use a different way to write StaticAssertExpr() that does not require the GCC extension statement expressions. For C, we put the static_assert into a struct. This appears to be a common approach. We still need to keep the fallback implementation to support buggy MSVC <

Re: pgsql: Perform provider-specific initialization in new functions.

2026-03-06 Thread Andrey Borodin
> On 3 Dec 2024, at 12:27, Jeff Davis wrote: > > Perform provider-specific initialization in new functions. > > Reviewed-by: Andreas Karlsson > Discussion: https://postgr.es/m/[email protected] Hi Jeff! I'm toying with my WAL compression patch. This test is segf

pgsql: Don't include wait_event.h in pgstat.h

2026-03-06 Thread Álvaro Herrera
Don't include wait_event.h in pgstat.h wait_event.h itself includes wait_event_types.h, which is a generated file, so it's nice that we can avoid compiling >10% of the tree just because that file is regenerated. To avoid breaking too many third-party modules, we now #include utils/wait_classes.h

pgsql: Fix Python deprecation warning

2026-03-06 Thread Peter Eisentraut
Fix Python deprecation warning Starting with Python 3.14, contrib/unaccent/generate_unaccent_rules.py complains DeprecationWarning: codecs.open() is deprecated. Use open() instead. This makes that change. This works for all Python 3.x versions. Reviewed-by: Chao Li Discussion: https://ww

pgsql: doc: Fix capitalization of Unicode

2026-03-06 Thread Peter Eisentraut
doc: Fix capitalization of Unicode Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/2a668979-ed92-49a3-abf9-a3ec2d460ec2%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/90ca7c1429d6ebfd89300ddcf1c8da6b3e671928 Modified

pgsql: CREATE SUBSCRIPTION ... SERVER.

2026-03-06 Thread Jeff Davis
CREATE SUBSCRIPTION ... SERVER. Allow CREATE SUBSCRIPTION to accept a foreign server using the SERVER clause instead of a raw connection string using the CONNECTION clause. * Enables a user with sufficient privileges to create a subscription using a foreign server by name without specifying

pgsql: pg_dumpall: Fix handling of conflicting options.

2026-03-06 Thread Nathan Bossart
pg_dumpall: Fix handling of conflicting options. pg_dumpall is missing checks for some conflicting options, including those passed through to pg_dump. To fix, introduce a new function that checks whether mutually exclusive options are set, and use that in pg_dumpall. A similar change could likel

Re: pgsql: Perform provider-specific initialization in new functions.

2026-03-06 Thread Jeff Davis
On Fri, 2026-03-06 at 20:24 +0500, Andrey Borodin wrote: > I'm toying with my WAL compression patch. This test is segfaulting > for me Thank you for the report! > wal_compression is PGC_SUSET, so when a non-superuser sets it via the > startup > packet (PGC_BACKEND context), set_config_with_handle

pgsql: libpq: Introduce PQAUTHDATA_OAUTH_BEARER_TOKEN_V2

2026-03-06 Thread Jacob Champion
libpq: Introduce PQAUTHDATA_OAUTH_BEARER_TOKEN_V2 For the libpq-oauth module to eventually make use of the PGoauthBearerRequest API, it needs some additional functionality: the derived Issuer ID for the authorization server needs to be provided, and error messages need to be built without relying

pgsql: Use palloc_object() and palloc_array() in more areas of the logi

2026-03-06 Thread Masahiko Sawada
Use palloc_object() and palloc_array() in more areas of the logical replication. The idea is to encourage the use of newer routines across the tree, as these offer stronger type-safety guarantees than raw palloc(). Similar work has been done in commits 1b105f9472bd, 0c3c5c3b06a3, 31d3847a37be, an

pgsql: Support grouping-expression references and GROUPING() in subquer

2026-03-06 Thread Tom Lane
Support grouping-expression references and GROUPING() in subqueries. Until now, substitute_grouped_columns and its predecessor check_ungrouped_columns intentionally did not cope with references to GROUP BY expressions (anything more complex than a Var) within subqueries of the query having GROUP B