serverpod cloud db user create says it creates a superuser (Create a new superuser in the Serverpod Cloud DB.), and so do the Cloud database docs. The user it creates can read and write rows, and that's it. Superuser advice from elsewhere, like pg_restore --disable-triggers, then fails with permission errors that the word "superuser" doesn't explain.
Reproduction
Create a user with serverpod cloud db user create permcheck, connect, and run each statement inside BEGIN; ... ROLLBACK;.
| Statement |
Result |
SELECT rolsuper for the current user |
false (member of neon_superuser, tables owned by owner) |
CREATE TABLE public.t (x int) |
permission denied for schema public |
ALTER TABLE ... ADD COLUMN |
must be owner of table serverpod_auth_core_profile |
ALTER TABLE ... DISABLE TRIGGER ALL |
must be owner of table serverpod_auth_core_profile |
SET LOCAL session_replication_role = replica |
permission denied to set parameter "session_replication_role" |
INSERT, UPDATE, DELETE, sequence UPDATE |
allowed |
Suggested fix
Call it a database user in the db user help text (create, list, and delete all say superuser), and say that it can read and write data but can't create or change tables. The strings are in db_command.dart, db_ops.dart, and db_ui.dart in the Cloud CLI. The Cloud docs use the same word in cloud/concepts/database.md and the scloud db reference intro.
Cloud CLI 1.0.0, PostgreSQL 17.11.
Related: serverpod/serverpod_docs#853
serverpod cloud db user createsays it creates a superuser (Create a new superuser in the Serverpod Cloud DB.), and so do the Cloud database docs. The user it creates can read and write rows, and that's it. Superuser advice from elsewhere, likepg_restore --disable-triggers, then fails with permission errors that the word "superuser" doesn't explain.Reproduction
Create a user with
serverpod cloud db user create permcheck, connect, and run each statement insideBEGIN; ... ROLLBACK;.SELECT rolsuperfor the current userfalse(member ofneon_superuser, tables owned byowner)CREATE TABLE public.t (x int)permission denied for schema publicALTER TABLE ... ADD COLUMNmust be owner of table serverpod_auth_core_profileALTER TABLE ... DISABLE TRIGGER ALLmust be owner of table serverpod_auth_core_profileSET LOCAL session_replication_role = replicapermission denied to set parameter "session_replication_role"INSERT,UPDATE,DELETE, sequenceUPDATESuggested fix
Call it a database user in the
db userhelp text (create,list, anddeleteall say superuser), and say that it can read and write data but can't create or change tables. The strings are indb_command.dart,db_ops.dart, anddb_ui.dartin the Cloud CLI. The Cloud docs use the same word incloud/concepts/database.mdand thescloud dbreference intro.Cloud CLI 1.0.0, PostgreSQL 17.11.
Related: serverpod/serverpod_docs#853