Re: lifetime of the old CTID

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: lifetime of the old CTID
Date: 2022-07-06 13:53:54
Message-ID: 20220706135354.e7nxo2vyrxwqlkce@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2022-07-06 14:26:00 +0200, Matthias Apitz wrote:
> DB layer must LOCK the row for update. It does so using the CTID. Of
> course there is a key in the row (d01gsi, the signature of the book),
> but this is not uniqu and can't be used to lock exactly this row for
> update.

If it isn't unique it is *not* a key. If your tables don't have a
primary key you should seriously rethink the data model.

hp

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2022-07-06 14:32:08 Re: ADD COLUMN ts tsvector GENERATED too slow
Previous Message Alvaro Herrera 2022-07-06 12:32:48 Re: lifetime of the old CTID