Re: problem trying to create a temp table - Mailing list pgsql-general

From Richard Huxton
Subject Re: problem trying to create a temp table
Date
Msg-id 4F4794CC.80407@archonet.com
Whole thread Raw
In response to Re: problem trying to create a temp table  (<mgould@isstrucksoftware.net>)
List pgsql-general
On 24/02/12 13:36, mgould@isstrucksoftware.net wrote:
> How do I access it. I just did that and when I try and access it with a
> ERROR: relation "sessionsetting" does not exist
> LINE 1: select * from "sessionsetting"

=> CREATE SCHEMA foo;
CREATE SCHEMA
=> CREATE TABLE foo.table1 (id int);
CREATE TABLE
=> SET search_path = foo;
SET
=> INSERT INTO table1 VALUES (1),(2),(3);
INSERT 0 3
=> CREATE TEMP TABLE table1 (id int);
CREATE TABLE
=> INSERT INTO table1 VALUES (4),(5),(6);
INSERT 0 3
=> SELECT * FROM table1;
  id
----
   4
   5
   6
(3 rows)
=> DROP TABLE table1;
DROP TABLE
=> SELECT * FROM table1;
  id
----
   1
   2
   3
(3 rows)

Try "SELECT * FROM pg_namespace" to see the various temp schemas being
created.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From:
Date:
Subject: Re: problem trying to create a temp table
Next
From: Richard Huxton
Date:
Subject: Re: problem trying to create a temp table