Skip to content

Connect to local PostgreSQL from Mac

Use 127.0.0.1 as the host when PostgreSQL runs on the same Mac as TableAI. For a container, use the Docker guide instead.

You need a running PostgreSQL server, its TCP port, and a database account. TableAI connects through a host and port, so the server must accept TCP connections.

Check your PostgreSQL installation for the database name, user, and configured port. The usual PostgreSQL port is 5432; use the configured value if it differs. If PostgreSQL client tools are installed, check readiness in Terminal:

Terminal window
pg_isready -h 127.0.0.1 -p 5432

This checks whether the server accepts connections, not whether your password is correct. See the PostgreSQL readiness reference.

  1. Choose File › New Connection….
  2. Select PostgreSQL in Driver.
  3. Give the connection a Name.
  4. Enter 127.0.0.1 in Host and the server’s TCP port in Port.
  5. Enter Database, User, and Password for your local server.
  6. Configure SSL Mode for your server.
  7. Click Test.
  8. Click Save & Connect after a successful test.

See connection basics for password storage and URL import.

PostgreSQL connection form with a local host and demo database details

Use the SSL/TLS guide if your local server uses certificates. A server on this Mac does not need an SSH tunnel. For a server on another computer, enter that computer’s address and check Local Network permission.

connection refused
no pg_hba.conf entry for host

For a refusal, check the running server, TCP port, and listen_addresses setting. For a pg_hba.conf error, check the server’s rules for the client address, database, user, and encryption. A successful Unix socket login in Terminal can use different authentication rules from TableAI’s TCP connection.

Use password authentication failed for rejected credentials, or connection failed for network errors.

Continue with write and run SQL, or return to the PostgreSQL overview.