[PATCH] Remove useless USE_PGXS support in contrib

Started by Peter Eisentrautalmost 13 years ago34 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

This has served no purpose except to

1. take up space
2. confuse users
3. produce broken external extension modules that take contrib as an example
4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

There is adequate material in the documentation and elsewhere (PGXN) on
how to write extensions and their makefiles, so this is not needed.
---
pursuant to discussion here:
/messages/by-id/512CEAB8.9010400@gmx.net

contrib/adminpack/Makefile | 6 ------
contrib/auth_delay/Makefile | 6 ------
contrib/auto_explain/Makefile | 6 ------
contrib/btree_gin/Makefile | 6 ------
contrib/btree_gist/Makefile | 6 ------
contrib/chkpass/Makefile | 6 ------
contrib/citext/Makefile | 6 ------
contrib/cube/Makefile | 6 ------
contrib/dblink/Makefile | 6 ------
contrib/dict_int/Makefile | 6 ------
contrib/dict_xsyn/Makefile | 6 ------
contrib/dummy_seclabel/Makefile | 6 ------
contrib/earthdistance/Makefile | 6 ------
contrib/file_fdw/Makefile | 6 ------
contrib/fuzzystrmatch/Makefile | 6 ------
contrib/hstore/Makefile | 6 ------
contrib/intagg/Makefile | 6 ------
contrib/intarray/Makefile | 6 ------
contrib/isn/Makefile | 6 ------
contrib/lo/Makefile | 6 ------
contrib/ltree/Makefile | 6 ------
contrib/oid2name/Makefile | 6 ------
contrib/pageinspect/Makefile | 6 ------
contrib/passwordcheck/Makefile | 6 ------
contrib/pg_archivecleanup/Makefile | 6 ------
contrib/pg_buffercache/Makefile | 6 ------
contrib/pg_freespacemap/Makefile | 6 ------
contrib/pg_standby/Makefile | 6 ------
contrib/pg_stat_statements/Makefile | 6 ------
contrib/pg_test_fsync/Makefile | 6 ------
contrib/pg_test_timing/Makefile | 6 ------
contrib/pg_trgm/Makefile | 6 ------
contrib/pg_upgrade/Makefile | 6 ------
contrib/pg_upgrade_support/Makefile | 8 +-------
contrib/pg_xlogdump/Makefile | 6 ------
contrib/pgbench/Makefile | 6 ------
contrib/pgcrypto/Makefile | 6 ------
contrib/pgrowlocks/Makefile | 6 ------
contrib/pgstattuple/Makefile | 6 ------
contrib/postgres_fdw/Makefile | 6 ------
contrib/seg/Makefile | 6 ------
contrib/sepgsql/Makefile | 6 ------
contrib/spi/Makefile | 6 ------
contrib/sslinfo/Makefile | 6 ------
contrib/tablefunc/Makefile | 6 ------
contrib/tcn/Makefile | 6 ------
contrib/test_parser/Makefile | 6 ------
contrib/tsearch2/Makefile | 6 ------
contrib/unaccent/Makefile | 6 ------
contrib/uuid-ossp/Makefile | 6 ------
contrib/vacuumlo/Makefile | 6 ------
contrib/worker_spi/Makefile | 6 ------
contrib/xml2/Makefile | 6 ------
53 files changed, 1 insertion(+), 319 deletions(-)

diff --git a/contrib/adminpack/Makefile b/contrib/adminpack/Makefile
index 5cbc8f0..074d443 100644
--- a/contrib/adminpack/Makefile
+++ b/contrib/adminpack/Makefile
@@ -7,13 +7,7 @@ PG_CPPFLAGS = -I$(libpq_srcdir)
 EXTENSION = adminpack
 DATA = adminpack--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/adminpack
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/auth_delay/Makefile b/contrib/auth_delay/Makefile
index 09d2d54..d1c7918 100644
--- a/contrib/auth_delay/Makefile
+++ b/contrib/auth_delay/Makefile
@@ -2,13 +2,7 @@

MODULES = auth_delay

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/auth_delay
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/auto_explain/Makefile b/contrib/auto_explain/Makefile
index 2d1443f..d343572 100644
--- a/contrib/auto_explain/Makefile
+++ b/contrib/auto_explain/Makefile
@@ -3,13 +3,7 @@
 MODULE_big = auto_explain
 OBJS = auto_explain.o
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/auto_explain
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/btree_gin/Makefile b/contrib/btree_gin/Makefile
index 09fd3e6..284b745 100644
--- a/contrib/btree_gin/Makefile
+++ b/contrib/btree_gin/Makefile
@@ -11,13 +11,7 @@ REGRESS = install_btree_gin int2 int4 int8 float4 float8 money oid \
 	macaddr inet cidr text varchar char bytea bit varbit \
 	numeric
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/btree_gin
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/btree_gist/Makefile b/contrib/btree_gist/Makefile
index ba4af14..0d1dee3 100644
--- a/contrib/btree_gist/Makefile
+++ b/contrib/btree_gist/Makefile
@@ -17,13 +17,7 @@ REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz \

SHLIB_LINK += $(filter -lm, $(LIBS))

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/btree_gist
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/chkpass/Makefile b/contrib/chkpass/Makefile
index b775aef..5175371 100644
--- a/contrib/chkpass/Makefile
+++ b/contrib/chkpass/Makefile
@@ -8,13 +8,7 @@ DATA = chkpass--1.0.sql chkpass--unpackaged--1.0.sql

SHLIB_LINK = $(filter -lcrypt, $(LIBS))

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/chkpass
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/citext/Makefile b/contrib/citext/Makefile
index 6594252..18e0f0f 100644
--- a/contrib/citext/Makefile
+++ b/contrib/citext/Makefile
@@ -7,13 +7,7 @@ DATA = citext--1.0.sql citext--unpackaged--1.0.sql

REGRESS = citext

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/citext
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/cube/Makefile b/contrib/cube/Makefile
index b5cd5d0..635d707 100644
--- a/contrib/cube/Makefile
+++ b/contrib/cube/Makefile
@@ -12,16 +12,10 @@ EXTRA_CLEAN = y.tab.c y.tab.h

SHLIB_LINK += $(filter -lm, $(LIBS))

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/cube
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 # cubescan is compiled as part of cubeparse
diff --git a/contrib/dblink/Makefile b/contrib/dblink/Makefile
index 32314a0..f7b4acf 100644
--- a/contrib/dblink/Makefile
+++ b/contrib/dblink/Makefile
@@ -14,13 +14,7 @@ REGRESS = dblink
 # the db name is hard-coded in the tests
 override USE_MODULE_DB =
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/dblink
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/dict_int/Makefile b/contrib/dict_int/Makefile
index 3a3fc36..0a8b511 100644
--- a/contrib/dict_int/Makefile
+++ b/contrib/dict_int/Makefile
@@ -8,13 +8,7 @@ DATA = dict_int--1.0.sql dict_int--unpackaged--1.0.sql

REGRESS = dict_int

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/dict_int
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/dict_xsyn/Makefile b/contrib/dict_xsyn/Makefile
index ce92baa..e7f6286 100644
--- a/contrib/dict_xsyn/Makefile
+++ b/contrib/dict_xsyn/Makefile
@@ -9,13 +9,7 @@ DATA_TSEARCH = xsyn_sample.rules

REGRESS = dict_xsyn

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/dict_xsyn
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/dummy_seclabel/Makefile b/contrib/dummy_seclabel/Makefile
index 105400f..9c3d3ea 100644
--- a/contrib/dummy_seclabel/Makefile
+++ b/contrib/dummy_seclabel/Makefile
@@ -2,13 +2,7 @@

MODULES = dummy_seclabel

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/dummy_seclabel
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/earthdistance/Makefile b/contrib/earthdistance/Makefile
index 48a7cf8..d60ed86 100644
--- a/contrib/earthdistance/Makefile
+++ b/contrib/earthdistance/Makefile
@@ -10,13 +10,7 @@ REGRESS_OPTS = --extra-install=contrib/cube

LDFLAGS_SL += $(filter -lm, $(LIBS))

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/earthdistance
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/file_fdw/Makefile b/contrib/file_fdw/Makefile
index 4616cec..8c03df4 100644
--- a/contrib/file_fdw/Makefile
+++ b/contrib/file_fdw/Makefile
@@ -9,13 +9,7 @@ REGRESS = file_fdw

EXTRA_CLEAN = sql/file_fdw.sql expected/file_fdw.out

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/file_fdw
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/fuzzystrmatch/Makefile b/contrib/fuzzystrmatch/Makefile
index 834b679..6e51455 100644
--- a/contrib/fuzzystrmatch/Makefile
+++ b/contrib/fuzzystrmatch/Makefile
@@ -6,16 +6,10 @@ OBJS = fuzzystrmatch.o dmetaphone.o
 EXTENSION = fuzzystrmatch
 DATA = fuzzystrmatch--1.0.sql fuzzystrmatch--unpackaged--1.0.sql

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/fuzzystrmatch
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 # levenshtein.c is #included by fuzzystrmatch.c
 fuzzystrmatch.o: fuzzystrmatch.c levenshtein.c
diff --git a/contrib/hstore/Makefile b/contrib/hstore/Makefile
index 1236e79..3e258e7 100644
--- a/contrib/hstore/Makefile
+++ b/contrib/hstore/Makefile
@@ -9,13 +9,7 @@ DATA = hstore--1.1.sql hstore--1.0--1.1.sql hstore--unpackaged--1.0.sql

REGRESS = hstore

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/hstore
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/intagg/Makefile b/contrib/intagg/Makefile
index 2cfe997..8e52b41 100644
--- a/contrib/intagg/Makefile
+++ b/contrib/intagg/Makefile
@@ -3,13 +3,7 @@
 EXTENSION = intagg
 DATA = intagg--1.0.sql intagg--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/intagg
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/intarray/Makefile b/contrib/intarray/Makefile
index 71f820e..4107dc6 100644
--- a/contrib/intarray/Makefile
+++ b/contrib/intarray/Makefile
@@ -8,13 +8,7 @@ DATA = intarray--1.0.sql intarray--unpackaged--1.0.sql

REGRESS = _int

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/intarray
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/isn/Makefile b/contrib/isn/Makefile
index bd8f193..1f8e189 100644
--- a/contrib/isn/Makefile
+++ b/contrib/isn/Makefile
@@ -5,13 +5,7 @@ MODULES = isn
 EXTENSION = isn
 DATA = isn--1.0.sql isn--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/isn
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/lo/Makefile b/contrib/lo/Makefile
index 66b337c..fa7dfe9 100644
--- a/contrib/lo/Makefile
+++ b/contrib/lo/Makefile
@@ -5,13 +5,7 @@ MODULES = lo
 EXTENSION = lo
 DATA = lo--1.0.sql lo--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/lo
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/ltree/Makefile b/contrib/ltree/Makefile
index 65d42f8..4c4fd3f 100644
--- a/contrib/ltree/Makefile
+++ b/contrib/ltree/Makefile
@@ -10,13 +10,7 @@ DATA = ltree--1.0.sql ltree--unpackaged--1.0.sql

REGRESS = ltree

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/ltree
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/oid2name/Makefile b/contrib/oid2name/Makefile
index f695b4a..10f4f58 100644
--- a/contrib/oid2name/Makefile
+++ b/contrib/oid2name/Makefile
@@ -9,13 +9,7 @@ OBJS	= oid2name.o
 PG_CPPFLAGS = -I$(libpq_srcdir)
 PG_LIBS = $(libpq_pgport)
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/oid2name
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pageinspect/Makefile b/contrib/pageinspect/Makefile
index 0e267eb..ec0b279 100644
--- a/contrib/pageinspect/Makefile
+++ b/contrib/pageinspect/Makefile
@@ -7,13 +7,7 @@ EXTENSION = pageinspect
 DATA = pageinspect--1.1.sql pageinspect--1.0--1.1.sql \
 	pageinspect--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pageinspect
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/passwordcheck/Makefile b/contrib/passwordcheck/Makefile
index 4829bfd..0e2338c 100644
--- a/contrib/passwordcheck/Makefile
+++ b/contrib/passwordcheck/Makefile
@@ -7,13 +7,7 @@ OBJS = passwordcheck.o
 # PG_CPPFLAGS = -DUSE_CRACKLIB '-DCRACKLIB_DICTPATH="/usr/lib/cracklib_dict"'
 # SHLIB_LINK = -lcrack
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/passwordcheck
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_archivecleanup/Makefile b/contrib/pg_archivecleanup/Makefile
index 39c55d8..e746023 100644
--- a/contrib/pg_archivecleanup/Makefile
+++ b/contrib/pg_archivecleanup/Makefile
@@ -6,13 +6,7 @@ PGAPPICON = win32
 PROGRAM = pg_archivecleanup
 OBJS	= pg_archivecleanup.o
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_archivecleanup
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_buffercache/Makefile b/contrib/pg_buffercache/Makefile
index 323c0ac..06d2c30 100644
--- a/contrib/pg_buffercache/Makefile
+++ b/contrib/pg_buffercache/Makefile
@@ -6,13 +6,7 @@ OBJS = pg_buffercache_pages.o
 EXTENSION = pg_buffercache
 DATA = pg_buffercache--1.0.sql pg_buffercache--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_buffercache
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_freespacemap/Makefile b/contrib/pg_freespacemap/Makefile
index b2e3ba3..f028c05 100644
--- a/contrib/pg_freespacemap/Makefile
+++ b/contrib/pg_freespacemap/Makefile
@@ -6,13 +6,7 @@ OBJS = pg_freespacemap.o
 EXTENSION = pg_freespacemap
 DATA = pg_freespacemap--1.0.sql pg_freespacemap--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_freespacemap
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_standby/Makefile b/contrib/pg_standby/Makefile
index b7c6ae9..493624a 100644
--- a/contrib/pg_standby/Makefile
+++ b/contrib/pg_standby/Makefile
@@ -6,13 +6,7 @@ PGAPPICON = win32
 PROGRAM = pg_standby
 OBJS	= pg_standby.o
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_standby
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_stat_statements/Makefile b/contrib/pg_stat_statements/Makefile
index e8aed61..ad717b5 100644
--- a/contrib/pg_stat_statements/Makefile
+++ b/contrib/pg_stat_statements/Makefile
@@ -7,13 +7,7 @@ EXTENSION = pg_stat_statements
 DATA = pg_stat_statements--1.1.sql pg_stat_statements--1.0--1.1.sql \
 	pg_stat_statements--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_stat_statements
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_test_fsync/Makefile b/contrib/pg_test_fsync/Makefile
index b456429..2cb05a5 100644
--- a/contrib/pg_test_fsync/Makefile
+++ b/contrib/pg_test_fsync/Makefile
@@ -6,13 +6,7 @@ PGAPPICON = win32
 PROGRAM  = pg_test_fsync
 OBJS = pg_test_fsync.o
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_test_fsync
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_test_timing/Makefile b/contrib/pg_test_timing/Makefile
index b8b266a..83c99c0 100644
--- a/contrib/pg_test_timing/Makefile
+++ b/contrib/pg_test_timing/Makefile
@@ -6,13 +6,7 @@ PGAPPICON = win32
 PROGRAM  = pg_test_timing
 OBJS = pg_test_timing.o
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_test_timing
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_trgm/Makefile b/contrib/pg_trgm/Makefile
index 0d549f8..0b0ee44 100644
--- a/contrib/pg_trgm/Makefile
+++ b/contrib/pg_trgm/Makefile
@@ -8,13 +8,7 @@ DATA = pg_trgm--1.1.sql pg_trgm--1.0--1.1.sql pg_trgm--unpackaged--1.0.sql

REGRESS = pg_trgm

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_trgm
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_upgrade/Makefile b/contrib/pg_upgrade/Makefile
index bbb14a1..41612a3 100644
--- a/contrib/pg_upgrade/Makefile
+++ b/contrib/pg_upgrade/Makefile
@@ -13,16 +13,10 @@ PG_LIBS = $(libpq_pgport)

EXTRA_CLEAN = analyze_new_cluster.sh delete_old_cluster.sh log/ tmp_check/

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/pg_upgrade
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 check: test.sh all
 	MAKE=$(MAKE) bindir=$(bindir) libdir=$(libdir) $(SHELL) $< --install
diff --git a/contrib/pg_upgrade_support/Makefile b/contrib/pg_upgrade_support/Makefile
index f7def16..4214585 100644
--- a/contrib/pg_upgrade_support/Makefile
+++ b/contrib/pg_upgrade_support/Makefile
@@ -1,16 +1,10 @@
 # contrib/pg_upgrade_support/Makefile
-PGFILEDESC = "pg_upgrade_support - server-side functions for pg_upgrade"
+###PGFILEDESC = "pg_upgrade_support - server-side functions for pg_upgrade"

MODULES = pg_upgrade_support

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pg_upgrade_support
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_xlogdump/Makefile b/contrib/pg_xlogdump/Makefile
index 22bd8dc..23fb8f7 100644
--- a/contrib/pg_xlogdump/Makefile
+++ b/contrib/pg_xlogdump/Makefile
@@ -12,16 +12,10 @@ RMGRDESCOBJS = $(patsubst %.c,%.o,$(RMGRDESCSOURCES))

EXTRA_CLEAN = $(RMGRDESCSOURCES) xlogreader.c

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/pg_xlogdump
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

override CPPFLAGS := -DFRONTEND $(CPPFLAGS)

diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile
index b8f5fb4..98646ee 100644
--- a/contrib/pgbench/Makefile
+++ b/contrib/pgbench/Makefile
@@ -9,16 +9,10 @@ OBJS	= pgbench.o
 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
-endif

 ifneq ($(PORTNAME), win32)
 override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile
index dadec95..17c620d 100644
--- a/contrib/pgcrypto/Makefile
+++ b/contrib/pgcrypto/Makefile
@@ -36,16 +36,10 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \

EXTRA_CLEAN = gen-rtab

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/pgcrypto
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 # Add libraries that pgcrypto depends (or might depend) on into the
 # shared library link.  (The order in which you list them here doesn't
diff --git a/contrib/pgrowlocks/Makefile b/contrib/pgrowlocks/Makefile
index fe80423..4640403 100644
--- a/contrib/pgrowlocks/Makefile
+++ b/contrib/pgrowlocks/Makefile
@@ -6,13 +6,7 @@ OBJS		= pgrowlocks.o
 EXTENSION = pgrowlocks
 DATA = pgrowlocks--1.1.sql pgrowlocks--1.0--1.1.sql pgrowlocks--unpackaged--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pgrowlocks
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pgstattuple/Makefile b/contrib/pgstattuple/Makefile
index fc893d8..d9f7802 100644
--- a/contrib/pgstattuple/Makefile
+++ b/contrib/pgstattuple/Makefile
@@ -8,13 +8,7 @@ DATA = pgstattuple--1.1.sql pgstattuple--1.0--1.1.sql pgstattuple--unpackaged--1

REGRESS = pgstattuple

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/pgstattuple
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/postgres_fdw/Makefile b/contrib/postgres_fdw/Makefile
index 8c49720..b584a91 100644
--- a/contrib/postgres_fdw/Makefile
+++ b/contrib/postgres_fdw/Makefile
@@ -15,13 +15,7 @@ REGRESS = postgres_fdw
 # the db name is hard-coded in the tests
 override USE_MODULE_DB =
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/postgres_fdw
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/seg/Makefile b/contrib/seg/Makefile
index fb9c576..e37ae29 100644
--- a/contrib/seg/Makefile
+++ b/contrib/seg/Makefile
@@ -10,16 +10,10 @@ REGRESS = seg

EXTRA_CLEAN = y.tab.c y.tab.h

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/seg
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 # segscan is compiled as part of segparse
diff --git a/contrib/sepgsql/Makefile b/contrib/sepgsql/Makefile
index ff3a61d..d3aa3dd 100644
--- a/contrib/sepgsql/Makefile
+++ b/contrib/sepgsql/Makefile
@@ -9,15 +9,9 @@ DATA_built = sepgsql.sql
 # we have to clean those result files explicitly
 EXTRA_CLEAN = -r $(pg_regress_clean_files) tmp/ *.pp sepgsql-regtest.if sepgsql-regtest.fc

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/sepgsql
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 SHLIB_LINK += -lselinux
diff --git a/contrib/spi/Makefile b/contrib/spi/Makefile
index 0c11bfc..2af5c01 100644
--- a/contrib/spi/Makefile
+++ b/contrib/spi/Makefile
@@ -18,13 +18,7 @@ PG_CPPFLAGS = -DREFINT_VERBOSE

LDFLAGS_SL += -L$(top_builddir)/src/port -lpgport

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/spi
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/sslinfo/Makefile b/contrib/sslinfo/Makefile
index 0dee6ed..5708660 100644
--- a/contrib/sslinfo/Makefile
+++ b/contrib/sslinfo/Makefile
@@ -6,15 +6,9 @@ OBJS = sslinfo.o
 EXTENSION = sslinfo
 DATA = sslinfo--1.0.sql sslinfo--unpackaged--1.0.sql

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/sslinfo
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif

 SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))
diff --git a/contrib/tablefunc/Makefile b/contrib/tablefunc/Makefile
index eb10893..695a7f3 100644
--- a/contrib/tablefunc/Makefile
+++ b/contrib/tablefunc/Makefile
@@ -9,13 +9,7 @@ REGRESS = tablefunc

LDFLAGS_SL += $(filter -lm, $(LIBS))

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/tablefunc
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/tcn/Makefile b/contrib/tcn/Makefile
index 7bac5e3..e4ea2a6 100644
--- a/contrib/tcn/Makefile
+++ b/contrib/tcn/Makefile
@@ -5,13 +5,7 @@ MODULES = tcn
 EXTENSION = tcn
 DATA = tcn--1.0.sql
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/tcn
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/test_parser/Makefile b/contrib/test_parser/Makefile
index b9766cb..67711f5 100644
--- a/contrib/test_parser/Makefile
+++ b/contrib/test_parser/Makefile
@@ -8,13 +8,7 @@ DATA = test_parser--1.0.sql test_parser--unpackaged--1.0.sql

REGRESS = test_parser

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/test_parser
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/tsearch2/Makefile b/contrib/tsearch2/Makefile
index d260fd0..a065f0f 100644
--- a/contrib/tsearch2/Makefile
+++ b/contrib/tsearch2/Makefile
@@ -7,13 +7,7 @@ DATA = tsearch2--1.0.sql tsearch2--unpackaged--1.0.sql

REGRESS = tsearch2

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/tsearch2
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/unaccent/Makefile b/contrib/unaccent/Makefile
index f0be62d..53f33db 100644
--- a/contrib/unaccent/Makefile
+++ b/contrib/unaccent/Makefile
@@ -13,13 +13,7 @@ REGRESS = unaccent
 ENCODING = UTF8
 NO_LOCALE = 1
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/unaccent
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/uuid-ossp/Makefile b/contrib/uuid-ossp/Makefile
index 9b2d2e3..44af514 100644
--- a/contrib/uuid-ossp/Makefile
+++ b/contrib/uuid-ossp/Makefile
@@ -8,13 +8,7 @@ DATA = uuid-ossp--1.0.sql uuid-ossp--unpackaged--1.0.sql

SHLIB_LINK += $(OSSP_UUID_LIBS)

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/uuid-ossp
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile
index b658f9b..bc257ae 100644
--- a/contrib/vacuumlo/Makefile
+++ b/contrib/vacuumlo/Makefile
@@ -9,13 +9,7 @@ OBJS	= vacuumlo.o
 PG_CPPFLAGS = -I$(libpq_srcdir)
 PG_LIBS = $(libpq_pgport)
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/vacuumlo
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/worker_spi/Makefile b/contrib/worker_spi/Makefile
index edf4105..ea9e2c7 100644
--- a/contrib/worker_spi/Makefile
+++ b/contrib/worker_spi/Makefile
@@ -2,13 +2,7 @@

MODULES = worker_spi

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
 subdir = contrib/worker_spi
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/xml2/Makefile b/contrib/xml2/Makefile
index be3d018..2b97c35 100644
--- a/contrib/xml2/Makefile
+++ b/contrib/xml2/Makefile
@@ -10,13 +10,7 @@ REGRESS = xml2

SHLIB_LINK += $(filter -lxslt, $(LIBS)) -lxml2

-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
subdir = contrib/xml2
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
-endif
--
1.7.10.4

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

#2David E. Wheeler
david@kineticode.com
In reply to: Peter Eisentraut (#1)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On Jun 12, 2013, at 8:16 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

This has served no purpose except to

1. take up space
2. confuse users
3. produce broken external extension modules that take contrib as an example
4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

There is adequate material in the documentation and elsewhere (PGXN) on
how to write extensions and their makefiles, so this is not needed.

+1 Nice.

David

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

#3amul sul
sul_amul@yahoo.co.in
In reply to: Peter Eisentraut (#1)
Re: [PATCH] Remove useless USE_PGXS support in contrib

----- Original Message -----

From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-hackers@postgresql.org
Cc:
Sent: Thursday, 13 June 2013 12:16 PM
Subject: [HACKERS] [PATCH] Remove useless USE_PGXS support in contrib

T his has served no purpose except to

1. take up space
2. confuse users
3. produce broken external extension modules that take contrib as an example
4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

Agree, only if we consider these contrib module is always gonna deployed with the postgresql.
But, what if user going to install such module elsewhere i.e. not from contrib directory of pg source.
I this way Makefile should different, right? 

We need to makefile code should uniform to exclude any confusion to user.

if space is not such dominant, we can add code at the top of make file to avoid confusion of user to export USE_PGXS as follow  

ifndef USE_PGXS
top_builddir = ../..
makefile_global = $(top_builddir)/src/Makefile.global
ifeq "$(wildcard $(makefile_global))" ""
USE_PGXS = 1 
endif

/* remaining code as it is */*

Regards,
Amul Sul

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

#4Peter Eisentraut
peter_e@gmx.net
In reply to: amul sul (#3)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On 6/13/13 9:20 PM, amul sul wrote:

Agree, only if we consider these contrib module is always gonna deployed with the postgresql.
But, what if user going to install such module elsewhere i.e. not from contrib directory of pg source.

Why would anyone do that?

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

#5Amit Langote
Langote_Amit_f8@lab.ntt.co.jp
In reply to: Peter Eisentraut (#4)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On Fri, Jun 14, 2013 at 9:35 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

On 6/13/13 9:20 PM, amul sul wrote:

Agree, only if we consider these contrib module is always gonna deployed with the postgresql.
But, what if user going to install such module elsewhere i.e. not from contrib directory of pg source.

Why would anyone do that?

Is he probably saying "install such module *from* elsewhere"? Like
directly from the source directory of a module using something like
following:

cd /path/to/module-source
make USE_PGXS=1 PG_CONFIG=/path/to/pg_config
make USE_PGXS=1 PG_CONFIG=/path/to/pg_config install

When user does not work with pg source directly and does not have
postgresql-contrib installed?
Am I missing something here?

--
Amit Langote

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

#6Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Eisentraut (#4)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On 06/14/2013 08:35 AM, Peter Eisentraut wrote:

On 6/13/13 9:20 PM, amul sul wrote:

Agree, only if we consider these contrib module is always gonna deployed with the postgresql.
But, what if user going to install such module elsewhere i.e. not from contrib directory of pg source.

Why would anyone do that?

Maybe they wouldn't.

I do think we need to make sure that we have at least buildfarm coverage
of pgxs module building and testing. I have some coverage of a few
extensions I have written, which exercise that, so maybe that will
suffice. If not, maybe we need to have one module that only builds via
pgxs and is build after an install (i.e. not via the standard contrib
build).

I don't really like the directory layout we use for these modules
anyway, so I'm not sure they constitute best practice for extension
builders. Lately I have been using an extension skeleton that looks
something like this:

License
Readme.md
META.json (for pgxn)
extension.control
Makefile
doc/extension.md (soft linked to ../Readme.md)
src/extension.c
sql/extension.sql
test/sql/extension.sql
test/expected/extension.out

cheers

andrew

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

#7Craig Ringer
craig@2ndquadrant.com
In reply to: Peter Eisentraut (#1)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On 06/13/2013 11:16 AM, Peter Eisentraut wrote:

This has served no purpose except to

1. take up space
2. confuse users
3. produce broken external extension modules that take contrib as an example
4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

Weak -1 from me; I find being able to build contrib modules using PGXS
from the source tree extremely useful in development. It allows me to
easily install an extension from a newer Pg version into an older
server, test against older servers, etc.

What about assuming USE_PGXS=1 if it's unset, and have recursive make
set USE_PGXS=0 explicitly when invoking contrib makefiles?

There'd be a behaviour change, in that you'd have to write USE_PGXS=0
when you wanted the module to build against the tree it was currently in
instead of with pgxs. Maybe that's just as confusing.

If everyone hates that idea I can just write a 'pgxs' command that
copies the Makefile, hacks it to use PGXS, and runs it, so it's not like
I lose anything critical.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#8Cédric Villemain
cedric@2ndquadrant.com
In reply to: Andrew Dunstan (#6)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Andrew Dunstan <andrew@dunslane.net> a écrit :

On 06/14/2013 08:35 AM, Peter Eisentraut wrote:

On 6/13/13 9:20 PM, amul sul wrote:

Agree, only if we consider these contrib module is always gonna

deployed with the postgresql.

But, what if user going to install such module elsewhere i.e. not

from contrib directory of pg source.

Why would anyone do that?

Maybe they wouldn't.

I do think we need to make sure that we have at least buildfarm
coverage
of pgxs module building and testing. I have some coverage of a few
extensions I have written, which exercise that, so maybe that will
suffice. If not, maybe we need to have one module that only builds via
pgxs and is build after an install (i.e. not via the standard contrib
build).

I agree, I found very useful to have all the provided extensions build with PGXS to debug it.
It also offers a good set of natural regression tests.

I don't really like the directory layout we use for these modules
anyway, so I'm not sure they constitute best practice for extension
builders. Lately I have been using an extension skeleton that looks
something like this:

License
Readme.md
META.json (for pgxn)
extension.control
Makefile
doc/extension.md (soft linked to ../Readme.md)

This makes mandatory to have a MODULEDIR defined or a rule to rename it with the extension name suffixed.

src/extension.c
sql/extension.sql

It is (was) the default place for regression tests....I am not sure it is a good thing to shuffle that.
Also, you don't do 'c/source.c'

--
Envoyé de mon téléphone, excusez la brièveté.

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

#9Andrew Dunstan
andrew@dunslane.net
In reply to: Cédric Villemain (#8)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On 06/15/2013 06:24 AM, Cédric Villemain wrote:

Andrew Dunstan <andrew@dunslane.net> a écrit :

On 06/14/2013 08:35 AM, Peter Eisentraut wrote:

On 6/13/13 9:20 PM, amul sul wrote:

Agree, only if we consider these contrib module is always gonna

deployed with the postgresql.

But, what if user going to install such module elsewhere i.e. not

from contrib directory of pg source.

Why would anyone do that?

Maybe they wouldn't.

I do think we need to make sure that we have at least buildfarm
coverage
of pgxs module building and testing. I have some coverage of a few
extensions I have written, which exercise that, so maybe that will
suffice. If not, maybe we need to have one module that only builds via
pgxs and is build after an install (i.e. not via the standard contrib
build).

I agree, I found very useful to have all the provided extensions build with PGXS to debug it.
It also offers a good set of natural regression tests.

I don't really like the directory layout we use for these modules
anyway, so I'm not sure they constitute best practice for extension
builders. Lately I have been using an extension skeleton that looks
something like this:

License
Readme.md
META.json (for pgxn)
extension.control
Makefile
doc/extension.md (soft linked to ../Readme.md)

This makes mandatory to have a MODULEDIR defined or a rule to rename it with the extension name suffixed.

Of course, for extension foo this would actually be foo.md. It installs
just fine like that. The makefile template has:

DOCS = $(wildcard doc/*.md)

src/extension.c
sql/extension.sql

It is (was) the default place for regression tests....I am not sure it is a good thing to shuffle that.
Also, you don't do 'c/source.c'

The sql here is the sql to install the extension, not part of the build
nor part of the tests.

Some time ago I fixed pg_regress to honor --inputdir and --outputdir
properly, so my Makefile template has this:

REGRESS_OPTS = --inputdir=test --outputdir=test \
--load-extension=$(EXTENSION)
...
override pg_regress_clean_files = test/results/
test/regression.diffs test/regression.out tmp_check/ log/

That keeps the testing stuff out of the way quite nicely.

You might not like this pattern, but I find it much saner that what we
currently use. I certainly don't claim it's perfect.

cheers

andrew

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

#10Cédric Villemain
cedric@2ndquadrant.com
In reply to: Andrew Dunstan (#9)
Re: [PATCH] Remove useless USE_PGXS support in contrib

I don't really like the directory layout we use for these modules
anyway, so I'm not sure they constitute best practice for extension
builders. Lately I have been using an extension skeleton that looks

something like this:
License
Readme.md
META.json (for pgxn)
extension.control
Makefile
doc/extension.md (soft linked to ../Readme.md)

This makes mandatory to have a MODULEDIR defined or a rule to rename it
with the extension name suffixed.

Of course, for extension foo this would actually be foo.md. It installs
just fine like that. The makefile template has:

DOCS = $(wildcard doc/*.md)

Oh! yes, I missed the soft link.

src/extension.c
sql/extension.sql

It is (was) the default place for regression tests....I am not sure it is
a good thing to shuffle that. Also, you don't do 'c/source.c'

The sql here is the sql to install the extension, not part of the build
nor part of the tests.

I am interested by this topic, since we have Extensions we invite users to
increase the usage of them. So going a step forward with a better layout is
definitively something to do.

What do you suggest for the previous usage ? we have a hard rule to try to put
libdir in *sql.in files for example.

Some time ago I fixed pg_regress to honor --inputdir and --outputdir
properly, so my Makefile template has this:

REGRESS_OPTS = --inputdir=test --outputdir=test \
--load-extension=$(EXTENSION)
...
override pg_regress_clean_files = test/results/
test/regression.diffs test/regression.out tmp_check/ log/

That keeps the testing stuff out of the way quite nicely.

You might not like this pattern, but I find it much saner that what we
currently use. I certainly don't claim it's perfect.

I am interested by this topic, since we have Extensions we invite users to
increase the usage of them. So going a step forward with a better layout is
definitively something to do. I have no strong assumption on what the ideal
layout is, 'your' and pgxn layout are good and I won't vote against suggesting
to use them (and improve PGXS to match those suggestions).

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

#11Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Craig Ringer (#7)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Craig Ringer wrote:

On 06/13/2013 11:16 AM, Peter Eisentraut wrote:

This has served no purpose except to

1. take up space
2. confuse users
3. produce broken external extension modules that take contrib as an example
4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

Weak -1 from me; I find being able to build contrib modules using PGXS
from the source tree extremely useful in development. It allows me to
easily install an extension from a newer Pg version into an older
server, test against older servers, etc.

This use case seems too narrow to me to justify the burden of keeping
PGXS-enabled makefiles in contrib.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#12Joe Conway
mail@joeconway.com
In reply to: Alvaro Herrera (#11)
Re: [PATCH] Remove useless USE_PGXS support in contrib

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/15/2013 11:28 AM, Alvaro Herrera wrote:

Craig Ringer wrote:

On 06/13/2013 11:16 AM, Peter Eisentraut wrote:

This has served no purpose except to

1. take up space 2. confuse users 3. produce broken external
extension modules that take contrib as an example 4. break
builds of PostgreSQL when users try to fix 3. by exporting
USE_PGXS

Weak -1 from me; I find being able to build contrib modules using
PGXS from the source tree extremely useful in development. It
allows me to easily install an extension from a newer Pg version
into an older server, test against older servers, etc.

This use case seems too narrow to me to justify the burden of
keeping PGXS-enabled makefiles in contrib.

What was the burden of it?

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRvLWLAAoJEDfy90M199hllqIP/3ZHKaiOEidUPoRK2n9BrW3b
MmHzfzn2rhOxhL4XYSxUz5mI8CDecYf5PXi1m0dwdyTCGUNWSQRiNMzN5x0Wd8v3
TVD2PS3m9XM4tWf+Y1DxSjkrDZ4KZFE8HdKFJUoCu73a0wS+nIerPC28PsPJjfen
bBzaWMbZsuY37GUh3uzJW4p/KDrRV5Bh298tP2hgWPCdxpenwT3sK7+qw2Goumly
Gdltp6BBkUTxpk42X72PRPx+QUwZJfmQ0QjubR+vkiYSi5otyVB2q1xr+umts+SW
Z69dfxyQIp0BHaFpUB1DFVXwx+hmWyNKWwA0mIBIXQhlKh8VZXbz5ENHKnK1xPpK
GcO/LFl/z5zI0CMFVFW2nwQPJ8NN+Jmru23Q53FGGsIXXJJJofCDt8U9BDLCGYpZ
uq1E1/7HfIkDL0f6jDRrBmdQacnRRYWKmhEGXjQQ1Med5IG3pFiqedZj3d8xCNDU
xB1wwAnIOiLnIo8WF2eIeYzuPQ5gN+xZFpUrQz+tt3UBuIsvhxXI1qQvJwRnwJTx
O30Aw7zZYbnI+zZvkO1ibyIUUp8byE0DuIBwg2ergKTD4BVpKi2ThIntSXY3W/hO
JzwulZfaQ120NBmrDXx641SnkXlRmMYK82KzJcDFMcyR6y04dZVhrUi0Ml2Yno6Z
dsi1AdDZJpBJq9nwIJ53
=fVLk
-----END PGP SIGNATURE-----

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

#13David E. Wheeler
david@kineticode.com
In reply to: Andrew Dunstan (#9)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On Jun 15, 2013, at 4:12 AM, Andrew Dunstan <andrew@dunslane.net> wrote:

REGRESS_OPTS = --inputdir=test --outputdir=test \
--load-extension=$(EXTENSION)
...
override pg_regress_clean_files = test/results/
test/regression.diffs test/regression.out tmp_check/ log/

That keeps the testing stuff out of the way quite nicely.

I don't suppose there could be a way for the makefile to notice the --outputdir option and add those files to the clean target itself, could there? Having it hard-coded is slightly annoying. Maybe it could ask pg_regress where to find them?

Thanks,

David

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

#14Andrew Dunstan
andrew@dunslane.net
In reply to: David E. Wheeler (#13)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On 06/15/2013 02:43 PM, David E. Wheeler wrote:

On Jun 15, 2013, at 4:12 AM, Andrew Dunstan <andrew@dunslane.net> wrote:

REGRESS_OPTS = --inputdir=test --outputdir=test \
--load-extension=$(EXTENSION)
...
override pg_regress_clean_files = test/results/
test/regression.diffs test/regression.out tmp_check/ log/

That keeps the testing stuff out of the way quite nicely.

I don't suppose there could be a way for the makefile to notice the --outputdir option and add those files to the clean target itself, could there? Having it hard-coded is slightly annoying. Maybe it could ask pg_regress where to find them?

That doesn't sound like a promising line of development to me. Better
would be to provide a PGXS option to specify where tests are based, and
set the clean target accordingly.

Then instead of the above you'd just be able to say something like

MODULETEST = test
REGRESS_OPTS = --load-extension=$(EXTENSION)

Which would be a good deal cleaner.

cheers

andrew

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

#15Cédric Villemain
cedric@2ndquadrant.com
In reply to: Andrew Dunstan (#14)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Le samedi 15 juin 2013 23:45:21, Andrew Dunstan a écrit :

On 06/15/2013 02:43 PM, David E. Wheeler wrote:

On Jun 15, 2013, at 4:12 AM, Andrew Dunstan <andrew@dunslane.net> wrote:

REGRESS_OPTS = --inputdir=test --outputdir=test \

--load-extension=$(EXTENSION)

...
override pg_regress_clean_files = test/results/
test/regression.diffs test/regression.out tmp_check/ log/

That keeps the testing stuff out of the way quite nicely.

I don't suppose there could be a way for the makefile to notice the
--outputdir option and add those files to the clean target itself, could
there? Having it hard-coded is slightly annoying. Maybe it could ask
pg_regress where to find them?

That doesn't sound like a promising line of development to me. Better
would be to provide a PGXS option to specify where tests are based, and
set the clean target accordingly.

Then instead of the above you'd just be able to say something like

MODULETEST = test

or REGRESSDIR ?

Also I suggest to remove the need to set REGRESS at all, and default to all
sql files in REGRESSDIR/sql (if REGRESSDIR is set)

Back to DOCS, we may also have PGXS default to find a README(.*) and rename it
to README.$extension.$1 if MODULEDIR is not set.

REGRESS_OPTS = --load-extension=$(EXTENSION)

Which would be a good deal cleaner.

yes.

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

#16Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Peter Eisentraut (#1)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Hi,

Peter Eisentraut <peter_e@gmx.net> writes:

2. confuse users
3. produce broken external extension modules that take contrib as an example

I agree that having both cases (sections) in the Makefile is a bad idea.
Still, why should we keep the in-tree build instructions?

Would it be possible instead to instruct PGXN to work with a non
installed server source tree? And how much do we need that really?

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

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

#17David E. Wheeler
david@kineticode.com
In reply to: Cédric Villemain (#15)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On Jun 16, 2013, at 9:20 AM, Cédric Villemain <cedric@2ndquadrant.com> wrote:

Then instead of the above you'd just be able to say something like

MODULETEST = test

or REGRESSDIR ?

Yeah, that sounds perfect.

Also I suggest to remove the need to set REGRESS at all, and default to all
sql files in REGRESSDIR/sql (if REGRESSDIR is set)

Yeah, that would be nice. If one has different file names or something, then one should still be able to set REGRESS.

Best,

David

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

#18Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Joe Conway (#12)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Joe Conway wrote:

On 06/15/2013 11:28 AM, Alvaro Herrera wrote:

This use case seems too narrow to me to justify the burden of
keeping PGXS-enabled makefiles in contrib.

What was the burden of it?

Per /messages/by-id/1371093408.309.5.camel@vanquo.pezone.net :

: 1. take up space
: 2. confuse users
: 3. produce broken external extension modules that take contrib as an example
: 4. break builds of PostgreSQL when users try to fix 3. by exporting USE_PGXS

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#19Cédric Villemain
cedric@2ndquadrant.com
In reply to: Alvaro Herrera (#18)
Re: [PATCH] Remove useless USE_PGXS support in contrib

Le lundi 17 juin 2013 18:41:32, Alvaro Herrera a écrit :

Joe Conway wrote:

On 06/15/2013 11:28 AM, Alvaro Herrera wrote:

This use case seems too narrow to me to justify the burden of
keeping PGXS-enabled makefiles in contrib.

What was the burden of it?

Per http://www.postgresql.org/message-

id/1371093408.309.5.camel@vanquo.pezone.net :

: 1. take up space
: 2. confuse users
: 3. produce broken external extension modules that take contrib as an
: example 4. break builds of PostgreSQL when users try to fix 3. by
: exporting USE_PGXS

But:
4. can be fixed (see patches I sent) so it is not an excuse.

I agree for other points.
My only grief is to loose the perfect regression tests for PGXS those contribs
are.

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

#20Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#6)
Re: [PATCH] Remove useless USE_PGXS support in contrib

On Fri, 2013-06-14 at 09:32 -0400, Andrew Dunstan wrote:

I do think we need to make sure that we have at least buildfarm
coverage of pgxs module building and testing. I have some coverage of
a few extensions I have written, which exercise that, so maybe that
will suffice. If not, maybe we need to have one module that only
builds via pgxs and is build after an install (i.e. not via the
standard contrib build).

The way to test pgxs is to build actual pgxs modules, and possibly some
unit tests made for the purpose. Testing with fake hybrid modules that
will never actually appear that way in practice isn't going to satisfy
anyone.

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

#21Peter Eisentraut
peter_e@gmx.net
In reply to: Cédric Villemain (#15)
#22Peter Eisentraut
peter_e@gmx.net
In reply to: Cédric Villemain (#19)
#23Peter Eisentraut
peter_e@gmx.net
In reply to: Dimitri Fontaine (#16)
#24Cédric Villemain
cedric@2ndquadrant.com
In reply to: Peter Eisentraut (#22)
#25Cédric Villemain
cedric@2ndquadrant.com
In reply to: Peter Eisentraut (#1)
#26Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Peter Eisentraut (#23)
#27Andrew Dunstan
andrew@dunslane.net
In reply to: Dimitri Fontaine (#26)
#28Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Andrew Dunstan (#27)
#29Andrew Dunstan
andrew@dunslane.net
In reply to: Dimitri Fontaine (#28)
#30Cédric Villemain
cedric@2ndquadrant.com
In reply to: Andrew Dunstan (#27)
#31Josh Berkus
josh@agliodbs.com
In reply to: Peter Eisentraut (#1)
#32Cédric Villemain
cedric@2ndquadrant.com
In reply to: Josh Berkus (#31)
#33Josh Berkus
josh@agliodbs.com
In reply to: Peter Eisentraut (#1)
#34Andrew Dunstan
andrew@dunslane.net
In reply to: Josh Berkus (#33)