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 1o3YS4-0001I2-Nz for pgsql-general@arkaria.postgresql.org; Tue, 21 Jun 2022 07:37:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o3YS2-0000m4-S0 for pgsql-general@arkaria.postgresql.org; Tue, 21 Jun 2022 07:37:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3YS2-0000ls-7i for pgsql-general@lists.postgresql.org; Tue, 21 Jun 2022 07:37:30 +0000 Received: from 7.mo550.mail-out.ovh.net ([87.98.158.110]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3YRy-0002Hd-TK for pgsql-general@lists.postgresql.org; Tue, 21 Jun 2022 07:37:28 +0000 Received: from player696.ha.ovh.net (unknown [10.109.143.208]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 29A0D2023D for ; Tue, 21 Jun 2022 07:37:22 +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 player696.ha.ovh.net (Postfix) with ESMTPSA id 5497E219FAB97; Tue, 21 Jun 2022 07:37:21 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-108S002ad3993fc-ab93-431d-98c4-c75b8f352ee9, 74B203C135D513A8DA1A59687111D243D3864AC2) smtp.auth=gilles@darold.net X-OVh-ClientIp: 90.119.236.165 Content-Type: multipart/alternative; boundary="------------LS6JoZRPMRmch88v0mcHDPFt" Message-ID: Date: Tue, 21 Jun 2022 09:37:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL Content-Language: fr To: Jagmohan Kaintura , "pgsql-generallists.postgresql.org" References: From: Gilles Darold In-Reply-To: X-Ovh-Tracer-Id: 8444812252926680793 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrudefvddguddukecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertdefjeenucfhrhhomhepifhilhhlvghsucffrghrohhlugcuoehgihhllhgvshesuggrrhholhgurdhnvghtqeenucggtffrrghtthgvrhhnpedvueegveetfeegleelhedvjeefhffhuddtfeffteeuueegfeevleegvefhvedtjeenucffohhmrghinhepghhithhhuhgsrdgtohhmpdgurghrohhlugdrnhgvthenucfkpheptddrtddrtddrtddpledtrdduudelrddvfeeirdduieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheileeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepghhilhhlvghssegurghrohhlugdrnhgvthdpnhgspghrtghpthhtohepuddprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdpoffvtefjohhsthepmhhoheehtd 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. --------------LS6JoZRPMRmch88v0mcHDPFt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 21/06/2022 à 09:08, Jagmohan Kaintura a écrit : > Hi Team, > We are working on a project where we are moving from Oracle to > PostgreSQL and working on a migration tool which mostly have > statements for inserting the records which are correct and logging the > errors in error table using ORACLE inbuilt statement for INSERT ALL > with DML ERROR logging. > > As part of the postgresql best practices, what approach are we taking > to move these types of statements in Postgresql as we don't have any > such equivalent mechanism to load correct data in the main table and > error record in error table with error reason. > > The statements mostly used are --> > INSERT ALL INTO > target_table > (COLUMN LIST) > VALUES() > LOG ERROR INTO ... > SELECT statement considering the source tables; > > ) > Can anyone please help me with what could be the best approach to > convert this in the tool. > > -- > *Best Regards,* > Jagmohan Hi, Maybe what you are looking for is here https://github.com/MigOpsRepos/pg_dbms_errlog , this is a PostgreSQL extension that emulates the DBMS_ERRLOG Oracle package. Best regards, -- Gilles Darold http://www.darold.net/ --------------LS6JoZRPMRmch88v0mcHDPFt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Le 21/06/2022 à 09:08, Jagmohan Kaintura a écrit :
Hi Team,
We are working on a project where we are moving from Oracle to PostgreSQL and working on a migration tool which mostly have statements for inserting the records which are correct and logging the errors in error table using ORACLE inbuilt statement for INSERT ALL with DML ERROR logging. 

As part of the postgresql best practices, what approach are we taking to move these types of statements in Postgresql as we don't have any such equivalent mechanism to load correct data in the main table and error record in error table with error reason. 

The statements mostly used are -->
INSERT ALL INTO
target_table
(COLUMN LIST)
VALUES()
LOG ERROR INTO ...
SELECT statement considering the source tables;

)
Can anyone please help me with what could be the best approach to convert this in the tool.

--
Best Regards,
Jagmohan 


Hi,


Maybe what you are looking for is here https://github.com/MigOpsRepos/pg_dbms_errlog , this is a PostgreSQL extension that emulates the DBMS_ERRLOG Oracle package.


Best regards,

-- 
Gilles Darold
http://www.darold.net/
--------------LS6JoZRPMRmch88v0mcHDPFt--