Re: using pg_tables and tablename in queries

Поиск
Список
Период
Сортировка
От Gregory S. Williamson
Тема Re: using pg_tables and tablename in queries
Дата
Msg-id 71E37EF6B7DCC1499CEA0316A2568328024BBA00@loki.wc.globexplorer.net
обсуждение исходный текст
Ответ на using pg_tables and tablename in queries  (solarsail <solarsail@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: solarsail
Дата:
Сообщение: Re: using pg_tables and tablename in queries
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Help with multistage query