Search Postgresql Archives

Re: Update foreign table with trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 February 2016 at 20:42, Leonardo M. Ramé <l.rame@xxxxxxxxxxx> wrote:


El 26/02/16 a las 16:33, s d escribió:
On 26 February 2016 at 20:19, Leonardo M. Ramé <l.rame@xxxxxxxxxxx
<mailto:l.rame@xxxxxxxxxxx>> wrote:



    El 26/02/16 a las 16:18, s d escribió:


        On 26 February 2016 at 20:02, Leonardo M. Ramé
        <l.rame@xxxxxxxxxxx <mailto:l.rame@xxxxxxxxxxx>
        <mailto:l.rame@xxxxxxxxxxx <mailto:l.rame@xxxxxxxxxxx>>> wrote:


             El 26/02/16 a las 15:55, John R Pierce escribió:

                 On 2/26/2016 10:29 AM, Leonardo M. Ramé wrote:

                     Hi, I created a Postgres_FDW table (TABLE_A) and
        need to do
                     an update on that table.

                     As TABLE_A has a trigger, and the trigger does an
        insert on
                     another table (TABLE_B), I had to create another
        foreign
                     table called TABLE_B, that's ok.



                 that trigger is defined on the server that actually has
        table_a,
                 right?   or did you define a trigger on the FDW table ?

             Hi John, yes, the trigger is only defined on the foreign
        server.


        Let's check we get this right!
        You have two "real" table in the remote server with a trigger
        doing it's
        job on them and on the local server you have and FDW on each remote
        table. Right?


    Yes, that's right.


Then try to do the update on the remote db directly.

In the meantime could you provide the table and trigger definitions?


I don't understand why the trigger is run in the caller database instead of the called (foreign) one.

It isn't. You get this error message because the reason why the local command fails is in the remote trigger somewhere.

Ezt az e-mailt egy Avast védelemmel rendelkező, vírusmentes számítógépről küldték.
www.avast.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux