Victor Yegorov <viy@pirmabanka.lv> writes:
> One more thing. I still cannot find any info on HOW pg_dump locks data it
> is going to backup.
It doesn't. Well, it does take a reader's lock (AccessShareLock) on
each table it intends to back up, but that's essentially just preventing
the table from being dropped completely. The individual data rows need
not be locked. pg_dump does the whole dump as a single transaction, so
it can rely on MVCC semantics to give it a consistent picture of the
data in every table. Basically, it doesn't "see" changes that commit
after its transaction starts. See the discussion of MVCC.
regards, tom lane