From: Gregory S. Williamson <gsw@globexplorer.com>
To: solarsail <solarsail@gmail.com>
To: Yasir Malik <ymalik@cs.stevens.edu>
Cc: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: using pg_tables and tablename in queries
Date: Tue, 4 Oct 2005 15:33:28 -0700
Message-ID: <71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net> (raw)
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
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-sql@postgresql.org
Cc: gsw@globexplorer.com, solarsail@gmail.com, ymalik@cs.stevens.edu
Subject: Re: using pg_tables and tablename in queries
In-Reply-To: <71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net>
* 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