error: permission denied to create database

created at 10-29-2021 views: 2

When using general users to create a database

PG::Error: ERROR: permission denied to create database

Solution

Login with postgres

sudo -u postgres psql
postgres=# ALTER ROLE xxxx CREATEROLE CREATEDB;
xxxx: common user name

Grant super authority

ALTER ROLE xxxx CREATEROLE SUPERUSER;
created at:10-29-2021
edited at: 10-29-2021: