diff --git a/lib/hanami/cli/commands/app/db/utils/postgres.rb b/lib/hanami/cli/commands/app/db/utils/postgres.rb index 0f469536..863400b6 100644 --- a/lib/hanami/cli/commands/app/db/utils/postgres.rb +++ b/lib/hanami/cli/commands/app/db/utils/postgres.rb @@ -14,7 +14,7 @@ module Utils class Postgres < Database # @api private def create_command - existing_stdout, status = Open3.capture2(cli_env_vars, "psql -t -c '\\l #{escaped_name}'") + existing_stdout, status = Open3.capture2(cli_env_vars.update("PGDATABASE" => "postgres"), "psql -t -c '\\l #{escaped_name}'") return true if status.success? && existing_stdout.include?(escaped_name)