Re: Using COPY FREEZE in pgbench

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: coelho(at)cri(dot)ensmp(dot)fr
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Using COPY FREEZE in pgbench
Date: 2021-03-08 11:22:21
Message-ID: 20210308.202221.1833410652133851800.t-ishii@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fabien,

> That looks good!
>
> As COPY FREEZE was introduced in 9.3, this means that loading data
> would break with previous versions. Pgbench attempts at being
> compatible with older versions. I'm wondering whether we should not
> care or if we should attempt some compatibility layer. It seems enough
> to test "PQserverVersion() >= 90300"?

Good point.

Unfortunately with pre-14 COPY FREEZE we cannot get the speed up
effect because it requires the commit:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7db0cd2145f2bce84cac92402e205e4d2b045bf2
which was there only in the master branch as of Jan 17, 2021.

So I think adding "freeze" to the copy statement should only happen in
PostgreSQL 14 or later. Probably the test should be
"PQserverVersion() >= 140000" I think. Attached is the patch doing
what you suggest.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
pgbench_freeze_v2.diff text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2021-03-08 11:23:07 Re: Using COPY FREEZE in pgbench
Previous Message Dilip Kumar 2021-03-08 11:06:27 Re: [Patch] ALTER SYSTEM READ ONLY