Re: ALTER TABLE does not check for column existence before starting operations

2018-06-26 Thread Arthur Zakirov
Hello, On Fri, Mar 02, 2018 at 12:36:41PM +0100, Pierre Ducroquet wrote: > The attached patch fixes this behaviour by adding a small check in the first > pass of alter table to make sure that a column referenced by an alter command > exists first. It also checks if the column is added by

Re: ALTER TABLE does not check for column existence before starting operations

2018-03-02 Thread Tom Lane
Pierre Ducroquet writes: > On Friday, March 2, 2018 2:44:16 PM CET David Steele wrote: >> I recommend entering this patch in the 2018-09 CF so it doesn't get lost. > Thanks for the answer. > I saw that bug two days ago but I had no time then to do the patch. Had

Re: ALTER TABLE does not check for column existence before starting operations

2018-03-02 Thread Pierre Ducroquet
On Friday, March 2, 2018 2:44:16 PM CET David Steele wrote: > Hi Pierre, > > On 3/2/18 6:36 AM, Pierre Ducroquet wrote: > > While working on a big table recently, I noticed that ALTER TABLE does not > > check for column existence in operations like SET NOT NULL before starting > > working on the

Re: ALTER TABLE does not check for column existence before starting operations

2018-03-02 Thread David Steele
Hi Pierre, On 3/2/18 6:36 AM, Pierre Ducroquet wrote: > > While working on a big table recently, I noticed that ALTER TABLE does not > check for column existence in operations like SET NOT NULL before starting > working on the table, for instance adding a primary key. > It is thus possible, if

ALTER TABLE does not check for column existence before starting operations

2018-03-02 Thread Pierre Ducroquet
Hi While working on a big table recently, I noticed that ALTER TABLE does not check for column existence in operations like SET NOT NULL before starting working on the table, for instance adding a primary key. It is thus possible, if a typo has been made, to generate a long lock and a lot of