# Postgres error 28000: no pg_hba.conf entry for host / role "x" is not permitted to log in

> The server does not allow this role to connect from this address or with this method.

Source: https://scribase.com/postgres-errors/28000

SQLSTATE class: Invalid Authorization Specification. Over PostgREST/supabase-js this maps to HTTP 403.

## Causes

- Connecting without TLS to a server that requires it.
- The client IP is not in the allowed ranges.
- The role has NOLOGIN, such as an API role used only through a gateway.

## Fixes

- Add sslmode=require to the connection string.
- Connect from an allowed network or update the allow list.
- Use a login role; do not connect directly as roles meant for the API.