I need to generate an uuid that does not exist in a certain column in a table. I found a function gen_random_uuid(). Is there some way in the loop to check if such an uuid exists and replace it if it does?
CREATE TABLE x (id UUID PRIMARY KEY, name TEXT) INSERT INTO x VALUES ( gen_random_uuid(), // Need to check if uuid not exist in id column 'some name' )