Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jo6Bl-0006eQ-U8 for pgsql-general@arkaria.postgresql.org; Wed, 24 Jun 2020 14:15:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jo6Bj-0008K4-NJ for pgsql-general@arkaria.postgresql.org; Wed, 24 Jun 2020 14:15:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jo6Bj-0008Jx-Fa for pgsql-general@lists.postgresql.org; Wed, 24 Jun 2020 14:15:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jo6Bb-0007I1-QK for pgsql-general@postgresql.org; Wed, 24 Jun 2020 14:15:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05OEFNtr2203821; Wed, 24 Jun 2020 10:15:23 -0400 From: Tom Lane To: David Rowley cc: Jaime Soler , Fabien COELHO , PostgreSQL mailing lists Subject: Re: pgbench and timestamps In-reply-to: References: Comments: In-reply-to David Rowley message dated "Thu, 25 Jun 2020 00:49:49 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2203819.1593008123.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Jun 2020 10:15:23 -0400 Message-ID: <2203820.1593008123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On Wed, 24 Jun 2020 at 20:41, Jaime Soler wrote: >> I don't know why pgbench use timestamp: =C2=AB2006-03-01 00$1$2=C2=BB = 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