pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaime Casanova <systemguards@gmail.com>
To: renneyt@yahoo.com <renneyt@yahoo.com>
Cc: postgres <pgsql-admin@postgresql.org>
Subject: Re: PLPGSQL/EXCEPTION HANDLING
Date: Tue, 13 Jun 2006 21:49:44 -0500
Message-ID: <c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com> (raw)
In-Reply-To: <448EC40A.5020102@yahoo.com>
References: <448E453D.3080207@yahoo.com>
	<c2d9e70e0606122210m7965cc7ctda2e39b5e3738806@mail.gmail.com>
	<448EC40A.5020102@yahoo.com>

On 6/13/06, renneyt@yahoo.com <renneyt@yahoo.com> wrote:
> Jaime Casanova wrote:
> > On 6/12/06, renneyt@yahoo.com <renneyt@yahoo.com> wrote:
> >> In a function implemented in 7.4.8 I had the following error when I call
> >> the function:
> >>
> >> ERROR:  syntax error at or near "EXCEPTION"
> >>
> >> Offending line is:
> >>     EXCEPTION WHEN dup_val_on_index THEN NULL;
> >>
> >> When this line is removed, all is well.
> >>
> >
> > that's because that construction was added in 8.0, you have to upgrade
> > to use it
> >
> What part of the original  construction is  not supported?
> Are any "exception when" statements supported?
>

all the BEGIN .. EXCEPTION block:

[ <<label>> ]
[ DECLARE
    declarations ]
BEGIN
    statements
EXCEPTION
    WHEN condition [ OR condition ... ] THEN
        handler_statements
    [ WHEN condition [ OR condition ... ] THEN
          handler_statements
      ... ]
END;


all you can do until 7.4.x was:
http://www.postgresql.org/docs/7.4/static/plpgsql-errors-and-messages.html

-- 
Atentamente,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook



view thread (4+ messages)

Message-ID: <c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com>
Permalink:  ../c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com/
Also on:    postgresql.org/message-id/c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: systemguards@gmail.com, renneyt@yahoo.com
  Subject: Re: PLPGSQL/EXCEPTION HANDLING
  In-Reply-To: <c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com>
  References: <448E453D.3080207@yahoo.com> <c2d9e70e0606122210m7965cc7ctda2e39b5e3738806@mail.gmail.com> <448EC40A.5020102@yahoo.com> <c2d9e70e0606131949g75cd3fear3596c06b6ace5cb1@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox