Re: ALTER TABLE INHERIT vs collations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE INHERIT vs collations
Date
Msg-id 12373.1302997257@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE INHERIT vs collations  (Thom Brown <thom@linux.com>)
Responses Re: ALTER TABLE INHERIT vs collations  (Thom Brown <thom@linux.com>)
List pgsql-hackers
Thom Brown <thom@linux.com> writes:
> On 16 April 2011 23:23, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Does anyone think it's not a bug that ALTER TABLE lets this through?
>> If so, what do you think the querying semantics ought to be?

> An argument to not treat it as a bug might be to suggest that the
> child table's column could inherit the parent table's column collation
> when the query targets the parent, but revert to its own otherwise.

That seems to me to be about on par with arguing that inheritance
shouldn't demand column type matching, but should coerce child columns
on-the-fly to their parent's type.  Even if you don't think that's
horrid from a theoretical standpoint, there's a good practical reason
not to allow it: if it acts that way, then indexes on the child column
will silently not be usable for many kinds of query against the parent.
People will be tearing their hair out looking for the cause of their
performance problems ... and, no doubt, filing bugs against the planner
... when throwing an error would have helped them catch the mismatch.

I think there needs to be a pretty darn compelling use-case for such
mismatches before we should allow them.  And I don't see one.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: MMAP Buffers
Next
From: Thom Brown
Date:
Subject: Re: ALTER TABLE INHERIT vs collations