fix: fix output of RPCs returning scalar values with multiple rows
resolves #1584 BREAKING CHANGE: Changed output of RPCs to match return type better: * single scalar return: value (unchanged) * setof scalar return: array of values (new; was array of objects) * single composite return: object (new; was array of objects) * setof composite return: array of objects (unchanged) * void return: nothing (new; was "null") A single OUT column is now treated as "composite" instead of "scalar", i.e. consistent with multiple OUT columns.
This commit is contained in:
committed by
Wolfgang Walther
parent
093fd3c8f6
commit
0c25f12825
@@ -226,8 +226,12 @@ procsSqlQuery = [q|
|
||||
tn.nspname AS schema,
|
||||
COALESCE(comp.relname, t.typname) AS name,
|
||||
p.proretset AS rettype_is_setof,
|
||||
-- Only pg pseudo type that is a row type is 'record'
|
||||
(t.typtype = 'c' or t.typtype = 'p' and t.typname = 'record') AS rettype_is_composite,
|
||||
(t.typtype = 'c'
|
||||
-- Only pg pseudo type that is a row type is 'record'
|
||||
or t.typtype = 'p' and t.typname = 'record'
|
||||
-- if any INOUT or OUT arguments present, treat as composite
|
||||
or COALESCE(proargmodes::text[] && '{b,o}', false)
|
||||
) AS rettype_is_composite,
|
||||
p.provolatile
|
||||
FROM pg_proc p
|
||||
JOIN pg_namespace pn ON pn.oid = p.pronamespace
|
||||
|
||||
Reference in New Issue
Block a user