Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YGWka-00011C-5G for pgsql-sql@arkaria.postgresql.org; Wed, 28 Jan 2015 17:50:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YGWkZ-0000Oy-Kn for pgsql-sql@arkaria.postgresql.org; Wed, 28 Jan 2015 17:49:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YGWkX-0000Lw-V7 for pgsql-sql@postgresql.org; Wed, 28 Jan 2015 17:49:58 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YGWkU-0007BS-Dt for pgsql-sql@postgresql.org; Wed, 28 Jan 2015 17:49:55 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 6AF91120A584 for ; Wed, 28 Jan 2015 09:49:54 -0800 (PST) Date: Wed, 28 Jan 2015 10:49:52 -0700 (MST) From: ciamblex To: pgsql-sql@postgresql.org Message-ID: <1422467392779-5835817.post@n5.nabble.com> In-Reply-To: <1422445747001-5835771.post@n5.nabble.com> References: <1422445747001-5835771.post@n5.nabble.com> Subject: Re: How to insert in a table the error returns by query MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.0 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org 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.html 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