Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3Zed-000438-Fb for pgsql-general@arkaria.postgresql.org; Tue, 21 Jun 2022 08:54:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o3Zec-0007AR-7k for pgsql-general@arkaria.postgresql.org; Tue, 21 Jun 2022 08:54:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3Zeb-00079x-Th for pgsql-general@lists.postgresql.org; Tue, 21 Jun 2022 08:54:33 +0000 Received: from 3.mo584.mail-out.ovh.net ([46.105.57.129]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3Zea-00088W-7W for pgsql-general@lists.postgresql.org; Tue, 21 Jun 2022 08:54:33 +0000 Received: from player796.ha.ovh.net (unknown [10.111.208.48]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 5A9EF24E4D for ; Tue, 21 Jun 2022 08:54:30 +0000 (UTC) Received: from darold.net (lfbn-lyo-1-666-165.w90-119.abo.wanadoo.fr [90.119.236.165]) (Authenticated sender: gilles@darold.net) by player796.ha.ovh.net (Postfix) with ESMTPSA id 5F8A22BBFCFF0; Tue, 21 Jun 2022 08:54:28 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-99G0032211a61e-e73c-41e2-95c9-9388cfaed18e, 74B203C135D513A8DA1A59687111D243D3864AC2) smtp.auth=gilles@darold.net X-OVh-ClientIp: 90.119.236.165 Content-Type: multipart/alternative; boundary="------------8Wqo6uKqIH8XmK3jysf7Vl0f" Message-ID: Date: Tue, 21 Jun 2022 10:54:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: Jagmohan Kaintura Cc: "pgsql-generallists.postgresql.org" References: From: Gilles Darold Subject: Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL In-Reply-To: X-Ovh-Tracer-Id: 9747196971474853593 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrudeffedgtdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptgfkffggfgfvvehfhffujgesrgdtreertdefjeenucfhrhhomhepifhilhhlvghsucffrghrohhlugcuoehgihhllhgvshesuggrrhholhgurdhnvghtqeenucggtffrrghtthgvrhhnpeeludegieffteeghffggfeffefhtedtkeegffdugeejhffhkefhjeejuefhleefheenucffohhmrghinhepuggrrhholhgurdhnvghtnecukfhppedtrddtrddtrddtpdeltddrudduledrvdefiedrudeiheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeeliedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehgihhllhgvshesuggrrhholhgurdhnvghtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdfovfetjfhoshhtpehmohehkeeg List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------8Wqo6uKqIH8XmK3jysf7Vl0f Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 21/06/2022 à 10:28, Jagmohan Kaintura a écrit : > Hi Gilles, > > I was going though this earlier today but didn't compiled it as I read > it may not be able to capture the errors if we have below type of > statement and most of our statements are of INSERT .. > SELECT statements only. > > The form |INSERT INTO SELECT ...| will not have the same > behavior than in Oracle. It will not stored the successful insert and > logged the rows in error. This is not supported because it is a single > transaction for PostgreSQL and everything is rolled back in case of error. > > Our all statements are of that form will it be still useful. Right, this was not obvious in your post, but yes if you are using INSERT + SELECT this is not possible with the current version of this extension. Maybe that could be possible by rewriting internally the query to loop over the result of the select and generate an insert per row returned, but with performances lost of courses. Best regards, -- Gilles Darold http://www.darold.net/ --------------8Wqo6uKqIH8XmK3jysf7Vl0f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Le 21/06/2022 à 10:28, Jagmohan Kaintura a écrit :
Hi Gilles,

I was going though this earlier today but didn't compiled it as I read it may not be able to capture the errors if we have below type of statement and most of our statements are of INSERT .. SELECT statements only.

The form INSERT INTO <tablename> SELECT ... will not have the same behavior than in Oracle. It will not stored the successful insert and logged the rows in error. This is not supported because it is a single transaction for PostgreSQL and everything is rolled back in case of error.

Our all statements are of that form will it be still useful.


Right, this was not obvious in your post, but yes if you are using INSERT + SELECT this is not possible with the current version of this extension. Maybe that could be possible by rewriting internally the query to loop over the result of the select and generate an insert per row returned, but with performances lost of courses.


Best regards,

-- 
Gilles Darold
http://www.darold.net/
--------------8Wqo6uKqIH8XmK3jysf7Vl0f--