Re: proposal: possibility to read dumped table's name from file

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Surafel Temesgen <surafel3000(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: possibility to read dumped table's name from file
Date: 2021-10-02 06:18:14
Message-ID: 32dbe249-8421-f54e-cacf-39c308c59dd9@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/1/21 6:19 PM, Erik Rijkers wrote:
> On 10/1/21 3:19 PM, Daniel Gustafsson wrote:
>>
>> As has been discussed upthread, this format strikes a compromise wrt
>> simplicity
>> and doesn't preclude adding a more structured config file in the
>> future should

>
> If you try to dump/restore a foreign file from a file_fdw server, the
> restore step will complain and thus leave the returnvalue nonzero. The
> foreign table will be there, with complete 'data'.
>
> A complete runnable exampe is a lot of work; I hope the below bits of
> input and output makes the problem clear.  Main thing: the pg_restore
> contains 2 ERROR lines like:
>
> pg_restore: error: COPY failed for table "ireise1": ERROR:  cannot
> insert into foreign table "ireise1"

Further testing makes clear that the file_fdw-addressing line
include foreign_data goethe
was the culprit: it causes a COPY which of course fails in a readonly
wrapper like file_fdw. Without that line it works (because I run the
restore on the same machine so the underlying file_fdw .txt files are
there for testdb2 too)

So the issue is not as serious as it seemed. The complaint remaining is
only that this could somehow be documented better.

I attach a running example (careful, it deletes stuff) of the original
ERROR-producing bash (remove the 'include foreign_data' line from the
input file to run it without error).

thanks,

Erik Rijkers

Attachment Content-Type Size
dump_restore_foreign_table.sh application/x-shellscript 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Shinderuk 2021-10-02 06:48:42 Re: pgcrypto support for bcrypt $2b$ hashes
Previous Message Michael Paquier 2021-10-02 05:40:16 Re: Deduplicate code updating ControleFile's DBState.