On Fri, Jul 24, 2015 at 3:08 AM, Andres Freund <and...@anarazel.de> wrote: >> + else >> + { >> + Node *nattExpr = list_nth(idxExprs, (natt - 1) - >> nplain); >> + >> + /* >> + * Note that unlike routines like >> match_index_to_operand(), we're >> + * unconcerned about RelabelType. An exact match is >> required. >> + */ >> + if (equal(elem->expr, nattExpr)) >> + return true; > > Why is that?
No very strong reason. RelabelType exists to represent a dummy coercion between two binary-compatible types. I think that a unique index inference specification (which is novel in some ways) does not need to do anything special for this case. Each inference specification attribute that is an expression should match some attribute in some index's cataloged definition. The inference specification looks very much like the CREATE UNIQUE INDEX that created the unique index that is inferred (usually, they'll be identical). No need to make it any more complicated than that. In fact, I don't think it's possible to construct a case where it could even be argued that it matters. I'm not very caffeinated at the moment, so I'm not sure of that. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers