agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Robert Patrick <Robert_Patrick@TIKA.NDIM.EDRC.CMU.EDU>
To: postgres@postgres.Berkeley.EDU
Subject: Re: How can i handle the error message?
Date: Wed, 08 Mar 1995 10:15:27 -0500
Message-ID: <199503081516.HAA11564@nobozo.CS.Berkeley.EDU> (raw)

>Hello...

>How can i get error message from backend use libpq library??

>I make some program use libpq lib. Then i have some problem.
>Backend returns error message when a query failed ..
>i guess backend send message through STDERR.
>however I would like to handle messages ..
>How can i do it??

There is a description of how to handle errors in the libpq section of the 
Postgres reference manual.  Basically, the first character of the string 
returned from PQexec() gives the return status of the function call (E and R 
are errors).  When an error occurs, the error message is stored in PQerrormsg.

You might take a look at bin/monitor/monitor.c in the Postgres source tree for 
an example of the proper way to handle errors.

Robert

--
+------------------------------------------------------------------------+
| Robert Patrick (rp2y+@edrc.cmu.edu) Engineering Design Research Center |
| n-dim Group                                 Carnegie Mellon University |
| World Wide Web: http://paneer.ndim.edrc.cmu.edu:8888/~rp2y/Home.html   |
+------------------------------------------------------------------------+













==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: Robert_Patrick@TIKA.NDIM.EDRC.CMU.EDU
  Subject: Re: How can i handle the error message?
  In-Reply-To: <199503081516.HAA11564@nobozo.CS.Berkeley.EDU>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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