Skip to content

Instantly share code, notes, and snippets.

@fdelbos
fdelbos / random_string.sql
Created February 23, 2024 05:56
A function to generate a random URL safe string with PostgreSQL
create or replace function random_string(nb_bytes integer)
returns text
as $$
select
trim('='
from
(
select
replace ( (
select