Search Postgresql Archives

Re: SQL state: 42601. Execption handling.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



=?UTF-8?B?0KY=?= <pfunk@xxxxxxx> writes:
> -- 2 -- 
> do  $$ 
> begin  
>    select  p.result  from  dbo.func() p  into  v_result; 
> exception   when  SQLSTATE  '42601'   then
>      raise   '42601' ;
>    when   others   then  
>      raise   'others' ; 
> end ;
> $$
>  
> --Exception is not handled. This is the question.
> ERROR:   "v_result"   is   not  a known variable
> LINE  3 :    select  p.result  from  dbo.func() p  into  v_result;

This error is thrown by the plpgsql parser, so you can't trap it
with "exception", any more than you could trap other syntax errors
detected by the parser.  (As an extreme example, you could certainly
not trap it if you misspelled "exception".)

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux