From b23c9fa9293c54a3829093d207be37a7b42cb630 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 26 Mar 2011 14:25:48 -0400 Subject: Clean up a few failures to set collation fields in expression nodes. I'm not sure these have any non-cosmetic implications, but I'm not sure they don't, either. In particular, ensure the CaseTestExpr generated by transformAssignmentIndirection to represent the base target column carries the correct collation, because parse_collate.c won't fix that. Tweak lsyscache.c API so that we can get the appropriate collation without an extra syscache lookup. --- src/backend/utils/adt/ruleutils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 621f1eb24ae..326079a75ba 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -912,12 +912,14 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, { /* Simple index column */ char *attname; + int32 keycoltypmod; attname = get_relid_attribute_name(indrelid, attnum); if (!colno || colno == keyno + 1) appendStringInfoString(&buf, quote_identifier(attname)); - keycoltype = get_atttype(indrelid, attnum); - keycolcollation = get_attcollation(indrelid, attnum); + get_atttypetypmodcoll(indrelid, attnum, + &keycoltype, &keycoltypmod, + &keycolcollation); } else { -- cgit v1.2.3