X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C5EA3DA04E for ; Tue, 4 Oct 2005 19:33:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04598-08 for ; Tue, 4 Oct 2005 22:33:27 +0000 (GMT) Received: from loki.globexplorer.com (loki.globexplorer.com [208.35.14.101]) by svr1.postgresql.org (Postfix) with ESMTP id D7BBFD9C60 for ; Tue, 4 Oct 2005 19:33:26 -0300 (ADT) content-class: urn:content-classes:message MIME-Version: 1.0 Subject: Re: using pg_tables and tablename in queries Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Date: Tue, 4 Oct 2005 15:33:28 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Message-ID: <71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] using pg_tables and tablename in queries Thread-Index: AcXJHmj2SXKy9BDNR8GdZ+qwPYPx8gAFLZhy From: "Gregory S. Williamson" To: "solarsail" , "Yasir Malik" Cc: "PostgreSQL" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/11 X-Sequence-Number: 22864 Yasir -- You wrote: >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