Re: PATCH: pgbench allow '=' in \set - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: PATCH: pgbench allow '=' in \set
Date
Msg-id alpine.DEB.2.10.1505072028160.20788@sto
Whole thread Raw
In response to Re: PATCH: pgbench allow '=' in \set  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: PATCH: pgbench allow '=' in \set
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Auditing extension for PostgreSQL (Take 2)
Next
From: "David G. Johnston"
Date:
Subject: Re: PATCH: pgbench allow '=' in \set