Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNWFV-00031M-ON for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Feb 2023 09:51:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pNWFU-0000dG-Jn for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Feb 2023 09:51:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNWFU-0000d6-6x for pgsql-hackers@lists.postgresql.org; Thu, 02 Feb 2023 09:51:20 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pNWFR-000354-3v for pgsql-hackers@lists.postgresql.org; Thu, 02 Feb 2023 09:51:19 +0000 Received: by mail-ej1-x636.google.com with SMTP id lu11so4372188ejb.3 for ; Thu, 02 Feb 2023 01:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=vJi2E9d1o25zg9k937UocUKm974BhmgWFchoAEWmbMs=; b=c6zocs3IqA94Ufap0u/DvjjjC5mBb0ea1IGntAubsHVxu6xxAgRlTsmom7TNlAjCm5 ST0lqkXhWUTChE7fZowjsqMYArvWmk7AlbwPya4HQvX6NZA09Vzcy85/Op67UbqxGrcc csKjiolBj08meLdPYJOrt83tYskG4mtnOnceUS1x/7or36qZFXQLwNd/OxfOt3mxnX/F pM/6eTIf5Jmeks+/iGMlwhbiWBSh2LMNkjy7OJHW5eIAx2ePqc1w/J8K1rmAKhcV1hLf uHKh2nIIzLITRwrz+DpnONBT3sP2M9aYHRVqWkZ0PAnlZhiWVDAhoIut1NDBOEU0P3Ut qnTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vJi2E9d1o25zg9k937UocUKm974BhmgWFchoAEWmbMs=; b=C7Ku+8+evILh8pvywKCZuMomsXV49wCxjv5G16xJnZy5baI6ZJqwDps4BNyCqRbPYt HWGLC2clT/dSRZVayLN+9tAyyR6to8IZSnMmLEnnJnve1BuLTwYfIi2gC/8gHBo/JFI7 Tp3yH41E4Zibvs7RGHd3vNsCvIfhbHUtQwiecFXTBEPwlQOhghl8ECZMNd1T4LAMwtba w/D/g0Z0qekWXAKqFkumLv6ouATXcl9/AErc3JHJc/9sJDMQgPug4EyxmPM+t+rKn/U3 /d5JISunl5rAr0DzGfsPDombXch0f1JXoEXexZlEE8a/bWf1ZG49XXTftgvQqsFVtZA8 t6gw== X-Gm-Message-State: AO0yUKUcSqz5/DwIRQ1XUgrR6pvis0r4O8J4/l7D6GpEZp+miBxWGOlj ZA+jIUtfsjPs8iTCaIs7iucaeA== X-Google-Smtp-Source: AK7set9bymmKpssiOxPxdaR+/YKqt44SiOKCMcr8d9odZPxE7iC+FJMQSOIg2FTIcwRLMVg0yJxHng== X-Received: by 2002:a17:907:990b:b0:87c:c2eb:6dfb with SMTP id ka11-20020a170907990b00b0087cc2eb6dfbmr5924164ejc.29.1675331476149; Thu, 02 Feb 2023 01:51:16 -0800 (PST) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:5e:539:1b2c:c52a:475d:310c]) by smtp.gmail.com with ESMTPSA id 9-20020a170906200900b0087848a5daf5sm11313268ejo.225.2023.02.02.01.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:51:15 -0800 (PST) Message-ID: <7b130ad352a908b34281a2205dd58660a9b90b1d.camel@cybertec.at> Subject: Re: pg_dump versus hash partitioning From: Laurenz Albe To: Tom Lane , Robert Haas Cc: pgsql-hackers@lists.postgresql.org, Andrew Date: Thu, 02 Feb 2023 10:51:14 +0100 In-Reply-To: <1426306.1675291744@sss.pgh.pa.us> References: <1376149.1675268279@sss.pgh.pa.us> <1412538.1675283692@sss.pgh.pa.us> <1422349.1675289317@sss.pgh.pa.us> <1426306.1675291744@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-02-01 at 17:49 -0500, Tom Lane wrote: > Robert Haas writes: > > On Wed, Feb 1, 2023 at 5:08 PM Tom Lane wrote: > > > I can agree with that argument for range or list partitioning, where > > > the partitions have some semantic meaning to the user.=C2=A0 I don't = buy it > > > for hash partitioning.=C2=A0 It was an implementation artifact to beg= in > > > with that a given row ended up in partition 3 not partition 11, so wh= y > > > would users care which partition it ends up in after a dump/reload? > > > If they think there is a difference between the partitions, they need > > > education. >=20 > > I see your point. I think it's somewhat valid. However, I also think > > it muddies the definition of what pg_dump is allowed to do in a way > > that I do not like. I think there's a difference between the CTID or > > XMAX of a tuple changing and it ending up in a totally different > > partition. It feels like it makes the definition of correctness > > subjective: we do think that people care about range and list > > partitions as individual entities, so we'll put the rows back where > > they were and complain if we can't, but we don't think they think > > about hash partitions that way, so we will err on the side of making > > the dump restoration succeed. That's a level of guessing what the user > > meant that I think is uncomfortable. >=20 > I see your point too, and to me it's evidence for the position that > we should never have done hash partitioning in the first place. You suggested earlier to deprecate hash partitioning. That's a bit much, but I'd say that most use cases of hash partitioning that I can imagine would involve integers. We could warn against using hash partitioning for data types other than numbers and date/time in the documentation. I also understand the bad feeling of changing partitions during a dump/restore, but I cannot think of a better way out. > What do you think of "--load-via-partition-root=3Don/off/auto", where > auto means "not with hash partitions" or the like? That's perhaps the best way. So users who know that their hash partitions won't change and want the small speed benefit can have it. Yours, Laurenz Albe