Re: Avoid FK validations for no-rewrite ALTER TABLE ALTER TYPE - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Avoid FK validations for no-rewrite ALTER TABLE ALTER TYPE
Date
Msg-id 20120126033956.GC15670@tornado.leadboat.com
Whole thread Raw
In response to Re: Avoid FK validations for no-rewrite ALTER TABLE ALTER TYPE  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Avoid FK validations for no-rewrite ALTER TABLE ALTER TYPE  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Wed, Jan 25, 2012 at 11:17:27AM -0300, Alvaro Herrera wrote:
>
> Excerpts from Noah Misch's message of dom ene 22 02:05:31 -0300 2012:
>
> > Thanks.  I've attached a new version fixing this problem.
>
> Looks good to me.  Can you please clarify this bit?
>
>              * Since we elsewhere require that all collations share the same
>              * notion of equality, don't compare collation here.
>
> Since I'm not familiar with this code, it's difficult for me to figure
> out where this "elsewhere" is, and what does "same notion of equality"
> mean.

Good questions.  See the comment in front of ri_GenerateQualCollation(), the
comment in process_ordered_aggregate_single() at nodeAgg.c:605, the larger
comment in add_sort_column(), and the two XXX comments in
relation_has_unique_index_for().  We should probably document that assumption
in xindex.sgml to keep type implementors apprised.

"Same notion of equality" just means that "a COLLATE x = b COLLATE y" has the
same value for every x, y.

In any event, the patch needed a rebase, so I've attached it rebased and with
that comment edited to reference ri_GenerateQualCollation(), that being the
most-relevant source for the assumption in question.

Thanks for reviewing,
nm

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Second thoughts on CheckIndexCompatible() vs. operator families
Next
From: Alvaro Herrera
Date:
Subject: cursors FOR UPDATE don't return most recent row