2013/6/5 Erik Ande <Erik(dot)Ande(at)muthpartners(dot)de>
> @@error
Hi,
assuming:*
*
1. definition*: "**Returns an error number if the previous statement
encountered an error.*" by
http://msdn.microsoft.com/en-us/library/ms188790.aspx
2. last (? - maybe first) error in current transaction
3. You use plpgsql
You can use GET STACKED DIAGNOSTICS (
http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html#PLPGSQL-EXCEPTION-DIAGNOSTICS)
I think full BEGIN...EXCEPTION...END will do the work for you.
Regards,
Bartek