SupabaseS
Supabase2mo ago
Tyg

Bug? GRANT kills the connection even inside EXCEPTION

Hi, guys. Is it normal that a GRANT operation kills the connection? ...

I'd really appreciate some help with this issue. I don't understand well SQL DBs, so maybe this is obvious.

There is one problematic migration code that Windmill.dev tries to run on installation, and it is this:

DO
$do$
BEGIN
GRANT windmill_user to CURRENT_USER;
GRANT windmill_admin to CURRENT_USER;
EXCEPTION WHEN OTHERS THEN
RAISE NOTICE 'error granting windmill_user and windmill_admin to current_user: %', SQLERRM;
END
$do$;

This results in dropping the connection immediately, even when the statement is in an EXCEPTION block. My understanding is that this operation is not allowed because the current connection's user doesn't have the privilege.

The issue is that instead of skipping the exception, the connection drops and the Windmill installation fails.

Is this a bug on Supabase's side, or is it a bug in Windmill?
Was this page helpful?