Skip to content

Commit

Permalink
Parallelism for 9.6 (#4)
Browse files Browse the repository at this point in the history
1.0 for release on pgxn
Adds parallelism for 9.6 and higher
  • Loading branch information
einhverfr authored Nov 15, 2017
1 parent b5739fa commit a2596e3
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 2 deletions.
39 changes: 39 additions & 0 deletions META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "base36",
"abstract": "Integers represented in base36",
"version": "1.0.0",
"maintainer": [ "Chris Travers <[email protected]>", "Manuel Kniep <[email protected]>" ],
"license": {
"PostgreSQL": "http://www.postgresql.org/about/licence"
},
"provides": {
"base36": {
"file": "sql/base36.sql",
"version": "1.0.0",
"abstract": "Integers represented in base36"
}
},
"meta-spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
},
"description": "Integers represented in base36",
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "9.3.0"
}
}
},
"resources": {
"bugtracker": {
"web": "http://github.com/adjust/pg-country/issues"
},
"repository": {
"url": "git://github.com/adjust/pg-country.git",
"web": "http://github.com/adjust/pg-country",
"type": "git"
}
}
}

47 changes: 47 additions & 0 deletions base36--0.0.1--1.0.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

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 base36_in(cstring) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_out(base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_recv(internal) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_send(base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36(text) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION text(base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_eq(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_ne(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_lt(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_le(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_gt(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_ge(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION base36_cmp(base36, base36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION hash_base36(base36) 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 bigbase36_in(cstring) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_out(bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_recv(internal) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_send(bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36(text) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION text(bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_eq(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_ne(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_lt(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_le(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_gt(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_ge(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION bigbase36_cmp(bigbase36, bigbase36) PARALLEL SAFE $E$;
EXECUTE $E$ ALTER FUNCTION hash_bigbase36(bigbase36) PARALLEL SAFE $E$;
END IF;
END;
$$;

Loading

0 comments on commit a2596e3

Please sign in to comment.