Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail From: "Laurenz Albe" Newsgroups: comp.databases.postgresql References: <8s6vvqFiv3U1@mid.uni-berlin.de> <8selq5Fv57U1@mid.uni-berlin.de> Subject: Re: sqlstate or messages in pltcl Date: Tue, 3 May 2011 09:20:30 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 Organization: dienste.wien.at ISP Message-ID: <1304407248.229356@proxy.dienste.wien.at> X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Lines: 26 NNTP-Posting-Host: 141.203.254.23 X-Trace: 1304407249 aconews.univie.ac.at 5640 141.203.254.23 X-Complaints-To: abuse@univie.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.databases.postgresql:108 M. Strobel wrote: >> I am looking for a way to get the database messages and sqlstate >> in pltcl, and I can't find it in the docs. >> >> Must be something like "pg_result $db -status" in pgtcl, >> or $stmt->errorInfo() in PHP. >> >> Is this information somewhere in the system tables? >> >> /Str. > > so nothing in the system catalogs? It cannot be in the system catalogs because it is not persistent. Unfortunately I know nothing about Tcl, but the manual says (for spi_exec): "An error in the command causes an error to be raised." So I guess you should catch that error and examine the information therein. It should contain the message, and maybe it also contains the SQLSTATE. Yours, Laurenz Albe