mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Logical replication
- Add PUBLICATION catalogs and DDL - Add SUBSCRIPTION catalog and DDL - Define logical replication protocol and output plugin - Add logical replication workers From: Petr Jelinek <petr@2ndquadrant.com> Reviewed-by: Steve Singer <steve@ssinger.info> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Erik Rijkers <er@xs4all.nl> Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
This commit is contained in:
@ -319,3 +319,31 @@ defGetTypeLength(DefElem *def)
|
||||
def->defname, defGetString(def))));
|
||||
return 0; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract a list of string values (otherwise uninterpreted) from a DefElem.
|
||||
*/
|
||||
List *
|
||||
defGetStringList(DefElem *def)
|
||||
{
|
||||
ListCell *cell;
|
||||
|
||||
if (def->arg == NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("%s requires a parameter",
|
||||
def->defname)));
|
||||
if (nodeTag(def->arg) != T_List)
|
||||
elog(ERROR, "unrecognized node type: %d", (int) nodeTag(def->arg));
|
||||
|
||||
foreach(cell, (List *)def->arg)
|
||||
{
|
||||
Node *str = (Node *) lfirst(cell);
|
||||
|
||||
if (!IsA(str, String))
|
||||
elog(ERROR, "unexpected node type in name list: %d",
|
||||
(int) nodeTag(str));
|
||||
}
|
||||
|
||||
return (List *) def->arg;
|
||||
}
|
||||
|
Reference in New Issue
Block a user