Re: pgbench: new feature allowing to launch shell commands

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench: new feature allowing to launch shell commands
Date: 2009-12-15 01:51:21
Message-ID: 20091215105120.0FDD.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:

> Yeah the grammar ":variable" is used to set a parameter, the user will feel
> disorientated if there is no support.
> The attached patch supports this new case, based on Itagaki-san's last
> version.

What is the spec of "\setshell :variable" ?
Literally interpreted, it declares a variable with name ":variable".
But pgbench cannot use such variables because only variables named
with alphabets, numbers, and _ can be accepted. Should we forbid to
assign variables that name contain invalid characters instead?

> I also added a warning to tell the user that pgbench is slowing
> down when using this feature.

This change seems to be nonsense. Do you want to fill your terminal
with such messages?

Proposed patch attached. It checks for variable names whether they
consist of isalnum or _. The check is only performed when a new variable
is assigned to avoid overhead. In normal workload, variables with the
same names are re-used repeatedly. I don't think the additinal check would
decrease performance of pgbench.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

Attachment Content-Type Size
pgbenchshell_20091215.patch application/octet-stream 11.8 KB
pgbenchshell_test.sql application/octet-stream 317 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2009-12-15 02:06:52 Re: Row-Level Security
Previous Message KaiGai Kohei 2009-12-15 01:40:32 Re: Row-Level Security