here is the test case
CREATE OR REPLACE FUNCTION func() RETURNS int as $$
BEGIN
RAISE EXCEPTION 'ex -----';
EXCEPTION
WHEN OTHERS THEN
RAISE INFO 'sql error msg %',sqlerrm;
DECLARE
v_msg VARCHAR(200) := sqlerrm;
BEGIN
RAISE INFO 'sql error msg %',sqlerrm; -- it show's <NULL>
RAISE INFO 'sql error v_msg %',v_msg; -- it show's <NULL>
ENd;
RETURN 0;
END;
$$ LANGUAGE plpgsql;
Regards,
--Asif
On 2/8/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Asif Ali" <asifalirehman@gmail.com> writes:
> > your patch fixes the crash but instead of displaying the sqlerrm value,
> it
> > is displaying <NULL> in
> > pl block, declared inside exception block.
>
> Hm, not what I see here. Could you submit a test case that does that?
>
> regards, tom lane
>
--
Regards,
--Asif Ali Rehman