From 53cedcac22bca29bb6ac766b04d5dd08db77ac03 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 3 May 2002 00:32:19 +0000 Subject: 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. --- src/backend/commands/typecmds.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/backend/commands/typecmds.c') 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", -- cgit v1.2.3