pgbench and timestamps - Mailing list pgsql-general

From Jaime Soler
Subject pgbench and timestamps
Date
Msg-id CAKVUGgQaZVAUi1Ex41H4wrru=FU+MfwgjG0aM1br6st7sz31Vw@mail.gmail.com
Whole thread Raw
Responses Re: pgbench and timestamps  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-general
Hi, does anybody know what is wrong with pgbench in this case ?. Here is a simple query to generate a random date in a interval time.sql: 
 (select timestamp '2005-09-01' + random() * ( timestamp '2006-03-01 00:00:00' -  timestamp '2005-09-01 00:00:00' ));
query executed successfullly with psql
/usr/lib/postgresql/12/bin/psql -p 5432 -h localhost -d picp -U postgres -f time.sql
BEGIN
?column?
--------------------------
2005-11-24 13:22:02.4781
(1 fila)COMMIT
psql (PostgreSQL) 12.3 (Ubuntu 12.3-1.pgdg20.04+1)
but look at what happen with pgbench
pgbench -c 2 -j 2 -M prepared --file time.sql -h localhost -d picp -U postgres -p 5432
pghost: localhost pgport: 5432 nclients: 2 nxacts: 10 dbName: picp
starting vacuum...ERROR: no existe la relación «pgbench_branches»
(ignoring this error and continuing anyway)
ERROR: no existe la relación «pgbench_tellers»
(ignoring this error and continuing anyway)
ERROR: no existe la relación «pgbench_history»
(ignoring this error and continuing anyway)
end.
client 0 executing script "time.sql"
ERROR: la sintaxis de entrada no es válida para tipo timestamp: «2006-03-01 00$1$2»
LINE 1: ...t timestamp '2005-09-01' + random() * ( timestamp '2006-03-0...
^
client 0 sending P0_0
client 0 receiving
client 0 receiving
client 0 sending P0_1
client 0 receiving
client 0 receiving
client 0 script 0 aborted in command 1 query 0: ERROR: no existe la sentencia preparada «P0_1»
client 1 executing script "time.sql"
ERROR: la sintaxis de entrada no es válida para tipo timestamp: «2006-03-01 00$1$2»
LINE 1: ...t timestamp '2005-09-01' + random() * ( timestamp '2006-03-0...
^Run was aborted; the above results are incomplete.
pgbench (PostgreSQL) 12.3 (Ubuntu 12.3-1.pgdg20.04+1)
I don't know why pgbench use  timestamp: «2006-03-01 00$1$2» instead of timestamp '2006-03-01 00:00:00' 

Regards

pgsql-general by date:

Previous
From: RAJAMOHAN
Date:
Subject: ERROR: canceling statement due to conflict with recovery
Next
From: "Peter J. Holzer"
Date:
Subject: Re: n_distinct off by a factor of 1000