From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Роман Осипов <osipovromanvladimirovich@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Incorrect number of rows inserted into partitioned table
Date: Mon, 10 Apr 2023 23:39:07 +0200
Message-ID: <4561fe9b-e303-dc28-1a3e-1b5aab626395@enterprisedb.com> (raw)
In-Reply-To: <CAAqk126uv_J-T8MhOvMqmUUD6MPsxFpq=zojDnWeftZokDYyEw@mail.gmail.com>
References: <CAAqk126uv_J-T8MhOvMqmUUD6MPsxFpq=zojDnWeftZokDYyEw@mail.gmail.com>
On 4/10/23 20:42, Роман Осипов wrote:
> Good afternoon
>
> When reloading data from a simple table into a partitioned (through
> inheritance) using a query like:*insert into [new_partition_table]
> select * from [old_table] limit xxxxxxx*;
>
> There is an insertion not of the amount specified in *limit*,, but a
> little more or less than it.
>
Which version? I did try this on master, and I can't reproduce it - the
count at the end returns the correct value (1M).
The rule affects the insert status, which looks e.g. like this:
INSERT 0 611532
instead of 1M, but that's expected because of the rule, I think.
FWIW I wonder why you use rules, it's rather tricky to get that right,
which is why the usual recommendation is not to use this if there's an
alternative way to do stuff (which for partitioning there is).
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
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-bugs@postgresql.org
Cc: tomas.vondra@enterprisedb.com, osipovromanvladimirovich@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Incorrect number of rows inserted into partitioned table
In-Reply-To: <4561fe9b-e303-dc28-1a3e-1b5aab626395@enterprisedb.com>
* 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