Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 36ccca3

Browse files
committed
Fix omissions in support for the "regcollation" type.
The patch that added regcollation doesn't seem to have been too thorough about supporting it everywhere that other reg* types are supported. Fix that. (The find_expr_references omission is moderately serious, since it could result in missing expression dependencies. The others are less exciting.) Noted while fixing bug #17483. Back-patch to v13 where regcollation was added. Discussion: https://postgr.es/m/1423433.1652722406@sss.pgh.pa.us
1 parent 6230bd7 commit 36ccca3

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/backend/catalog/dependency.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,13 @@ find_expr_references_walker(Node *node,
18511851
add_object_address(OCLASS_TYPE, objoid, 0,
18521852
context->addrs);
18531853
break;
1854+
case REGCOLLATIONOID:
1855+
objoid = DatumGetObjectId(con->constvalue);
1856+
if (SearchSysCacheExists1(COLLOID,
1857+
ObjectIdGetDatum(objoid)))
1858+
add_object_address(OCLASS_COLLATION, objoid, 0,
1859+
context->addrs);
1860+
break;
18541861
case REGCONFIGOID:
18551862
objoid = DatumGetObjectId(con->constvalue);
18561863
if (SearchSysCacheExists1(TSCONFIGOID,

src/backend/utils/adt/selfuncs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4089,6 +4089,7 @@ convert_to_scalar(Datum value, Oid valuetypid, Oid collid, double *scaledvalue,
40894089
case REGOPERATOROID:
40904090
case REGCLASSOID:
40914091
case REGTYPEOID:
4092+
case REGCOLLATIONOID:
40924093
case REGCONFIGOID:
40934094
case REGDICTIONARYOID:
40944095
case REGROLEOID:
@@ -4220,6 +4221,7 @@ convert_numeric_to_scalar(Datum value, Oid typid, bool *failure)
42204221
case REGOPERATOROID:
42214222
case REGCLASSOID:
42224223
case REGTYPEOID:
4224+
case REGCOLLATIONOID:
42234225
case REGCONFIGOID:
42244226
case REGDICTIONARYOID:
42254227
case REGROLEOID:

src/backend/utils/cache/catcache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ GetCCHashEqFuncs(Oid keytype, CCHashFN *hashfunc, RegProcedure *eqfunc, CCFastEq
239239
case REGOPERATOROID:
240240
case REGCLASSOID:
241241
case REGTYPEOID:
242+
case REGCOLLATIONOID:
242243
case REGCONFIGOID:
243244
case REGDICTIONARYOID:
244245
case REGROLEOID:

0 commit comments

Comments
 (0)