Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA10467; Tue, 21 Jul 92 10:39:58 -0700
Message-Id: <9207211739.AA10467@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: error
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Fri, 17 Jul 92 16:47:31 EDT."
             <9207172056.AA00055@postgres.Berkeley.EDU> 
Date: Tue, 21 Jul 92 10:38:36 PDT

you write:
> --------
> Is there a way to capture errors in postgres?
> 
> eg:Error: tuple index 0 out of bound.
> can I capture the above error message and customize it for my
> program?

In version 4 error messages are put into the global variable PQerrormsg.
Unfortunately, there currently isn't a means by which you can turn off
printing them to stderr.  There are only a few places in libpq where this
happens.  It wouldn't be very difficult to change them so that they print
only when some global (e.g. PGsilent) is set to 0.  The source code for
libpq can be found in $POSTGRESHOME/src/lib/libpq.


Jeff Meredith
mer@postgres.berkeley.edu
