mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Fix collation of JSON_TABLE output columns
The output columns of JSON_TABLE should have the collations of their data type. The existing implementation sets the default collation if the type is collatable. Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://www.postgresql.org/message-id/flat/9d75ce67-0121-5050-5bec-bf5009db55ce%40enterprisedb.com
This commit is contained in:
parent
4a8a5dd7f5
commit
2172455865
@ -514,10 +514,7 @@ appendJsonTableColumns(JsonTableContext *cxt, List *columns)
|
||||
|
||||
tf->coltypes = lappend_oid(tf->coltypes, typid);
|
||||
tf->coltypmods = lappend_int(tf->coltypmods, typmod);
|
||||
tf->colcollations = lappend_oid(tf->colcollations,
|
||||
type_is_collatable(typid)
|
||||
? DEFAULT_COLLATION_OID
|
||||
: InvalidOid);
|
||||
tf->colcollations = lappend_oid(tf->colcollations, get_typcollation(typid));
|
||||
tf->colvalexprs = lappend(tf->colvalexprs, colexpr);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user