Re: PL/pgSQL, RAISE and error context - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: PL/pgSQL, RAISE and error context
Date
Msg-id 5214B9D0.9000409@joh.to
Whole thread Raw
In response to PL/pgSQL, RAISE and error context  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On 8/21/13 2:28 PM, I wrote:
> By default, PL/pgSQL does not print the error context of a RAISE
> statement, for example:

An even worse example:

=# create function foof() returns void as $$ begin raise exception 
'foo'; end $$ language plpgsql;
CREATE FUNCTION

=# create function barf() returns void as $$ declare _ record; begin for 
_ in execute 'select foof()' loop end loop; end $$ language plpgsql;
CREATE FUNCTION

=# select barf();
ERROR:  foo
CONTEXT:  PL/pgSQL function "barf" line 1 at FOR over EXECUTE statement

Notice how there's no mention at all about the function the error came 
from, and compare that to:

=# select barf();
ERROR:  foo
CONTEXT:  PL/pgSQL function "foof" line 1 RAISE
PL/pgSQL function "barf" line 1 at FOR over EXECUTE statement



Regards,
Marko Tiikkaja



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL, RAISE and error context
Next
From: Tom Lane
Date:
Subject: Re: CAST Within EXCLUSION constraint