why pgAdmin4 Tablespace Security privileges does not count for pg_default if no tablespace is selected when creating new database? how to solve this issue?

Hy all -I have a server dedicated to PostGreSQL and with two additional HDD's to associate with two distinct users and their databases (I'll use generic names gere) -I sucessfully created logins for additional two users: and besides the user with Privileges enabled only for CanLogin, CreateSatabases and CanInitiate backups -I sucessfully created two Tablespaces <db_a> <db_b> pointing to locations on the two distinct HDD (Ubuntu) and set security to grant privileges <db_a> only for and and <db_b> only for and -I modified Tablespace pg_default's Security to grant privileges only for user the owner for pd_default is postgres

-I set these up because I want to limit and to not to be able to create new databases on other Tablespaces than the one allocated to their users

-I somewhat succeded, and if tryes to create a new database using a different Tablespace than <db_b> (the one it is assigned to him), it gets "permission denied for tablespace db_a it even gets "permission denied for tablespace pg_default" if it chooses the <pg_default> Tablespace

BUT here is my problem: If the same user does not specify(choose) a Tablespace, the database gets created without any error or notification and the Tablespace gets set to <pg_default> that resides on the install folder of the small OS HDD and not one of the additional large HDD's

I'm not sure if it's ok to delete the pg_default Tablespace trying to find a workaround for this.

Setup: ubuntu24 desktop, PostGreSQL16, pgAdmin4

I've seen the post named "Why do I get a PostgreSQL permission error when specifying a tablespace in the "create database" command?" but my case is different and suggestions from there do not apply for me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.