Re: locking a dropped table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas F(dot) O'Connell" <tfo(at)monsterlabs(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: locking a dropped table
Date: 2001-05-15 15:51:06
Message-ID: 4824.989941866@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Thomas F. O'Connell" <tfo(at)monsterlabs(dot)com> writes:
> is there any way to preserve a lock on a table that gets dropped?
> i have a situation where it would be nice to have a select wait on a
> lock on a table that gets dropped but almost immediately recreated, but,
> at the moment, the select generates an error as soon as the table is
> dropped if the two actions happen close enough in time.

When you drop and recreate a table, you do not have the same table
anymore. You have a completely different object that happens to have
the same name as the previous table. So there is no possibility of
having a lock that covers both.

Perhaps rather than dropping the table, you should consider just
removing all its entries.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Hayner 2001-05-15 16:17:55 help with programming
Previous Message Stephan Szabo 2001-05-15 15:28:16 Re: Performance aggregates