Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-17 Thread Tom Lane
Peter Eisentraut writes: > On Sat, 2011-04-16 at 18:23 -0400, Tom Lane wrote: >> Right at the moment, ALTER INHERIT doesn't verify that collations >> match in a proposed inheritance child. > It should be prevented, I think. BTW, on looking through the source to find the cause, I see that the rea

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-17 Thread Peter Eisentraut
On Sat, 2011-04-16 at 21:52 -0400, Jean-Pierre Pelletier wrote: > One use case for this might be with constraint exclusion where there > would be one > partition per collation (language) with queries against the parent table > always > being for exactly one language. If you really wanted that, yo

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-17 Thread Peter Eisentraut
On Sat, 2011-04-16 at 18:23 -0400, Tom Lane wrote: > Right at the moment, ALTER INHERIT doesn't verify that collations > match in a proposed inheritance child. It should be prevented, I think. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscrip

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Jean-Pierre Pelletier
One use case for this might be with constraint exclusion where there would be one partition per collation (language) with queries against the parent table always being for exactly one language. Not sure what the collation should be in the parent table then. -- Sent via pgsql-hackers mailing lis

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Robert Haas
On Sat, Apr 16, 2011 at 6:23 PM, Tom Lane 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 collat

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Thom Brown
On 17 April 2011 00:40, Tom Lane wrote: > Thom Brown writes: >> On 16 April 2011 23:23, Tom Lane 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

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Tom Lane
Thom Brown writes: > On 16 April 2011 23:23, Tom Lane 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 in

Re: [HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Thom Brown
On 16 April 2011 23:23, Tom Lane 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"

[HACKERS] ALTER TABLE INHERIT vs collations

2011-04-16 Thread Tom Lane
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