Commit bb30410b authored by Tom Lane's avatar Tom Lane

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
parent 810bcbd3
...@@ -1842,6 +1842,13 @@ find_expr_references_walker(Node *node, ...@@ -1842,6 +1842,13 @@ find_expr_references_walker(Node *node,
add_object_address(OCLASS_TYPE, objoid, 0, add_object_address(OCLASS_TYPE, objoid, 0,
context->addrs); context->addrs);
break; break;
case REGCOLLATIONOID:
objoid = DatumGetObjectId(con->constvalue);
if (SearchSysCacheExists1(COLLOID,
ObjectIdGetDatum(objoid)))
add_object_address(OCLASS_COLLATION, objoid, 0,
context->addrs);
break;
case REGCONFIGOID: case REGCONFIGOID:
objoid = DatumGetObjectId(con->constvalue); objoid = DatumGetObjectId(con->constvalue);
if (SearchSysCacheExists1(TSCONFIGOID, if (SearchSysCacheExists1(TSCONFIGOID,
......
...@@ -4305,6 +4305,7 @@ convert_to_scalar(Datum value, Oid valuetypid, Oid collid, double *scaledvalue, ...@@ -4305,6 +4305,7 @@ convert_to_scalar(Datum value, Oid valuetypid, Oid collid, double *scaledvalue,
case REGOPERATOROID: case REGOPERATOROID:
case REGCLASSOID: case REGCLASSOID:
case REGTYPEOID: case REGTYPEOID:
case REGCOLLATIONOID:
case REGCONFIGOID: case REGCONFIGOID:
case REGDICTIONARYOID: case REGDICTIONARYOID:
case REGROLEOID: case REGROLEOID:
...@@ -4436,6 +4437,7 @@ convert_numeric_to_scalar(Datum value, Oid typid, bool *failure) ...@@ -4436,6 +4437,7 @@ convert_numeric_to_scalar(Datum value, Oid typid, bool *failure)
case REGOPERATOROID: case REGOPERATOROID:
case REGCLASSOID: case REGCLASSOID:
case REGTYPEOID: case REGTYPEOID:
case REGCOLLATIONOID:
case REGCONFIGOID: case REGCONFIGOID:
case REGDICTIONARYOID: case REGDICTIONARYOID:
case REGROLEOID: case REGROLEOID:
......
...@@ -239,6 +239,7 @@ GetCCHashEqFuncs(Oid keytype, CCHashFN *hashfunc, RegProcedure *eqfunc, CCFastEq ...@@ -239,6 +239,7 @@ GetCCHashEqFuncs(Oid keytype, CCHashFN *hashfunc, RegProcedure *eqfunc, CCFastEq
case REGOPERATOROID: case REGOPERATOROID:
case REGCLASSOID: case REGCLASSOID:
case REGTYPEOID: case REGTYPEOID:
case REGCOLLATIONOID:
case REGCONFIGOID: case REGCONFIGOID:
case REGDICTIONARYOID: case REGDICTIONARYOID:
case REGROLEOID: case REGROLEOID:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment