Re: add modulo (%) operator to pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add modulo (%) operator to pgbench
Date: 2014-09-11 06:47:46
Message-ID: alpine.DEB.2.10.1409101731310.7949@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Robert,

> I am not objecting to the functionality; I'm objecting to bolting on
> ad-hoc operators one at a time. I think an expression syntax would
> let us do this in a much more scalable way. If I had time, I'd go do
> that, but I don't. We could add abs(x) and hash(x) and it would all
> be grand.

Ok. I do agree that an expression syntax would be great!

However, that would not diminish nor change much the amount and kind of
code necessary to add an operator or a function: the parser would have to
be updated, and the expression structure, and the executor. Currently the
pgbench "parser" and expression are very limited, but they are also very
generic so that nothing is needed to add a new operator there, only the
execution code needs to be updated, and the update would be basically the
same (if this is this function or operator, actually do it...) if the
execution part of a real expression syntax would have to be updated.

So although I agree that a real expression syntax would be great "nice to
have", I do not think that it is valid objection to block this patch.

Moreover, upgrading pgbench to handle an actual expression syntax is not
so trivial, because for instance some parts of the text needs to be parsed
(set syntax) while others would need not to be pased (SQL commands), so
some juggling would be needed in the lexer, or maybe only call the parser
on some lines and not others... Everything is possible, but this one would
require some careful thinking.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2014-09-11 07:35:24 Re: RLS Design
Previous Message Pavel Stehule 2014-09-11 06:45:37 Re: proposal: ignore null fields in not relation type composite type based constructors