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

From Mark Hollomon
Subject Re: [HACKERS] DROP TABLE inside a transaction block
Date
Msg-id 38C65010.82B109FF@americasm01.nt.com
Whole thread Raw
In response to Re: [HACKERS] DROP TABLE inside a transaction block  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> 
> If we change the implementation so that the files are named after
> the (fixed, never-changed-after-creation) table OID, then RENAME
> TABLE is no problem: it affects *nothing* except the relname field
> of the table's pg_class row, and either that row update is committed
> or it ain't.
> 
> But if the physical file names contain the logical table name, we
> have to be prepared to rename those files in sync with the transaction
> commit that makes the pg_class update valid.  Quite aside from any
> implementation effort involved, the critical point is this: it is
> *not possible* to ensure that that collection of changes is atomic.
> At best, we can make the window for failure small.
>

How about using hard-links? The transaction that created the change
would see the new link along with the new tuple. other transactions
would see the old directory and the old tuple. rollback drops the new
tuple and the new directory entry. Commit does the obvious.

Does WinNT have something similar to a hard link?
-- 

Mark Hollomon
mhh@nortelnetworks.com
ESN 451-9008 (302)454-9008


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] library policy question
Next
From: Patrick Welche
Date:
Subject: Re: [HACKERS] alter_table.sql