Steve Wampler wrote:
> Madison Kelly wrote:
>> Hi all,
>>
>> I am (re)writing a backup program and I want to add a section for
>> backing up pSQL DBs. In the planning steps (making sure a given
>> destination has enough space) I try to calculate how much space will be
>> needed by a 'pg_dump' run *before* actually dumping it.
>
> I suppose:
>
> pg_dump $PGD_OPTIONS | wc -c
>
> isn't efficient enough, right? Without knowing the options you plan
> to use with pg_dump (compression? dump just tables?, etc.) this is
> going to be hard to get a decent estimate from...
>
For now, lets assume I am doing a raw dump (no compression) and no fancy
switches. I would probably err of the side of caution and try dumping
OIDs and all schema (plus whatever else is needed to insure a full
restore to a clean DB).
I could try piping the dump into something like 'wc' but with very large
DBs I'd be worried about the (tremendous) disk I/O that would cause.
This is also why I am hoping Pg keeps this info somewhere.
Madison