title: libpq.so.5 file is not available while installing postgres-12
body: <p>I have installed postgres-11 already on my machine. libpq.so.5 file is there already into /usr/pgsql-11/lib directory. However, now I need to upgrade to 12. I ran below commands:</p>
  <pre><code>   yum install postgresql12-server postgresql12 -y
  </code></pre>
  <p>Then, I go with initialize step and got below error:</p>
  <pre><code>   /usr/pgsql-12/bin/postgresql-12-setup initdb
     Initializing database ... failed, see /var/lib/pgsql/12/initdb.log
    
     cat /var/lib/pgsql/12/initdb.log
     /usr/pgsql-12/bin/initdb: error while loading shared libraries: 
     libpq.so.5: cannot open shared 
     object file: No such file or directory
  </code></pre>
  <p>Then,I started searching for this file into my postgresql-12 directory and didn't find any file there. However, this file was present into pgsql-11 directory structure:</p>
  <pre><code>   cat /var/lib/pgsql/12/initdb.log
    /usr/pgsql-12/bin/initdb: error while loading shared libraries: libpq.so.5: 
     cannot open shared 
     object file: No such file or directory
  </code></pre>
  <p>As per available searches - created a link like below to avoid the error:</p>
  <pre><code>    ln -s /usr/pgsql-11/lib/libpq.so.5 /usr/lib64/libpq.so.5
  </code></pre>
  <p>And after this I was able to initialize the db successfully and perform upgrade. But, when I tried to connect psql after starting services for 12 after upgrade- I got below error:</p>
  <pre><code>    sudo su - postgres -c &quot;psql&quot;
      psql (12.3)
      psql: symbol lookup error: psql: undefined symbol: PQgssEncInUse
  </code></pre>
  <p>After this , I'm stuck at this error and unable to connect psql. I have below 2 questions now:</p>
  <ol>
  <li>Why libpq.so.5 file is not available into postgres-12 directory structure?</li>
  <li>How to avoid PQgssEncInUse error or what is causing this error?</li>
  </ol>
  <p>Any help will be appreciated.</p>