Re: DDL and DML in a transaction

Поиск
Список
Период
Сортировка
От Igal @ Lucee.org
Тема Re: DDL and DML in a transaction
Дата
Msg-id 4c485a6f-9845-8d45-d902-b6d24f59856b@lucee.org
обсуждение исходный текст
Ответ на Re: DDL and DML in a transaction  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: DDL and DML in a transaction
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: How do I create a Backup Operator account ?