pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian Cox <brian.cox@ca.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: "could not open relation..."
Date: Tue, 13 Apr 2010 15:25:01 -0400
Message-ID: <8614.1271186701@sss.pgh.pa.us> (raw)
In-Reply-To: <4BC149DD.1090908@ca.com>
References: <4BC149DD.1090908@ca.com>

Brian Cox <brian.cox@ca.com> writes:
> On 04/10/2010 12:29 AM, Tom Lane [tgl@sss.pgh.pa.us] wrote:
>> but anyway: the main
>> known cause for that is if one of the tables used in the query got
>> dropped (by another session) just after the query started. Could
>> that have happened to you?

> interesting and possible; but why doesn't locking prevent this?

Locking prevents you from getting some random internal failure
that would happen if the table disappeared mid-query.  It cannot
eliminate the problem altogether, because the issue here is that
the dropping transaction got there first; there is no reason not
to allow it to proceed.  So the reading transaction is going to fail.
The most we could change is the spelling of the error message,
but I'm not sure that masking the fact that something odd happened
is a good idea.  (From the reader's viewpoint, it did see a table
by that name in the catalogs, but by the time it acquired lock on
the table, the catalog entry was gone.  Playing dumb and just saying
"table does not exist" could be even more confusing than the current
behavior.)

			regards, tom lane



view thread (4+ messages)

Message-ID: <8614.1271186701@sss.pgh.pa.us>
Permalink:  ../8614.1271186701@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8614.1271186701@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, brian.cox@ca.com
  Subject: Re: "could not open relation..."
  In-Reply-To: <8614.1271186701@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox