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

Commit50cf1c8

Browse files
committed
Record dependencies on owners for logical replication objects
This was forgotten in665d1fa andcaused the whole buildfarm to become red for a little while.Author: Petr JelínekAlso fix a typo in a nearby error message.
1 parenta600ee9 commit50cf1c8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

‎src/backend/commands/publicationcmds.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ CreatePublication(CreatePublicationStmt *stmt)
218218
CatalogUpdateIndexes(rel,tup);
219219
heap_freetuple(tup);
220220

221+
recordDependencyOnOwner(PublicationRelationId,puboid,GetUserId());
222+
221223
ObjectAddressSet(myself,PublicationRelationId,puboid);
222224

223225
/* Make the changes visible. */

‎src/backend/commands/subscriptioncmds.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt)
210210
Oidsubid;
211211
boolnulls[Natts_pg_subscription];
212212
Datumvalues[Natts_pg_subscription];
213+
Oidowner=GetUserId();
213214
HeapTupletup;
214215
boolenabled_given;
215216
boolenabled;
@@ -263,7 +264,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt)
263264
values[Anum_pg_subscription_subdbid-1]=ObjectIdGetDatum(MyDatabaseId);
264265
values[Anum_pg_subscription_subname-1]=
265266
DirectFunctionCall1(namein,CStringGetDatum(stmt->subname));
266-
values[Anum_pg_subscription_subowner-1]=ObjectIdGetDatum(GetUserId());
267+
values[Anum_pg_subscription_subowner-1]=ObjectIdGetDatum(owner);
267268
values[Anum_pg_subscription_subenabled-1]=BoolGetDatum(enabled);
268269
values[Anum_pg_subscription_subconninfo-1]=
269270
CStringGetTextDatum(conninfo);
@@ -279,6 +280,8 @@ CreateSubscription(CreateSubscriptionStmt *stmt)
279280
CatalogUpdateIndexes(rel,tup);
280281
heap_freetuple(tup);
281282

283+
recordDependencyOnOwner(SubscriptionRelationId,subid,owner);
284+
282285
snprintf(originname,sizeof(originname),"pg_%u",subid);
283286
replorigin_create(originname);
284287

@@ -493,6 +496,9 @@ DropSubscription(DropSubscriptionStmt *stmt)
493496

494497
ReleaseSysCache(tup);
495498

499+
/* Clean up dependencies */
500+
deleteSharedDependencyRecordsFor(SubscriptionRelationId,subid,0);
501+
496502
/* Protect against launcher restarting the worker. */
497503
LWLockAcquire(LogicalRepLauncherLock,LW_EXCLUSIVE);
498504

@@ -530,7 +536,7 @@ DropSubscription(DropSubscriptionStmt *stmt)
530536

531537
if (!walrcv_command(wrconn,cmd.data,&err))
532538
ereport(ERROR,
533-
(errmsg("count not drop the replication slot \"%s\" on publisher",
539+
(errmsg("could not drop the replication slot \"%s\" on publisher",
534540
slotname),
535541
errdetail("The error was: %s",err)));
536542
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp