summaryrefslogtreecommitdiff
path: root/src/pl/plpgsql
diff options
context:
space:
mode:
authorTom Lane2001-02-09 03:26:28 +0000
committerTom Lane2001-02-09 03:26:28 +0000
commitdfbd5d653250f12e19bec4550cc617eb0e022250 (patch)
tree9856cffdfc8aaf47f1599a424d1953e1f7381108 /src/pl/plpgsql
parent467f43d2fae9ac58c3d96e56eb7c8dde25e4ab67 (diff)
plpgsql's private copy of xlateSqlType was out of sync. Again. This
is clearly not maintainable, so dike it out in favor of calling the real version in the backend's gram.y.
Diffstat (limited to 'src/pl/plpgsql')
-rw-r--r--src/pl/plpgsql/src/pl_comp.c52
1 files changed, 7 insertions, 45 deletions
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index 299a31da09d..ffcb7d72d6f 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.25 2000/12/08 00:03:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.26 2001/02/09 03:26:28 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -46,19 +46,19 @@
#include "plpgsql.h"
#include "pl.tab.h"
-#include "executor/spi.h"
-#include "commands/trigger.h"
-#include "utils/builtins.h"
-#include "fmgr.h"
#include "access/heapam.h"
-
-#include "utils/syscache.h"
#include "catalog/catname.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "catalog/pg_class.h"
#include "catalog/pg_attribute.h"
#include "catalog/pg_attrdef.h"
+#include "commands/trigger.h"
+#include "executor/spi.h"
+#include "fmgr.h"
+#include "parser/gramparse.h"
+#include "utils/builtins.h"
+#include "utils/syscache.h"
/* ----------
@@ -86,13 +86,6 @@ PLpgSQL_function *plpgsql_curr_compile;
/* ----------
- * Local function declarations
- * ----------
- */
-static char *xlateSqlType(char *name);
-
-
-/* ----------
* plpgsql_compile Given a pg_proc's oid, make
* an execution tree for it.
* ----------
@@ -1386,34 +1379,3 @@ plpgsql_yyerror(const char *s)
plpgsql_comperrinfo();
elog(ERROR, "%s at or near \"%s\"", s, plpgsql_yytext);
}
-
-
-/* ----------
- * xlateSqlType()
- * Convert alternate type names to internal Postgres types.
- *
- * Stolen from backend's main parser
- * ----------
- */
-static char *
-xlateSqlType(char *name)
-{
- if ((strcmp(name,"int") == 0)
- || (strcmp(name,"integer") == 0))
- return "int4";
- else if (strcmp(name, "smallint") == 0)
- return "int2";
- else if ((strcmp(name, "real") == 0)
- || (strcmp(name, "float") == 0))
- return "float8";
- else if (strcmp(name, "decimal") == 0)
- return "numeric";
- else if (strcmp(name, "datetime") == 0)
- return "timestamp";
- else if (strcmp(name, "timespan") == 0)
- return "interval";
- else if (strcmp(name, "boolean") == 0)
- return "bool";
- else
- return name;
-} /* xlateSqlType() */