trigger problem

From: Jan Verheyden <jan(dot)verheyden(at)uz(dot)kuleuven(dot)ac(dot)be>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: trigger problem
Date: 2009-08-06 09:09:19
Message-ID: E30C7040DE22624185BAD4093190B54437BE5DB44E@EX2007-MBX-2.uz.kuleuven.ac.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Klas Stockhem 2009-08-06 10:00:46 Problems when copy data from dump file
Previous Message Richard Huxton 2009-08-06 08:42:06 Re: Problems when copy data from dump file