Как сделать случайное имя пользователя?
create table public.profiles (
  id uuid not null,
  username text default concat('Пользователь #', random()*100000),

  primary key (id)
);
CREATE SEQUENCE profiles_seq START 1;

CREATE OR REPLACE FUNCTION nextval_rand(regclass)
  RETURNS text AS
$func$
BEGIN
EXECUTE format('ALTER SEQUENCE profiles_seq INCREMENT %s', (random() * 100)::int + 1);
RETURN 'Пользователь #' || nextval($1)::text;
END
$func$ LANGUAGE plpgsql SECURITY DEFINER;

create table profiles (
  id uuid not null,
  username text default nextval_rand('profiles_seq'::regclass),
  primary key (id)
);

insert into profiles (id) values
(gen_random_uuid()), 
(gen_random_uuid()),
(gen_random_uuid()),
(gen_random_uuid()),
(gen_random_uuid());

select * from profiles;

https://sqlize.online/sql/psql15/5c8c2073d52cd9696...