Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit914d238

Browse files
committed
Correctly mark pg_subscription.subslotname as nullable.
Due to the layout of this catalog, subslotname has to be explicitlymarked BKI_FORCE_NULL, else initdb will default to the assumptionthat it's non-nullable. Since, in fact, CREATE/ALTER SUBSCRIPTIONwill 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 dependson attnotnull being truthful. However, JIT'ed tuple deconstructiondoes depend on that in some cases, allowing crashes or wrong answersin queries that inspect pg_subscription. Commit9de77b5 quiteaccidentally exposed this on the buildfarm members that force JITactivation.Back-patch to v13. The problem goes further back, but we cannotforce initdb in released branches, so some klugier solution willbe needed there. Before working on that, push this simple fixto try to get the buildfarm back to green.Discussion:https://postgr.es/m/4118109.1595096139@sss.pgh.pa.us
1 parentf2b6551 commit914d238

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

‎doc/src/sgml/catalogs.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7517,8 +7517,9 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
75177517
<structfield>subslotname</structfield> <type>name</type>
75187518
</para>
75197519
<para>
7520-
Name of the replication slot in the upstream database. Also used
7521-
for local replication origin name.
7520+
Name of the replication slot in the upstream database (also used
7521+
for the local replication origin name);
7522+
null represents <literal>NONE</literal>
75227523
</para></entry>
75237524
</row>
75247525

‎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-
#defineCATALOG_VERSION_NO202007131
56+
#defineCATALOG_VERSION_NO202007191
5757

5858
#endif

‎src/include/catalog/pg_subscription.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROW
5353
textsubconninfoBKI_FORCE_NOT_NULL;
5454

5555
/* Slot name on publisher */
56-
NameDatasubslotname;
56+
NameDatasubslotnameBKI_FORCE_NULL;
5757

5858
/* Synchronous commit setting for worker */
5959
textsubsynccommitBKI_FORCE_NOT_NULL;

‎src/test/regress/expected/subscription.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ DROP SUBSCRIPTION regress_testsub;
147147
ERROR: DROP SUBSCRIPTION cannot run inside a transaction block
148148
COMMIT;
149149
ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);
150+
\dRs+
151+
List of subscriptions
152+
Name | Owner | Enabled | Publication | Synchronous commit | Conninfo
153+
-----------------+----------------------------+---------+---------------------+--------------------+------------------------------
154+
regress_testsub | regress_subscription_user2 | f | {testpub2,testpub3} | local | dbname=regress_doesnotexist2
155+
(1 row)
156+
150157
-- now it works
151158
BEGIN;
152159
DROP SUBSCRIPTION regress_testsub;

‎src/test/regress/sql/subscription.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ COMMIT;
109109

110110
ALTER SUBSCRIPTION regress_testsubSET (slot_name= NONE);
111111

112+
\dRs+
113+
112114
-- now it works
113115
BEGIN;
114116
DROP SUBSCRIPTION regress_testsub;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp