1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Add the notion of REPLICA IDENTITY for a table.

Pending patches for logical replication will use this to determine
which columns of a tuple ought to be considered as its candidate key.

Andres Freund, with minor, mostly cosmetic adjustments by me
This commit is contained in:
Robert Haas
2013-11-08 12:30:43 -05:00
parent b97ee66cc1
commit 07cacba983
23 changed files with 902 additions and 49 deletions

View File

@@ -3270,6 +3270,17 @@ _copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
return newnode;
}
static ReplicaIdentityStmt *
_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
{
ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
COPY_SCALAR_FIELD(identity_type);
COPY_STRING_FIELD(name);
return newnode;
}
static CreateSeqStmt *
_copyCreateSeqStmt(const CreateSeqStmt *from)
{
@@ -4343,6 +4354,9 @@ copyObject(const void *from)
case T_RefreshMatViewStmt:
retval = _copyRefreshMatViewStmt(from);
break;
case T_ReplicaIdentityStmt:
retval = _copyReplicaIdentityStmt(from);
break;
case T_CreateSeqStmt:
retval = _copyCreateSeqStmt(from);
break;