FIX (postgresql): Escape special characters in .pgpass file for authentication #391

Closed
opened 2026-04-05 16:16:21 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @kapawit on 11/26/2025

Even if the password is correct, PostgreSQL may read it incorrectly if the special characters in the .pgpass file are not properly escaped. In the .pgpass format, the following characters must be escaped:

  • Backslash: \ → \
  • Colon: : → :

If these are not escaped, PostgreSQL will parse the file incorrectly and authentication will fail.
The fix aligns with PostgreSQL’s official .pgpass specification for handling special characters.

*Originally created by @kapawit on 11/26/2025* Even if the password is correct, PostgreSQL may read it incorrectly if the special characters in the .pgpass file are not properly escaped. In the .pgpass format, the following characters must be escaped: - Backslash: \ → \\ - Colon: : → \: If these are not escaped, PostgreSQL will parse the file incorrectly and authentication will fail. The fix aligns with PostgreSQL’s official .pgpass specification for handling special characters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#391