Skip to content

Commit 05e170c

Browse files
author
Antonin Houska
committed
Include the relation OID in the replication slot name.
This way multiple tables can be processed at a time.
1 parent 687338e commit 05e170c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pg_rewrite.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,12 +1463,12 @@ setup_decoding(Oid relid, TupleDesc tup_desc)
14631463
oldcontext = MemoryContextSwitchTo(TopTransactionContext);
14641464

14651465
/*
1466-
* In order to be able to run partition_table() in each database
1467-
* independently, thus the slot name should be database-specific.
1466+
* In order to be able to run partition_table() for multiple tables at a
1467+
* time, slot name should contain both database OID and relation OID.
14681468
*/
14691469
buf = makeStringInfo();
14701470
appendStringInfoString(buf, REPL_SLOT_BASE_NAME);
1471-
appendStringInfo(buf, "%u", MyDatabaseId);
1471+
appendStringInfo(buf, "%u_%u", MyDatabaseId, relid);
14721472
#if PG_VERSION_NUM >= 140000
14731473
ReplicationSlotCreate(buf->data, true, RS_EPHEMERAL, false);
14741474
#else

0 commit comments

Comments
 (0)