summaryrefslogtreecommitdiff
path: root/contrib/pgrowlocks
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-02-13 20:06:41 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-02-13 22:54:49 -0500
commit629b3af27d5c2bc9d6e16b22b943ad651d4ecb56 (patch)
treeeae9ef9a69ae6ad7aacb2428e3cf15ec77873ac5 /contrib/pgrowlocks
parente693e97d754ed6812ea115170afeae4bf8797d3f (diff)
downloadpostgresql-629b3af27d5c2bc9d6e16b22b943ad651d4ecb56.tar.gz
Convert contrib modules to use the extension facility.
This isn't fully tested as yet, in particular I'm not sure that the "foo--unpackaged--1.0.sql" scripts are OK. But it's time to get some buildfarm cycles on it. sepgsql is not converted to an extension, mainly because it seems to require a very nonstandard installation process. Dimitri Fontaine and Tom Lane
Diffstat (limited to 'contrib/pgrowlocks')
-rw-r--r--contrib/pgrowlocks/.gitignore1
-rw-r--r--contrib/pgrowlocks/Makefile11
-rw-r--r--contrib/pgrowlocks/pgrowlocks--1.0.sql (renamed from contrib/pgrowlocks/pgrowlocks.sql.in)5
-rw-r--r--contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql3
-rw-r--r--contrib/pgrowlocks/pgrowlocks.control5
-rw-r--r--contrib/pgrowlocks/uninstall_pgrowlocks.sql6
6 files changed, 12 insertions, 19 deletions
diff --git a/contrib/pgrowlocks/.gitignore b/contrib/pgrowlocks/.gitignore
deleted file mode 100644
index b2729282bf..0000000000
--- a/contrib/pgrowlocks/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/pgrowlocks.sql
diff --git a/contrib/pgrowlocks/Makefile b/contrib/pgrowlocks/Makefile
index fd338d75d7..f56389b0e2 100644
--- a/contrib/pgrowlocks/Makefile
+++ b/contrib/pgrowlocks/Makefile
@@ -1,15 +1,10 @@
-#-------------------------------------------------------------------------
-#
-# pgrowlocks Makefile
-#
# contrib/pgrowlocks/Makefile
-#
-#-------------------------------------------------------------------------
MODULE_big = pgrowlocks
OBJS = pgrowlocks.o
-DATA_built = pgrowlocks.sql
-DATA = uninstall_pgrowlocks.sql
+
+EXTENSION = pgrowlocks
+DATA = pgrowlocks--1.0.sql pgrowlocks--unpackaged--1.0.sql
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/contrib/pgrowlocks/pgrowlocks.sql.in b/contrib/pgrowlocks/pgrowlocks--1.0.sql
index 3bcb3ee7ea..8b5fc9a1c8 100644
--- a/contrib/pgrowlocks/pgrowlocks.sql.in
+++ b/contrib/pgrowlocks/pgrowlocks--1.0.sql
@@ -1,7 +1,4 @@
-/* contrib/pgrowlocks/pgrowlocks.sql.in */
-
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
+/* contrib/pgrowlocks/pgrowlocks--1.0.sql */
CREATE OR REPLACE FUNCTION pgrowlocks(IN relname text,
OUT locked_row TID, -- row TID
diff --git a/contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql b/contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql
new file mode 100644
index 0000000000..2d9d1eed41
--- /dev/null
+++ b/contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql
@@ -0,0 +1,3 @@
+/* contrib/pgrowlocks/pgrowlocks--unpackaged--1.0.sql */
+
+ALTER EXTENSION pgrowlocks ADD function pgrowlocks(text);
diff --git a/contrib/pgrowlocks/pgrowlocks.control b/contrib/pgrowlocks/pgrowlocks.control
new file mode 100644
index 0000000000..a6ba164515
--- /dev/null
+++ b/contrib/pgrowlocks/pgrowlocks.control
@@ -0,0 +1,5 @@
+# pgrowlocks extension
+comment = 'show row-level locking information'
+default_version = '1.0'
+module_pathname = '$libdir/pgrowlocks'
+relocatable = true
diff --git a/contrib/pgrowlocks/uninstall_pgrowlocks.sql b/contrib/pgrowlocks/uninstall_pgrowlocks.sql
deleted file mode 100644
index 004e97c0e9..0000000000
--- a/contrib/pgrowlocks/uninstall_pgrowlocks.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-/* contrib/pgrowlocks/uninstall_pgrowlocks.sql */
-
--- Adjust this setting to control where the objects get dropped.
-SET search_path = public;
-
-DROP FUNCTION pgrowlocks(text);