Re: Tuples inserted and deleted by the same transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Nikita Malakhov <hukutoc(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Tuples inserted and deleted by the same transaction
Date: 2022-09-13 13:45:24
Message-ID: 2031521.1663076724@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> But once they are deleted or updated, even the transaction that created them cannot
> see them any more, right?

I would not trust that claim very far. The transaction might have active
snapshots with a command ID between the times of insertion and deletion.
(Consider a query that is firing triggers as it goes, and the triggers
are performing new actions that cause the command counter to advance.
The outer query should not see the results of those actions.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2022-09-13 14:00:48 Re: is_superuser is not documented
Previous Message Ranier Vilela 2022-09-13 13:21:22 Avoid redudant initialization and possible memory leak (src/backend/parser/parse_relation.c)