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 1k5tYY-0002jA-V1 for pgsql-general@arkaria.postgresql.org; Wed, 12 Aug 2020 16:24:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5tYX-0007gS-Re for pgsql-general@arkaria.postgresql.org; Wed, 12 Aug 2020 16:24:49 +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 1k5tYX-0007gH-K3 for pgsql-general@lists.postgresql.org; Wed, 12 Aug 2020 16:24:49 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5tYU-00035M-AN for pgsql-general@postgresql.org; Wed, 12 Aug 2020 16:24:48 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 5394D20532C6C for ; Wed, 12 Aug 2020 09:24:44 -0700 (MST) Date: Wed, 12 Aug 2020 09:24:44 -0700 (MST) From: pinker To: pgsql-general@postgresql.org Message-ID: <1597249484340-0.post@n3.nabble.com> In-Reply-To: <8723a4ce-ee04-a52a-1ac7-eb4226b52712@aklaver.com> References: <1597242184038-0.post@n3.nabble.com> <8723a4ce-ee04-a52a-1ac7-eb4226b52712@aklaver.com> Subject: Re: insert on conflict postgres returning distinction MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk thank you Adrian, the background of it is that I have already written the python script that translates Oracle MERGE clause to Postgres INSERT ... ON CONFLICT, but in order to be able to add DELETE part from MERGE i need to distinct those operations. thank you for the idea with trigger, i haven't thought about it at the beginning, but it does complicate the code a lot :/ not saying about performance... -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html