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

From Luis Alberto Pérez Paz
Subject how can I check the error status??
Date
Msg-id 7f64980c0604251038t2bfeb4bbmf4d0e909f16d2d1f@mail.gmail.com
Whole thread Raw
Responses Re: how can I check the error status??  (Richard Huxton <dev@archonet.com>)
List 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)

pgsql-general by date:

Previous
From: Bill Moseley
Date:
Subject: Re: Anyone install 8.1 on Debian Stable?
Next
From: Gavin Hamill
Date:
Subject: Re: Anyone install 8.1 on Debian Stable?