R: Re: [ADMIN] dblink question about duplicate connection

2011-08-03 Thread francescobocca...@libero.it
Thanks, I solved it with your help. Francesco Boccacci >Messaggio originale >Da: m...@joeconway.com >Data: 02/08/2011 22.46 >A: "francescobocca...@libero.it" >Cc: >Ogg: Re: [ADMIN] dblink question about duplicate connection > >On 08/02/2011 05:36 AM,

Re: [ADMIN] dblink question about duplicate connection

2011-08-02 Thread Joe Conway
On 08/02/2011 05:36 AM, francescobocca...@libero.it wrote: > Somentimes happend that an error accours in insert data and when i try to run > new insert posgresql return and error like duplicate connection. > I would like to change my functions in this way: > If 'conn_test' exist PERFORM dbl

[ADMIN] dblink question about duplicate connection

2011-08-02 Thread francescobocca...@libero.it
Dear all, i have a question about dblink connection.I use it in a trigger function : CREATE OR REPLACE FUNCTION setuser() RETURNS trigger AS $BODY$ DECLARE BEGIN IF (TG_OP = 'INSERT') THEN PERFORM dblink_connect('conn_test', 'dbname=database_test'); PERFORM dblink_exec(