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
/** | |
* Returns a Segment's KSUID. | |
* | |
* Reference implementation: https://github.com/segmentio/ksuid | |
* Also read: https://segment.com/blog/a-brief-history-of-the-uuid/ | |
* Taken suggestions from: https://stackoverflow.com/a/71137273/518493 | |
*/ | |
CREATE EXTENSION pgcrypto; | |
CREATE OR REPLACE FUNCTION fn_ksuid(prefix text DEFAULT '') RETURNS text AS $$ |