pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PQstatus is getting blocked when database sytem powered off
3+ messages / 2 participants
[nested] [flat]

* PQstatus is getting blocked when database sytem powered off
@ 2008-07-22 15:48 Sunil Khatri <sunil@6dtech.co.in>
  2008-07-22 17:28 ` Re: PQstatus is getting blocked when database sytem powered off Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Sunil Khatri @ 2008-07-22 15:48 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,
In my application I need to check connection status before executing the query. I am doing it using PQstatus. 
Problem is : PQstatus is getting blocked If the system on which database server is running is powered off.
If I shutdown the database using pg_ctl stop or pkill -9 postmaster in that case its returning.

Is there any other way to check the connection status in this case?

Thanks 
Sk

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PQstatus is getting blocked when database sytem powered off
  2008-07-22 15:48 PQstatus is getting blocked when database sytem powered off Sunil Khatri <sunil@6dtech.co.in>
@ 2008-07-22 17:28 ` Tom Lane <tgl@sss.pgh.pa.us>
  2008-07-23 06:48   ` Re: PQstatus is getting blocked when database sytem powered off Sunil Khatri <sunil@6dtech.co.in>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2008-07-22 17:28 UTC (permalink / raw)
  To: Sunil Khatri <sunil@6dtech.co.in>; +Cc: pgsql-interfaces

"Sunil Khatri" <sunil@6dtech.co.in> writes:
> Problem is : PQstatus is getting blocked If the system on which database server is running is powered off.

Hardly likely, considering that PQstatus is just

ConnStatusType
PQstatus(const PGconn *conn)
{
	if (!conn)
		return CONNECTION_BAD;
	return conn->status;
}


I have no doubt that a query-issuing call could get blocked if the
postmaster stops responding, but not PQstatus.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PQstatus is getting blocked when database sytem powered off
  2008-07-22 15:48 PQstatus is getting blocked when database sytem powered off Sunil Khatri <sunil@6dtech.co.in>
  2008-07-22 17:28 ` Re: PQstatus is getting blocked when database sytem powered off Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-07-23 06:48   ` Sunil Khatri <sunil@6dtech.co.in>
  0 siblings, 0 replies; 3+ messages in thread

From: Sunil Khatri @ 2008-07-23 06:48 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces

Thanks for your reply.
You are right PQstatus is not blocking, query-issuing call is getting
blocked.
Is there any way for handling this blocking situation?

Regards
Sk
----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Sunil Khatri" <sunil@6dtech.co.in>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Tuesday, July 22, 2008 10:58 PM
Subject: Re: [INTERFACES] PQstatus is getting blocked when database sytem 
powered off


> "Sunil Khatri" <sunil@6dtech.co.in> writes:
>> Problem is : PQstatus is getting blocked If the system on which database 
>> server is running is powered off.
>
> Hardly likely, considering that PQstatus is just
>
> ConnStatusType
> PQstatus(const PGconn *conn)
> {
> if (!conn)
> return CONNECTION_BAD;
> return conn->status;
> }
>
>
> I have no doubt that a query-issuing call could get blocked if the
> postmaster stops responding, but not PQstatus.
>
> regards, tom lane
>
> -- 
> Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-interfaces
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.5.3/1565 - Release Date: 7/21/2008 
> 6:36 PM
>
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2008-07-23 06:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-22 15:48 PQstatus is getting blocked when database sytem powered off Sunil Khatri <sunil@6dtech.co.in>
2008-07-22 17:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2008-07-23 06:48   ` Sunil Khatri <sunil@6dtech.co.in>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox