Fixed CREATE TYPE to recognize changed parsenodes

Jan
This commit is contained in:
Jan Wieck 2000-04-13 11:51:07 +00:00
parent 5eaa271b77
commit 3e00c9db4a

View File

@ -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)
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
{ {
@ -743,6 +743,9 @@ defGetTypeLength(DefElem *def)
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;