Re: pgbench - allow to create partitioned tables

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - allow to create partitioned tables
Date: 2019-09-30 11:47:04
Message-ID: alpine.DEB.2.21.1909301332440.26631@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Amit,

>>> $node->safe_psql('postgres',
>>> "CREATE TABLESPACE regress_pgbench_tap_1_ts LOCATION '$ets';"
>>
>> I think that this last command fails if the path contains a "'", so the
>> '-escaping is necessary. I had to make changes in TAP tests before because
>> it was not working when the path was a little bit strange, so now I'm
>> careful.
>
> Hmm, I don't know what kind of issues you have earlier faced,

AFAICR, path with shell-sensitive characters ($ ? * ...) which was
breaking something somewhere.

> but tablespace creation doesn't allow quotes. See the message
> "tablespace location cannot contain single quotes" in CreateTableSpace.

Hmmm. That is the problem of CreateTableSpace. From an SQL perspective,
escaping is required. If the command fails later, that is the problem of
the command implementation, but otherwise this is just a plain syntax
error at the SQL level.

> Also, there are other places in tests like
> src/bin/pg_checksums/t/002_actions.pl which uses the way I have
> mentioned.

Yes, I looked at it and imported the window-specific function to handle
the path. It does not do anything about escaping.

> I don't think there is any need for escaping single-quotes
> here

As said, this is required for SQL, or you must know that there are no
single quotes in the string.

> and I am not seeing the use of same.

Sure. It is probably buggy there too.

> I don't want to introduce a new pattern in tests which people can then
> tomorrow copy at other places even though such code is not required.
> OTOH, if there is a genuine need for the same, then I am fine.

Hmmm. The committer is right by definition. Here is a version without
escaping but with a comment instead.

--
Fabien.

Attachment Content-Type Size
pgbench-init-partitioned-20.patch text/x-diff 16.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-09-30 11:57:29 Re: [HACKERS] [PATCH] Generic type subscripting
Previous Message Amit Khandekar 2019-09-30 11:34:57 Re: Minimal logical decoding on standbys