Different PG user for DB creation

Hi,

I’m testing Hanami 2 and I ran into an issue when creating DB. My PG user is different from my system user and the createdb command returns an error that there is no such user in PG. Can’t I specify this somewhere?

2 Likes

I think it’s a pure postgres question, but you should be able to setup an owner of the db you create using the --owner flag.

Let me know if that answers the question.
For the db settings inside of the hanami app, you just need the URL to your database which can contain user and password specified:

postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]

Source: What is the format for the PostgreSQL connection string / URL? - Stack Overflow