aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/lsyscache.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-12 23:43:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-12 23:43:04 +0000
commit3389a110d40a505951e7c7babdfb8681173bb2ca (patch)
tree438acebac5cfd161cf920bcda6ad168affcb96a7 /src/backend/utils/cache/lsyscache.c
parentf9e4f611a18f64fd9106a72ec9af9e2220075780 (diff)
downloadpostgresql-3389a110d40a505951e7c7babdfb8681173bb2ca.tar.gz
postgresql-3389a110d40a505951e7c7babdfb8681173bb2ca.zip
Get rid of long-since-vestigial Iter node type, in favor of adding a
returns-set boolean field in Func and Oper nodes. This allows cleaner, more reliable tests for expressions returning sets in the planner and parser. For example, a WHERE clause returning a set is now detected and complained of in the parser, not only at runtime.
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r--src/backend/utils/cache/lsyscache.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index ca3bd80e8a7..e695f533b02 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.72 2002/04/30 01:26:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.73 2002/05/12 23:43:03 tgl Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -613,6 +613,27 @@ get_func_rettype(Oid funcid)
}
/*
+ * get_func_retset
+ * Given procedure id, return the function's proretset flag.
+ */
+bool
+get_func_retset(Oid funcid)
+{
+ HeapTuple tp;
+ bool result;
+
+ tp = SearchSysCache(PROCOID,
+ ObjectIdGetDatum(funcid),
+ 0, 0, 0);
+ if (!HeapTupleIsValid(tp))
+ elog(ERROR, "Function OID %u does not exist", funcid);
+
+ result = ((Form_pg_proc) GETSTRUCT(tp))->proretset;
+ ReleaseSysCache(tp);
+ return result;
+}
+
+/*
* func_volatile
* Given procedure id, return the function's provolatile flag.
*/