cli icon indicating copy to clipboard operation
cli copied to clipboard

CREATE ROLE error with `NOSUPERUSER` on v 1.164.1

Open beagreenlite opened this issue 1 year ago • 2 comments

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:

  1. supabase start
  2. Go to your db http://localhost:54323
  3. CREATE ROLE "test_user" WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
  4. 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 services command]

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]

beagreenlite avatar Apr 30 '24 19:04 beagreenlite

@soedirgo I wonder if this is an issue with supautils? I haven't tried reproducing myself.

sweatybridge avatar May 01 '24 15:05 sweatybridge

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

maennchen avatar May 27 '24 16:05 maennchen