mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
This patch updates the DDL for contrib/pgcrypto to create all
functions as STRICT, and all functions except gen_salt() as IMMUTABLE. gen_salt() is VOLATILE. Although the functions are now STRICT, I left their PG_ARGISNULL() checks in place as a protective measure for users who install the new code but use old (non-STRICT) catalog entries (e.g., restored from a dump). Per recent discussion in pgsql-hackers. Patch from Michael Fuhr.
This commit is contained in:
parent
40ffa1a14c
commit
86897f54a8
@ -4,71 +4,71 @@ SET search_path = public;
|
||||
CREATE OR REPLACE FUNCTION digest(text, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_digest'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION digest(bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_digest'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION digest_exists(text)
|
||||
RETURNS bool
|
||||
AS 'MODULE_PATHNAME', 'pg_digest_exists'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION hmac(text, text, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_hmac'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION hmac(bytea, bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_hmac'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION hmac_exists(text)
|
||||
RETURNS bool
|
||||
AS 'MODULE_PATHNAME', 'pg_hmac_exists'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION crypt(text, text)
|
||||
RETURNS text
|
||||
AS 'MODULE_PATHNAME', 'pg_crypt'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION gen_salt(text)
|
||||
RETURNS text
|
||||
AS 'MODULE_PATHNAME', 'pg_gen_salt'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' VOLATILE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION gen_salt(text, int4)
|
||||
RETURNS text
|
||||
AS 'MODULE_PATHNAME', 'pg_gen_salt_rounds'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' VOLATILE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION encrypt(bytea, bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_encrypt'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION decrypt(bytea, bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_decrypt'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION encrypt_iv(bytea, bytea, bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_encrypt_iv'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION decrypt_iv(bytea, bytea, bytea, text)
|
||||
RETURNS bytea
|
||||
AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION cipher_exists(text)
|
||||
RETURNS bool
|
||||
AS 'MODULE_PATHNAME', 'pg_cipher_exists'
|
||||
LANGUAGE 'C';
|
||||
LANGUAGE 'C' IMMUTABLE STRICT;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user