Return-Path: owner-postman Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id HAA11574 for postgres-redist; Wed, 8 Mar 1995 07:16:15 -0800 Resent-From: POSTGRES mailing list Resent-Message-Id: <199503081516.HAA11574@nobozo.CS.Berkeley.EDU> X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from TIKA.NDIM.EDRC.CMU.EDU (TIKA.NDIM.EDRC.CMU.EDU [128.2.214.239]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id HAA11564 for ; Wed, 8 Mar 1995 07:16:15 -0800 Message-Id: <199503081516.HAA11564@nobozo.CS.Berkeley.EDU> Received: from LOCALHOST by TIKA.NDIM.EDRC.CMU.EDU id aa05377; 8 Mar 95 15:15 GMT X-Mailer: exmh version 1.6alpha 2/16/95 To: postgres@postgres.Berkeley.EDU Subject: Re: How can i handle the error message? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Mar 1995 10:15:27 -0500 From: Robert Patrick Resent-To: postgres-redist@postgres.Berkeley.EDU Resent-Date: Wed, 08 Mar 95 07:16:15 -0800 Resent-XMts: smtp >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/