forked from pandrewhk/hashtypes
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changelog added PGXN files bumped for release Parallelism added for 9.6 md5 hash function added that are consistent with casting conventions
- Loading branch information
Showing
11 changed files
with
263 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Changes since 0.1.1: | ||
|
||
1. Join operations now provide correct estimates | ||
2. Functions correctly marked immutable when immutable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
0.1.4 2017-11-16 | ||
Parallelism for 9.6 and higher | ||
Adding text(md5hash) and bytea(md5hash) functions for consistency | ||
|
||
0.1.3 2017-11-14 | ||
First release after handover | ||
Immutability fixes | ||
Join operation estimate fixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"name": "hashtypes", | ||
"abstract": "data types for sha{1,256,512}, md5 and crc32", | ||
"version": "0.1.1", | ||
"maintainer": "Andrey Popp <8mayday@gmail.com>", | ||
"version": "0.1.4", | ||
"maintainer": ["Chris Travers <chris.travers@adjust.com>", "Manuel Kniep <[email protected]>"], | ||
"license": "postgresql", | ||
"meta-spec": { | ||
"version": "1.0.0", | ||
"url": "http://pgxn.org/meta/spec.txt" | ||
}, | ||
"provides": { | ||
"hashtypes": { | ||
"file": "sql/hashtypes--0.1.sql", | ||
"version": "0.1.0" | ||
"file": "sql/hashtypes--0.1.4.sql", | ||
"version": "0.1.4" | ||
} | ||
}, | ||
"resources": { | ||
"bugtracker": { | ||
"web": "http://github.com/infofarmer/hashtypes/issues/" | ||
"web": "http://github.com/adjust/hashtypes/issues/" | ||
}, | ||
"repository": { | ||
"url": "git://github.com/infofarmer/hashtypes.git", | ||
"web": "http://github.com/infofarmer/hashtypes/", | ||
"url": "git://github.com/adjust/hashtypes.git", | ||
"web": "http://github.com/adjust/hashtypes/", | ||
"type": "git" | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
This extension is actually a fork of shatypes[1] which adds some other data types | ||
as crc32 and provides some fixes to original implementations. | ||
|
||
This project is a continuation of the project formerly at https://github.com/infofarmer/hashtypes. | ||
Many thanks to Andrey Ropp, Infofarmer, and others for their work and support on the transition.[2] | ||
|
||
[1]: http://pgfoundry.org/projects/shatypes | ||
[2]: https://github.com/infofarmer/hashtypes/issues/7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
comment = 'A set of data types for various hashes and control sums' | ||
default_version = '0.1.3' | ||
default_version = '0.1.4' | ||
encoding = 'utf8' | ||
superuser = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION crc32_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32_out(crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32lt(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32le(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32eq(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32gt(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32ge(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION crc32ne(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION btcrc32cmp(crc32, crc32) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION hashcrc32(crc32) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
-- this has to be run after pg upgrade too so not assuming the functions are missing | ||
CREATE OR REPLACE FUNCTION md5hash(text) RETURNS md5hash LANGUAGE C IMMUTABLE STRICT AS 'hashtypes', 'text_to_md5'; | ||
CREATE OR REPLACE FUNCTION md5hash(bytea) RETURNS md5hash language C IMMUTABLE STRICT AS 'hashtypes', 'bytea_to_md5'; | ||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION md5_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_out(md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_send(md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_recv(internal) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_lt(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_le(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_eq(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_gt(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_ge(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_ne(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_cmp(md5hash,md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5_hash(md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5hash(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5hash(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5t(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION md5b(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(md5hash) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(md5hash) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION sha1_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha1_out(sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_lt(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_le(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_eq(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_gt(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_ge(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_neq(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_cmp(sha1, sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha1(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha1(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(sha1) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(sha1) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION sha224_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha224_out(sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_lt(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_le(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_eq(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_gt(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_ge(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_neq(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_cmp(sha224, sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha224(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha224(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(sha224) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(sha224) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION sha256_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha256_out(sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_lt(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_le(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_eq(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_gt(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_ge(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_neq(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_cmp(sha256, sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha256(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha256(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(sha256) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(sha256) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION sha384_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha384_out(sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_lt(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_le(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_eq(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_gt(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_ge(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_neq(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_cmp(sha384, sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha384(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha384(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(sha384) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(sha384) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; | ||
|
||
DO $$ | ||
DECLARE version_num integer; | ||
BEGIN | ||
SELECT current_setting('server_version_num') INTO STRICT version_num; | ||
IF version_num > 90600 THEN | ||
EXECUTE $E$ ALTER FUNCTION sha512_in(cstring) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha512_out(sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_lt(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_le(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_eq(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_gt(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_ge(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_neq(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha_cmp(sha512, sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha512(text) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION sha512(bytea) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION text(sha512) PARALLEL SAFE $E$; | ||
EXECUTE $E$ ALTER FUNCTION bytea(sha512) PARALLEL SAFE $E$; | ||
END IF; | ||
END; | ||
$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters