pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Frazer <mark@somanetworks.com>
To: pgsql-sql@postgresql.org
To: pgsql-interfaces@somanetworks.com
Subject: Possible Bug regarding temp tables (sql or psql?)
Date: Wed, 3 Jul 2002 16:59:03 -0400
Message-ID: <20020703165903.A17844@somanetworks.com> (raw)

When using the attached script in psql, the temp variables disappear as 
far as \distv shows, but running the script a second time fails.

To reproduce, save the following script as bug.sql, then start psql on an
test database.
\i bug.sql
\distv
-- no relations should be shown
\i bug.sql 
-- this will fail.

However, if you run psql again, you can
\i bug.sql
successfully.  It will only fail if run twice in the same script.

cheers
-mark

-- 
Hardy Boys: too easy. Nancy Drew: too hard! - Fry

Attachments:

bug.sql (text/plain, 536B) download CREATE TABLE foo ( foo_idx SERIAL PRIMARY KEY, foo INTEGER ) ; CREATE TABLE bar ( bar_idx SERIAL PRIMARY KEY, foo_idx INTEGER REFERENCES foo, bar INTEGER ) ; INSERT INTO foo ( foo ) VALUES ( 111 ) ; INSERT INTO foo ( foo ) VALUES ( 222 ) ; INSERT INTO foo ( foo ) VALUES ( 333 ) ; BEGIN WORK ; SELECT foo_idx INTO TEMP v_idx FROM foo WHERE foo.foo = 222 ; INSERT INTO bar ( foo_idx, bar ) VALUES ( v_idx.foo_idx, 888 ) ; END WORK ; DROP TABLE foo ; DROP SEQUENCE foo_foo_idx_seq ; DROP TABLE bar ; DROP SEQUENCE bar_bar_idx_seq ;

view thread (11+ messages)  latest in thread

Message-ID: <20020703165903.A17844@somanetworks.com>
Permalink:  ../20020703165903.A17844@somanetworks.com/
Also on:    postgresql.org/message-id/20020703165903.A17844@somanetworks.com

 · 

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-interfaces@postgresql.org
  Cc: mark@somanetworks.com, pgsql-sql@postgresql.org, pgsql-interfaces@somanetworks.com
  Subject: Re: Possible Bug regarding temp tables (sql or psql?)
  In-Reply-To: <20020703165903.A17844@somanetworks.com>

* 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