pgsql: pgbench: Add a real expression syntax to \set
pgbench: Add a real expression syntax to \set
Previously, you could do \set variable operand1 operator operand2, but
nothing more complicated. Now, you can \set variable expression, which
makes it much simpler to do multi-step calculations here. This also
adds support for the modulo operator (%), with the same semantics as in
C.
Robert Haas and Fabien Coelho, reviewed by Álvaro Herrera and
Stephen Frost
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/878fdcb843e087cc1cdeadc987d6ef55202ddd04
Modified Files
--------------
contrib/pgbench/.gitignore | 2 +
contrib/pgbench/Makefile | 17 +++-
contrib/pgbench/exprparse.y | 96 +++++++++++++++++++
contrib/pgbench/exprscan.l | 105 +++++++++++++++++++++
contrib/pgbench/pgbench.c | 215 ++++++++++++++++++++++++++++---------------
contrib/pgbench/pgbench.h | 56 +++++++++++
doc/src/sgml/pgbench.sgml | 17 ++--
src/tools/msvc/Mkvcbuild.pm | 1 +
8 files changed, 425 insertions(+), 84 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Robert Haas <rhaas@postgresql.org> writes:
pgbench: Add a real expression syntax to \set
The makefile changes in this do not look right to me. Files that are
meant to be shipped in the tarball should be removed by make
maintainer-clean, not an ordinary "make clean" which is what the committed
patch appears to do. Otherwise, a tarball user without bison installed
would be cut off at the knees if he did "make clean" or "make distclean";
but those operations are not supposed to remove files that were in the
tarball.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
The makefile changes in this do not look right to me. Files that are
meant to be shipped in the tarball should be removed by make
maintainer-clean, not an ordinary "make clean" which is what the committed
patch appears to do. Otherwise, a tarball user without bison installed
would be cut off at the knees if he did "make clean" or "make distclean";
but those operations are not supposed to remove files that were in the
tarball.
Ooops, sorry, I'm probably responsible for the wrong EXTRA_CLEAN. I
definitely did not consider that clean was expected to leave the directory
to be compilable without flex/bison.
--
Fabien.
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
On Mon, Mar 2, 2015 at 2:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Robert Haas <rhaas@postgresql.org> writes:
pgbench: Add a real expression syntax to \set
The makefile changes in this do not look right to me. Files that are
meant to be shipped in the tarball should be removed by make
maintainer-clean, not an ordinary "make clean" which is what the committed
patch appears to do. Otherwise, a tarball user without bison installed
would be cut off at the knees if he did "make clean" or "make distclean";
but those operations are not supposed to remove files that were in the
tarball.
Hmm, yeah. Also, it appears that the exprscan.h file doesn't actually
get (or need to be) generated here. So I think we need something like
the attached.
Thought?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachments:
pgbench-expr-build-fix.patchbinary/octet-stream; name=pgbench-expr-build-fix.patchDownload+3-10
Also, it appears that the exprscan.h file doesn't actually
get (or need to be) generated here.
Indeed.
So I think we need something like the attached.
There is a $(RM) make macro usually defined as "rm -f", but it does not
seem to be used elsewhere.
--
Fabien.
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Robert Haas <robertmhaas@gmail.com> writes:
On Mon, Mar 2, 2015 at 2:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
The makefile changes in this do not look right to me. Files that are
meant to be shipped in the tarball should be removed by make
maintainer-clean, not an ordinary "make clean" which is what the committed
patch appears to do. Otherwise, a tarball user without bison installed
would be cut off at the knees if he did "make clean" or "make distclean";
but those operations are not supposed to remove files that were in the
tarball.
Hmm, yeah. Also, it appears that the exprscan.h file doesn't actually
get (or need to be) generated here. So I think we need something like
the attached.
Looks OK to me.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers