aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/lsyscache.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-01-31 17:03:55 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-01-31 17:03:55 -0500
commit25dc267a1be573c36c4e40dce651ae462f17eb9e (patch)
treea1d80f035b5bb05b45eed4e7e32fa75fed1413e9 /src/include/utils/lsyscache.h
parent63634883fbcbb4881f1bd3ab1012163df743b9c9 (diff)
downloadpostgresql-25dc267a1be573c36c4e40dce651ae462f17eb9e.tar.gz
postgresql-25dc267a1be573c36c4e40dce651ae462f17eb9e.zip
Fix CheckAttributeType's handling of collations for ranges.
Commit fc7695891 changed CheckAttributeType to recurse into ranges, but made it pass down the wrong collation (always InvalidOid, since ranges as such have no collation). This would result in guaranteed failure when considering a range type whose subtype is collatable. Embarrassingly, we lack any regression tests that would expose such a problem (but fortunately, somebody noticed before we shipped this bug in any release). Fix it to pass down the range's subtype collation property instead, and add some regression test cases to exercise collatable-subtype ranges a bit more. Back-patch to all supported branches, as the previous patch was. Report and patch by Julien Rouhaud, test cases tweaked by me Discussion: https://postgr.es/m/CAOBaU_aBWqNweiGUFX0guzBKkcfJ8mnnyyGC_KBQmO12Mj5f_A@mail.gmail.com
Diffstat (limited to 'src/include/utils/lsyscache.h')
-rw-r--r--src/include/utils/lsyscache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index e868d84cef6..c97c926992b 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -177,6 +177,7 @@ extern void free_attstatsslot(AttStatsSlot *sslot);
extern char *get_namespace_name(Oid nspid);
extern char *get_namespace_name_or_temp(Oid nspid);
extern Oid get_range_subtype(Oid rangeOid);
+extern Oid get_range_collation(Oid rangeOid);
#define type_is_array(typid) (get_element_type(typid) != InvalidOid)
/* type_is_array_domain accepts both plain arrays and domains over arrays */