pgsql: Correctly mark pg_subscription.subslotname as nullable.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Correctly mark pg_subscription.subslotname as nullable.
Date: 2020-07-19 16:37:38
Message-ID: E1jxCJm-0006bH-FJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Correctly mark pg_subscription.subslotname as nullable.

Due to the layout of this catalog, subslotname has to be explicitly
marked BKI_FORCE_NULL, else initdb will default to the assumption
that it's non-nullable. Since, in fact, CREATE/ALTER SUBSCRIPTION
will store null values there, the existing marking is just wrong,
and has been since this catalog was invented.

We haven't noticed because not much in the system actually depends
on attnotnull being truthful. However, JIT'ed tuple deconstruction
does depend on that in some cases, allowing crashes or wrong answers
in queries that inspect pg_subscription. Commit 9de77b545 quite
accidentally exposed this on the buildfarm members that force JIT
activation.

Back-patch to v13. The problem goes further back, but we cannot
force initdb in released branches, so some klugier solution will
be needed there. Before working on that, push this simple fix
to try to get the buildfarm back to green.

Discussion: https://postgr.es/m/4118109.1595096139@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/72eab84a565cbc0677bf8907cd4bfaddf064bd64

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 3 ++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_subscription.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2020-07-19 16:47:43 pgsql: Mark buffers as defined to Valgrind consistently.
Previous Message Peter Eisentraut 2020-07-19 10:45:33 pgsql: Define OPENSSL_API_COMPAT