Re: Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully
Date
Msg-id db471ace0905010831vfdb6474ua0b046c8be2a22ae@mail.gmail.com
Whole thread Raw
In response to Re: Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Wow, a response from the famous Tom Lane to my lame problem :-) .

> What I'd try is a "ping" to the database server, and not initiate any
> libpq operation unless the server is answering pings.  If you get
> a failure due to connectivity loss midway through an operation,
> PQreset is appropriate then --- but don't do it to recover from
> a momentary network outage.

That's interesting. In general, it's hard to ping from a windows
program, unless you want to repeatedly invoke ping.exe. I'm not sure
that I can even retrieve the result of that. That strikes me as fairly
kludgey - acceptable for some utility shellscript, but probably not
for what is supposed to be a responsive program.

Perhaps it would be preferable to call the function after the
operation, but before the application reports success. I'll look into
it.

Regards,
Peter Geoghegan

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Do TEMP Tables have an OID? Can this be a problem if used too frequently?
Next
From: Tom Lane
Date:
Subject: Re: Understand this error