Temp table woes - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Temp table woes
Date
Msg-id 467BB8A2.6050505@enterprisedb.com
Whole thread Raw
Responses Re: Temp table woes  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #3403: ver 8.2 can't add serial column to temp table,but 8.1 can
Next
From: Zdenek Kotala
Date:
Subject: Re: BUG #3403: ver 8.2 can't add serial column to temp table,but 8.1 can