Postgres uuid
Jump to navigation
Jump to search
select gen_random_uuid (); select replace((select gen_random_uuid()::TEXT), '-', '') ;
CREATE OR REPLACE FUNCTION jb() RETURNS TEXT AS $$ DECLARE rtv TEXT := 'test'; _uuid text := (select replace((select gen_random_uuid()::TEXT), '-', '')); BEGIN -- PERFORM 'test'; -- PERFORM uuid; CREATE ROLE _uuid; RETURN _uuid; END; $$ LANGUAGE plpgsql;