Create schema during user creation?

I’ve not done a lot of postgres admin work but is it a common pattern to create a schema with the same name as the user? Would it make sense if there was a checkbox or something that ran create schema authorization $user after the user is created?

I noticed I can’t run that as a different user. When I try to run it from the web sql editor thing it says
ERROR: must be member of role "test-app" (SQLSTATE 42501). I’m not sure if that means I always have to run it as the user I just created. I need to learn more about postgres permissions.

On the mysql side I can just specify on the jdbc url ?createDatabaseIfNotExists=true heh. I kind of wish the postgres side had an equivalent thing.

1 Like

I noticed I can’t run that as a different user. When I try to run it from the web sql editor thing it says
ERROR: must be member of role "test-app" (SQLSTATE 42501).

We are using a separate Postgres user for SQL editor queries and it actually causes weird problems like that one. We have a plan to allow more user management to happen in Postgres itself (neon/017-user-management.md at user_mgmt_rfc · neondatabase/neon · GitHub) and to avoid using a separate user for SQL editor queries.