Techtrekking

create new database, database user

By Pravin•
CREATE USER db_name_db_user WITH PASSWORD 'change_me'; CREATE DATABASE db_name_db OWNER db_name_db_user; GRANT ALL PRIVILEGES ON DATABASE db_name_db TO db_name_db_user; \c dhgs_spliteasy_db ALTER SCHEMA public OWNER TO db_name_db_user; GRANT ALL ON SCHEMA public TO db_name_db_user;

The last two lines matter on PostgreSQL 15 and later. Without them, the user can connect to the database but gets “permission denied for schema public” as soon as it tries to create tables.

Comments
No comments yet. Be the first to comment!
Leave a Comment
Your comment will be visible after approval.