pgbench failed when -f option contains a char '@'

Wang, Shenhao <wangsh.fnst@cn.fujitsu.com>

From: "Wang, Shenhao" <wangsh.fnst@cn.fujitsu.com>
To: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2020-12-18T06:22:36Z
Lists: pgsql-hackers

Attachments

Hi, hackers

pgbench use -f filename[@weight] to receive a sql script file with a weight,
but if I create a file contains char'@', like a@2.sql, specify this file without weigth,
pgbench will failed with error:
	pgbench: fatal: invalid weight specification: @2.sql

This action may be unfriendly, because the char '@' is a valid character on Linux
and Windows.

I have created a patch to modify this action. The patch is attached.

Thoughts?

Regards
Shenhao Wang


Commits

  1. Doc: improve description of pgbench script weights.