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 1lHrbN-0000ut-4W for pgsql-general@arkaria.postgresql.org; Thu, 04 Mar 2021 17:17:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHrbM-00017B-1q for pgsql-general@arkaria.postgresql.org; Thu, 04 Mar 2021 17:17:28 +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 1lHrbL-000173-QE for pgsql-general@lists.postgresql.org; Thu, 04 Mar 2021 17:17:27 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHrbJ-0007Bh-MO for pgsql-general@postgresql.org; Thu, 04 Mar 2021 17:17:27 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 1BC811D3E; Thu, 4 Mar 2021 19:17:24 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id evaAzgjl8IEY; Thu, 4 Mar 2021 19:17:21 +0200 (EET) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id CD82A1D2B; Thu, 4 Mar 2021 19:17:21 +0200 (EET) Subject: Re: Duplicate key error To: Adrian Klaver , pgsql-general@postgresql.org References: <5b68b4b3-b957-5009-cf3e-4bbc9dcbd0d9@aklaver.com> <97577cda-b3fa-4edb-1c8a-2b39afad65c6@hot.ee> <6a9dcf88-7b28-3b8f-0a1a-8a163f45a2a8@hot.ee> <6cdec299-a677-03c4-2c8e-36560e052c9e@aklaver.com> From: Andrus Message-ID: <8bd1ce20-a369-7adf-2bb5-20fb6742c232@hot.ee> Date: Thu, 4 Mar 2021 19:17:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <6cdec299-a677-03c4-2c8e-36560e052c9e@aklaver.com> Content-Type: multipart/alternative; boundary="------------BFE2A347508B363206474D5D" Content-Language: et 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. --------------BFE2A347508B363206474D5D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi! > Since we have not actually seen the entire script nor have any idea > what the other process is, there is no way to answer this. This is the same whole script. It will ran by multiple scheduled tasks, maybe at same time. It registers logged in user. Different processes may have same user name. In this case one row should remain. I can just ignore duplicate key error on commit but maybe there is some better way not to cause error. Andrus. --------------BFE2A347508B363206474D5D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi!


Since we have not actually seen the entire script nor have any idea what the other process is, there is no way to answer this.

This is the same whole script. It will ran by multiple scheduled tasks, maybe at same time.

It registers logged in user. Different processes may have same user name. In this case one row should remain.

I can just ignore duplicate key error on commit but maybe there is some better way not to cause error.

Andrus.


--------------BFE2A347508B363206474D5D--