Skip site navigation (1) Skip section navigation (2)

Temp table woes

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Temp table woes
Date: 2007-06-22 11:55:14
Message-ID: 467BB8A2.6050505@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugs
This only works as a superuser, but it's wrong nevertheless:

Session 1:

postgres=# CREATE temp table foo (x int);
CREATE TABLE

Session 2:
postgres=# SELECT * FROM pg_temp_1.foo;
  x
---
(0 rows)

postgres=# INSERT INTO pg_temp_1.foo values (1);
INSERT 0 1

The insert in session 2 goes to a buffer in the shared buffer cache, 
which causes problems at the next checkpoint:

ERROR:  could not open relation 1663/11502/24576: No such file or directory
CONTEXT:  writing block 0 of relation 1663/11502/24576
WARNING:  could not write block 0 of 1663/11502/24576
DETAIL:  Multiple failures --- write error might be permanent.

Without superuser rights, you'll get a permission denied error trying to 
access the table from another session.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Responses

pgsql-bugs by date

Next:From: Zdenek KotalaDate: 2007-06-22 12:19:06
Subject: Re: BUG #3403: ver 8.2 can't add serial column to temp table,but 8.1 can
Previous:From: Heikki LinnakangasDate: 2007-06-22 10:18:45
Subject: Re: BUG #3403: ver 8.2 can't add serial column to temp table,but 8.1 can

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group