Re: [HACKERS] DROP TABLE inside transaction block - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] DROP TABLE inside transaction block
Date
Msg-id 8091.936572048@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] DROP TABLE inside transaction block  (Michael Simms <grim@argh.demon.co.uk>)
Responses Re: [HACKERS] DROP TABLE inside transaction block  (Michael Simms <grim@argh.demon.co.uk>)
List 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 by date:

Previous
From: Michael Simms
Date:
Subject: Re: [HACKERS] DROP TABLE inside transaction block
Next
From: Michael Simms
Date:
Subject: Re: [HACKERS] DROP TABLE inside transaction block