Re: using pg_tables and tablename in queries

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "solarsail" <solarsail(at)gmail(dot)com>, "Yasir Malik" <ymalik(at)cs(dot)stevens(dot)edu>
Cc: "PostgreSQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: using pg_tables and tablename in queries
Date: 2005-10-04 22:33:28
Message-ID: 71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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, unless they are referenced with schema-qualified names. Any indexes created on a temporary table are automatically temporary as 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

Browse pgsql-sql by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-04 22:34:50 Re: Help with multistage query
Previous Message solarsail 2005-10-04 19:50:39 Re: using pg_tables and tablename in queries