From 4b726c20504ee7b2d50235b4632182c0d8597ef6 Mon Sep 17 00:00:00 2001 From: Alexey Savchkov Date: Fri, 3 Jul 2026 16:24:59 +0700 Subject: [PATCH 1/3] Try to find the Postgres binary --- src/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index 5e9fa955..3738c7fb 100644 --- a/src/utils.py +++ b/src/utils.py @@ -183,8 +183,7 @@ def get_bin_dir(os_ops: OsOperations) -> str: pg_config = os.environ.get("PG_CONFIG") if pg_config: - bindir = get_pg_config(pg_config, os_ops)["BINDIR"] - return bindir + return get_pg_config(pg_config, os_ops)["BINDIR"] # try PG_BIN pg_bin = os_ops.environ("PG_BIN") @@ -193,8 +192,11 @@ def get_bin_dir(os_ops: OsOperations) -> str: pg_config_path = os_ops.find_executable('pg_config') if pg_config_path: - bindir = get_pg_config(pg_config_path)["BINDIR"] - return bindir + return get_pg_config(pg_config_path)["BINDIR"] + + postgres = os_ops.find_executable('postgres') + if postgres: + return os.path.dirname(postgres) raise RuntimeError("BinDir is not detected.") From f3b7473f2420b6064c18ad95cf1b1a953ae32af7 Mon Sep 17 00:00:00 2001 From: vshepard Date: Sat, 4 Jul 2026 18:14:57 +0200 Subject: [PATCH 2/3] Update get_pg_config with os_ops --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 3738c7fb..3d372d4b 100644 --- a/src/utils.py +++ b/src/utils.py @@ -192,7 +192,7 @@ def get_bin_dir(os_ops: OsOperations) -> str: pg_config_path = os_ops.find_executable('pg_config') if pg_config_path: - return get_pg_config(pg_config_path)["BINDIR"] + return get_pg_config(pg_config_path, os_ops)["BINDIR"] postgres = os_ops.find_executable('postgres') if postgres: From 697b69af336ee6e9e9dcf11a330478a74276a467 Mon Sep 17 00:00:00 2001 From: Alexey Savchkov Date: Mon, 6 Jul 2026 10:49:57 +0700 Subject: [PATCH 3/3] Get dirname from the OsOperations class --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 3d372d4b..b8bec39b 100644 --- a/src/utils.py +++ b/src/utils.py @@ -196,7 +196,7 @@ def get_bin_dir(os_ops: OsOperations) -> str: postgres = os_ops.find_executable('postgres') if postgres: - return os.path.dirname(postgres) + return os_ops.get_dirname(postgres) raise RuntimeError("BinDir is not detected.")