Re: dblink questions - Mailing list pgsql-general

From Joe Conway
Subject Re: dblink questions
Date
Msg-id 3FD515C6.5020607@joeconway.com
Whole thread Raw
In response to dblink questions  ("Brian Maguire" <bmaguire@vantage.com>)
List pgsql-general
Brian Maguire wrote:
> What's the best way to create a connection with dblink with persisted
> connections for web applications?
>

It all depends on how you intend to use the dblink connections.

If your web page connects to Postgres, issues a single query using
dblink (via a view or whatever), and then completes, you don't need a
persistent dblink connection -- just use the explicit connection syntax.

If, on the other hand, your web page connects to Postgres, issues
several queries using dblink (via a view or whatever), and then
completes, it would make sense to use a persistent dblink connection. In
that case, execute dblink_connect() before you execute your queries. Use
named persistent connections if you need more than one, anonymous otherwise.

HTH,

Joe


pgsql-general by date:

Previous
From: Socketd
Date:
Subject: OO database?
Next
From: "Victor B. Berdin"
Date:
Subject: Re: pgsql 7.4 on minimal environment