jackc / jackc/pgx

Support for connections/connstrings that don't require passwords

Open
#2,040 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

**Is your feature request related to a problem? Please describe.**
When using typical connection strings, you can exclude the password part as postgres (by default, on many machines) authenticates the connection via PEER authentication method. This requires no password nor username. Otherwise, there are also settings (in `pg_hba.conf`) that allows all users to connect to any role without password.

But - as far as I can tell - pgx only authenticates with password-provided methods. Any attempt to use a connstring without a password you get:

```
failed to connect to `host=localhost user= database=`: failed SASL auth (FATAL: password authentication failed for user "" (SQLSTATE 28P01))
```

**Describe the solution you'd like**
Tthe connstrings that exclude passwords should be possible on postgres instances where passwords are not needed.

Contributor guide

Open the contributing guide

Research direction

Reproduce the passwordless connection case described in the issue, then trace pgx's connection and PostgreSQL authentication entry points to see where password-based authentication is assumed. The issue names no files or tests, so completion would require defining and validating support for peer or other no-password authentication without breaking existing password flows.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.