From 2a7412e49fa355c83a9acaa16c047c684282d92b Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Fri, 31 Jul 2026 21:42:55 +0200 Subject: [PATCH] =?UTF-8?q?gate2:=20fix=20prestart.sh=20=E2=80=94=20inline?= =?UTF-8?q?=20password=20for=20ALTER=20ROLE=20(prepared=20statements=20don?= =?UTF-8?q?t=20work=20with=20ALTER=20ROLE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prestart.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prestart.sh b/prestart.sh index 5635993..1f0f672 100644 --- a/prestart.sh +++ b/prestart.sh @@ -55,7 +55,9 @@ async def set_passwords(): async with engine.begin() as conn: for role in roles: try: - await conn.execute(text(f'ALTER ROLE {role} WITH LOGIN PASSWORD :pwd'), {'pwd': pwd}) + # ALTER ROLE doesn't support prepared statement parameters + # so we inline the password (extracted from DB URL, safe) + await conn.execute(text(f"ALTER ROLE {role} WITH LOGIN PASSWORD '{pwd}'")) print(f'[prestart] Password set for {role}') except Exception as e: print(f'[prestart] WARNING: Could not set password for {role}: {e}')