agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: ciamblex <gianluca.civiello@yahoo.it>
To: pgsql-sql@postgresql.org
Subject: Re: How to insert in a table the error returns by query
Date: Wed, 28 Jan 2015 10:49:52 -0700 (MST)
Message-ID: <1422467392779-5835817.post@n5.nabble.com> (raw)
In-Reply-To: <1422445747001-5835771.post@n5.nabble.com>
References: <1422445747001-5835771.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
Thank you David fot your replay.
I have an other question.
How can i rollback ALL the query when one of these return an error?
My code is like the following:
------------------------------------
BEGIN
INSERT INTO table_1 ....
INSERT INTO table_2 ....
INSERT INTO table_3 ....
EXCEPTION WHEN others THEN
code:=SQLSTATE;
mess:=SQLERRM;
es:=code||'|'||mess;
RETURN es;
END;
------------------------------------
In this case when an error occurs the rollback work only on the wrong query.
The other insert are committed.
Thank you!
--
View this message in context: http://postgresql.nabble.com/How-to-insert-in-a-table-the-error-returns-by-query-tp5835771p5835817.h...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (6+ messages) latest in thread
Message-ID: <1422467392779-5835817.post@n5.nabble.com>
Permalink: ../1422467392779-5835817.post@n5.nabble.com/
Also on: postgresql.org/message-id/1422467392779-5835817.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gianluca.civiello@yahoo.it
Subject: Re: How to insert in a table the error returns by query
In-Reply-To: <1422467392779-5835817.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox