pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-hackers@lists.postgresql.org, Andrew <pgsqlhackers@andrewrepp.com>
Subject: Re: pg_dump versus hash partitioning
Date: Mon, 27 Feb 2023 11:20:34 -0500
Message-ID: <369734.1677514834@sss.pgh.pa.us> (raw )
In-Reply-To: <CA+TgmoaJJUZF41r-5NyEb2mMNXaT6Rf4FK=BWdRun0S758dXDw@mail.gmail.com >
References: <1376149.1675268279@sss.pgh.pa.us >
<CA+TgmoaZ8kDKiQMtDq82Qqqgc5JAfF_UEvc2qa46QwVVLvtMDw@mail.gmail.com >
<1412538.1675283692@sss.pgh.pa.us >
<CA+TgmoYoSoX8bN_yzabmRDQBNxEaWmjBKPnkZPMUDpPTBy=d4A@mail.gmail.com >
<CAH2-WzkjKCmVD9JDKHx09YC+c5kSL_1rHH0kRMyvDHRFoxgw6Q@mail.gmail.com >
<CA+TgmoYJ+3XpW_iYapXN3gwq2MECi7GH8BxuwKFCQPOzLaa3OQ@mail.gmail.com >
<CAH2-Wz=cMRoYHeoac7kscdDNBSYzHKgMvSHX5CFEoE66rimk8A@mail.gmail.com >
<1425446.1675291093@sss.pgh.pa.us >
<CAApHDvqJM5HxhZSnxESENAHLxTZ=eXKKHxeHfvVe1E8v28woDA@mail.gmail.com >
<1440373.1675299790@sss.pgh.pa.us >
<a7ef6212-f9fe-6826-9640-5dac54327140@dunslane.net >
<1533086.1675349554@sss.pgh.pa.us >
<1912821.1676402493@sss.pgh.pa.us >
<CA+TgmoaJJUZF41r-5NyEb2mMNXaT6Rf4FK=BWdRun0S758dXDw@mail.gmail.com >
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Feb 14, 2023 at 2:21 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This made me wonder if this could be a usable solution at all, but
>> after thinking for awhile, I don't see how the claim about foreign key
>> constraints is anything but FUD. pg_dump/pg_restore have sufficient
>> dependency logic to prevent that from happening. I think we can just
>> drop the "or perhaps ..." clause here, and tolerate the possible
>> inefficiency as better than failing.
> Right, but isn't that dependency logic based around the fact that the
> inserts are targeting the original partition? Like, suppose partition
> A has a foreign key that is not present on partition B. A row that is
> originally in partition B gets rerouted into partition A. It must now
> satisfy the foreign key constraint when, previously, that was
> unnecessary.
Well, that's a user error not pg_dump's fault. Particularly so for hash
partitioning, where there is no defensible reason to make the partitions
semantically different.
There could be a risk of a timing problem, namely that parallel pg_restore
tries to check an FK constraint before all the relevant data has arrived.
But in practice I don't believe that either. We load all the data in
"data" phase and then create indexes and check FKs in "post-data" phase,
and I do not believe that parallel restore weakens that separation
(because it's enforced by a post-data boundary object in the dependencies).
regards, tom lane
view thread (49+ messages) latest in thread
Message-ID: <369734.1677514834@sss.pgh.pa.us>
Permalink: ../369734.1677514834@sss.pgh.pa.us/
Also on: postgresql.org/message-id/369734.1677514834@sss.pgh.pa.us
copy link · copy postgr.es
reply 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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andrew@dunslane.net, alvherre@alvh.no-ip.org, dgrowleyml@gmail.com, pg@bowt.ie, pgsqlhackers@andrewrepp.com
Subject: Re: pg_dump versus hash partitioning
In-Reply-To: <369734.1677514834@sss.pgh.pa.us>
* 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