aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/typecmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-03 00:32:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-03 00:32:19 +0000
commit53cedcac22bca29bb6ac766b04d5dd08db77ac03 (patch)
tree52a9ada483515c730714941cac9cb494edfd6cd0 /src/backend/commands/typecmds.c
parentc2def1b1287eca171212de0cd9d1de21de469961 (diff)
downloadpostgresql-53cedcac22bca29bb6ac766b04d5dd08db77ac03.tar.gz
postgresql-53cedcac22bca29bb6ac766b04d5dd08db77ac03.zip
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.
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r--src/backend/commands/typecmds.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index 74e5a15cc8d..6aa5fae182e 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.2 2002/04/27 03:45:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.3 2002/05/03 00:32:16 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -133,21 +133,22 @@ DefineType(List *names, List *parameters)
/*
* Note: if argument was an unquoted identifier, parser will
- * have applied xlateSqlType() to it, so be prepared to
+ * have applied translations to it, so be prepared to
* recognize translated type names as well as the nominal
* form.
*/
- if (strcasecmp(a, "double") == 0)
+ if (strcasecmp(a, "double") == 0 ||
+ strcasecmp(a, "float8") == 0 ||
+ strcasecmp(a, "pg_catalog.float8") == 0)
alignment = 'd';
- else if (strcasecmp(a, "float8") == 0)
- alignment = 'd';
- else if (strcasecmp(a, "int4") == 0)
+ else if (strcasecmp(a, "int4") == 0 ||
+ strcasecmp(a, "pg_catalog.int4") == 0)
alignment = 'i';
- else if (strcasecmp(a, "int2") == 0)
+ else if (strcasecmp(a, "int2") == 0 ||
+ strcasecmp(a, "pg_catalog.int2") == 0)
alignment = 's';
- else if (strcasecmp(a, "char") == 0)
- alignment = 'c';
- else if (strcasecmp(a, "bpchar") == 0)
+ else if (strcasecmp(a, "char") == 0 ||
+ strcasecmp(a, "pg_catalog.bpchar") == 0)
alignment = 'c';
else
elog(ERROR, "DefineType: \"%s\" alignment not recognized",