On 05/16/2014 08:11 PM, David G Johnston wrote:
> Can we simply backup the non-data parts of $PGDATA first then move onto the
> data-parts? For the files that we'd be dealing with it would be
> sufficiently quick to just try and fail, immediately, then check for all
> possible preconditions first. The main issue seems to be the case where the
> 2TB of data get backed-up and then a small 1k file blows away all that work.
> Lets do those 1k files first.
You'll still need to distinguish "data" and "non-data" parts somehow.
One idea would be to backup any files in the top directory first, before
recursing into the subdirectories. That would've caught the OP's case,
and probably many other typical cases where you drop something
unexpected into $PGDATA. You could still have something funny nested
deep in the data directory, but that's much less common.
- Heikki