pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedConnection Error message in ECPG
3+ messages / 2 participants
[nested] [flat]
* Connection Error message in ECPG
@ 2003-02-08 19:50 Matthew Vanecek <mevanecek@yahoo.com>
2003-02-10 12:44 ` Re: Connection Error message in ECPG Michael Meskes <meskes@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Vanecek @ 2003-02-08 19:50 UTC (permalink / raw)
To: pgsql-interfaces
Hi,
What would it take to get a better error message out of the ECPG
interface, when a connection fails? It uses PQstatus(conn) to check the
status, but it doesn't use PQerrorMessage(conn) to get the error from
the backend and string it into sqlca.sqlerrm.sqlerrmc. Is there a way
to get that message from ECPG currently? If not, where do I file an
RFE, or submit a patch?
Thanks,
--
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...
Attachments:
signature.asc (application/pgp-signature, 231B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Connection Error message in ECPG
2003-02-08 19:50 Connection Error message in ECPG Matthew Vanecek <mevanecek@yahoo.com>
@ 2003-02-10 12:44 ` Michael Meskes <meskes@postgresql.org>
2003-02-11 04:50 ` Re: Connection Error message in ECPG Matthew Vanecek <mevanecek@yahoo.com>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Meskes @ 2003-02-10 12:44 UTC (permalink / raw)
To: Matthew Vanecek <mevanecek@yahoo.com>; +Cc: pgsql-interfaces
On Sat, Feb 08, 2003 at 01:50:38PM -0600, Matthew Vanecek wrote:
> What would it take to get a better error message out of the ECPG
> interface, when a connection fails? It uses PQstatus(conn) to check the
> status, but it doesn't use PQerrorMessage(conn) to get the error from
> the backend and string it into sqlca.sqlerrm.sqlerrmc. Is there a way
> to get that message from ECPG currently? If not, where do I file an
No, you're completely right.
> RFE, or submit a patch?
The RFE has been noted, a patch can be send to me or any other committer
of course, but I'd prefer you send it directly to me, so I can remove it
from my todo list.
Michael
--
Michael Meskes
Email: Michael@Fam-Meskes.De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Connection Error message in ECPG
2003-02-08 19:50 Connection Error message in ECPG Matthew Vanecek <mevanecek@yahoo.com>
2003-02-10 12:44 ` Re: Connection Error message in ECPG Michael Meskes <meskes@postgresql.org>
@ 2003-02-11 04:50 ` Matthew Vanecek <mevanecek@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Matthew Vanecek @ 2003-02-11 04:50 UTC (permalink / raw)
To: Michael Meskes <meskes@postgresql.org>; +Cc: pgsql-interfaces
On Mon, 2003-02-10 at 06:44, Michael Meskes wrote:
> On Sat, Feb 08, 2003 at 01:50:38PM -0600, Matthew Vanecek wrote:
> > What would it take to get a better error message out of the ECPG
> > interface, when a connection fails? It uses PQstatus(conn) to check the
> > status, but it doesn't use PQerrorMessage(conn) to get the error from
> > the backend and string it into sqlca.sqlerrm.sqlerrmc. Is there a way
> > to get that message from ECPG currently? If not, where do I file an
>
> No, you're completely right.
>
> > RFE, or submit a patch?
>
> The RFE has been noted, a patch can be send to me or any other committer
> of course, but I'd prefer you send it directly to me, so I can remove it
> from my todo list.
>
May I say, "ARGH!". I'm spoiled by DB2, with short simple messages and
distinct error codes. I was working on a patch, but there's absolutely
no way to predict the size of the PQerrorMessage() message, and I hate
to send out a truncated error message. :(
What may be a better idea is to provide a function (a la sqlprint) that
returns the error message the backend returns. The backend error
message would be stored in one field, and of course provide the same
guarantees that PQerrorMessage() does (i.e., this field is susceptible
to change without notice after an operation). That way, the -402
message stays the same, and interested programs could access the backend
error message after receiving a non-zero return code.
What would be really handy is if the back-end had a table of error codes
and matching strings it used (all less than 70 chars, of course!!),
instead of the nebulous CONNECTION_BAD, and hard-wired error messages...
Thanks for the reply. I'll try to work on the, oh, sqlerrmsg,
function. It should be relatively easy to implement.
What do you think?
--
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...
Attachments:
signature.asc (application/pgp-signature, 231B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-02-11 04:50 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-08 19:50 Connection Error message in ECPG Matthew Vanecek <mevanecek@yahoo.com>
2003-02-10 12:44 ` Michael Meskes <meskes@postgresql.org>
2003-02-11 04:50 ` Matthew Vanecek <mevanecek@yahoo.com>
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