Re: [HACKERS] "stored procedures"

2013-04-16 Thread aasat
Is "stored procedures" planned in future? I think is a "most missing" future
today in Postgres.

Using a dblink to emulate commit in transaction is very complicated




--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/stored-procedures-tp4331060p5752274.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Access Error Details from PL/pgSQL

2012-02-21 Thread aasat
I have question. GET STACKED DIAGNOSTICS work only in exception block? is it
posible to use it in separate function called in exception block?


EXCEPTION 
  WHEN others THEN
peform log_error();
END;

CREATE OR REPLACE FUNCTION log_error()
  RETURNS boolean AS
$BODY$
declare
v_state   TEXT;
v_msg TEXT;
v_detail  TEXT;
v_hintTEXT;
v_context TEXT;
begin

  GET 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;
$BODY$
LANGUAGE plpgsql VOLATILE;



--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Access-Error-Details-from-PL-pgSQL-tp5479926p5501584.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers