Re: server crash: displaying sqlerrm in exception block

From: "Asif Ali" <asifalirehman(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: server crash: displaying sqlerrm in exception block
Date: 2007-02-08 15:17:50
Message-ID: c5110cc50702080717h49e73e28if11e47671cd24ed5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> "Asif Ali" <asifalirehman(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-02-08 15:37:39 Re: server crash: displaying sqlerrm in exception block
Previous Message Tom Lane 2007-02-08 14:54:05 Re: server crash: displaying sqlerrm in exception block