Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing pg_dump while still many active transaction

As subjects, what will happen to the backup file while there is still many active transaction in the database. Does it export realtime or just partially backups ?

thanks in advance.

like image 603
Brain90 Avatar asked Oct 22 '10 09:10

Brain90


2 Answers

pg_dump runs in a serializable transaction, so it sees a consistent snapshot of the database including system catalogs.

However it is possible to get 'cache lookup failed' error if someone performs DDL changes while a dump is starting. The time window for this sort of thing isn't very large, but it can happen. See: http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php

like image 117
mnencia Avatar answered Sep 22 '22 17:09

mnencia


pg_dump will give you a consistent state. Any transaction not completed before pg_dump has been issued will not be reflected.

like image 21
knitti Avatar answered Sep 18 '22 17:09

knitti