Re: [HACKERS] DROP TABLE inside transaction block

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] DROP TABLE inside transaction block
Дата
Msg-id 8091.936572048@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] DROP TABLE inside transaction block  (Michael Simms <grim@argh.demon.co.uk>)
Ответы Re: [HACKERS] DROP TABLE inside transaction block  (Michael Simms <grim@argh.demon.co.uk>)
Список pgsql-hackers
Michael Simms <grim@argh.demon.co.uk> writes:
>> (Of course, what would be really nice is if it just worked, but I don't
>> see any way to make that happen without major changes.  Simply
>> postponing the unlink to end of transaction isn't workable; consider
>> BEGIN; DROP TABLE foo; CREATE TABLE foo; ...)

> Cant you just rename to a unique name, maybee in another directory,

Not if other backends are also accessing the table.  Remember that to
make this really work, the DROP would have to be invisible to other
backends until commit.

I think that to make this work correctly, we'd have to give up naming
table datafiles after the tables, and use a table's OID or some such
as its file name.  Ugly, and a pain in the neck for debugging and
maintenance.  And we'd still need to postpone the unlink till commit.

The amount of work needed seems vastly more than the feature is worth...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Simms
Дата:
Сообщение: Re: [HACKERS] DROP TABLE inside transaction block
Следующее
От: Michael Simms
Дата:
Сообщение: Re: [HACKERS] DROP TABLE inside transaction block