From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wael Khobalatte <wael@vendr.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Persistent changes in rolled-back transactions
Date: Wed, 09 Nov 2022 22:42:47 -0500
Message-ID: <78833.1668051767@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJZ8yobSeSs8b28jzH5P4=OGvntPNxPyu_PsNWKm4De2E_WTjg@mail.gmail.com>
References: <CAOC+FBX=usM8nj_TavDgrBW0kQYpC2Ubg97qShGQ4c4m33NFXQ@mail.gmail.com>
<CAJZ8yoZvQ7C5j6d+HnQ4aj=nq0R1LA_mLwKcFNcN2yJc=YxWFQ@mail.gmail.com>
<CAOC+FBX2DWpgb-Ny3Y5yEFGftXX2_wZNG1W3XePa7oRAMxP1Rg@mail.gmail.com>
<CAKFQuwYScf5K8TJ80C4iohDPdyKrjDNbPqwHTNn-xu=kgUtjWQ@mail.gmail.com>
<CAJZ8yobSeSs8b28jzH5P4=OGvntPNxPyu_PsNWKm4De2E_WTjg@mail.gmail.com>
Wael Khobalatte <wael@vendr.com> writes:
>> Why do you say truncate is non-transactional? Something simple proves
>> that it's not?
> Right, I meant 'non-transactional' in the sense that "persisted changes" as
> you quoted them will also appear in the case of Truncate (MVCC-safety is
> more correct here).
Yeah, TRUNCATE will cause MVCC anomalies, in that data will disappear
although it should still be visible to other transactions running with
pre-TRUNCATE snapshots. Another thing TRUNCATE does that's not very
kosher is to skip running ON DELETE triggers. If you don't like these
things, use "DELETE FROM table" instead --- much slower, but no shortcuts.
Sequences are the same sort of animal, in that they give up some
transactional guarantees for performance reasons.
For that matter, every transaction isolation level below full
SERIALIZABLE represents a performance-vs-semantic-guarantees tradeoff.
I can't offhand think of any more examples within Postgres, but I
probably haven't thought long enough.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, wael@vendr.com, david.g.johnston@gmail.com, wells.oliver@gmail.com
Subject: Re: Persistent changes in rolled-back transactions
In-Reply-To: <78833.1668051767@sss.pgh.pa.us>
* 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