2

Our application server is on EC2 running on Amazon Linux 1. Postgres dropped support for Amazon Linux and so we depend on Amazon providing the postgres client.

The client is 9.6 and our Amazon hosted RDS postgres server is 11.4. Because of our automation, it would take a good amount of time to upgrade from Amazon Linux 1 to Amazon Linux 2. Even then Amazon Linux 2 only has a postgres 10 client.

It's a small app that uses the Rails ORM Active Record and only does simple queries and inserts.

Is it a no-go to use 9.6 as the client? I'm wondering what the risk are.

0

I don't believe that PostgreSQL dropped support for any Linux distribution. Perhaps you mean that there are no binary installation packages provided.

Using a 9.6 client is no problem, since 9.6 is a supported release. You will not be able to use new features like scram-sha-256 authentication, but I guess you can live without that.

Building PostgreSQL from source would be another option.

  • Thank you! Yes, I should have said no binary installation. Yeah, we tried building PostgreSQL from source but had I think a dependency issue. – Todd Sep 24 '19 at 22:22
  • I am sure that dependency problem can be solved by installing some software. – Laurenz Albe Sep 25 '19 at 1:59
  • Yes, I can't remember the error but would like to try again and ask for help. Though I don't know if we need to if the protocol version v2 is the same and we don't need more than the basic functionality. Thanks for your help! – Todd Sep 25 '19 at 6:19
  • No, 9.6 is not an ancient version. It will work like a charm with a v11 server. – Laurenz Albe Sep 25 '19 at 6:38
0

Well, the complete answer is a bit more complicated. The general rule is that any client version will work with any server version, if both use the same major version of libpq communication library (and protocol).

So:

  1. psql command line client 9.6 (libpq version 5.8) should work properly with server 11.4 (even Postgres 12 uses libpq 5.12).

  2. Other tools based on libpq.so.5 client library should also work properly.

  3. However pg_dump tool will refuse to work with newer major server version (9.6 will work with any 9.x, but not with 10.x and later). This behavior is intentional, to prevent creating incomplete or invalid database backups.

  4. For any other tools, based not on libpq.so library, but eg. on native JDBC driver, you need to check the exact version of communication protocol they implement.

  • There are some inaccuracies in this answer: 1) There is no version 9 in PostgreSQL. A 9.4 pg_dump will refuse to dump a 9.6 server, because these are different major versions. PostgreSQL changed from two-part to one-part major versions in v10. 2) The server does not use libpq.so to communicate with the client, so the library version is immaterial. What matters is the protocol version. Support for protocol v2, which is very old, hasn't been dropped. – Laurenz Albe Sep 25 '19 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.