diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-22 00:01:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-22 00:01:51 +0000 |
commit | b663f3443ba096a06970214c3e83e79f6e570b84 (patch) | |
tree | 049e26c1b02535c12bee6e60ba89cf1d42a41a72 /src/backend/commands/proclang.c | |
parent | 606c9b9d4fafe9300d039c044edc9727c0ed43c9 (diff) | |
download | postgresql-b663f3443ba096a06970214c3e83e79f6e570b84.tar.gz postgresql-b663f3443ba096a06970214c3e83e79f6e570b84.zip |
Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion. I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
Diffstat (limited to 'src/backend/commands/proclang.c')
-rw-r--r-- | src/backend/commands/proclang.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 9672e74ea9b..8aa2addc512 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.40 2002/08/13 17:22:08 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.41 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -71,17 +71,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) elog(ERROR, "Language %s already exists", languageName); /* - * Lookup the PL handler function and check that it is of return type - * Opaque + * Lookup the PL handler function and check that it is of the expected + * return type */ MemSet(typev, 0, sizeof(typev)); procOid = LookupFuncName(stmt->plhandler, 0, typev); if (!OidIsValid(procOid)) elog(ERROR, "function %s() doesn't exist", NameListToString(stmt->plhandler)); - if (get_func_rettype(procOid) != InvalidOid) - elog(ERROR, "function %s() does not return type \"opaque\"", - NameListToString(stmt->plhandler)); + if (get_func_rettype(procOid) != LANGUAGE_HANDLEROID) + elog(ERROR, "function %s() does not return type %s", + NameListToString(stmt->plhandler), + format_type_be(LANGUAGE_HANDLEROID)); /* validate the validator function */ if (stmt->plvalidator) @@ -91,6 +92,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) if (!OidIsValid(valProcOid)) elog(ERROR, "function %s(oid) doesn't exist", NameListToString(stmt->plvalidator)); + /* return value is ignored, so we don't check the type */ } else valProcOid = InvalidOid; |