Re: temp table same name real table

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: temp table same name real table
Дата
Msg-id CAHOFxGrLCS9S4Ds0eaH5m_NOmEDxpNjwGz=TzB96034riy+ihA@mail.gmail.com
обсуждение исходный текст
Ответ на temp table same name real table  ("v.brusa@joinsnc.com" <v.brusa@joinsnc.com>)
Ответы Re: temp table same name real table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general


On Wed, Sep 30, 2020, 7:27 AM v.brusa@joinsnc.com <v.brusa@joinsnc.com> wrote:


Hi all,
I have this strange behavior when I use temp table with same name of a permanent table in a function.

IMO, you are asking for strange behavior when you overload a table name.

I expect that one of the people who work down deep down in the code will say it is a caching thing that saves system table lookups. It also may be required to ensure consistent behavior when you use the same table name (non specified schema) then you should always get the same table.

Still, it might be simple to use exceptions and try to read the pg_temp table and if it does not exist, try the public schema.

Or, just schema qualify the fetch call with a string that is computed for which schema you want to use.

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

Предыдущее
От: Matthias Apitz
Дата:
Сообщение: Re: Problem close curser after rollback
Следующее
От: Devrim Gündüz
Дата:
Сообщение: Re: Yum repository RPM behind release