Created
August 26, 2015 13:17
-
-
Save tygern/3c3f68818a5aa73ed602 to your computer and use it in GitHub Desktop.
Non Sequential ID Generation - create function
This file contains hidden or 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
| CREATE FUNCTION fetch_id(text) RETURNS bigint AS | |
| 'select (9369712273 * nextval($1) + 1365089121) % 999999937;' | |
| LANGUAGE SQL | |
| IMMUTABLE | |
| RETURNS NULL ON NULL INPUT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment