You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

RHEL 8环境下PostgreSQL 11的pg_isready工具获取及路径配置问询

PostgreSQL 11 on RHEL 8: pg_isready Location and PATH Questions

Let me break this down for you based on your migration experience from Ubuntu to RHEL 8 with PostgreSQL 11:

1. Is pg_isready part of PostgreSQL 11 for RHEL 8? How to get it?

Yes, pg_isready is absolutely part of the PostgreSQL 11 client toolset for RHEL 8. The confusion here comes from differences in package structure between Ubuntu and RHEL's PGDG repository.

On Ubuntu, installing postgresql-client-11 drops all client tools (including pg_isready) directly into /usr/bin for easy access. But on RHEL 8, the postgresql11 package (even without postgresql11-server) installs all client tools to /usr/pgsql-11/bin/ instead. Only a handful of commonly used tools (like psql) get set up with soft links via the alternatives system to /usr/bin by default.

You already found pg_isready in /usr/pgsql-11/bin/—that means your installation worked correctly. The missing piece was just that this directory isn't in the default system PATH.

2. Will adding /usr/pgsql-11/bin to the system PATH cause issues?

Adding this directory to your PATH is generally safe, but there are a few considerations to keep things smooth:

  • Avoid version conflicts: RHEL 8's default AppStream repository includes an older PostgreSQL version (usually 10). If you add /usr/pgsql-11/bin before /usr/bin in your PATH, the PGDG PostgreSQL 11 tools will take precedence—which is exactly what you want for your migration. If you add it after /usr/bin, the system's older PostgreSQL tools would run first, which could lead to unexpected behavior.
  • Choose user-specific or system-wide access:
    • For just your user account, add this line to your shell's config file (like ~/.bashrc or ~/.zshrc):
      export PATH="/usr/pgsql-11/bin:$PATH"
      
      Then run source ~/.bashrc to apply the change immediately.
    • For all users on the system, create a new file at /etc/profile.d/postgresql.sh with this content:
      export PATH="/usr/pgsql-11/bin:$PATH"
      
      This will apply the PATH change on every user's login.
  • Stick with the alternatives system (optional): If you prefer matching how psql is set up, you can manually add pg_isready to the alternatives chain. Run this command as root:
    sudo alternatives --install /usr/bin/pg_isready pg_isready /usr/pgsql-11/bin/pg_isready 100
    
    This creates a soft link from /usr/bin/pg_isready to the PGDG version, keeping consistency with your existing psql setup.

Quick Recommendation

If you need access to most or all PostgreSQL 11 client tools, adding /usr/pgsql-11/bin to your PATH is the simplest solution. If you only need a few specific tools available system-wide, using the alternatives method is a cleaner approach.

内容的提问来源于stack exchange,提问作者Shawn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 16:12:27