pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pgbench: Add a real expression syntax to \set
6+ messages / 4 participants
[nested] [flat]

* pgsql: pgbench: Add a real expression syntax to \set
@ 2015-03-02 19:29 Robert Haas <rhaas@postgresql.org>
  2015-03-02 19:38 ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Robert Haas @ 2015-03-02 19:29 UTC (permalink / raw)
  To: pgsql-committers

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


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pgbench: Add a real expression syntax to \set
  2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
@ 2015-03-02 19:38 ` Tom Lane <tgl@sss.pgh.pa.us>
  2015-03-02 19:56   ` Re: pgsql: pgbench: Add a real expression syntax to \set Fabien COELHO <coelho@cri.ensmp.fr>
  2015-03-02 22:02   ` Re: pgsql: pgbench: Add a real expression syntax to \set Robert Haas <robertmhaas@gmail.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-02 19:38 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pgbench: Add a real expression syntax to \set
  2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
  2015-03-02 19:38 ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-03-02 19:56   ` Fabien COELHO <coelho@cri.ensmp.fr>
  1 sibling, 0 replies; 6+ messages in thread

From: Fabien COELHO @ 2015-03-02 19:56 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <rhaas@postgresql.org>; 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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pgbench: Add a real expression syntax to \set
  2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
  2015-03-02 19:38 ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-03-02 22:02   ` Robert Haas <robertmhaas@gmail.com>
  2015-03-02 22:17     ` Re: pgsql: pgbench: Add a real expression syntax to \set Fabien COELHO <coelho@cri.ensmp.fr>
  2015-03-03 00:22     ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 2 replies; 6+ messages in thread

From: Robert Haas @ 2015-03-02 22:02 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: 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

-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Attachments:

pgbench-expr-build-fix.patch (binary/octet-stream, 957B) download diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile index 6d13222..a18130b 100644 --- a/contrib/pgbench/Makefile +++ b/contrib/pgbench/Makefile @@ -6,8 +6,6 @@ PGAPPICON = win32 PROGRAM = pgbench OBJS = pgbench.o exprparse.o $(WIN32RES) -EXTRA_CLEAN = exprparse.c exprscan.c - PG_CPPFLAGS = -I$(libpq_srcdir) PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS) @@ -28,13 +26,8 @@ ifneq ($(PORTNAME), win32) override CFLAGS += $(PTHREAD_CFLAGS) endif -# There is no correct way to write a rule that generates two files. -# Rules with two targets don't have that meaning, they are merely -# shorthand for two otherwise separate rules. To be safe for parallel -# make, we must chain the dependencies like this. The semicolon is -# important; otherwise, make will choose the built-in rule. - -exprparse.h: exprparse.c ; - # exprscan is compiled as part of exprparse exprparse.o: exprscan.c + +maintainer-clean: + rm -f exprparse.c exprscan.c
^ permalink raw reply [nested|flat] 6+ messages in thread

* Re: pgsql: pgbench: Add a real expression syntax to \set
  2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
  2015-03-02 19:38 ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
  2015-03-02 22:02   ` Re: pgsql: pgbench: Add a real expression syntax to \set Robert Haas <robertmhaas@gmail.com>
@ 2015-03-02 22:17     ` Fabien COELHO <coelho@cri.ensmp.fr>
  1 sibling, 0 replies; 6+ messages in thread

From: Fabien COELHO @ 2015-03-02 22:17 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers


> 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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: pgbench: Add a real expression syntax to \set
  2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
  2015-03-02 19:38 ` Re: pgsql: pgbench: Add a real expression syntax to \set Tom Lane <tgl@sss.pgh.pa.us>
  2015-03-02 22:02   ` Re: pgsql: pgbench: Add a real expression syntax to \set Robert Haas <robertmhaas@gmail.com>
@ 2015-03-03 00:22     ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-03 00:22 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2015-03-03 00:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02 19:29 pgsql: pgbench: Add a real expression syntax to \set Robert Haas <rhaas@postgresql.org>
2015-03-02 19:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-03-02 19:56   ` Fabien COELHO <coelho@cri.ensmp.fr>
2015-03-02 22:02   ` Robert Haas <robertmhaas@gmail.com>
2015-03-02 22:17     ` Fabien COELHO <coelho@cri.ensmp.fr>
2015-03-03 00:22     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox