Re: [GENERAL] Means to emulate global temporary table

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: [GENERAL] Means to emulate global temporary table
Дата
Msg-id b8525046-98da-3a3a-8b12-e6f838330e3b@hogranch.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Means to emulate global temporary table  (Ian Lewis <ilewis@mstarlabs.com>)
Ответы Re: [GENERAL] Means to emulate global temporary table  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 1/11/2017 6:39 PM, Ian Lewis wrote:
> Does this mean that a local temporary table created in one function in
> a database is visible globally throughout the database for the
> duration of the session?

postgres temporary tables are only visible to the session that creates
them.     all kind of wierdness would happen if they were somehow
visible outside that session, for instance what if another session is
accessing one of these hypothetical things, when the session that
creates the temp table exits ?   and, how do you resolve name
conflicts?      if session 1 creates temp table ABC, and session 2
creates temp table ABC, how would session 3 know which one to use?
conversely, if each session creates unique names, they'd have to build
every sql statement from string fragments, this is considered poor
practice, and how would session 3 know what unique name to use for one
of these other sessions shared temporary tables?     all very confusing.


so I'm still not clear here what it is you expect these 'global temp
tables' to do, and how they are supposed to behave?


--
john r pierce, recycling bits in santa cruz



В списке pgsql-general по дате отправления:

Предыдущее
От: Ian Lewis
Дата:
Сообщение: Re: [GENERAL] Means to emulate global temporary table
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] Means to emulate global temporary table