fix(sql): move ROLE PASSWORD outside DO block (psql skips :var in dollar-quoting)

This commit is contained in:
User
2026-07-12 17:12:26 +02:00
parent 67d030b24d
commit 3f816044c3
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -5,9 +5,11 @@
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'thoth_vector_rw') THEN
CREATE ROLE thoth_vector_rw LOGIN PASSWORD :'PWD';
CREATE ROLE thoth_vector_rw LOGIN;
END IF;
END $$;
-- :'PWD' va fuori dal DO (psql non interpola nelle stringhe dollar-quoted)
ALTER ROLE thoth_vector_rw PASSWORD :'PWD';
CREATE SCHEMA IF NOT EXISTS vectors;