Re: ALTER TABLE INHERIT vs collations

From: Thom Brown <thom(at)linux(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ALTER TABLE INHERIT vs collations
Date: 2011-04-16 22:45:36
Message-ID: BANLkTi=UHrw9YWOkkwhWrYQyvbu2isc0bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16 April 2011 23:23, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Right at the moment, ALTER INHERIT doesn't verify that collations match
> in a proposed inheritance child.  So you can do this:
>
> regression=# create table foo (f1 text collate "C");
> CREATE TABLE
> regression=# create table bar (f1 text collate "POSIX");
> CREATE TABLE
> regression=# alter table bar inherit foo;
> ALTER TABLE
>
> but then the planner whines about it:
>
> regression=# select * from foo;
> ERROR:  attribute "f1" of relation "bar" does not match parent's collation
>
> 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.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-04-16 23:19:21 Re: MMAP Buffers
Previous Message Radosław Smogura 2011-04-16 22:43:31 Re: MMAP Buffers