Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 72eab84

Browse files
committed
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 9de77b5 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
1 parent 4d3db13 commit 72eab84

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7529,7 +7529,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
75297529
</para>
75307530
<para>
75317531
Name of the replication slot in the upstream database (also used
7532-
for the local replication origin name)
7532+
for the local replication origin name);
7533+
null represents <literal>NONE</literal>
75337534
</para></entry>
75347535
</row>
75357536

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202007181
56+
#define CATALOG_VERSION_NO 202007192
5757

5858
#endif

src/include/catalog/pg_subscription.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROW
5656
text subconninfo BKI_FORCE_NOT_NULL;
5757

5858
/* Slot name on publisher */
59-
NameData subslotname;
59+
NameData subslotname BKI_FORCE_NULL;
6060

6161
/* Synchronous commit setting for worker */
6262
text subsynccommit BKI_FORCE_NOT_NULL;

0 commit comments

Comments
 (0)