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
-- SELECT gen_prefixed_id('account_', 20); | |
-- account_9f2oOuK23Xpv3rdtHnQY | |
-- Example usage in a table column definition: | |
-- id text DEFAULT gen_prefixed_id('account_', 16) PRIMARY KEY | |
-- Load the built-in pgcrypto module if not loaded. | |
CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
-- Create a function that takes a text prefix and the length of the |