Re: In which session context is a trigger run?

Поиск
Список
Период
Сортировка
От Mitar
Тема Re: In which session context is a trigger run?
Дата
Msg-id CAKLmikNq72rSKXj2EcoDKESCtmx2xxYDhfvFk2ZJ3MMDA5drGg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: In which session context is a trigger run?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: In which session context is a trigger run?
In which session context is a trigger run?
Список pgsql-general
Hi!

On Fri, Dec 28, 2018 at 9:36 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> When you create the temporary function it is 'pinned' to a particular
> session/pg_temp_nn. Running the trigger in another session 'pins' it to
> that session and it is not able to see the posts_temp table in the
> original session.

Yes. But why is trigger run in that other session? Could there be a
way to get trigger to run in the session where it was declared?

And yes, global temporary tables would be another approach to solve
this. But being able to set the session could be another, no? Or are
sessions linked to OS processes PostgreSQL is using and this is why
triggers run based on the session in which a change on the table was
made?


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m


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

Предыдущее
От: patrick keshishian
Дата:
Сообщение: Re: libpq bug?
Следующее
От: Mitar
Дата:
Сообщение: Using placeholders when creating a materialized view