Re: User's exception plpgsql - Mailing list pgsql-patches

From Neil Conway
Subject Re: User's exception plpgsql
Date
Msg-id 42E5D178.8020404@samurai.com
Whole thread Raw
In response to Re: User's exception plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Those cases are for places where the spec defines similar cases under
> the error classes "SQL Routine Exception" and "External Routine Exception".
> You can blame me for having assumed that plpgsql didn't need to
> distinguish these cases.

Well, in and of itself, I agree it is probably better to combine similar
SQLSTATEs into a single logical condition. However, considering the
problem it poses for implementing RAISE with builtin condition names,
IMHO it would be a net win to get rid of it, if we can't find a better
solution.

> So I see no backwards-compatibility argument that we can't change
> this.  How would you want to do it better?

I would just change the mapping from condition names to SQLSTATEs to be
one-to-one. If a client application does need to trap multiple SQLSTATEs
for a logically similar condition, they can always specify "WHEN x OR y
OR ..."

-Neil

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: User's exception plpgsql
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: [HACKERS] Autovacuum loose ends