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

Erik Rijkers <er@xs4all.nl>

From: Erik Rijkers <er@xs4all.nl>
To: Daniel Gustafsson <daniel@yesql.se>, Pavel Stehule <pavel.stehule@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@2ndquadrant.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Justin Pryzby <pryzby@telsasoft.com>, Dean Rasheed <dean.a.rasheed@gmail.com>, Stephen Frost <sfrost@snowman.net>, Surafel Temesgen <surafel3000@gmail.com>, vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-10-02T06:18:14Z
Lists: pgsql-hackers

Attachments

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



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix array subscript warnings

  2. Read include/exclude commands for dump/restore from file

  3. Allow records to span multiple lines in pg_hba.conf and pg_ident.conf.