1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Tom Lane
2011-02-13 20:06:41 -05:00
parent e693e97d75
commit 629b3af27d
264 changed files with 2026 additions and 2349 deletions

View File

@ -1,5 +0,0 @@
/autoinc.sql
/insert_username.sql
/moddatetime.sql
/refint.sql
/timetravel.sql

View File

@ -1,7 +1,15 @@
# contrib/spi/Makefile
MODULES = autoinc insert_username moddatetime refint timetravel
DATA_built = $(addsuffix .sql, $(MODULES))
EXTENSION = autoinc insert_username moddatetime refint timetravel
DATA = autoinc--1.0.sql autoinc--unpackaged--1.0.sql \
insert_username--1.0.sql insert_username--unpackaged--1.0.sql \
moddatetime--1.0.sql moddatetime--unpackaged--1.0.sql \
refint--1.0.sql refint--unpackaged--1.0.sql \
timetravel--1.0.sql timetravel--unpackaged--1.0.sql
DOCS = $(addsuffix .example, $(MODULES))
# this is needed for the regression tests;

View File

@ -0,0 +1,6 @@
/* contrib/spi/autoinc--1.0.sql */
CREATE OR REPLACE FUNCTION autoinc()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -0,0 +1,3 @@
/* contrib/spi/autoinc--unpackaged--1.0.sql */
ALTER EXTENSION autoinc ADD function autoinc();

View File

@ -0,0 +1,5 @@
# autoinc extension
comment = 'functions for autoincrementing fields'
default_version = '1.0'
module_pathname = '$libdir/autoinc'
relocatable = true

View File

@ -1,9 +0,0 @@
/* contrib/spi/autoinc.sql.in */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
CREATE OR REPLACE FUNCTION autoinc()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -0,0 +1,6 @@
/* contrib/spi/insert_username--1.0.sql */
CREATE OR REPLACE FUNCTION insert_username()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -0,0 +1,3 @@
/* contrib/spi/insert_username--unpackaged--1.0.sql */
ALTER EXTENSION insert_username ADD function insert_username();

View File

@ -0,0 +1,5 @@
# insert_username extension
comment = 'functions for tracking who changed a table'
default_version = '1.0'
module_pathname = '$libdir/insert_username'
relocatable = true

View File

@ -1,9 +0,0 @@
/* contrib/spi/insert_username.sql.in */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
CREATE OR REPLACE FUNCTION insert_username()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -0,0 +1,6 @@
/* contrib/spi/moddatetime--1.0.sql */
CREATE OR REPLACE FUNCTION moddatetime()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -0,0 +1,3 @@
/* contrib/spi/moddatetime--unpackaged--1.0.sql */
ALTER EXTENSION moddatetime ADD function moddatetime();

View File

@ -0,0 +1,5 @@
# moddatetime extension
comment = 'functions for tracking last modification time'
default_version = '1.0'
module_pathname = '$libdir/moddatetime'
relocatable = true

View File

@ -1,9 +0,0 @@
/* contrib/spi/moddatetime.sql.in */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
CREATE OR REPLACE FUNCTION moddatetime()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;

View File

@ -1,7 +1,4 @@
/* contrib/spi/refint.sql.in */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
/* contrib/spi/refint--1.0.sql */
CREATE OR REPLACE FUNCTION check_primary_key()
RETURNS trigger

View File

@ -0,0 +1,4 @@
/* contrib/spi/refint--unpackaged--1.0.sql */
ALTER EXTENSION refint ADD function check_primary_key();
ALTER EXTENSION refint ADD function check_foreign_key();

View File

@ -0,0 +1,5 @@
# refint extension
comment = 'functions for implementing referential integrity (obsolete)'
default_version = '1.0'
module_pathname = '$libdir/refint'
relocatable = true

View File

@ -1,7 +1,4 @@
/* contrib/spi/timetravel.sql.in */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
/* contrib/spi/timetravel--1.0.sql */
CREATE OR REPLACE FUNCTION timetravel()
RETURNS trigger

View File

@ -0,0 +1,5 @@
/* contrib/spi/timetravel--unpackaged--1.0.sql */
ALTER EXTENSION timetravel ADD function timetravel();
ALTER EXTENSION timetravel ADD function set_timetravel(name,integer);
ALTER EXTENSION timetravel ADD function get_timetravel(name);

View File

@ -0,0 +1,5 @@
# timetravel extension
comment = 'functions for implementing time travel'
default_version = '1.0'
module_pathname = '$libdir/timetravel'
relocatable = true