mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Oops, plpgsql didn't have the datetime->timestamp and timespan->interval
mappings. In fact, it had them backward because it was using the 6.5.* code. Copied them from parser/gram.y, so it is fixed now. Looks like our first 7.0.1 fix. Oops, seems Tom has beat me to it as I was typing this.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
* procedural language
|
* procedural language
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.19 2000/04/16 04:16:55 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.20 2000/05/11 04:00:00 momjian Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@ -1355,18 +1355,22 @@ plpgsql_yyerror(const char *s)
|
|||||||
static char *
|
static char *
|
||||||
xlateSqlType(char *name)
|
xlateSqlType(char *name)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(name, "int")
|
if ((strcmp(name,"int") == 0)
|
||||||
|| !strcasecmp(name, "integer"))
|
|| (strcmp(name,"integer") == 0))
|
||||||
return "int4";
|
return "int4";
|
||||||
else if (!strcasecmp(name, "smallint"))
|
else if (strcmp(name, "smallint") == 0)
|
||||||
return "int2";
|
return "int2";
|
||||||
else if (!strcasecmp(name, "real")
|
else if ((strcmp(name, "real") == 0)
|
||||||
|| !strcasecmp(name, "float"))
|
|| (strcmp(name, "float") == 0))
|
||||||
return "float8";
|
return "float8";
|
||||||
else if (!strcasecmp(name, "interval"))
|
else if (strcmp(name, "decimal") == 0)
|
||||||
return "timespan";
|
return "numeric";
|
||||||
else if (!strcasecmp(name, "boolean"))
|
else if (strcmp(name, "datetime") == 0)
|
||||||
|
return "timestamp";
|
||||||
|
else if (strcmp(name, "timespan") == 0)
|
||||||
|
return "interval";
|
||||||
|
else if (strcmp(name, "boolean") == 0)
|
||||||
return "bool";
|
return "bool";
|
||||||
else
|
else
|
||||||
return name;
|
return name;
|
||||||
} /* xlateSqlType() */
|
} /* xlateSqlType() */
|
||||||
|
Reference in New Issue
Block a user