mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Basic foreign table support.
Foreign tables are a core component of SQL/MED. This commit does not provide a working SQL/MED infrastructure, because foreign tables cannot yet be queried. Support for foreign table scans will need to be added in a future patch. However, this patch creates the necessary system catalog structure, syntax support, and support for ancillary operations such as COMMENT and SECURITY LABEL. Shigeru Hanada, heavily revised by Robert Haas
This commit is contained in:
@ -2575,11 +2575,15 @@ _copyCopyStmt(CopyStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateStmt *
|
||||
_copyCreateStmt(CreateStmt *from)
|
||||
/*
|
||||
* CopyCreateStmtFields
|
||||
*
|
||||
* This function copies the fields of the CreateStmt node. It is used by
|
||||
* copy functions for classes which inherit from CreateStmt.
|
||||
*/
|
||||
static void
|
||||
CopyCreateStmtFields(CreateStmt *from, CreateStmt *newnode)
|
||||
{
|
||||
CreateStmt *newnode = makeNode(CreateStmt);
|
||||
|
||||
COPY_NODE_FIELD(relation);
|
||||
COPY_NODE_FIELD(tableElts);
|
||||
COPY_NODE_FIELD(inhRelations);
|
||||
@ -2589,6 +2593,14 @@ _copyCreateStmt(CreateStmt *from)
|
||||
COPY_SCALAR_FIELD(oncommit);
|
||||
COPY_STRING_FIELD(tablespacename);
|
||||
COPY_SCALAR_FIELD(if_not_exists);
|
||||
}
|
||||
|
||||
static CreateStmt *
|
||||
_copyCreateStmt(CreateStmt *from)
|
||||
{
|
||||
CreateStmt *newnode = makeNode(CreateStmt);
|
||||
|
||||
CopyCreateStmtFields(from, newnode);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
@ -3297,6 +3309,19 @@ _copyDropUserMappingStmt(DropUserMappingStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateForeignTableStmt *
|
||||
_copyCreateForeignTableStmt(CreateForeignTableStmt *from)
|
||||
{
|
||||
CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
|
||||
|
||||
CopyCreateStmtFields((CreateStmt *) from, (CreateStmt *) newnode);
|
||||
|
||||
COPY_STRING_FIELD(servername);
|
||||
COPY_NODE_FIELD(options);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateTrigStmt *
|
||||
_copyCreateTrigStmt(CreateTrigStmt *from)
|
||||
{
|
||||
@ -4198,6 +4223,9 @@ copyObject(void *from)
|
||||
case T_DropUserMappingStmt:
|
||||
retval = _copyDropUserMappingStmt(from);
|
||||
break;
|
||||
case T_CreateForeignTableStmt:
|
||||
retval = _copyCreateForeignTableStmt(from);
|
||||
break;
|
||||
case T_CreateTrigStmt:
|
||||
retval = _copyCreateTrigStmt(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user