Hello,
>> \set id = 1 + abs((:id * 1021) % (100000 * :scale))
>>
>> seems slightly better than:
>>
>> \set id 1 + abs((:id * 1021) % (100000 * :scale))
>
> It is question :( - it break a consistency with psql
It actually "breaks" nothing as it is purely cosmectic:-)
More seriously, I'm not sure that having a apparent syntatic homogeneity
between psql and pgbench should be a requirement, but that is a point
worth raising.
The syntax are not really the same anyway: for instance "\set" and "\set
NAME" means something for psql but not for pgbench.
Moreover the "\set [NAME [VALUE]]" syntax of psql does not allow an
expression, so it stays quite readable as it is, a situation not
comparable to pgbench with expressions.
So I would tend to fully ignore the similitude between the two as a
guideline, as it is only a simulitude and not a real compatibility issue.
--
Fabien.