mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Correctly handle array pseudotypes in to_json and to_jsonb
Columns with array pseudotypes have not been identified as arrays, so they have been rendered as strings in the json and jsonb conversion routines. This change allows them to be rendered as json arrays, making it possible to deal correctly with the anyarray columns in pg_stats.
This commit is contained in:
@ -1397,9 +1397,10 @@ json_categorize_type(Oid typoid,
|
||||
|
||||
default:
|
||||
/* Check for arrays and composites */
|
||||
if (OidIsValid(get_element_type(typoid)))
|
||||
if (OidIsValid(get_element_type(typoid)) || typoid == ANYARRAYOID
|
||||
|| typoid == RECORDARRAYOID)
|
||||
*tcategory = JSONTYPE_ARRAY;
|
||||
else if (type_is_rowtype(typoid))
|
||||
else if (type_is_rowtype(typoid)) /* includes RECORDOID */
|
||||
*tcategory = JSONTYPE_COMPOSITE;
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user