mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +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:
@ -65,7 +65,7 @@
|
||||
/* State shared by transformCreateStmt and its subroutines */
|
||||
typedef struct
|
||||
{
|
||||
const char *stmtType; /* "CREATE TABLE" or "ALTER TABLE" */
|
||||
const char *stmtType; /* "CREATE [FOREIGN] TABLE" or "ALTER TABLE" */
|
||||
RangeVar *relation; /* relation to create */
|
||||
Relation rel; /* opened/locked rel, if ALTER */
|
||||
List *inhRelations; /* relations to inherit from */
|
||||
@ -173,7 +173,10 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
|
||||
pstate = make_parsestate(NULL);
|
||||
pstate->p_sourcetext = queryString;
|
||||
|
||||
cxt.stmtType = "CREATE TABLE";
|
||||
if (IsA(stmt, CreateForeignTableStmt))
|
||||
cxt.stmtType = "CREATE FOREIGN TABLE";
|
||||
else
|
||||
cxt.stmtType = "CREATE TABLE";
|
||||
cxt.relation = stmt->relation;
|
||||
cxt.rel = NULL;
|
||||
cxt.inhRelations = stmt->inhRelations;
|
||||
|
Reference in New Issue
Block a user