CREATE
OR REPLACE FUNCTION generate_uid(size INT) RETURNS TEXT LANGUAGE PLPGSQL AS $$ DECLARE characters TEXT := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
bytes BYTEA := gen_random_bytes(size);
l INT := LENGTH(characters);
i INT := 0;
output TEXT := '';
BEGIN WHILE i < size LOOP output := output || SUBSTR(characters, GET_BYTE(bytes, i) % l + 1, 1);
i := i + 1;
END LOOP;
RETURN output;
END;
$$;
-- ADD SQL HERE
Unable to format SQL: Error: Parse error: Unexpected "$$ DECLARE"
Not able to format function and procedures in vscode extension
Input data
Which SQL and options did you provide as input?
Unable to format SQL: Error: Parse error: Unexpected "$$ DECLARE"
Not able to format function and procedures in vscode extension