Re: Error on pgbench logs
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: Michael Paquier <michael@paquier.xyz>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>, rulyox@gmail.com,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-12T21:32:54Z
Lists: pgsql-hackers
> + while ((next = agg->start_time + agg_interval * INT64CONST(1000000)) <= now) > > I can find the similar code to convert "seconds" to "us" using casting like > > end_time = threads[0].create_time + (int64) 1000000 * duration; > > or > > next_report = last_report + (int64) 1000000 * progress; > > Is there a reason use INT64CONST instead of (int64)? Do these imply the same effect? I guess that the macros does 1000000LL or something similar to directly create an int64 constant. It is necessary if the constant would overflow a usual 32 bits C integer, whereas the cast is sufficient if there is no overflow. Maybe I c/should have used the previous approach. > Sorry, if this is a dumb question... Nope. -- Fabien.
Commits
-
Fix pgbench timestamp bugs.
- 5614a0f78eaa 14.0 landed
- 0e39a608ed55 15.0 landed
-
pgbench: Improve time logic.
- 547f04e7348b 14.0 cited
-
Make [U]INT64CONST safe for use in #if conditions.
- 9d6b160d7db7 11.0 cited
-
Teach libpq to detect integer overflow in the row count of a PGresult.
- 2e70d6b5e99b 11.0 cited