Re: how can I check the error status??

From: Richard Huxton <dev(at)archonet(dot)com>
To: Luis Alberto Pérez Paz <midriasis(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how can I check the error status??
Date: 2006-04-26 08:28:49
Message-ID: 444F2F41.5010908@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2006-04-26 08:40:46 Cascade constraint renames?
Previous Message Teodor Sigaev 2006-04-26 07:17:26 Re: Please comment on the following OpenFTS/tsearch2 issues!