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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -