Search Postgresql Archives

Apparent race in information_schema.tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This query:

SELECT 1 FROM information_schema.tables WHERE table_schema = $1 AND table_name = $2;

fails sporadically with the error "relation with OID <number> does not
exist".  The query is run by a non-superuser, and the table/schema
combination exists in the database.  The query may have been PREPAREd
(it's submitted using DBD::Pg with the default flags)---I would have
to turn on logging to discover this, and I'm somewhat reluctant to do
so.

I guess the OID refers to a temporary table because I can't find it in
pg_class, and the cause is a race between listing the tables and
applying the permission checks to them (which I don't need anyway, I
think) because tables in the system catalog are not subject to MVCC.
That suggests the problem should go away when I query pg_tables
instead, but I haven't tried that yet.

This happens with 8.2.6 and 8.2.13, and only while there is
significant CREATE TEMPORARY TABLE/DROP TABLE activity in an other
backend process.

-- 
Florian Weimer                <fweimer@xxxxxx>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux