Re: PROPOSAL - User's exception in PL/pgSQL - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: PROPOSAL - User's exception in PL/pgSQL
Date
Msg-id Pine.LNX.4.44.0506211932141.4872-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: PROPOSAL - User's exception in PL/pgSQL  (Neil Conway <neilc@samurai.com>)
Responses Re: PROPOSAL - User's exception in PL/pgSQL
List pgsql-hackers
On Sun, 19 Jun 2005, Neil Conway wrote:

> Pavel Stehule wrote:
> >     DECLARE excpt EXCEPTION [= 'SQLSTATE']
> 
> What would this default to? (i.e. if no '= SQLSTATE' is specified)

I wont to prohibit synonyms in exception (every exception has unique 
sqlstate). If I need better control for sqlstate - exception can leave one 
function I can specify own sql state. If I need only name, its unimportant 
sqlstate value.

> 
> > Rules:
> >  o User can specify SQLSTATE only from class 'U1' 
> >  o Default values for SQLSTATE usr excpt are from class 'U0'
> 

It's my idiot implentation uniques sqlstates. No more ;-)

> Can you elaborate on what you mean?
> 
> >  o Every exception's variable has unique SQLSTATE
> >  o User's exception or system's exception can be raised only with
> >    level EXCEPTION
> 
> It might be worth allowing a custom SQLSTATE to be specified for 
> non-exception RAISEs -- there are already WARNING SQLSTATE error codes 
> (see ERRCODE_WARNING).
> 

Hmm. True. Maybe:
 o System's exception can be raised with relevant level exception.

Regards
Pavel 



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Schedule for 8.1 feature freeze
Next
From: Dave Cramer
Date:
Subject: PROPOSAL FE/BE extension to handle IN/OUT parameters