Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D1BEA47634A for ; Wed, 3 Jul 2002 19:20:51 -0400 (EDT) Mailbox-Line: From mark@somanetworks.com Wed Jul 3 19:20:51 2002 Received: from frogger.yyz.somanetworks.com (gw-yyz.somanetworks.com [216.126.67.39]) by postgresql.org (Postfix) with ESMTP id D5F4B4767D0 for ; Wed, 3 Jul 2002 17:01:25 -0400 (EDT) Received: by frogger.yyz.somanetworks.com (Postfix, from userid 506) id A585B23B43; Wed, 3 Jul 2002 17:01:21 -0400 (EDT) Received: by frogger.yyz.somanetworks.com (Postfix, from userid 506) id BA0BB23B43; Wed, 3 Jul 2002 16:59:03 -0400 (EDT) Date: Wed, 3 Jul 2002 16:59:03 -0400 From: Mark Frazer To: pgsql-sql@postgresql.org, pgsql-interfaces@somanetworks.com Subject: Possible Bug regarding temp tables (sql or psql?) Message-ID: <20020703165903.A17844@somanetworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Message-Flag: Outlook not so good. Organization: Detectable, well, not really X-Fry-1: That's a chick show. I prefer programs of the genre: World's X-Fry-2: Blankiest Blank. Resent-From: mark@somanetworks.com Resent-Date: Wed, 3 Jul 2002 17:01:21 -0400 Resent-To: pgsql-interfaces@postgresql.org Resent-Message-Id: <20020703210121.A585B23B43@frogger.yyz.somanetworks.com> X-Spam-Status: No, hits=3.0 required=5.0 tests=DOUBLE_CAPSWORD,UPPERCASE_25_50 version=2.30 X-Spam-Level: *** X-Archive-Number: 200207/7 X-Sequence-Number: 2816 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bug.sql" 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 ; --T4sUOijqQbZv57TR--