> > 2) Change pg_dump to walk through dependencies?
>
> The trouble with that is that dependency analysis is a monstrous job,
> and one that would make pg_dump even more fragile and backend-version-
> dependent than it is now.
One way to get around that might be to make the dumping routine a part
of the backend instead of a frontend. This is what at least MS SQL does.
So I can do for example:
BACKUP DATABASE mydb TO DISK 'c:\foo.dump'
or, if I want to send the backup directly to my backup program
BACKUP DATABASE mydb TO PIPE 'somepipe'
Then to reload it I just do
RESTORE DATABASE mydb FROM DISK 'c:\foo.dump'
Doing this might also help with permissions issues, since the entire
process can be run inside tbe backend (and skip security checks at some
points, assuming that it was a user with backup permissions who started
the operation)?
//Magnus