Re: BUG #2372: dblink_exec doesn't return. NEVER! - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2372: dblink_exec doesn't return. NEVER!
Date
Msg-id 16788.1144098910@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2372: dblink_exec doesn't return. NEVER!  ("William Leite Araújo" <william.bh@gmail.com>)
Responses Re: BUG #2372: dblink_exec doesn't return. NEVER!  (Stephen Frost <sfrost@snowman.net>)
List pgsql-bugs
"William Leite Araújo" <william.bh@gmail.com> writes:
> A trigger start a dblink_exec local connection to insert on a table "A" as
> SuperUser. Table "A" fires insert trigger that, by LOG messages, ends, but
> the function never return to initial trigger.

Perhaps the other transaction is blocked on some lock held by your
original transaction?

dblink connections to your own database are very seldom a good idea;
there is always a better, more efficient, less deadlock-prone way
to do it.  In this case I'd venture that you want to use a SECURITY
DEFINER function, and not dblink at all.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "William Leite Araújo"
Date:
Subject: BUG #2372: dblink_exec doesn't return. NEVER!
Next
From: Stephen Frost
Date:
Subject: Re: BUG #2372: dblink_exec doesn't return. NEVER!