pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dump, --exclude-table-data
2+ messages / 2 participants
[nested] [flat]
* pg_dump, --exclude-table-data
@ 2020-02-01 08:33 PG Doc comments form <noreply@postgresql.org>
2020-02-02 20:53 ` Re: pg_dump, --exclude-table-data Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2020-02-01 08:33 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: zvolsky@seznam.cz
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/12/app-pgdump.html
Description:
I cannot find and understand what happens, if I will ommit the table data
for a table where primary keys are refenced by foreignkeys from other
tables. I think the integrity will break and such backup/dump is
unusable...? Or is there a way how to handle this during restore?
(What I want to do is anonymize the content. I don't want to give user data
(User table), but lot of foreignkeys reference them. Something like
exporting all the rows with only primary key and foreign keys (which meet my
needs if just int/bigint are used for keys) + random content in other
fields. I understand that this is difficult to achieve and the completely
omiitted data will be ok - if there is not integrity problem during
restore.)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pg_dump, --exclude-table-data
2020-02-01 08:33 pg_dump, --exclude-table-data PG Doc comments form <noreply@postgresql.org>
@ 2020-02-02 20:53 ` Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 2+ messages in thread
From: Laurenz Albe @ 2020-02-02 20:53 UTC (permalink / raw)
To: zvolsky@seznam.cz; pgsql-docs@lists.postgresql.org
On Sat, 2020-02-01 at 08:33 +0000, PG Doc comments form wrote:
> I cannot find and understand what happens, if I will ommit the table data
> for a table where primary keys are refenced by foreignkeys from other
> tables. I think the integrity will break and such backup/dump is
> unusable...? Or is there a way how to handle this during restore?
>
> (What I want to do is anonymize the content. I don't want to give user data
> (User table), but lot of foreignkeys reference them. Something like
> exporting all the rows with only primary key and foreign keys (which meet my
> needs if just int/bigint are used for keys) + random content in other
> fields. I understand that this is difficult to achieve and the completely
> omiitted data will be ok - if there is not integrity problem during
> restore.)
Yes, if you omit the data for a table, restoring a foreign key that relies
on the data will fail. Note that only the foreign key will fail and not
get created, but the tables themselves will be restored.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-02-02 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01 08:33 pg_dump, --exclude-table-data PG Doc comments form <noreply@postgresql.org>
2020-02-02 20:53 ` Laurenz Albe <laurenz.albe@cybertec.at>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox