David Rowley <dgrowleyml@gmail.com> writes:
> On Wed, 24 Jun 2020 at 20:41, Jaime Soler <jaime.soler@gmail.com> wrote:
>> I don't know why pgbench use timestamp: «2006-03-01 00$1$2» instead of timestamp '2006-03-01 00:00:00'
> I've not debugged it, but it looks like pgbench thinks that :00 is a
> pgbench variable and is replacing each instance with a query
> parameter.
Yeah.
> I don't often do much with pgbench and variables, but there are a few
> things that surprise me here.
> 1) That pgbench replaces variables within single quotes, and;
> 2) that we still think it's a variable name when it starts with a digit, and;
> 3) We replace variables that are undefined.
Also (4) this only happens when in non-simple query mode --- the
example works fine without "-M prepared".
I can think of use-cases for substituting variables inside quotes,
so maybe (1) isn't a bug; but it sure seems like (3) and (4) are.
In any case, the documentation about this seems pretty inadequate.
regards, tom lane