Skip to content

Commit 53cedca

Browse files
committed
Retire xlateSqlType/xlateSqlFunc; all type name translations are now
handled as special productions. This is needed to keep us honest about user-schema type names that happen to coincide with system type names. Per pghackers discussion 24-Apr. To avoid bloating the keyword list too much, I removed the translations for datetime, timespan, and lztext, all of which were slated for destruction several versions back anyway.
1 parent c2def1b commit 53cedca

File tree

12 files changed

+186
-186
lines changed

12 files changed

+186
-186
lines changed

src/backend/commands/typecmds.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.2 2002/04/27 03:45:02 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.3 2002/05/03 00:32:16 tgl Exp $
1212
*
1313
* DESCRIPTION
1414
* The "DefineFoo" routines take the parse tree and pick out the
@@ -133,21 +133,22 @@ DefineType(List *names, List *parameters)
133133

134134
/*
135135
* Note: if argument was an unquoted identifier, parser will
136-
* have applied xlateSqlType() to it, so be prepared to
136+
* have applied translations to it, so be prepared to
137137
* recognize translated type names as well as the nominal
138138
* form.
139139
*/
140-
if (strcasecmp(a, "double") == 0)
140+
if (strcasecmp(a, "double") == 0 ||
141+
strcasecmp(a, "float8") == 0 ||
142+
strcasecmp(a, "pg_catalog.float8") == 0)
141143
alignment = 'd';
142-
else if (strcasecmp(a, "float8") == 0)
143-
alignment = 'd';
144-
else if (strcasecmp(a, "int4") == 0)
144+
else if (strcasecmp(a, "int4") == 0 ||
145+
strcasecmp(a, "pg_catalog.int4") == 0)
145146
alignment = 'i';
146-
else if (strcasecmp(a, "int2") == 0)
147+
else if (strcasecmp(a, "int2") == 0 ||
148+
strcasecmp(a, "pg_catalog.int2") == 0)
147149
alignment = 's';
148-
else if (strcasecmp(a, "char") == 0)
149-
alignment = 'c';
150-
else if (strcasecmp(a, "bpchar") == 0)
150+
else if (strcasecmp(a, "char") == 0 ||
151+
strcasecmp(a, "pg_catalog.bpchar") == 0)
151152
alignment = 'c';
152153
else
153154
elog(ERROR, "DefineType: \"%s\" alignment not recognized",

0 commit comments

Comments
 (0)