mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
SQL/MED catalog manipulation facilities
This doesn't do any remote or external things yet, but it gives modules like plproxy and dblink a standardized and future-proof system for managing their connection information. Martin Pihlak and Peter Eisentraut
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.415 2008/12/04 17:51:26 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.416 2008/12/19 16:25:17 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2033,6 +2033,17 @@ _copyDefElem(DefElem *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static OptionDefElem *
|
||||
_copyOptionDefElem(OptionDefElem *from)
|
||||
{
|
||||
OptionDefElem *newnode = makeNode(OptionDefElem);
|
||||
|
||||
COPY_SCALAR_FIELD(alter_op);
|
||||
COPY_NODE_FIELD(def);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static LockingClause *
|
||||
_copyLockingClause(LockingClause *from)
|
||||
{
|
||||
@@ -2869,6 +2880,117 @@ _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateFdwStmt *
|
||||
_copyCreateFdwStmt(CreateFdwStmt *from)
|
||||
{
|
||||
CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
|
||||
|
||||
COPY_STRING_FIELD(fdwname);
|
||||
COPY_STRING_FIELD(library);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterFdwStmt *
|
||||
_copyAlterFdwStmt(AlterFdwStmt *from)
|
||||
{
|
||||
AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
|
||||
|
||||
COPY_STRING_FIELD(fdwname);
|
||||
COPY_STRING_FIELD(library);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DropFdwStmt *
|
||||
_copyDropFdwStmt(DropFdwStmt *from)
|
||||
{
|
||||
DropFdwStmt *newnode = makeNode(DropFdwStmt);
|
||||
|
||||
COPY_STRING_FIELD(fdwname);
|
||||
COPY_SCALAR_FIELD(missing_ok);
|
||||
COPY_SCALAR_FIELD(behavior);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateForeignServerStmt *
|
||||
_copyCreateForeignServerStmt(CreateForeignServerStmt *from)
|
||||
{
|
||||
CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
|
||||
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_STRING_FIELD(servertype);
|
||||
COPY_STRING_FIELD(version);
|
||||
COPY_STRING_FIELD(fdwname);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterForeignServerStmt *
|
||||
_copyAlterForeignServerStmt(AlterForeignServerStmt *from)
|
||||
{
|
||||
AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
|
||||
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_STRING_FIELD(version);
|
||||
COPY_NODE_FIELD(options);
|
||||
COPY_SCALAR_FIELD(has_version);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DropForeignServerStmt *
|
||||
_copyDropForeignServerStmt(DropForeignServerStmt *from)
|
||||
{
|
||||
DropForeignServerStmt *newnode = makeNode(DropForeignServerStmt);
|
||||
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_SCALAR_FIELD(missing_ok);
|
||||
COPY_SCALAR_FIELD(behavior);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateUserMappingStmt *
|
||||
_copyCreateUserMappingStmt(CreateUserMappingStmt *from)
|
||||
{
|
||||
CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
|
||||
|
||||
COPY_STRING_FIELD(username);
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterUserMappingStmt *
|
||||
_copyAlterUserMappingStmt(AlterUserMappingStmt *from)
|
||||
{
|
||||
AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
|
||||
|
||||
COPY_STRING_FIELD(username);
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DropUserMappingStmt *
|
||||
_copyDropUserMappingStmt(DropUserMappingStmt *from)
|
||||
{
|
||||
DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
|
||||
|
||||
COPY_STRING_FIELD(username);
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_SCALAR_FIELD(missing_ok);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateTrigStmt *
|
||||
_copyCreateTrigStmt(CreateTrigStmt *from)
|
||||
{
|
||||
@@ -3696,6 +3818,33 @@ copyObject(void *from)
|
||||
case T_DropTableSpaceStmt:
|
||||
retval = _copyDropTableSpaceStmt(from);
|
||||
break;
|
||||
case T_CreateFdwStmt:
|
||||
retval = _copyCreateFdwStmt(from);
|
||||
break;
|
||||
case T_AlterFdwStmt:
|
||||
retval = _copyAlterFdwStmt(from);
|
||||
break;
|
||||
case T_DropFdwStmt:
|
||||
retval = _copyDropFdwStmt(from);
|
||||
break;
|
||||
case T_CreateForeignServerStmt:
|
||||
retval = _copyCreateForeignServerStmt(from);
|
||||
break;
|
||||
case T_AlterForeignServerStmt:
|
||||
retval = _copyAlterForeignServerStmt(from);
|
||||
break;
|
||||
case T_DropForeignServerStmt:
|
||||
retval = _copyDropForeignServerStmt(from);
|
||||
break;
|
||||
case T_CreateUserMappingStmt:
|
||||
retval = _copyCreateUserMappingStmt(from);
|
||||
break;
|
||||
case T_AlterUserMappingStmt:
|
||||
retval = _copyAlterUserMappingStmt(from);
|
||||
break;
|
||||
case T_DropUserMappingStmt:
|
||||
retval = _copyDropUserMappingStmt(from);
|
||||
break;
|
||||
case T_CreateTrigStmt:
|
||||
retval = _copyCreateTrigStmt(from);
|
||||
break;
|
||||
@@ -3823,6 +3972,9 @@ copyObject(void *from)
|
||||
case T_DefElem:
|
||||
retval = _copyDefElem(from);
|
||||
break;
|
||||
case T_OptionDefElem:
|
||||
retval = _copyOptionDefElem(from);
|
||||
break;
|
||||
case T_LockingClause:
|
||||
retval = _copyLockingClause(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user