pg.ddx.io  patroni/patroni GitHub issues and pull requests  
help / color / mirror / Atom feed
From: khushi-git-7 (@khushi-git-7) <noreply+khushi-git-7@github.com>
To: patroni/patroni <noreply+patroni-patroni@github.com>
Subject: Re: [patroni/patroni] PR #3787: Accept a Windows drive-letter path as a unix socket directory
Date: Mon, 16 Nov 2026 17:22:55 +0000
Message-ID: <gh-patroni-patroni-3787-c6923756955@github.com> (raw)
In-Reply-To: <gh-patroni-patroni-3787@github.com>
References: <gh-patroni-patroni-3787@github.com>

Thanks for the review, @CyberDem0n. All three are in b8d62c8 and 6e03189:

- **`.pgpass`:** you're right. libpq looks a socket directory up under `localhost` only when it's the default one, which is empty on Windows, so the line I added was never used there. I reverted that hunk and its test, and `_pgpass_content()` is as on master.
- **Custom bootstrap:** I applied your suggestion. `replace_pg_hba()` now writes the `local` rules on Windows with PostgreSQL 13+, and still writes none for 12 and older. A new test, `test_replace_pg_hba_custom_bootstrap_on_windows`, covers both. With PG13+ and a drive-letter socket directory, it checks that the rules are `local` and that the directory isn't resolved as a host name. With PG12, only the TCP address gets a `host` rule.
- **PostgreSQL 12 and older on Windows:** `resolve_connection_addresses()` now takes a drive-letter socket directory only when `os.name != 'nt'` or `major_version >= 130000`. Otherwise it falls back to TCP, as before this PR. `is_unix_socket_path()` and `_get_unix_local_address()` take that as a `windows_sockets` flag, and `test_resolve_connection_addresses` and `test__get_unix_local_address` cover the PG12 case. One thing to note: when the major version isn't known yet, it's 0, so a Windows drive-letter directory falls back to TCP rather than being guessed.

The docs entry now says the drive-letter case needs PostgreSQL 13 or newer on Windows.

On my fork, `tests/test_postgresql.py` and `tests/test_config.py` pass on ubuntu-24.04 and windows-latest, with Python 3.8 and 3.12, and flake8 is clean. With master's `config.py`, the three changed tests fail.


view thread (17+ messages)  latest in thread

Message-ID: <gh-patroni-patroni-3787-c6923756955@github.com>
Permalink:  ../gh-patroni-patroni-3787-c6923756955@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox