Removing useless \. at the end of copy in pgbench

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Removing useless \. at the end of copy in pgbench
Date: 2018-07-28 01:23:12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

While populating pgbench_account table by using COPY FROM STDIN,
pgbench sends out "\." at the end of the copy data. However this is
only necessary in the version 2 of frontend/backend protocol (i.e. the
version 3 protocol does not need it). I think we can safely remove the
code to save a few CPU cycle since we only support back to PostgreSQL
9.3 and the version 3 protocol has been supported since 7.4.

If we want to support pre 7.4 backend (which only supports the version
2 protocol), we could test the current protocol version and decide
whether we should send out "\." or not, but I doubt it's necessary.


(patch to remove the unneccessary code attached)
Tatsuo Ishii
SRA OSS, Inc. Japan

Attachment Content-Type Size
pgbench_remove_unnecessary_code.diff text/x-patch 396 bytes


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-07-28 01:52:08 Re: Removing useless \. at the end of copy in pgbench
Previous Message Michael Paquier 2018-07-28 00:10:12 Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack