pgadmin - PostgreSQL Exception handling detail with GET STACKED DIAGNOSTICS -


i using simple function exception handling code is..

create or replace function test(int4) returns void $$  declare      v_state   text;     v_msg     text;     v_detail  text;     v_hint    text;     v_context text; begin      begin         insert test2 (id) values ($1);     exception when others         stacked diagnostics             v_state   = returned_sqlstate,             v_msg     = message_text,             v_detail  = pg_exception_detail,             v_hint    = pg_exception_hint,             v_context = pg_exception_context;         raise notice e'got exception:             state  : %             message: %             detail : %             hint   : %             context: %', v_state, v_msg, v_detail, v_hint, v_context;     end;     return; end; $$ language plpgsql; 

but giving error: syntax error @ or near "stacked" stacked diagnostics .

i using postgresql 9.1 , pgadmin 3.

you need upgrade postgresql 9.2 ... 9.1 version doesn't support stacked diagnostics far know .


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -