 /*Make sure all permissions are OFF by default*/
 REVOKE all privileges ON SCHEMA PUBLIC FROM usermanager;
 REVOKE all ON DATABASE POSTGRES FROM usermanager;
+REVOKE all ON DATABASE userdata FROM usermanager;
+REVOKE create ON DATABASE userdata FROM usermanager;
 
 /*Need to use to do anything else*/
+GRANT connect ON DATABASE userdata TO usermanager;
 GRANT usage ON SCHEMA PUBLIC TO usermanager;
 GRANT usage ON SCHEMA users TO usermanager;
 



/*
Finally, lock all permissions down to minimum.

NOTE: Do this as user 'postgres' in the userdata table!



This single table allows us to rebuild the complete, publicly visible
database.

NOTICE: No foreign key dependency as we want to be capable of rebuilding from
        this single table.

        Thus, we track when a row was created to avoid potential future issues
*/
CREATE TABLE users.collectionHistory (

