From 0d692a0dc9f0e532c67c577187fe5d7d323cb95b Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Sat, 1 Jan 2011 23:48:11 -0500 Subject: 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 --- src/backend/parser/parse_utilcmd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/backend/parser/parse_utilcmd.c') diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index d75c706816b..23c60eec318 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -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; -- cgit v1.2.3