Hello, people on the mailing list,
This is a rather technical question, but the people of pgsql ask that
certain questions be first posted here.
While busy learning the postgreSQL system and Tcl/Tk, I noticed
something that to me (a fulltime applications programmer) seems a flaw
When using pg_connect to a non-existing database, one doesn't have the
means to control the extent of the error. If you try the following
set connection [pg_connect notanexistingdatabase]
it is not at all possible to recover the running program from this
error. I have tried this using catch, but to no avail. This is the
Connection to database failed
FATAL 1: Database notadatabase does not exist in pg_database
(file "connect.tcl" line 10)
Or, this is an error in Tcl, or this is not good enough thought out in
Why do I say this about libpgtcl ?
As I mentioned, I am a full-time applications programmer. When writing
software for customers, you do NOT want to let loose parts of the OS
which they don't know. You want to implement a graceful recovery of this
error. In this case, I would like a way that my program keeps running,
so that it is possible to send a notification to the user that the
system isn't available and that he should try another time.
You could of course say, make sure that you have an existing database.
Well, this isn't always possible, and the backend may be down.
The kind of error that you have in this case is a resource allocation
error. It should always be possible for the programmer to recover from
this, or at least provide a meaningful message and a way to get out,
without leaving the user on his own devices.
Once you have a result from the connection, the programmer should be
able to test this result and act accordingly. If he doesn't test it, and
he tries to execute a query, and he gets strange results, then it is his
fault and responsibility. But this is what testing is for.
With regards to everybody,
pgsql-general by date
|Next:||From: Thomas Good||Date: 1999-10-28 13:52:14|
|Subject: Re: [ANNOUNCE] New PostgreSQL book on web site|
|Previous:||From: Yury Don||Date: 1999-10-28 11:31:03|
|Subject: Re: [GENERAL] A simple SQL command|