diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-25 12:21:22 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-25 12:21:28 -0500 |
commit | bac27394a1c69c20ec904729c593e59485c75c69 (patch) | |
tree | 7bdf15b078bfcef745a5bb2c7c479d6f8bd45f15 /src/include/utils/lsyscache.h | |
parent | 25976710dfd8611d3fc79c0c1e20179ff7a940ec (diff) |
Support arrays as input to array_agg() and ARRAY(SELECT ...).
These cases formerly failed with errors about "could not find array type
for data type". Now they yield arrays of the same element type and one
higher dimension.
The implementation involves creating functions with API similar to the
existing accumArrayResult() family. I (tgl) also extended the base family
by adding an initArrayResult() function, which allows callers to avoid
special-casing the zero-inputs case if they just want an empty array as
result. (Not all do, so the previous calling convention remains valid.)
This allowed simplifying some existing code in xml.c and plperl.c.
Ali Akbar, reviewed by Pavel Stehule, significantly modified by me
Diffstat (limited to 'src/include/utils/lsyscache.h')
-rw-r--r-- | src/include/utils/lsyscache.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h index 07d24d4cb8a..1a556f8ae29 100644 --- a/src/include/utils/lsyscache.h +++ b/src/include/utils/lsyscache.h @@ -128,6 +128,7 @@ extern void get_type_category_preferred(Oid typid, extern Oid get_typ_typrelid(Oid typid); extern Oid get_element_type(Oid typid); extern Oid get_array_type(Oid typid); +extern Oid get_promoted_array_type(Oid typid); extern Oid get_base_element_type(Oid typid); extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam); extern void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena); |