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 1maxbu-0007jX-DO for pgsql-general@arkaria.postgresql.org; Thu, 14 Oct 2021 10:05:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1maxbt-0001wn-Bv for pgsql-general@arkaria.postgresql.org; Thu, 14 Oct 2021 10:05:13 +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 1maxbt-0001h9-04 for pgsql-general@lists.postgresql.org; Thu, 14 Oct 2021 10:05:13 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maxbj-0001rx-Ap for pgsql-general@lists.postgresql.org; Thu, 14 Oct 2021 10:05:11 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id CA4AC57D9; Thu, 14 Oct 2021 12:04:59 +0200 (CEST) Date: Thu, 14 Oct 2021 12:04:59 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Duplicate key in UUID primary key index... Message-ID: Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hZhlUWO2CBlLziHJ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hZhlUWO2CBlLziHJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-10-14 03:02:08 +0000, Eric Tobias wrote: > I have a table with a UUID as the primary key field. I am using a procedu= re to > insert a parent and child record and using a UUID generated by an external > system (webhook). The UUID insert is generating a =E2=80=9Cduplicate key= =E2=80=9D error on > insert, but when I SELECT the uuid, nothing is returned. Are you perhaps trying to insert the same uuid twice in the same transaction? In this case the second insert would fail causing the whole transaction to fail and you would never see that uuid in another session. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --hZhlUWO2CBlLziHJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmFoAMsACgkQ8g5IURL+ KF0+DQ//Z2gzJJptuhlDfVURJQ1r62B8go66HUJWpAq5wcFDHD8e0B2KYG2SsIhz QQSRkiQBcq2fv1XiqenKRDlStVg0pCvZQOjhgf7o3Lig+gzo5S2zDF1eiouxUCLg WHsRqP1OSrm9siWiMybMuFqoTZAXP8cJaJIuycahfzfW2ZmUL+lfdn+BSlun4Y2c VFLmVcJUQAIomuAScOrCRhRuy8NhOWDhhVofVPbYTbb2NuNyfkVFYcGmgkzzPdQR fU64nnkEOJ1JncPOI1GY0qBgny0b4wNkUtpMsbMWpI/iRvp872VVRLNRIW4ZhyCc jmMMJ227wgO/Xi8/SgwH5mVeiBfpbJb95Cl3uwvaBy+g5KicLjm8afiEVVwRgRJ1 t82xMNg/1qY/sQ7GAfI4yp5ZpNO2DaGWKPrtNEiCvdbgj/xGdEiuQKiQAGghkqH+ iZnRJcHWkiuTLb7aej49hi7LFFarGnTJgLRv8V53oOPbOqiiW67OwIuV75fVE2IC u+Y4eURUjolKzL10+2ZnmBUIfUk2+Zjwx4usxhlDsedUmDyy2kaG5nQ7zaEQ9K2E RLB4qVkO10Pv3tgcHSbt19BRp0V0pVcL5W5eMjO1vgeKyRrt15WlAuIoam1dsSOr wqbjzAXXjxnSd24kflDwCRWPLwwOM6L/etCGM/bp8VcSVhASgQY= =+pgB -----END PGP SIGNATURE----- --hZhlUWO2CBlLziHJ--