aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-09-08 20:07:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-09-08 20:07:42 +0000
commit48123de71792c367313542883f0e9df7d850c994 (patch)
tree741725c1242dd2b91aa42937ddb5a884bd826eb5 /src/backend/commands/functioncmds.c
parentc18cabe8ab1c035b9e10368d7358eaadbf026c4c (diff)
downloadpostgresql-48123de71792c367313542883f0e9df7d850c994.tar.gz
postgresql-48123de71792c367313542883f0e9df7d850c994.zip
Create the pg_pltemplate system catalog to hold template information
for procedural languages. This replaces the hard-wired table I had originally proposed as a stopgap solution. For the moment, the initial contents only include languages shipped with the core distribution.
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r--src/backend/commands/functioncmds.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index d6bb902274e..c2bb4a2d9c8 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.66 2005/08/22 17:38:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.67 2005/09/08 20:07:41 tgl Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@@ -44,6 +44,7 @@
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
+#include "commands/proclang.h"
#include "miscadmin.h"
#include "optimizer/cost.h"
#include "parser/parse_func.h"
@@ -543,17 +544,11 @@ CreateFunction(CreateFunctionStmt *stmt)
PointerGetDatum(languageName),
0, 0, 0);
if (!HeapTupleIsValid(languageTuple))
- /* Add any new languages to this list to invoke the hint. */
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("language \"%s\" does not exist", languageName),
- (strcmp(languageName, "plperl") == 0 ||
- strcmp(languageName, "plperlu") == 0 ||
- strcmp(languageName, "plpgsql") == 0 ||
- strcmp(languageName, "plpythonu") == 0 ||
- strcmp(languageName, "pltcl") == 0 ||
- strcmp(languageName, "pltclu") == 0) ?
- errhint("You need to use \"createlang\" to load the language into the database.") : 0));
+ (PLTemplateExists(languageName) ?
+ errhint("Use CREATE LANGUAGE to load the language into the database.") : 0)));
languageOid = HeapTupleGetOid(languageTuple);
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);