1

I installed the postgres by brew install postgres

then I checked the information

$brew info postgresql

Warning: Use postgresql@14 instead of deprecated postgresql
==> postgresql@14: stable 14.7 (bottled)
Object-relational database system
https://www.postgresql.org/
/opt/homebrew/Cellar/postgresql@14/14.7 (3,314 files, 45.2MB) *
  Poured from bottle on 2023-04-28 at 12:16:16
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/postgresql@14.rb
License: PostgreSQL
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✔, lz4 ✔, openssl@1.1 ✔, readline ✔
==> Caveats
This formula has created a default database cluster with:
  initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@14
For more details, read:
  https://www.postgresql.org/docs/14/app-initdb.html

To restart postgresql@14 after an upgrade:
  brew services restart postgresql@14
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14
==> Analytics
install: 1,639 (30 days), 141,103 (90 days), 966,424 (365 days)
install-on-request: 1,615 (30 days), 138,040 (90 days), 943,202 (365 days)
build-error: 0 (30 days)

I guess, it says initdb is finished by brew

So, I try to login

$psql -U postgres
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  role "postgres" does not exist

There is no account postgres.

Where should I start?

whitebear
  • 11,200
  • 24
  • 114
  • 237

0 Answers0