Re: [HACKERS] DROP TABLE inside transaction block

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Simms <grim(at)argh(dot)demon(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] DROP TABLE inside transaction block
Date: 1999-09-05 22:54:08
Message-ID: 8091.936572048@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Simms <grim(at)argh(dot)demon(dot)co(dot)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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Simms 1999-09-05 23:11:36 Re: [HACKERS] DROP TABLE inside transaction block
Previous Message Michael Simms 1999-09-05 22:47:37 Re: [HACKERS] DROP TABLE inside transaction block