Re: Duplicate key error

From: Andrus <kobruleht2(at)hot(dot)ee>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Duplicate key error
Date: 2021-03-03 19:59:29
Message-ID: abc069b9-5e92-b461-f215-68ad67a533b6@hot.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!
>
> And if that name already exists there would be a duplicate key error.

Name cannot exist:  First delete deletes its value. Tables are not
changed by external process during transaction. As double insurance,
insert perfoms additional existence check and adds only if key does not
exist.

>Last inserted row data should remain.
>
> I'm not understanding the above.

This table should contain last login time, user and ip address. It
should be updated by every process on login. For this old entry is
removed if it exists and new entry with same primary key is added.

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2021-03-03 20:02:08 Re: Duplicate key error
Previous Message Boris Epstein 2021-03-03 19:40:06 Re: Code of Conduct: Russian Translation for Review