1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-06 18:42:54 +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,3 +1,2 @@
/pgcrypto.sql
# Generated subdirectories
/results/

View File

@@ -1,6 +1,4 @@
#
# contrib/pgcrypto/Makefile
#
INT_SRCS = md5.c sha1.c sha2.c internal.c internal-sha2.c blf.c rijndael.c \
fortuna.c random.c pgp-mpi-internal.c imath.c
@@ -26,9 +24,9 @@ SRCS = pgcrypto.c px.c px-hmac.c px-crypt.c \
MODULE_big = pgcrypto
OBJS = $(SRCS:.c=.o)
DATA_built = pgcrypto.sql
DATA = uninstall_pgcrypto.sql
EXTRA_CLEAN = gen-rtab
EXTENSION = pgcrypto
DATA = pgcrypto--1.0.sql pgcrypto--unpackaged--1.0.sql
REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
$(CF_TESTS) \
@@ -36,6 +34,7 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
pgp-armor pgp-decrypt pgp-encrypt $(CF_PGP_TESTS) \
pgp-pubkey-decrypt pgp-pubkey-encrypt pgp-info
EXTRA_CLEAN = gen-rtab
ifdef USE_PGXS
PG_CONFIG = pg_config

View File

@@ -1,13 +1,7 @@
--
-- init pgcrypto
--
--
-- first, define the functions. Turn off echoing so that expected file
-- does not depend on contents of pgcrypto.sql.
--
SET client_min_messages = warning;
\set ECHO none
RESET client_min_messages;
CREATE EXTENSION pgcrypto;
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;
-- check for encoding fn's

View File

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

View File

@@ -0,0 +1,35 @@
/* contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql */
ALTER EXTENSION pgcrypto ADD function digest(text,text);
ALTER EXTENSION pgcrypto ADD function digest(bytea,text);
ALTER EXTENSION pgcrypto ADD function hmac(text,text,text);
ALTER EXTENSION pgcrypto ADD function hmac(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function crypt(text,text);
ALTER EXTENSION pgcrypto ADD function gen_salt(text);
ALTER EXTENSION pgcrypto ADD function gen_salt(text,integer);
ALTER EXTENSION pgcrypto ADD function encrypt(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function decrypt(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function encrypt_iv(bytea,bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function decrypt_iv(bytea,bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function gen_random_bytes(integer);
ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt(text,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt_bytea(bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt(text,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt_bytea(bytea,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt(bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt_bytea(bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt(bytea,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt_bytea(bytea,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt(text,bytea);
ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt_bytea(bytea,bytea);
ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt(text,bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt_bytea(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea,text,text);
ALTER EXTENSION pgcrypto ADD function pgp_key_id(bytea);
ALTER EXTENSION pgcrypto ADD function armor(bytea);
ALTER EXTENSION pgcrypto ADD function dearmor(text);

View File

@@ -0,0 +1,5 @@
# pgcrypto extension
comment = 'cryptographic functions'
default_version = '1.0'
module_pathname = '$libdir/pgcrypto'
relocatable = true

View File

@@ -2,15 +2,7 @@
-- init pgcrypto
--
--
-- first, define the functions. Turn off echoing so that expected file
-- does not depend on contents of pgcrypto.sql.
--
SET client_min_messages = warning;
\set ECHO none
\i pgcrypto.sql
\set ECHO all
RESET client_min_messages;
CREATE EXTENSION pgcrypto;
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;

View File

@@ -1,45 +0,0 @@
/* contrib/pgcrypto/uninstall_pgcrypto.sql */
-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION digest(text, text);
DROP FUNCTION digest(bytea, text);
DROP FUNCTION hmac(text, text, text);
DROP FUNCTION hmac(bytea, bytea, text);
DROP FUNCTION crypt(text, text);
DROP FUNCTION gen_salt(text);
DROP FUNCTION gen_salt(text, int4);
DROP FUNCTION encrypt(bytea, bytea, text);
DROP FUNCTION decrypt(bytea, bytea, text);
DROP FUNCTION encrypt_iv(bytea, bytea, bytea, text);
DROP FUNCTION decrypt_iv(bytea, bytea, bytea, text);
DROP FUNCTION gen_random_bytes(int4);
DROP FUNCTION pgp_sym_encrypt(text, text);
DROP FUNCTION pgp_sym_encrypt_bytea(bytea, text);
DROP FUNCTION pgp_sym_encrypt(text, text, text);
DROP FUNCTION pgp_sym_encrypt_bytea(bytea, text, text);
DROP FUNCTION pgp_sym_decrypt(bytea, text);
DROP FUNCTION pgp_sym_decrypt_bytea(bytea, text);
DROP FUNCTION pgp_sym_decrypt(bytea, text, text);
DROP FUNCTION pgp_sym_decrypt_bytea(bytea, text, text);
DROP FUNCTION pgp_pub_encrypt(text, bytea);
DROP FUNCTION pgp_pub_encrypt_bytea(bytea, bytea);
DROP FUNCTION pgp_pub_encrypt(text, bytea, text);
DROP FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text);
DROP FUNCTION pgp_pub_decrypt(bytea, bytea);
DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea);
DROP FUNCTION pgp_pub_decrypt(bytea, bytea, text);
DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text);
DROP FUNCTION pgp_pub_decrypt(bytea, bytea, text, text);
DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text);
DROP FUNCTION pgp_key_id(bytea);
DROP FUNCTION armor(bytea);
DROP FUNCTION dearmor(text);