Re: Option to dump foreign data in pg_dump

From: Luis Carril <luis(dot)carril(at)swarm64(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Option to dump foreign data in pg_dump
Date: 2019-11-29 08:40:38
Message-ID: FRAPR01MB07247FE1A1618BCC42750813E7460@FRAPR01MB0724.DEUPRD01.PROD.OUTLOOK.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Luis,

It seems you've got enough support for this concept, so let's move
forward with this patch. There are some comments from Tom about the
patch; would you like to send an updated version perhaps?

Thanks
Hi,

I've attached a new version (v6) removing the superfluous JOIN that Tom identified, and not collecting the oids (avoiding the query) if the option is not used at all.

About the testing issues that Tom mentioned:
I do not see how can we have a pure SQL dummy FDW that tests the functionality. Because the only way to identify if the data of a foreign table for the chosen server is dumped is if the COPY statement appears in the output, but if the C callbacks of the FDW are not implemented, then the SELECT that dumps the data to generate the COPY cannot be executed.
Also, to test that the include option chooses only the data of the specified foreign servers we would need some negative testing, i.e. that the COPY statement for the non-desired table does not appear. But I do not find these kind of tests in the test suite, even for other selective options like --table or --exclude-schema.

Cheers
Luis M Carril

________________________________
From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Sent: Thursday, November 28, 2019 3:31 PM
To: Luis Carril <luis(dot)carril(at)swarm64(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>; Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>; vignesh C <vignesh21(at)gmail(dot)com>; PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Option to dump foreign data in pg_dump

On 2019-Nov-12, Luis Carril wrote:

> The nitpicks have been addressed. However, it seems that the new file
> containing the test FDW seems missing from the new version of the patch. Did
> you forget to git add the file?
>
> Yes, I forgot, thanks for noticing. New patch attached again.

Luis,

It seems you've got enough support for this concept, so let's move
forward with this patch. There are some comments from Tom about the
patch; would you like to send an updated version perhaps?

Thanks

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Support-foreign-data-in-pg_dump-v6.patch text/x-patch 19.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuro Yamada 2019-11-29 08:45:14 Re: progress report for ANALYZE
Previous Message Julien Rouhaud 2019-11-29 08:39:09 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?