aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/Makefile1
-rw-r--r--contrib/pgbench/Makefile33
-rw-r--r--doc/src/sgml/contrib.sgml1
-rw-r--r--doc/src/sgml/filelist.sgml1
-rw-r--r--doc/src/sgml/ref/allfiles.sgml1
-rw-r--r--doc/src/sgml/ref/pgbench.sgml (renamed from doc/src/sgml/pgbench.sgml)2
-rw-r--r--doc/src/sgml/reference.sgml1
-rw-r--r--src/bin/Makefile1
-rw-r--r--src/bin/pgbench/.gitignore (renamed from contrib/pgbench/.gitignore)0
-rw-r--r--src/bin/pgbench/Makefile42
-rw-r--r--src/bin/pgbench/exprparse.y (renamed from contrib/pgbench/exprparse.y)0
-rw-r--r--src/bin/pgbench/exprscan.l (renamed from contrib/pgbench/exprscan.l)0
-rw-r--r--src/bin/pgbench/pgbench.c (renamed from contrib/pgbench/pgbench.c)2
-rw-r--r--src/bin/pgbench/pgbench.h (renamed from contrib/pgbench/pgbench.h)0
-rw-r--r--src/tools/msvc/Mkvcbuild.pm23
15 files changed, 60 insertions, 48 deletions
diff --git a/contrib/Makefile b/contrib/Makefile
index c56050eecc3..d63e441cb59 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -38,7 +38,6 @@ SUBDIRS = \
pg_trgm \
pg_upgrade \
pg_upgrade_support \
- pgbench \
pgcrypto \
pgrowlocks \
pgstattuple \
diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile
deleted file mode 100644
index a18130b1dcf..00000000000
--- a/contrib/pgbench/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# contrib/pgbench/Makefile
-
-PGFILEDESC = "pgbench - a simple program for running benchmark tests"
-PGAPPICON = win32
-
-PROGRAM = pgbench
-OBJS = pgbench.o exprparse.o $(WIN32RES)
-
-PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pgbench
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-
-distprep: exprparse.c exprscan.c
-endif
-
-ifneq ($(PORTNAME), win32)
-override CFLAGS += $(PTHREAD_CFLAGS)
-endif
-
-# exprscan is compiled as part of exprparse
-exprparse.o: exprscan.c
-
-maintainer-clean:
- rm -f exprparse.c exprscan.c
diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml
index f21fa149182..57730955bfa 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -187,7 +187,6 @@ pages.
</para>
&oid2name;
- &pgbench;
&vacuumlo;
</sect1>
diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml
index 8b9d6a91279..ab935a6664f 100644
--- a/doc/src/sgml/filelist.sgml
+++ b/doc/src/sgml/filelist.sgml
@@ -125,7 +125,6 @@
<!ENTITY oid2name SYSTEM "oid2name.sgml">
<!ENTITY pageinspect SYSTEM "pageinspect.sgml">
<!ENTITY passwordcheck SYSTEM "passwordcheck.sgml">
-<!ENTITY pgbench SYSTEM "pgbench.sgml">
<!ENTITY pgbuffercache SYSTEM "pgbuffercache.sgml">
<!ENTITY pgcrypto SYSTEM "pgcrypto.sgml">
<!ENTITY pgfreespacemap SYSTEM "pgfreespacemap.sgml">
diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml
index f3b577119bd..9ae6aecb1a1 100644
--- a/doc/src/sgml/ref/allfiles.sgml
+++ b/doc/src/sgml/ref/allfiles.sgml
@@ -181,6 +181,7 @@ Complete list of usable sgml source files in this directory.
<!ENTITY initdb SYSTEM "initdb.sgml">
<!ENTITY pgarchivecleanup SYSTEM "pgarchivecleanup.sgml">
<!ENTITY pgBasebackup SYSTEM "pg_basebackup.sgml">
+<!ENTITY pgbench SYSTEM "pgbench.sgml">
<!ENTITY pgConfig SYSTEM "pg_config-ref.sgml">
<!ENTITY pgControldata SYSTEM "pg_controldata.sgml">
<!ENTITY pgCtl SYSTEM "pg_ctl-ref.sgml">
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index ed12e279064..a8085463a5e 100644
--- a/doc/src/sgml/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -1,4 +1,4 @@
-<!-- doc/src/sgml/pgbench.sgml -->
+<!-- doc/src/sgml/ref/pgbench.sgml -->
<refentry id="pgbench">
<indexterm zone="pgbench">
diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml
index 9fb32f8c284..c1765ef1c5e 100644
--- a/doc/src/sgml/reference.sgml
+++ b/doc/src/sgml/reference.sgml
@@ -230,6 +230,7 @@
&dropuser;
&ecpgRef;
&pgBasebackup;
+ &pgbench;
&pgConfig;
&pgDump;
&pgDumpall;
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 69cc2b83c1b..bb77142cab8 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -23,6 +23,7 @@ SUBDIRS = \
pg_dump \
pg_resetxlog \
pg_rewind \
+ pgbench \
psql \
scripts
diff --git a/contrib/pgbench/.gitignore b/src/bin/pgbench/.gitignore
index aae819ed70f..aae819ed70f 100644
--- a/contrib/pgbench/.gitignore
+++ b/src/bin/pgbench/.gitignore
diff --git a/src/bin/pgbench/Makefile b/src/bin/pgbench/Makefile
new file mode 100644
index 00000000000..18fdf58d13e
--- /dev/null
+++ b/src/bin/pgbench/Makefile
@@ -0,0 +1,42 @@
+# src/bin/pgbench/Makefile
+
+PGFILEDESC = "pgbench - a simple program for running benchmark tests"
+PGAPPICON = win32
+
+subdir = src/bin/pgbench
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+OBJS = pgbench.o exprparse.o $(WIN32RES)
+
+override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+
+ifneq ($(PORTNAME), win32)
+override CFLAGS += $(PTHREAD_CFLAGS)
+endif
+
+
+all: pgbench
+
+pgbench: $(OBJS) | submake-libpq submake-libpgport
+ $(CC) $(CFLAGS) $^ $(libpq_pgport) $(PTHREAD_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+
+# exprscan is compiled as part of exprparse
+exprparse.o: exprscan.c
+
+distprep: exprparse.c exprscan.c
+
+install: all installdirs
+ $(INSTALL_PROGRAM) pgbench$(X) '$(DESTDIR)$(bindir)/pgbench$(X)'
+
+installdirs:
+ $(MKDIR_P) '$(DESTDIR)$(bindir)'
+
+uninstall:
+ rm -f '$(DESTDIR)$(bindir)/pgbench$(X)'
+
+clean distclean:
+ rm -f pgbench$(X) $(OBJS)
+
+maintainer-clean: distclean
+ rm -f exprparse.c exprscan.c
diff --git a/contrib/pgbench/exprparse.y b/src/bin/pgbench/exprparse.y
index e68631e3e61..e68631e3e61 100644
--- a/contrib/pgbench/exprparse.y
+++ b/src/bin/pgbench/exprparse.y
diff --git a/contrib/pgbench/exprscan.l b/src/bin/pgbench/exprscan.l
index 5331ab778b4..5331ab778b4 100644
--- a/contrib/pgbench/exprscan.l
+++ b/src/bin/pgbench/exprscan.l
diff --git a/contrib/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 788484e8793..06a4dfd9a8c 100644
--- a/contrib/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -4,7 +4,7 @@
* A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors.
*
- * contrib/pgbench/pgbench.c
+ * src/bin/pgbench/pgbench.c
* Copyright (c) 2000-2015, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
diff --git a/contrib/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index a3db6b97cc9..a3db6b97cc9 100644
--- a/contrib/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index ef083349736..8993efaa192 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -31,42 +31,45 @@ my $libpq;
# Set of variables for contrib modules
my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
my @contrib_uselibpq =
- ('dblink', 'oid2name', 'pgbench', 'pg_upgrade', 'postgres_fdw', 'vacuumlo');
+ ('dblink', 'oid2name', 'pg_upgrade', 'postgres_fdw', 'vacuumlo');
my @contrib_uselibpgport = (
- 'oid2name', 'pgbench',
+ 'oid2name',
'pg_standby',
'pg_test_fsync', 'pg_test_timing',
'pg_upgrade', 'pg_xlogdump',
'vacuumlo');
my @contrib_uselibpgcommon = (
- 'oid2name', 'pgbench',
+ 'oid2name',
'pg_standby',
'pg_test_fsync', 'pg_test_timing',
'pg_upgrade', 'pg_xlogdump',
'vacuumlo');
-my $contrib_extralibs = { 'pgbench' => ['ws2_32.lib'] };
+my $contrib_extralibs = undef;
my $contrib_extraincludes =
{ 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] };
my $contrib_extrasource = {
'cube' => [ 'contrib\cube\cubescan.l', 'contrib\cube\cubeparse.y' ],
- 'pgbench' =>
- [ 'contrib\pgbench\exprscan.l', 'contrib\pgbench\exprparse.y' ],
'seg' => [ 'contrib\seg\segscan.l', 'contrib\seg\segparse.y' ], };
my @contrib_excludes = ('pgcrypto', 'intagg', 'sepgsql');
# Set of variables for frontend modules
my $frontend_defines = { 'initdb' => 'FRONTEND' };
-my @frontend_uselibpq = ('pg_ctl', 'psql');
-my @frontend_uselibpgport = ( 'pg_archivecleanup' );
-my @frontend_uselibpgcommon = ( 'pg_archivecleanup' );
+my @frontend_uselibpq = ('pg_ctl', 'pgbench', 'psql');
+my @frontend_uselibpgport = ( 'pg_archivecleanup', 'pgbench' );
+my @frontend_uselibpgcommon = ( 'pg_archivecleanup', 'pgbench' );
my $frontend_extralibs = {
'initdb' => ['ws2_32.lib'],
'pg_restore' => ['ws2_32.lib'],
+ 'pgbench' => ['ws2_32.lib'],
'psql' => ['ws2_32.lib'] };
my $frontend_extraincludes = {
'initdb' => ['src\timezone'],
'psql' => [ 'src\bin\pg_dump', 'src\backend' ] };
-my $frontend_extrasource = { 'psql' => ['src\bin\psql\psqlscan.l'] };
+my $frontend_extrasource = {
+ 'psql' => ['src\bin\psql\psqlscan.l'],
+ 'pgbench' =>
+ [ 'contrib\pgbench\exprscan.l', 'contrib\pgbench\exprparse.y' ],
+};
my @frontend_excludes =
('pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', 'scripts');