Skip to content

Commit 2172455

Browse files
committed
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
1 parent 4a8a5dd commit 2172455

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/backend/parser/parse_jsontable.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,7 @@ appendJsonTableColumns(JsonTableContext *cxt, List *columns)
514514

515515
tf->coltypes = lappend_oid(tf->coltypes, typid);
516516
tf->coltypmods = lappend_int(tf->coltypmods, typmod);
517-
tf->colcollations = lappend_oid(tf->colcollations,
518-
type_is_collatable(typid)
519-
? DEFAULT_COLLATION_OID
520-
: InvalidOid);
517+
tf->colcollations = lappend_oid(tf->colcollations, get_typcollation(typid));
521518
tf->colvalexprs = lappend(tf->colvalexprs, colexpr);
522519
}
523520
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy