mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
Add variants of digest() and hmac() that accept text inputs.
Marko Kreen says: This is so obvious that I would like to make it 'official'. Seems like the theology around bytea<>text casting kept me from seeing the simple :)
This commit is contained in:
parent
5b9a058384
commit
6d6b3e911c
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
|
-- drop function digest(text, text);
|
||||||
-- drop function digest(bytea, text);
|
-- drop function digest(bytea, text);
|
||||||
-- drop function digest_exists(text);
|
-- drop function digest_exists(text);
|
||||||
|
-- drop function hmac(text, text, text);
|
||||||
-- drop function hmac(bytea, bytea, text);
|
-- drop function hmac(bytea, bytea, text);
|
||||||
-- drop function hmac_exists(text);
|
-- drop function hmac_exists(text);
|
||||||
-- drop function crypt(text, text);
|
-- drop function crypt(text, text);
|
||||||
@ -14,6 +16,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE FUNCTION digest(text, text) RETURNS bytea
|
||||||
|
AS 'MODULE_PATHNAME',
|
||||||
|
'pg_digest' LANGUAGE 'C';
|
||||||
|
|
||||||
CREATE FUNCTION digest(bytea, text) RETURNS bytea
|
CREATE FUNCTION digest(bytea, text) RETURNS bytea
|
||||||
AS 'MODULE_PATHNAME',
|
AS 'MODULE_PATHNAME',
|
||||||
'pg_digest' LANGUAGE 'C';
|
'pg_digest' LANGUAGE 'C';
|
||||||
@ -22,6 +28,10 @@ CREATE FUNCTION digest_exists(text) RETURNS bool
|
|||||||
AS 'MODULE_PATHNAME',
|
AS 'MODULE_PATHNAME',
|
||||||
'pg_digest_exists' LANGUAGE 'C';
|
'pg_digest_exists' LANGUAGE 'C';
|
||||||
|
|
||||||
|
CREATE FUNCTION hmac(text, text, text) RETURNS bytea
|
||||||
|
AS 'MODULE_PATHNAME',
|
||||||
|
'pg_hmac' LANGUAGE 'C';
|
||||||
|
|
||||||
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
|
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
|
||||||
AS 'MODULE_PATHNAME',
|
AS 'MODULE_PATHNAME',
|
||||||
'pg_hmac' LANGUAGE 'C';
|
'pg_hmac' LANGUAGE 'C';
|
||||||
|
Loading…
Reference in New Issue
Block a user