From: Laurenz Albe <laurenz.albe@cybertec.at>
To: zvolsky@seznam.cz
To: pgsql-docs@lists.postgresql.org
Subject: Re: pg_dump, --exclude-table-data
Date: Sun, 02 Feb 2020 21:53:46 +0100
Message-ID: <5a24b53cff1c4a723e21e4ef980d5bdcb74f33d1.camel@cybertec.at> (raw)
In-Reply-To: <158054601828.19845.6369701897413049638@wrigleys.postgresql.org>
References: <158054601828.19845.6369701897413049638@wrigleys.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: laurenz.albe@cybertec.at, zvolsky@seznam.cz, pgsql-docs@lists.postgresql.org
Subject: Re: pg_dump, --exclude-table-data
In-Reply-To: <5a24b53cff1c4a723e21e4ef980d5bdcb74f33d1.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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