Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?
Date
Msg-id 371361.1737732246@sss.pgh.pa.us
Whole thread Raw
In response to Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> I don't think we need a new file for this. pg_backup_utils.c is already 
> there for routines common to pg_restore and pg_dump.

I'm not even on board with having a new function, because I doubt
we should try to share this code in the first place.  Who's to
say that pg_dump and pg_restore must support exactly the same list
of formats?  For example, in the future we might decide that some
format is obsolete and desupport it in pg_dump, while continuing
to allow it for awhile in pg_restore for compatibility reasons.
A closer-to-home possibility is that the work to allow non-text
output from pg_dumpall will result in a format that pg_restore
can read but pg_dump (by itself) doesn't write.

So I'd just scrap pg_restore's parsing logic for this and replace it
in-place.  To the extent that that's copying and pasting stuff, fine.
It's not like there's no other duplicativeness in their switch-parsing
logic.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Purpose of wal_init_zero
Next
From: Pavel Stehule
Date:
Subject: Re: XMLDocument (SQL/XML X030)