1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Limit pgbench COPY FREEZE to ordinary relations

pgbench client-side data generation uses COPY FREEZE to load data for most
tables. COPY FREEZE isn't supported for partitioned tables and since pgbench
only supports partitioning pgbench_accounts, pgbench used a hard-coded check to
skip COPY FREEZE and use plain COPY for a partitioned pgbench_accounts.

If the user has manually partitioned one of the other pgbench tables, this
causes client-side data generation to error out with:

ERROR:  cannot perform COPY FREEZE on a partitioned table

Fix this by limiting COPY FREEZE to ordinary tables (RELKIND_RELATION).

Author: Sergey Tatarintsev <s.tatarintsev@postgrespro.ru>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/flat/97f55fca-8a7b-4da8-b413-7d1c57010676%40postgrespro.ru
This commit is contained in:
Melanie Plageman
2025-02-11 16:51:28 -05:00
parent 38172d1856
commit d0d649e916
2 changed files with 35 additions and 15 deletions

View File

@ -231,11 +231,10 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
sent to the server. This uses the client/server bandwidth
extensively through a <command>COPY</command>.
<command>pgbench</command> uses the <option>FREEZE</option> option
with version 14 or later
of <productname>PostgreSQL</productname> to speed up
subsequent <command>VACUUM</command>, except on the
<literal>pgbench_accounts</literal> table if partitions are
enabled. Using <literal>g</literal> causes logging to
to load data into ordinary (non-partition) tables with version 14
or later of <productname>PostgreSQL</productname> to speed up
subsequent <command>VACUUM</command>.
Using <literal>g</literal> causes logging to
print one message every 100,000 rows while generating data for all
tables.
</para>