Re: Can PQstatus() be used by Application to check connection to postgres periodically?

From: Pavel Golub <pavel(at)microolap(dot)com>
To: sujayr06 <sujayr06(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Can PQstatus() be used by Application to check connection to postgres periodically?
Date: 2012-02-08 06:50:33
Message-ID: 1471671858.20120208085033@gf.microolap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, sujayr06.

You wrote:

s> Hello All,

s> My application has to do a real time data upload to PostgreSQL
s> server.

s> Every time i have to do a real time upload, i do not wish to open
s> new connection.
s> I want to open a connection once [when my application comes up]
s> and periodically check if the connection is active.
s> Can PQstatus() be used by application to check the status of the
s> connection already established?

s> If PQstatus() cannot be used, does PostgreSQL provide alternate
s> interface to check the status of the connection.

s> Note : I do not wish to open connection on every real time upload
s> as its an overhead for the application.

s> Appreciate any help!

You may use PQtransactionStatus for this purpose
(http://www.postgresql.org/docs/9.1/static/libpq-status.html)

s> WBR,
s> Sujay

s>

s>

s> --
s> View this message in context:
s> http://postgresql.1045698.n5.nabble.com/Can-PQstatus-be-used-by-Application-to-check-connection-to-postgres-periodically-tp5462315p5462315.html
s> Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

--
With best wishes,
Pavel mailto:pavel(at)gf(dot)microolap(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chetan Suttraway 2012-02-08 06:58:48 Re: patch for implementing SPI_gettypemod()
Previous Message Chetan Suttraway 2012-02-08 06:49:56 Re: patch for implementing SPI_gettypemod()