Convert postgresql_fdw to an EXTENSION.
authorShigeru Hanada <hanada@metrosystems.co.jp>
Thu, 24 Feb 2011 12:06:39 +0000 (21:06 +0900)
committerShigeru Hanada <hanada@metrosystems.co.jp>
Thu, 24 Feb 2011 12:06:39 +0000 (21:06 +0900)
contrib/README
contrib/postgresql_fdw/Makefile
contrib/postgresql_fdw/expected/postgresql_fdw.out
contrib/postgresql_fdw/postgresql_fdw--1.0.sql [moved from contrib/postgresql_fdw/postgresql_fdw.sql.in with 65% similarity]
contrib/postgresql_fdw/postgresql_fdw.control [new file with mode: 0644]
contrib/postgresql_fdw/sql/postgresql_fdw.sql

index 9bd1b137e6d33065300115869049e454396c12e0..e6d565fc51836e76e12b30c43ad034f8d5f2adff 100644 (file)
@@ -163,6 +163,9 @@ pgstattuple -
    space within a table
    by Tatsuo Ishii <ishii@sraoss.co.jp>
 
+postgresql_fdw -
+   Foreign-data wrapper for external PostgreSQL server.
+
 seg -
    Confidence-interval datatype (GiST indexing example)
    by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>
index b9cf9ec5e6aa7ad6288c94e3229a14e01b70177f..da3c845a086c8852a467399e0e753de1a00a8b9c 100644 (file)
@@ -4,11 +4,12 @@ MODULE_big = postgresql_fdw
 PG_CPPFLAGS = -I$(libpq_srcdir)
 OBJS   = postgresql_fdw.o
 SHLIB_LINK = $(libpq)
+SHLIB_PREREQS = submake-libpq
 
-DATA_built = postgresql_fdw.sql
-DATA = uninstall_postgresql_fdw.sql
-REGRESS = postgresql_fdw
+EXTENSION = postgresql_fdw
+DATA = postgresql_fdw--1.0.sql postgresql_fdw--unpachaged--1.0.sql
 
+REGRESS = postgresql_fdw
 
 ifdef USE_PGXS
 PG_CONFIG = pg_config
index 91cd6c10c74fb43c3b7c9f6ee62f2ded3f32fbc1..05b3914245edaffb70cd8e46f6d3648a84b602df 100644 (file)
@@ -1,14 +1,10 @@
-SET SEARCH_PATH = public;
 SET DATESTYLE = 'Postgres, MDY';
 -- =============================================================================
 -- Prepare section
 -- =============================================================================
+CREATE EXTENSION postgresql_fdw;
 -- connect database for regression test
 \c contrib_regression
--- install postgresql_fdw module
-SET client_min_messages = warning;
-\set ECHO none
-RESET client_min_messages;
 -- define fdw-related objects
 CREATE SERVER loopback1 FOREIGN DATA WRAPPER postgresql_fdw
    OPTIONS (dbname 'contrib_regression');
@@ -134,7 +130,8 @@ EXECUTE st(2);
 
 DEALLOCATE st;
 -- clean up
-DROP FOREIGN DATA WRAPPER postgresql_fdw CASCADE;
+DROP TABLE t1 CASCADE;
+DROP EXTENSION postgresql_fdw CASCADE;
 NOTICE:  drop cascades to 6 other objects
 DETAIL:  drop cascades to server loopback1
 drop cascades to user mapping for public
@@ -142,4 +139,3 @@ drop cascades to foreign table ft1
 drop cascades to server loopback2
 drop cascades to user mapping for public
 drop cascades to foreign table ft2
-DROP TABLE t1 CASCADE;
similarity index 65%
rename from contrib/postgresql_fdw/postgresql_fdw.sql.in
rename to contrib/postgresql_fdw/postgresql_fdw--1.0.sql
index 93d5926200e5fb452f94df5666497835bdb0aa76..37facd424eef5653ca77ddb35670b8f649463b13 100644 (file)
@@ -1,7 +1,4 @@
-/* contrib/postgresql/postgresql.sql.in */
-
--- Adjust this setting to control where the objects get created.
-set search_path = public;
+/* contrib/postgresql_fdw/postgresql_fdw--1.0.sql */
 
 CREATE OR REPLACE FUNCTION postgresql_fdw_handler ()
 RETURNS fdw_handler
diff --git a/contrib/postgresql_fdw/postgresql_fdw.control b/contrib/postgresql_fdw/postgresql_fdw.control
new file mode 100644 (file)
index 0000000..ef78aaf
--- /dev/null
@@ -0,0 +1,5 @@
+# postgresql_fdw extension
+comment = 'Foreign-data wrapepr for external PostgreSQL server'
+default_version = '1.0'
+module_pathname = '$libdir/postgresql_fdw'
+relocatable = true
index a9632078cb92c736f588a8b314e477787fb53267..eee9ff95f4d1b8f60650b8a18243d629cb0128f2 100644 (file)
@@ -1,19 +1,13 @@
-SET SEARCH_PATH = public;
 SET DATESTYLE = 'Postgres, MDY';
 
 -- =============================================================================
 -- Prepare section
 -- =============================================================================
+CREATE EXTENSION postgresql_fdw;
+
 -- connect database for regression test
 \c contrib_regression
 
--- install postgresql_fdw module
-SET client_min_messages = warning;
-\set ECHO none
-\i postgresql_fdw.sql
-\set ECHO all
-RESET client_min_messages;
-
 -- define fdw-related objects
 CREATE SERVER loopback1 FOREIGN DATA WRAPPER postgresql_fdw
    OPTIONS (dbname 'contrib_regression');
@@ -86,5 +80,5 @@ EXECUTE st(2);
 DEALLOCATE st;
 
 -- clean up
-DROP FOREIGN DATA WRAPPER postgresql_fdw CASCADE;
 DROP TABLE t1 CASCADE;
+DROP EXTENSION postgresql_fdw CASCADE;