> and maybe the short-term cheesy thing to do is special-case exactly this
> syntax:
> 
>       RAISE LEVEL [ SQLSTATE(text_expr), ] text_expr [, ... ]
> 
> which would give us the minimum functionality with a clear path to
> expansion later.
> 
or only RAISE LEVEL SQLSTATE(text_expr)|text_expr [, ...]

if I use registered sqlstate, plpgsql knows text message. But I think this 
syntax has more questions than exception's variables. It's really problem 
declare one exceptio's variable? It's similar like using constant 
variables or magic values.

Pavel

DECLARE not_money EXCEPTION=SQLSTATE('U1101');
BEGIN
  IF account < 0 THEN
    RAISE EXCEPTION not_money;
  ...

or 

BEGIN
  IF account < 0 THEN
    RAISE SQLSTATE ('U1101') 'Not money'; 



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to