Forgot to mention that adding
DROP TABLE v_idx ;
before the END WORK will fix things. However, I was under the impression that
temporary tables would go away after a transaction in which they were created
was committed.
---(end of broadcast)---
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
Any idea why the table can't be seen with \d in psql then?
Christopher Kings-Lynne <[EMAIL PROTECTED]> [02/07/04 00:21]:
>
> No - they go away at the end of a _connection_. However, there is now a
> patch floating around on -hackers that would add an ' ON COMMIT DROP;'
> option to CREATE TEMP T
Bruce Momjian <[EMAIL PROTECTED]> [02/07/04 22:10]:
>
> TODO has:
>
> * Allow psql \d to show temporary table structure
>
> Looks like it works fine now with schemas:
>
> I will mark the TODO as done.
It doesn't work with select into though:
config=> select 5 into temp v_tmp ;