Re: pgbench and timestamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Jaime Soler <jaime(dot)soler(at)gmail(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: pgbench and timestamps
Date: 2020-06-24 14:15:23
Message-ID: 2203820.1593008123@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> On Wed, 24 Jun 2020 at 20:41, Jaime Soler <jaime(dot)soler(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Hurne 2020-06-24 14:24:29 RE: autovacuum failing on pg_largeobject and disk usage of the pg_largeobject growing unchecked
Previous Message Daniel Verite 2020-06-24 14:08:27 RE: autovacuum failing on pg_largeobject and disk usage of the pg_largeobject growing unchecked