mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
CREATE TABLE IF NOT EXISTS.
Reviewed by Bernd Helmle.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.713 2010/06/13 17:43:12 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.714 2010/07/25 23:21:21 rhaas Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -2212,6 +2212,23 @@ CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')'
|
||||
n->options = $9;
|
||||
n->oncommit = $10;
|
||||
n->tablespacename = $11;
|
||||
n->if_not_exists = false;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '('
|
||||
OptTableElementList ')' OptInherit OptWith OnCommitOption
|
||||
OptTableSpace
|
||||
{
|
||||
CreateStmt *n = makeNode(CreateStmt);
|
||||
$7->istemp = $2;
|
||||
n->relation = $7;
|
||||
n->tableElts = $9;
|
||||
n->inhRelations = $11;
|
||||
n->constraints = NIL;
|
||||
n->options = $12;
|
||||
n->oncommit = $13;
|
||||
n->tablespacename = $14;
|
||||
n->if_not_exists = true;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE OptTemp TABLE qualified_name OF any_name
|
||||
@@ -2227,6 +2244,22 @@ CreateStmt: CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')'
|
||||
n->options = $8;
|
||||
n->oncommit = $9;
|
||||
n->tablespacename = $10;
|
||||
n->if_not_exists = false;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name
|
||||
OptTypedTableElementList OptWith OnCommitOption OptTableSpace
|
||||
{
|
||||
CreateStmt *n = makeNode(CreateStmt);
|
||||
n->relation = $7;
|
||||
n->tableElts = $10;
|
||||
n->ofTypename = makeTypeNameFromNameList($9);
|
||||
n->ofTypename->location = @9;
|
||||
n->constraints = NIL;
|
||||
n->options = $11;
|
||||
n->oncommit = $12;
|
||||
n->tablespacename = $13;
|
||||
n->if_not_exists = true;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
|
Reference in New Issue
Block a user