Re: error handling - Mailing list pgsql-general

From Jasen Betts
Subject Re: error handling
Date
Msg-id js42ld$pv5$1@reversiblemaps.ath.cx
Whole thread Raw
In response to error handling  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
List pgsql-general
On 2012-06-20, Little, Douglas <DOUGLAS.LITTLE@orbitz.com> wrote:
> --_000_8585BA53443004458E0BAA6134C5A7FBADD4CD8CEGEXCMB01owwroo_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hello,
>
> Greenplum 4.1.2.4 (PG 8.2.3)
> We are revising how we implement functions in order to better capture and h=
> andle fatal errors.
>
> What we want to have happen,
>
> 1.       is to have the fatal error captured,
>
> 2.       logged to our processing table,
>
> 3.       then have the function & psql exit with a non-zero return code, in=
> forming Informatica of the process failure.

you're going to have to return the result as a string to the script
that calls psql and have that script generate the return code,


  retval=`psql -c "copy(select funcname('arg')) to stdout"`
  exit $retval


--
⚂⚃ 100% natural

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Feature discussion: Should syntax errors abort a transaction?
Next
From: Raghavendra
Date:
Subject: Re: row_to_json question