pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Jaime Soler <jaime.soler@gmail.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: pgbench and timestamps
Date: Wed, 24 Jun 2020 10:15:23 -0400
Message-ID: <2203820.1593008123@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvpgRhWmDGPxBkVogbo46PadcgAGtMST7orosa2cYvW4WA@mail.gmail.com>
References: <CAKVUGgQaZVAUi1Ex41H4wrru=FU+MfwgjG0aM1br6st7sz31Vw@mail.gmail.com>
	<CAApHDvpgRhWmDGPxBkVogbo46PadcgAGtMST7orosa2cYvW4WA@mail.gmail.com>

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





view thread (8+ messages)  latest in thread

Message-ID: <2203820.1593008123@sss.pgh.pa.us>
Permalink:  ../2203820.1593008123@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2203820.1593008123@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, jaime.soler@gmail.com, coelho@cri.ensmp.fr
  Subject: Re: pgbench and timestamps
  In-Reply-To: <2203820.1593008123@sss.pgh.pa.us>
  References: <CAKVUGgQaZVAUi1Ex41H4wrru=FU+MfwgjG0aM1br6st7sz31Vw@mail.gmail.com> <CAApHDvpgRhWmDGPxBkVogbo46PadcgAGtMST7orosa2cYvW4WA@mail.gmail.com> <2203820.1593008123@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox