when you GRANT ALL PRIVILEGES ON [ALL TABLES IN] SCHEMA public TO testuser
in fact does not grant you all privileges, including CREATE privileges, it gives you permission to access existing tables not to create new. Changing the owner ALTER DATABASE test_db OWNER TO testuser
, enables other privileges (including CREATE). To solve this I think you can do GRANT USAGE, CREATE ON SCHEMA public TO testuser
. let me know you have more doubts