On Tue, 11 Apr 2023 at 08:50, Роман Осипов
<osipovromanvladimirovich@gmail.com> wrote:
> 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.
It would be good to see what your output actually is. I don't
currently see a way for the number of rows inserted to be *more* than
the LIMIT. If it's less, then that'll be because of the rule you have
defined to insert into another table instead.
With your example SQLs, you'll probably find that the reported number
of inserted rows matches: select count(*) from ONLY book_inherit_test;
Also, you might want to look at declarative partitioning [1] and use
that instead.
David
[1] https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE