Re: In which session context is a trigger run?

From: Mitar <mmitar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: In which session context is a trigger run?
Date: 2018-12-28 20:59:44
Message-ID: CAKLmikMyiYHzVtwVvuvU=nPJZFJcMNL9Qsc+3o6q=C9g8hH4Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

On Fri, Dec 28, 2018 at 12:57 PM Adrian Klaver
<adrian(dot)klaver(at)aklaver(dot)com> wrote:
> > CREATE OR REPLACE FUNCTION pg_temp.my_function()
>
> And it does what?

Copies/transforms data from posts into posts_temp.

> > When a row is added to "posts" table outside of my session, function
> > "my_function" is called, but it seems it cannot access "posts_temp"
> > table. It seems that "my_function" is called in the session of the
>
> Temp tables can not be seen by other sessions.

Sure, but why is a temporary function used as a temporary trigger made
from my session not run inside my session? Then it could see a
temporary table made in my session.

Mitar

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message patrick keshishian 2018-12-28 22:51:22 Re: libpq bug?
Previous Message Adrian Klaver 2018-12-28 20:57:15 Re: In which session context is a trigger run?