Re: I have an exporting need... - Mailing list pgsql-hackers

From David Rowley
Subject Re: I have an exporting need...
Date
Msg-id CAApHDvoESC9CeFEY6ycRrJQsNBK8sqzPLA6mCY+XN=o=FCDjEg@mail.gmail.com
Whole thread Raw
In response to I have an exporting need...  (Juan Hernández <dejesusog@gmail.com>)
List pgsql-hackers
On Tue, 14 May 2024 at 06:18, Juan Hernández <dejesusog@gmail.com> wrote:
> Do you consider useful to add a parameter (for example, --separatetables) so when used the exporting file process can
createa different tablename.sql file for each table in database automatically? 
>
> Example...
>
> PGHOST="/tmp" PGPASSWORD="mydbpass" pg_dump -U dbusername --separatetables -Fp --inserts dbname > "/route/dbname.sql"
>
> And if this database has tables table1...table10, then 10 files are created...

pg_dump has code to figure out the dependency of objects in the
database so that the dump file produced can be restored.  If one file
was output per table, how would you know in which order to restore
them? For example, you have a table with a FOREIGN KEY to reference
some other table, you need to restore the referenced table first.
That's true for both restoring the schema and restoring the data.

David



pgsql-hackers by date:

Previous
From: "Yusuke Egashira (Fujitsu)"
Date:
Subject: RE: Resetting synchronous_standby_names can wait for CHECKPOINT to finish
Next
From: Michael Paquier
Date:
Subject: Re: GUC-ify walsender MAX_SEND_SIZE constant