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

From Igal @ Lucee.org
Subject Re: DDL and DML in a transaction
Date
Msg-id 4c485a6f-9845-8d45-d902-b6d24f59856b@lucee.org
Whole thread Raw
In response to Re: DDL and DML in a transaction  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

Thank you, David.

I should get more sleep...

Igal

On 7/31/2019 11:52 AM, David G. Johnston wrote:

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: "David G. Johnston"
Date:
Subject: Re: DDL and DML in a transaction
Next
From: "Peter J. Holzer"
Date:
Subject: Re: How do I create a Backup Operator account ?