how can I check the error status??

From: Luis Alberto Pérez Paz <midriasis(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: how can I check the error status??
Date: 2006-04-25 17:38:24
Message-ID: 7f64980c0604251038t2bfeb4bbmf4d0e909f16d2d1f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

I mean, how can I translate this code in a postgres function?:

insert into table (a,b,c) values (1,2,3)
if (@@error =0)
return 0
else
return -900

Any advices?

thanks in advance!

Luis Paz.

--
paz, amor y comprensión
(1967-1994)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gavin Hamill 2006-04-25 17:58:20 Re: Anyone install 8.1 on Debian Stable?
Previous Message Bill Moseley 2006-04-25 17:06:12 Re: Anyone install 8.1 on Debian Stable?