pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Duplicate key in UUID primary key index...
Date: Thu, 14 Oct 2021 12:04:59 +0200
Message-ID: <YWgAy3zeG2FOgPb2@hjp.at> (raw)
In-Reply-To: <MW3PR17MB418624B85780DDD44FE9E291DCB89@MW3PR17MB4186.namprd17.prod.outlook.com>
References: <MW3PR17MB418624B85780DDD44FE9E291DCB89@MW3PR17MB4186.namprd17.prod.outlook.com>

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 procedure to
> insert a parent and child record and using a UUID generated by an external
> system (webhook). The UUID insert is generating a “duplicate key” 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

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)  latest in thread

Message-ID: <YWgAy3zeG2FOgPb2@hjp.at>
Permalink:  ../YWgAy3zeG2FOgPb2@hjp.at/
Also on:    postgresql.org/message-id/YWgAy3zeG2FOgPb2@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Duplicate key in UUID primary key index...
  In-Reply-To: <YWgAy3zeG2FOgPb2@hjp.at>
  References: <MW3PR17MB418624B85780DDD44FE9E291DCB89@MW3PR17MB4186.namprd17.prod.outlook.com> <YWgAy3zeG2FOgPb2@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox