Re: Option to dump foreign data in pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Option to dump foreign data in pg_dump
Date
Msg-id 15308.1561735837@sss.pgh.pa.us
Whole thread Raw
In response to Re: Option to dump foreign data in pg_dump  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Option to dump foreign data in pg_dump
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 28 Jun 2019, at 16:49, Luis Carril <luis.carril@swarm64.com> wrote:
>> pg_dump ignores the dumping of data in foreign tables
>> on purpose, this patch makes it optional as the user maybe
>> wants to manage the data in the foreign servers directly from
>> Postgres. Opinions?

> Wouldn’t that have the potential to make restores awkward for FDWs that aren’t
> writeable?

Yeah, I think the feature as-proposed is a shotgun that's much more likely
to cause problems than solve them.  Almost certainly, what people would
really need is the ability to dump individual foreign tables' data not
everything.  (I also note that the main reason for "dump everything",
namely to get a guaranteed-consistent snapshot, isn't really valid for
foreign tables anyhow.)

I'm tempted to suggest that the way to approach this is to say that if you
explicitly select some foreign table(s) with "-t", then we'll dump their
data, unless you suppress that with "-s".  No new switch needed.

Another way of looking at it, which responds more directly to Daniel's
point about non-writable FDWs, could be to have a switch that says "dump
foreign tables' data if their FDW is one of these".

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Option to dump foreign data in pg_dump
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Regression tests vs existing users in an installation