I wrote:
> Curiously, the behavior doesn't seem to be totally consistent --- when I
> run the same case again, I get an additional line of context:
> regression=# select f2();
> NOTICE: SQL statement "SELECT 1/0"
> PL/pgSQL function f1() line 5 at assignment
> PL/pgSQL function f2() line 3 at RETURN
> CONTEXT: PL/pgSQL function f2() line 3 at RETURN
> f2
> ----
> 0
> (1 row)
> That seems like a bug ...
FYI, a fix for this has been committed and will be in 9.2.3.
The code will now consistently include that first line of context.
regards, tom lane