summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/analyze.c4
-rw-r--r--src/backend/parser/gram.y25
2 files changed, 21 insertions, 8 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 1c7be76e72..746975f90b 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.307 2004/07/12 05:37:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.308 2004/08/02 04:26:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1199,7 +1199,7 @@ transformIndexConstraints(ParseState *pstate, CreateStmtContext *cxt)
index->relation = cxt->relation;
index->accessMethod = DEFAULT_INDEX_TYPE;
- index->tableSpace = NULL;
+ index->tableSpace = constraint->indexspace;
index->indexParams = NIL;
index->whereClause = NULL;
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 1c7faa2c99..eddfb6e80d 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.468 2004/07/27 05:10:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.469 2004/08/02 04:26:35 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -320,7 +320,7 @@ static void doNegateFloat(Value *v);
%type <list> constraints_set_list
%type <boolean> constraints_set_mode
-%type <str> OptTableSpace OptTableSpaceOwner
+%type <str> OptTableSpace OptConsTableSpace OptTableSpaceOwner
/*
@@ -1609,6 +1609,7 @@ ColConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = NULL;
$$ = (Node *)n;
}
| NULL_P
@@ -1619,9 +1620,10 @@ ColConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = NULL;
$$ = (Node *)n;
}
- | UNIQUE
+ | UNIQUE OptConsTableSpace
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_UNIQUE;
@@ -1629,9 +1631,10 @@ ColConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = $2;
$$ = (Node *)n;
}
- | PRIMARY KEY
+ | PRIMARY KEY OptConsTableSpace
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_PRIMARY;
@@ -1639,6 +1642,7 @@ ColConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = $3;
$$ = (Node *)n;
}
| CHECK '(' a_expr ')'
@@ -1649,6 +1653,7 @@ ColConstraintElem:
n->raw_expr = $3;
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = NULL;
$$ = (Node *)n;
}
| DEFAULT b_expr
@@ -1667,6 +1672,7 @@ ColConstraintElem:
}
n->cooked_expr = NULL;
n->keys = NULL;
+ n->indexspace = NULL;
$$ = (Node *)n;
}
| REFERENCES qualified_name opt_column_list key_match key_actions
@@ -1787,9 +1793,10 @@ ConstraintElem:
n->name = NULL;
n->raw_expr = $3;
n->cooked_expr = NULL;
+ n->indexspace = NULL;
$$ = (Node *)n;
}
- | UNIQUE '(' columnList ')'
+ | UNIQUE '(' columnList ')' OptConsTableSpace
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_UNIQUE;
@@ -1797,9 +1804,10 @@ ConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = $3;
+ n->indexspace = $5;
$$ = (Node *)n;
}
- | PRIMARY KEY '(' columnList ')'
+ | PRIMARY KEY '(' columnList ')' OptConsTableSpace
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_PRIMARY;
@@ -1807,6 +1815,7 @@ ConstraintElem:
n->raw_expr = NULL;
n->cooked_expr = NULL;
n->keys = $4;
+ n->indexspace = $6;
$$ = (Node *)n;
}
| FOREIGN KEY '(' columnList ')' REFERENCES qualified_name
@@ -1916,6 +1925,10 @@ OptTableSpace: TABLESPACE name { $$ = $2; }
| /*EMPTY*/ { $$ = NULL; }
;
+OptConsTableSpace: USING INDEX TABLESPACE name { $$ = $4; }
+ | /*EMPTY*/ { $$ = NULL; }
+ ;
+
/*
* Note: CREATE TABLE ... AS SELECT ... is just another spelling for