Answer the question
In order to leave comments, you need to log in
How to restart the function if the result is missing a large or small letter, number, symbol?
There is a key generation code, but sometimes an error pops up if there is not enough character, etc.
SELECT string_agg(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,-./:;<=>[email protected][]^', ceil(random() * 85)::integer, 1), '') FROM generate_series(1,32);
Answer the question
In order to leave comments, you need to log in
Don't worry, take a ready-made extension for PostgreSQL:
create extension if not exists pgcrypto;
select encode(gen_random_bytes(32),'base64');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question