aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-08-15 16:36:08 +0000
committerBruce Momjian <bruce@momjian.us>2002-08-15 16:36:08 +0000
commitb1a5f8720987fbfda23c6bfb4a0dd683b9bdae70 (patch)
tree9212ba16b7941ad741708dd0999beaf3e6948232 /src/backend/parser
parent38294db64bce9e78e6a1fc55fb6746074de59d2b (diff)
downloadpostgresql-b1a5f8720987fbfda23c6bfb4a0dd683b9bdae70.tar.gz
postgresql-b1a5f8720987fbfda23c6bfb4a0dd683b9bdae70.zip
Tom Lane wrote:
> There's no longer a separate call to heap_storage_create in that routine > --- the right place to make the test is now in the storage_create > boolean parameter being passed to heap_create. A simple change, but > it passeth patch's understanding ... Thanks. Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out that even after fixing the failed hunks, there was a new spot in bufmgr.c which needed to be fixed (related to temp relations; RelationUpdateNumberOfBlocks). But thankfully the regression test code caught it :-) Joe Conway
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 98acc050d56..a56f7d41b99 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.358 2002/08/10 19:01:53 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.359 2002/08/15 16:36:03 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -205,7 +205,7 @@ static void doNegateFloat(Value *v);
%type <list> stmtblock, stmtmulti,
OptTableElementList, TableElementList, OptInherit, definition,
- opt_distinct, opt_definition, func_args,
+ opt_distinct, opt_definition, func_args, rowdefinition
func_args_list, func_as, createfunc_opt_list
oper_argtypes, RuleActionList, RuleActionMulti,
opt_column_list, columnList, opt_name_list,
@@ -2233,6 +2233,39 @@ DefineStmt:
n->definition = $4;
$$ = (Node *)n;
}
+ | CREATE TYPE_P any_name AS rowdefinition
+ {
+ CompositeTypeStmt *n = makeNode(CompositeTypeStmt);
+ RangeVar *r = makeNode(RangeVar);
+
+ switch (length($3))
+ {
+ case 1:
+ r->catalogname = NULL;
+ r->schemaname = NULL;
+ r->relname = strVal(lfirst($3));
+ break;
+ case 2:
+ r->catalogname = NULL;
+ r->schemaname = strVal(lfirst($3));
+ r->relname = strVal(lsecond($3));
+ break;
+ case 3:
+ r->catalogname = strVal(lfirst($3));
+ r->schemaname = strVal(lsecond($3));
+ r->relname = strVal(lfirst(lnext(lnext($3))));
+ break;
+ default:
+ elog(ERROR,
+ "Improper qualified name "
+ "(too many dotted names): %s",
+ NameListToString($3));
+ break;
+ }
+ n->typevar = r;
+ n->coldeflist = $5;
+ $$ = (Node *)n;
+ }
| CREATE CHARACTER SET opt_as any_name GET definition opt_collate
{
DefineStmt *n = makeNode(DefineStmt);
@@ -2243,6 +2276,9 @@ DefineStmt:
}
;
+rowdefinition: '(' TableFuncElementList ')' { $$ = $2; }
+ ;
+
definition: '(' def_list ')' { $$ = $2; }
;