Thread: trigger problem

trigger problem

From
Jan Verheyden
Date:
<div class="Section1"><p class="MsoNormal">Hi,<p class="MsoNormal"> <p class="MsoNormal">If I try this to run in a
triggerfunction<p class="MsoNormal"> <p class="MsoNormal">‘<i>perform dblink_connect('myconnect','dbname=postgres
password=uzleuven');</i><pclass="MsoNormal"><i>perform dblink_exec('myconnect', 'insert into test (uid) values (' ||
quote_literal(NEW.pat_id)|| ')');</i><p class="MsoNormal"><i>return new;</i><p class="MsoNormal"><i>perform
dblink_disconnect('myconnect');</i>’<pclass="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal"> <p
class="MsoNormal">Iget the message <p class="MsoNormal"> <p class="MsoNormal">‘<span style="color:red">ERROR: duplicate
connectionname</span><p class="MsoNormal"><span style="color:red">SQL state: 42710</span><p class="MsoNormal"><span
style="color:red">Context:SQL statement "SELECT  dblink_connect('myconnect','dbname=postgres
password=uzleuven')"</span><pclass="MsoNormal"><span style="color:red">PL/pgSQL function "test_update_trigger" line 2
atperform</span>’<p class="MsoNormal"> <p class="MsoNormal">This happens only in one of my two databases, anyone an
idea?<pclass="MsoNormal"> <p class="MsoNormal"> <p class="MsoNormal">Regards,<p class="MsoNormal">Jan</div>