Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Ron Johnson
On Mon, May 20, 2024 at 11:54 AM Christophe Pettus wrote: > > > > On May 20, 2024, at 08:49, PetSerAl wrote: > > Basically, you need application cooperation to make > > consistent live database backup. > > If it is critical that you have a completely consistent backup as of a > particular point

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Christophe Pettus
> On May 20, 2024, at 08:49, PetSerAl wrote: > Basically, you need application cooperation to make > consistent live database backup. If it is critical that you have a completely consistent backup as of a particular point in time, and you are not concerned about restoring to a different proc

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread PetSerAl
> However, it would be the very same > database state that any other query would see at that time. Other queries can use different techniques to prevent this. For example, lock tables before snapshot, as recommended in documentation. I understand, that pg_dump can not use that, as it need snapshot

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Tom Lane
PetSerAl writes: > My question: > What happens if not MVCC-safe command committed after snapshot but before > lock? Then you'd get a dump that's not exactly consistent with the state at the time of the snapshot. However, it would be the very same database state that any other query would see at

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread PetSerAl
My question: What happens if not MVCC-safe command committed after snapshot but before lock? On Mon, May 20, 2024 at 12:33 PM Guillaume Lelarge wrote: > > Hi, > > Le lun. 20 mai 2024 à 11:27, PetSerAl a écrit : >> >> How pg_dump interact with not MVCC-safe commands? >> >> As I understand, pg_dum

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Guillaume Lelarge
Hi, Le lun. 20 mai 2024 à 11:27, PetSerAl a écrit : > How pg_dump interact with not MVCC-safe commands? > > As I understand, pg_dump first take snapshot and then lock all tables > it intended to dump. What happens if not MVCC-safe command committed > after snapshot but before lock? From comment

pg_dump and not MVCC-safe commands

2024-05-20 Thread PetSerAl
How pg_dump interact with not MVCC-safe commands? As I understand, pg_dump first take snapshot and then lock all tables it intended to dump. What happens if not MVCC-safe command committed after snapshot but before lock? From comment to pg_dump.c I understand that it may fail with 'cache lookup fa