Skip to content

Instantly share code, notes, and snippets.

@guilsa
Last active December 19, 2025 20:34
Show Gist options
  • Select an option

  • Save guilsa/0fb4e020e4a3c0372a3ce3758f155022 to your computer and use it in GitHub Desktop.

Select an option

Save guilsa/0fb4e020e4a3c0372a3ce3758f155022 to your computer and use it in GitHub Desktop.
PostgreSQL local development on macOS

PostgreSQL local development on macOS

Best Practices (mac OS)

Homebrew's default PostgreSQL uses your system user without a password.

Default user name

On macOS, the default user setup for PostgreSQL varies based on the installation method, but the general best practices emphasize avoiding the default superuser for daily operations and using a dedicated, least-privilege user for your projects (source: google ai).

Role creation

When managing PostgreSQL roles on macOS, the primary best practice is to implement the principle of least privilege by creating specific roles (users and groups) for different functions and granting them only the necessary permissions (source: google ai).

Initial things to check

Connect

psql list databases

List users

\du

List dbs

\l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment