From: | "Caleb Welton" <cwelton(at)greenplum(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #5621: Insufficient locking of dependent objects |
Date: | 2010-08-17 18:15:25 |
Message-ID: | 201008171815.o7HIFPPZ008842@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 5621
Logged by: Caleb Welton
Email address: cwelton(at)greenplum(dot)com
PostgreSQL version: 9.1devel
Operating system: OSX 10.6.4
Description: Insufficient locking of dependent objects
Details:
There is a general class of concurrency bugs related to insufficient
locking
of dependent objects. This can occur with just about any inter-object
dependency that exists in the system:
Creating a table while dropping the schema it is in
Creating a table while dropping a type it depends on
Creating a function while dropping the language
Creating an aggregate while dropping the transition function.
Etc.
Here are two cases that represent the class of problems:
1) Table/Schema dependencies:
Session 1:
CREATE SCHEMA DROPME;
BEGIN;
CREATE TABLE DROPME.TEST(a int);
Session 2:
DROP SCHEMA DROPME;
Session 1:
COMMIT;
SELECT relname
FROM pg_class c
LEFT OUTER JOIN pg_namespace n
ON (n.oid = c.relnamespace)
WHERE n.oid is null;
Expected output of final query is zero rows (every table should have a
schema)
actual output is:
relname
---------
test
(1 row)
2) Table/Type dependencies
Session 1:
CREATE TYPE dropme as (a int, b int);
BEGIN;
CREATE TABLE test(a dropme);
Session 2:
DROP TYPE dropme;
Session 1:
COMMIT;
SELECT * FROM test;
Output of final select is:
ERROR: cache lookup failed for type 16390
Problem exists in all versions of Postgtres from at least 8.2 through 9.1
devel.
From | Date | Subject | |
---|---|---|---|
Next Message | Thue Janus Kristensen | 2010-08-17 21:26:54 | BUG #5622: Query failed: server closed the connection unexpectedly |
Previous Message | Magnus Hagander | 2010-08-17 09:05:31 | Re: libpq: system-wide root.crt |