Commit 3e00c9db authored by Jan Wieck's avatar Jan Wieck

Fixed CREATE TYPE to recognize changed parsenodes

Jan
parent 5eaa271b
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.40 2000/04/12 17:14:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.41 2000/04/13 11:51:07 wieck Exp $
* *
* DESCRIPTION * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
...@@ -631,7 +631,7 @@ DefineType(char *typeName, List *parameters) ...@@ -631,7 +631,7 @@ DefineType(char *typeName, List *parameters)
if (!strcasecmp(a, "double")) if (!strcasecmp(a, "double"))
alignment = 'd'; alignment = 'd';
else if (!strcasecmp(a, "int")) else if (!strcasecmp(a, "int4"))
alignment = 'i'; alignment = 'i';
else else
{ {
...@@ -741,8 +741,11 @@ defGetTypeLength(DefElem *def) ...@@ -741,8 +741,11 @@ defGetTypeLength(DefElem *def)
if (nodeTag(def->arg) == T_Integer) if (nodeTag(def->arg) == T_Integer)
return intVal(def->arg); return intVal(def->arg);
else if (nodeTag(def->arg) == T_String && else if (nodeTag(def->arg) == T_String &&
!strcasecmp(strVal(def->arg), "variable")) !strcasecmp(strVal(def->arg), "variable"))
return -1; /* variable length */ return -1; /* variable length */
else if (nodeTag(def->arg) == T_TypeName &&
!strcasecmp(((TypeName *)(def->arg))->name, "variable"))
return -1;
elog(ERROR, "Define: \"%s\" = what?", def->defname); elog(ERROR, "Define: \"%s\" = what?", def->defname);
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment