Re: how can I check the error status?? - Mailing list pgsql-general

From Richard Huxton
Subject Re: how can I check the error status??
Date
Msg-id 444F2F41.5010908@archonet.com
Whole thread Raw
In response to how can I check the error status??  ("Luis Alberto Pérez Paz" <midriasis@gmail.com>)
List pgsql-general
Luis Alberto Pérez Paz wrote:
> Hi everybody!
>
> I'm migrating some sybase store procedures to postgres functions,
> I almost have found all that I need, however I dont know how to check the
> error status of the last transaction.
> I need to find in postgres the equivalent to the sybase @@error global
> variable.

If you're using pl/pgsql then you'll want to read the "Trapping Errors"
chapter of the manuals.

http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

--
   Richard Huxton
   Archonet Ltd


pgsql-general by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: Please comment on the following OpenFTS/tsearch2 issues!
Next
From: Hannes Dorbath
Date:
Subject: Cascade constraint renames?