Andres Freund <and...@2ndquadrant.com> writes: > On 2014-03-03 19:15:27 -0500, Tom Lane wrote: >> This greatly >> ameliorates the snapshot-skew problems that arise from its habit of doing >> some things for itself and other things via backend-internal functions >> (which historically used SnapshotNow and now use a fresh MVCC snapshot, >> either way potentially quite newer than the transaction snapshot pg_dump's >> own queries will use).
> Yea, I wonder if we shouldn't start to make them use a different > snapshot. It's the pg_get_*def() functions, or is there something else? See past discussions. By the time you trace all of ruleutils.c's dependencies, a dauntingly large fraction of the backend's basic catalog access support is implicated. For example, you'd need some way of making the catcaches return data that they know to be outdated. And I'm pretty sure pg_dump is making free use of stuff that isn't even in ruleutils. I would like to see pg_dump doing something much more bulletproof, but I'm afraid that there isn't any nice simple fix available. One relatively narrow fix that would probably make it a lot better *in the current state of affairs* is to provide a way whereby, once pg_dump has locks on everything it wants to dump, it can advance its transaction snapshot to current time. Then at least both its own queries and the backend's lookups will see post-locking state. However, if AccessShareLock isn't enough to block DDL on the tables then we're still hosed. > Afair (I really haven't rechecked) all the actions that have a changed > locklevels affect things that pg_dump recreates clientside, using a > repeatable read snapshot, so there shouldn't be much change there? You're missing the point entirely if you think pg_dump recreates everything client-side. It's never done that 100%, and we've migrated more and more stuff to the server side over time to avoid duplicate implementations of things like index expression decompilation. So while a theoretical answer would be to remove all of pg_dump's dependency on server-side functions, I am pretty sure that's never going to happen. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers