aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-07-19 12:37:23 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-07-19 12:37:23 -0400
commit72eab84a565cbc0677bf8907cd4bfaddf064bd64 (patch)
treecb6015ccdf6926b7bfcd528f424abbf276ba52da
parent4d3db13621be64fbac2faf7c01c4879d20885c1b (diff)
downloadpostgresql-72eab84a565cbc0677bf8907cd4bfaddf064bd64.tar.gz
postgresql-72eab84a565cbc0677bf8907cd4bfaddf064bd64.zip
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
-rw-r--r--doc/src/sgml/catalogs.sgml3
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_subscription.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 18ab3d434cb..80c183b2355 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -7529,7 +7529,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
</para>
<para>
Name of the replication slot in the upstream database (also used
- for the local replication origin name)
+ for the local replication origin name);
+ null represents <literal>NONE</literal>
</para></entry>
</row>
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index ccb586ad00f..dab7f4f4713 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202007181
+#define CATALOG_VERSION_NO 202007192
#endif
diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h
index a041ce9740a..9795c35000d 100644
--- a/src/include/catalog/pg_subscription.h
+++ b/src/include/catalog/pg_subscription.h
@@ -56,7 +56,7 @@ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROW
text subconninfo BKI_FORCE_NOT_NULL;
/* Slot name on publisher */
- NameData subslotname;
+ NameData subslotname BKI_FORCE_NULL;
/* Synchronous commit setting for worker */
text subsynccommit BKI_FORCE_NOT_NULL;