trigger problem - Mailing list pgsql-sql

From Jan Verheyden
Subject trigger problem
Date
Msg-id E30C7040DE22624185BAD4093190B54437BE5DB44E@EX2007-MBX-2.uz.kuleuven.ac.be
Whole thread
List pgsql-sql

Hi,

 

If I try this to run in a trigger function

 

perform dblink_connect('myconnect','dbname=postgres password=uzleuven');

perform dblink_exec('myconnect', 'insert into test (uid) values (' || quote_literal(NEW.pat_id) || ')');

return new;

perform dblink_disconnect('myconnect');

 

 

 

I get the message

 

ERROR: duplicate connection name

SQL state: 42710

Context: SQL statement "SELECT  dblink_connect('myconnect','dbname=postgres password=uzleuven')"

PL/pgSQL function "test_update_trigger" line 2 at perform

 

This happens only in one of my two databases, anyone an idea?

 

 

Regards,

Jan

pgsql-sql by date:

Previous
From: "Klas Stockhem"
Date:
Subject: Re: Problems when copy data from dump file
Next
From: "Klas Stockhem"
Date:
Subject: Problems when copy data from dump file