ciamblex wrote > I need to save in a table the error code (SQLSTATE) and the error message > (SQLERRM) returned by an insert or an update. My procedure must execute an > insert, and if an error occurs, it must be saved into an apposite table. > > But the problem is that if I use the EXCEPTION BLOCK, when an error occurs > the transaction is aborted and any command after cannot be execute. > > How can I save the error returned by a query in a table, using PLPGSQL??? > > Thanks The typical solution seems to be to use dblink to open an independent session that is not affected by rollback when the main session cronks. I'm not sure if FDWs work for this purpose... David J. -- View this message in context: http://postgresql.nabble.com/How-to-insert-in-a-table-the-error-returns-by-query-tp5835771p5835803.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера