mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
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>
This commit is contained in:
12
src/backend/utils/cache/lsyscache.c
vendored
12
src/backend/utils/cache/lsyscache.c
vendored
@ -1600,20 +1600,20 @@ func_parallel(Oid funcid)
|
||||
}
|
||||
|
||||
/*
|
||||
* get_func_isagg
|
||||
* Given procedure id, return the function's proisagg field.
|
||||
* get_func_prokind
|
||||
* Given procedure id, return the routine kind.
|
||||
*/
|
||||
bool
|
||||
get_func_isagg(Oid funcid)
|
||||
char
|
||||
get_func_prokind(Oid funcid)
|
||||
{
|
||||
HeapTuple tp;
|
||||
bool result;
|
||||
char result;
|
||||
|
||||
tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
|
||||
if (!HeapTupleIsValid(tp))
|
||||
elog(ERROR, "cache lookup failed for function %u", funcid);
|
||||
|
||||
result = ((Form_pg_proc) GETSTRUCT(tp))->proisagg;
|
||||
result = ((Form_pg_proc) GETSTRUCT(tp))->prokind;
|
||||
ReleaseSysCache(tp);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user