Re: Error message documentation ?

From: S Dawalt <shane(dot)dawalt(at)wright(dot)edu>
To: Bill Kurland <bill(at)shakespeare-nyc(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Error message documentation ?
Date: 2003-01-03 14:57:09
Message-ID: 013201c2b338$63c43a20$e8b16c82@HP0E2E6GKYFJS4
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hello folks:
>
> I am using the perl DBI to connect to a postgreSQL database and thought it
> would be a good idea to anticipate and handle errors returned by
postgreSQL
> in my perl code so the end users don't have to deal with mysterious
> error messages
> they don't understand. "Programming the Perl DBI" suggests using
> $h->errstr() but
> says that the message is determined by the underlying database.

While I agree that formal documentation would be nice (and time
consuming), this information is readily available in
"~postgres/include/libpq-fe.h". There are some explanations too. I think
it took a bit of experimentation on my part since SELECT and non-SELECT
commands return slightly different status codes. I think it is unreasonable
to assume the DBI would document postgresql return values. The DBI is
database-independant. Since there is no error-code specification for
databases (that I know of), the DBI cannot possibly define error codes for
every possible database. However, this would fit perfectly into the perldoc
for the DBD module that interfaces the DBI to the specific database library.
The DBD::Pg module identifies that it returns status codes directly from
libpq ... these are defined in the include file previously specified.

Shane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patric Bechtel 2003-01-03 16:11:31 Re: postmaster.pid [Viruschecked]
Previous Message Christoph Dalitz 2003-01-03 14:48:23 rules in other RDBS?