Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTfJ5-0008Qv-Mj for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2019 04:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hTfJ4-000312-Ag for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2019 04:26:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTfJ3-0002xy-VD for pgsql-general@lists.postgresql.org; Thu, 23 May 2019 04:26:17 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTfJ1-0006ng-40 for pgsql-general@postgresql.org; Thu, 23 May 2019 04:26:17 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 77A81A271A; Thu, 23 May 2019 06:26:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id qQCx4Bq65z_L; Thu, 23 May 2019 06:25:36 +0200 (CEST) Message-ID: <54f2f1f00aca3fed9e81b4f370c7e90192bc5062.camel@cybertec.at> Subject: Re: distinguish update from insert (on conflict) From: Laurenz Albe To: Justin Pryzby , pgsql-general@postgresql.org Date: Thu, 23 May 2019 06:25:34 +0200 In-Reply-To: <20190522013428.GG4426@telsasoft.com> References: <20190522013428.GG4426@telsasoft.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Justin Pryzby wrote: > Is it still impossible to distinguish whether a row was inserted vs updated ? > > The latest I can see is here: > https://wiki.postgresql.org/wiki/UPSERT#RETURNING_behavior > > ..but I'm hopeful that the 4 year old wiki page is out of date. Maybe this answer can help you: https://stackoverflow.com/a/39204667/6464308 Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com