CREATE ROLE error with `NOSUPERUSER` on v 1.164.1
Describe the bug
Permission denied to create role on CREATE ROLE "<user>" WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- supabase start
- Go to your db
http://localhost:54323 -
CREATE ROLE "test_user" WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; - Get error
Error: ERROR: 42501: permission denied to create role DETAIL: Only roles with the SUPERUSER attribute may create roles with the SUPERUSER attribute. CONTEXT: SQL statement "CREATE ROLE "test_user" WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION" PL/pgSQL function inline_code_block line 8 at SQL statement
This did not happen in the previous version 1.163.6
Expected behavior
To run regardless since we explicitly say NOSUPERUSER
Screenshots If applicable, add screenshots to help explain your problem.
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID: [e.g. ab1ac733e31e4f928a4d7c8402543712]
- Version of OS: [e.g. Ubuntu 22.04]
- Version of CLI: 1.164.1
- Version of Docker: [e.g. v25.0.3]
- Versions of services: [output from
supabase servicescommand]
Additional context If applicable, add any other context about the problem here.
- Browser [e.g. chrome, safari]
- Version of supabase-js [e.g. v2.22.0]
- Version of Node.js [e.g. v16.20.0]
@soedirgo I wonder if this is an issue with supautils? I haven't tried reproducing myself.
Having the same issue. It prevents me from creating roles using terraform which includes NOSUPERUSER in the query.
https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/postgresql_role