Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-21 Thread Robert Haas
On Tue, Mar 20, 2012 at 2:48 PM, Tom Lane wrote: >> I think Tom's correct about what the right behavior would be if >> composite types supported defaults, but they don't, never have, and >> maybe never will.  I had a previous argument about this with Tom, and >> lost, though I am not sure that any

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-20 Thread Merlin Moncure
On Tue, Mar 20, 2012 at 12:16 PM, Robert Haas wrote: > I think Tom's correct about what the right behavior would be if > composite types supported defaults, but they don't, never have, and > maybe never will.  I had a previous argument about this with Tom, and > lost, though I am not sure that any

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-20 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 7, 2012 at 3:49 PM, Merlin Moncure wrote: >> On Wed, Mar 7, 2012 at 2:31 PM, Tom Lane wrote: >>> It is not a bug. The ALTER ADD ... DEFAULT ... form implies rewriting >>> every existing tuple of the rowtype to insert a non-null value in the >>> added column, an

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-20 Thread Robert Haas
On Wed, Mar 7, 2012 at 3:49 PM, Merlin Moncure wrote: > On Wed, Mar 7, 2012 at 2:31 PM, Tom Lane wrote: >> Merlin Moncure writes: >>> On Wed, Mar 7, 2012 at 11:45 AM, Mike Blackwell >>> wrote: alter table a add column even_more_stuff boolean not null default false; >> >>> aha! that's not

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-08 Thread Mike Blackwell
Not a bad idea. I'd need to convert existing data, but it'd be an excuse to try out hstore. ^_^ Mike * * On Thu, Mar 8, 2012 at 11:08, Merlin Moncure wrote: > On Wed, Mar 7, 2012 at 2:49 PM, Merlin Moncure wrote: > > On a practical level, the error blocks nothing -- you can bypass it > > tri

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-08 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:49 PM, Merlin Moncure wrote: > On a practical level, the error blocks nothing -- you can bypass it > trivially.   It's just an annoyance that prevents things that users > would like to be able to do with table row types.  So I'd argue to > remove the check, although I can

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:31 PM, Tom Lane wrote: > Merlin Moncure writes: >> On Wed, Mar 7, 2012 at 11:45 AM, Mike Blackwell >> wrote: >>> alter table a add column even_more_stuff boolean not null default false; > >> aha! that's not what you posted last time.  you appended 'not null >> default f

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mié mar 07 17:31:32 -0300 2012: > This probably could be done for rowtype columns as well, but nobody has > collected the necessary round tuits. I think there was some fear of > locking/deadlock issues, too. It's probably easy to do if you require it to be ma

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Tom Lane
Merlin Moncure writes: > On Wed, Mar 7, 2012 at 11:45 AM, Mike Blackwell > wrote: >> alter table a add column even_more_stuff boolean not null default false; > aha! that's not what you posted last time. you appended 'not null > default false'; which inexplicably breaks the ALTER. > try this: