Postgres version compatibility - postgresql

I was using PostgresSQL version 9.6 with JDBC driver 9.4-1206-jdbc42 to connect to Java. I was using the SimpleJDBCCall of Springs to connect to the database.
However, after the upgrade of PostgreSQL to 10.5, we are unable to use the SimpleJDBCCall API. Any light on this issue will be of great help.

You should never use a version of the JDBC driver that is older than the PostgreSQL server release.
The recommendation is to always use the latest driver version. A new driver will know how to talk to an old server, while an old driver might not know how to talk to a new server.

Related

AWS RDS PostgreSQL Upgrade from 9.6.22 to 10.17

Good day. I just finished upgrading my AWS RDS database engine from 9.6.22 to 10.17. I used these steps to make the upgrade using the AWS Console:
Create snapshot of target database to upgrade
Restore snapshot
Upgrade the restored snapshot's (which is now a new instance) DB Engine version.
After I did all of this, everything seems fine but when I access the database, this warning message appears
WARNING: psql major version 9.6, server major version 10.
Some psql features might not work.
I did not continue on my testing because I want to know what is the meaning of this first. Because I am fairly new in AWS as a whole. Thanks!
The meaning is that just because you are connecting to an upgraded database on some machine run by Amazon, the PostgreSQL installation on your local machine was not magically updated. psql from version 9.6 doesn't know what metadata tables were changed in v10, what features were removed and so on.
It would be a good idea to install a more recent version of PostgreSQL on your machine. By the way, upgrading to v10 was not the smartest move, as that version will go out of support in less than a year. You should upgrade to the latest version that your service provider offers.
The client program psql you are using to connect to the database is from an older version than the database it is connecting to. Some of the introspection features might not work. For example, psql from 9.6 won't know how to do tab completion for commands that were added to the server after 9.6.
This is generally not a major problem for psql (unless the server wants to use SCRAM authentication), but for optimal experience it would be good to install a newer client. Other tools like pg_dimp might not with at all against a server newer than they are.

Which Postgres version compatibilty with JDBC Driver 42.1.4?

I am running Keycloak server 3.4.3.Final version, that it used JDBC_POSTGRES_VERSION=42.1.4. I want to know which latest Postgres version (10,11,12,13) will compatibility with 42.1.4 driver.
Thanks a lot!
With the JDBC driver 42.1.4 being released on the 1st of August 2017 (2017-08-01) according to the changelog, you can take a look at the state of the release/download page of Postgres at that time using e.g. the Internet Archive.
A page snapshot from November 2017 (some month after the release) reads the following:
Current Version 42.1.4
This is the current version of the driver. Unless you have unusual
requirements (running old applications or JVMs), this is the driver
you should be using. It supports PostgreSQL 8.2 or newer and requires
Java 6 or newer. It contains support for SSL and the javax.sql
package.
If you are using Java 8 or newer then you should use the JDBC 4.2 version.
If you are using Java 7 then you should use the JDBC 4.1 version.
If you are using Java 6 then you should use the JDBC 4.0 version.
If you are using a Java version older than 6 then you will need to use a JDBC3 version of the driver, which will by necessity not be
current, found in Other Versions.
TL;DR: You can use this driver starting with PostgreSQL 8.2.
PostgreSQL release history:
https://www.postgresql.org/docs/release/
https://www.postgresql.org/support/versioning/
PostgreSQL JDBC release history:
https://jdbc.postgresql.org/documentation/changelog.html

Migrating Postgresql 9.1 to 9.2 from an old server to a new server

In my old server, Postgresql 9.1 is installed and it contains a large scale of data. Now, I have got a new server and installed the latest version of Postgresql which is 9.2. I want to migrate the whole data from the old server to the new server. I looked at Postgresql documentation and there is a command to upgrade but it seems to explain upgrading in the same server. How could I approach for this matter?
I would be very careful about changing both hardware and major versions of PostgreSQL at the same time. If something goes wrong, it will greatly complicate figuring out what the problem is.
I do this as a two step process, first restore the database to the new server as the same version, then run pg_upgrade. That means you have to have both versions of the software installed on the new server simultaneously.
Dump the database with pg_dump and load it at the new server with psql. I think pg_upgrade is better as an in place procedure.

Does Npgsql support community version of postgres?

I read from the enterprise db website that only the Postgres standard server and advanced server support Npgsql.
But am not sure if
1. Npgsql will not work with community version at all ?? or
2. It is just that it is not packaged along with community version,but I can use npgsql to connect and work with postgresql from .Net
Can someone help me understand?
I read from the enterprise db website that only the Postgres standard
server and advanced server support Npgsql.
EnterpriseDB is not the same as PostgreSQL. PostgreSQL is PostgreSQL, it's not a "community version" from EnterpriseDB. EnterpriseDB Server is a fork of PostgreSQL, not the other way around.
And yes, Npgsql does work with PostgreSQL, it was created for PostgreSQL:
Npgsql is a .Net Data Provider for Postgresql. It allows any program
developed for .Net framework to access database server. It is
implemented in 100% C# code. Works with Postgresql 7.x and above.

Flyway: Support for older DB's

I'm currently trying to set up some simple migration scripts for our databases. I was checking flyway, which seems to be simple enough for what I need. My problem is that, for Postgres, only version 9 is supported (we're using 8.4). Is it possible to work around/fix this limitation somehow, or should I start looking for other options?
Edit: I forgot to mention that when I run something like mvn flyway:status, I get the error message:
Flyway Error: java.lang.IllegalArgumentException: Unsupported Database: PostgreSQL
I can connect to the DB via psql, and I'm using the correct jdbc driver, so when I saw the requirements page in the documentation, I assumed that the version was explicitly checked by flyway.
What limitations do you encounter? Flyway is only tested on PostgreSQL version 9.0, that's it. It's not said that older PostgreSQL versions don't work. Just give it a try.
You could also setup a PostgreSQL 9.0 installation on your testbox to see if there is any difference.