Re: DDL and DML in a transaction - Mailing list pgsql-general

From David G. Johnston
Subject Re: DDL and DML in a transaction
Date
Msg-id CAKFQuwZBy38L5X06WHMeFhMU03OmdSF8KTMMnJg6JLRu3=065g@mail.gmail.com
Whole thread Raw
In response to DDL and DML in a transaction  ("Igal @ Lucee.org" <igal@lucee.org>)
Responses Re: DDL and DML in a transaction
List pgsql-general
On Wed, Jul 31, 2019 at 11:38 AM Igal @ Lucee.org <igal@lucee.org> wrote:
     alter table some_table
         rename column amount_num to amount_text;

     alter table some_table
         drop column amount_num;

You just renamed amount_num to amount_text so I'm not sure why you expect the drop to succeed.

Would it have less locking than simply altering the column?

I doubt anything will improve upon simply altering the column.  You have to perform a full table rewrite in either case which is going to be the main resource consumer.

David J.

pgsql-general by date:

Previous
From: "Igal @ Lucee.org"
Date:
Subject: DDL and DML in a transaction
Next
From: "Igal @ Lucee.org"
Date:
Subject: Re: DDL and DML in a transaction