aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-03-02 08:57:38 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-03-02 13:48:33 -0500
commitfd1a421fe66173fb9b85d3fe150afde8e812cbe4 (patch)
tree24c80c87337ec2d1bb46ee8463207d0cfff5ffc3 /src/backend/utils/adt/ruleutils.c
parent1733460f0205fc6d6bbe4c14911049a918c6e073 (diff)
downloadpostgresql-fd1a421fe66173fb9b85d3fe150afde8e812cbe4.tar.gz
postgresql-fd1a421fe66173fb9b85d3fe150afde8e812cbe4.zip
Add prokind column, replacing proisagg and proiswindow
The new column distinguishes normal functions, procedures, aggregates, and window functions. This replaces the existing columns proisagg and proiswindow, and replaces the convention that procedures are indicated by prorettype == 0. Also change prorettype to be VOIDOID for procedures. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz>
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 36974667892..b58ee3c3876 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2481,12 +2481,12 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
proc = (Form_pg_proc) GETSTRUCT(proctup);
name = NameStr(proc->proname);
- if (proc->proisagg)
+ if (proc->prokind == PROKIND_AGGREGATE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is an aggregate function", name)));
- isfunction = (proc->prorettype != InvalidOid);
+ isfunction = (proc->prokind != PROKIND_PROCEDURE);
/*
* We always qualify the function name, to ensure the right function gets
@@ -2513,7 +2513,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
/* Emit some miscellaneous options on one line */
oldlen = buf.len;
- if (proc->proiswindow)
+ if (proc->prokind == PROKIND_WINDOW)
appendStringInfoString(&buf, " WINDOW");
switch (proc->provolatile)
{
@@ -2717,7 +2717,7 @@ pg_get_function_result(PG_FUNCTION_ARGS)
if (!HeapTupleIsValid(proctup))
PG_RETURN_NULL();
- if (((Form_pg_proc) GETSTRUCT(proctup))->prorettype == InvalidOid)
+ if (((Form_pg_proc) GETSTRUCT(proctup))->prokind == PROKIND_PROCEDURE)
{
ReleaseSysCache(proctup);
PG_RETURN_NULL();
@@ -2817,7 +2817,7 @@ print_function_arguments(StringInfo buf, HeapTuple proctup,
}
/* Check for special treatment of ordered-set aggregates */
- if (proc->proisagg)
+ if (proc->prokind == PROKIND_AGGREGATE)
{
HeapTuple aggtup;
Form_pg_aggregate agg;