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:
5
contrib/spi/.gitignore
vendored
5
contrib/spi/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
/autoinc.sql
|
||||
/insert_username.sql
|
||||
/moddatetime.sql
|
||||
/refint.sql
|
||||
/timetravel.sql
|
@ -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;
|
||||
|
6
contrib/spi/autoinc--1.0.sql
Normal file
6
contrib/spi/autoinc--1.0.sql
Normal file
@ -0,0 +1,6 @@
|
||||
/* contrib/spi/autoinc--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION autoinc()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
3
contrib/spi/autoinc--unpackaged--1.0.sql
Normal file
3
contrib/spi/autoinc--unpackaged--1.0.sql
Normal file
@ -0,0 +1,3 @@
|
||||
/* contrib/spi/autoinc--unpackaged--1.0.sql */
|
||||
|
||||
ALTER EXTENSION autoinc ADD function autoinc();
|
5
contrib/spi/autoinc.control
Normal file
5
contrib/spi/autoinc.control
Normal file
@ -0,0 +1,5 @@
|
||||
# autoinc extension
|
||||
comment = 'functions for autoincrementing fields'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/autoinc'
|
||||
relocatable = true
|
@ -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;
|
6
contrib/spi/insert_username--1.0.sql
Normal file
6
contrib/spi/insert_username--1.0.sql
Normal 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;
|
3
contrib/spi/insert_username--unpackaged--1.0.sql
Normal file
3
contrib/spi/insert_username--unpackaged--1.0.sql
Normal file
@ -0,0 +1,3 @@
|
||||
/* contrib/spi/insert_username--unpackaged--1.0.sql */
|
||||
|
||||
ALTER EXTENSION insert_username ADD function insert_username();
|
5
contrib/spi/insert_username.control
Normal file
5
contrib/spi/insert_username.control
Normal 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
|
@ -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;
|
6
contrib/spi/moddatetime--1.0.sql
Normal file
6
contrib/spi/moddatetime--1.0.sql
Normal file
@ -0,0 +1,6 @@
|
||||
/* contrib/spi/moddatetime--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION moddatetime()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
3
contrib/spi/moddatetime--unpackaged--1.0.sql
Normal file
3
contrib/spi/moddatetime--unpackaged--1.0.sql
Normal file
@ -0,0 +1,3 @@
|
||||
/* contrib/spi/moddatetime--unpackaged--1.0.sql */
|
||||
|
||||
ALTER EXTENSION moddatetime ADD function moddatetime();
|
5
contrib/spi/moddatetime.control
Normal file
5
contrib/spi/moddatetime.control
Normal file
@ -0,0 +1,5 @@
|
||||
# moddatetime extension
|
||||
comment = 'functions for tracking last modification time'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/moddatetime'
|
||||
relocatable = true
|
@ -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;
|
@ -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
|
4
contrib/spi/refint--unpackaged--1.0.sql
Normal file
4
contrib/spi/refint--unpackaged--1.0.sql
Normal 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();
|
5
contrib/spi/refint.control
Normal file
5
contrib/spi/refint.control
Normal file
@ -0,0 +1,5 @@
|
||||
# refint extension
|
||||
comment = 'functions for implementing referential integrity (obsolete)'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/refint'
|
||||
relocatable = true
|
@ -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
|
5
contrib/spi/timetravel--unpackaged--1.0.sql
Normal file
5
contrib/spi/timetravel--unpackaged--1.0.sql
Normal 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);
|
5
contrib/spi/timetravel.control
Normal file
5
contrib/spi/timetravel.control
Normal file
@ -0,0 +1,5 @@
|
||||
# timetravel extension
|
||||
comment = 'functions for implementing time travel'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/timetravel'
|
||||
relocatable = true
|
Reference in New Issue
Block a user