pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Franklin Haut <franklin.haut@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Temporary table
Date: Fri, 23 Jun 2006 18:04:28 -0400
Message-ID: <29399.1151100268@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c69710$264fe940$8adb02c9@franklin>
References: <000001c69710$264fe940$8adb02c9@franklin>

"Franklin Haut" <franklin.haut@gmail.com> writes:
> How to reproduce :

> 	CREATE TEMP TABLE cademp (
> 	       codemp INTEGER,
> 	       codfil INTEGER,
> 	       nomemp varchar(50)
> 	) ON COMMIT DROP;

> 	INSERT INTO cademp (codemp, codfil, nomemp) values (1,1,'TESTE');
> 	INSERT INTO cademp (codemp, codfil, nomemp) values (1,2,'TESTE1');
	
> 	Select * from cademp;

You need a BEGIN/COMMIT around that, or else rethink using ON COMMIT DROP.
As is, the temp table goes away instantly when the CREATE commits.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <29399.1151100268@sss.pgh.pa.us>
Permalink:  ../29399.1151100268@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29399.1151100268@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, franklin.haut@gmail.com
  Subject: Re: Temporary table
  In-Reply-To: <29399.1151100268@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox