Re: dblink question about duplicate connection

From: Joe Conway <mail(at)joeconway(dot)com>
To: "francescoboccacci(at)libero(dot)it" <francescoboccacci(at)libero(dot)it>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: dblink question about duplicate connection
Date: 2011-08-02 20:46:20
Message-ID: 4E38621C.1040206@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 08/02/2011 05:36 AM, francescoboccacci(at)libero(dot)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 dblink_disconnect('conn_test');
> else
>
> PERFORM dblink_connect('conn_test', 'dbname=database_test');

> How can write my new function?

See dblink_get_connections():
http://www.postgresql.org/docs/9.0/interactive/contrib-dblink-get-connections.html

HTH,

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message francescoboccacci@libero.it 2011-08-03 07:02:32 R: Re: dblink question about duplicate connection
Previous Message Kevin Grittner 2011-08-02 15:51:22 Re: migration wizard faild