Re: using pg_tables and tablename in queries - Mailing list pgsql-sql

From Gregory S. Williamson
Subject Re: using pg_tables and tablename in queries
Date
Msg-id 71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net
Whole thread Raw
In response to using pg_tables and tablename in queries  (solarsail <solarsail@gmail.com>)
List pgsql-sql
Yasir --

You wrote:
<snip>
>If I generate a temporary table instead of returning the results how
>long will that table exist for?  Excuse the OOP terminology but would
>it be correct to create a 'Singleton' to access the temporary table,
>where if it exists and is less than 30 minutes old use that one,
>otherwise drop the table and recreate it?

In 8.0:
"Temporary tables are automatically dropped at the end of a session, or optionally at the end of the current
transaction(see ON COMMIT below). 
Existing permanent tables with the same name are not visible to the current session while the temporary table exists,
unlessthey are referenced with schema-qualified names. Any indexes created on a temporary table are automatically
temporaryas well." 

So a temp table would persist as long as the originating session, but only that session could see it.

Not sure if this helps or not ...

Greg Williamson
DBA
GlobeXplorer LLC




pgsql-sql by date:

Previous
From: solarsail
Date:
Subject: Re: using pg_tables and tablename in queries
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Help with multistage query