Identify the postgres extension version shows different versions - postgresql

Have a postgres database with extensions
If I do psql>\dx it shows
oracle_fdw, 1.1, foreign data wrapper for Oracle access
But if I do psql>SELECT oracle_diag('oraclegwserver'); it says
oracle_fdw 2.0.0, PostgreSQL 10.0, Oracle client 11.2.0.3.0, Oracle server 11.2.0.2.0
Which version is correct or used?

The first is the extension version, which changes only if the extension's objects change. The second is the version of oracle_fdw.
See the documentation:
Note that the extension version as shown by the psql command \x or the system catalog pg_available_extensions is not the installed version of oracle_fdw. To get the oracle_fdw version, use the function oracle_diag.

Related

Flyway support for Postgresql by version

Other than looking over release notes, is there any way to find what versions of postgresql a given version of Flyway would support?
We are trying to upgrade some Postgresql 9.6 servers, so looking for the highest version of Flyway that would support Postgresql 9.6 so we can support both the existing 9.6 and a newer version of Postgresql.
It would be nice if there was a compatibility matrix of Flyway version against database version for each supported database in the docs but if such a thing exists, I haven't found it.
Instead, I've had to resort to a bit of git blame detective work.
For PostgreSQL, the minimum version is checked in PostgreSQLDatabase.java.
Viewing the Git Blame for that file, shows that the minimum community edition-supported version of PostgreSQL was changed to 10 in this commit, which first appeared in Flyway 8.0.0-beta1.
The previous minimum version was 9.5, which would work with your current database version of 9.6, and this can be found in Flyway 7.15.0, which is the latest release before 8.0.0-beta1.

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.

DBeaver PostgreSQL Database - SCRAM authentication is not supported by this driver

I am trying to add a PostgreSQL database to DBeaver and am getting the following error when I try to connect to the database. I'm using DBeaver Version 7.2.3.202010191702. And after receiving this message I installed the latest version of the JDK (11.0.9) and pgJDBC (postgresql-42.2.18.jar). I've not had PostgreSQL on this machine yet, so it's a fresh install of the latest version (v13). Any suggestions?
SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)
I had same error and in my situation I had old database drivers. These steps fixed it for me:
Go to Database Driver Manager
Select PostgreSQL (either double click or single select and then "Edit ...")
Click on "Download/Update"
Choose newer version (see bold version text) e.g. 42.2.18 for org.postgresql:postgresql:RELEASE
Press "Download"
Even using all the tips and tricks found on SO I was not able to connect to PGSQL 14 DBs.
I fixed it by using PostgreSQL (Old) driver, and it now works.
The problem I faced was identical, and what resolved it for me was:
Removing the previous PostgreSQL JDBC from the lib folder.
Downloading the latest PostgreSQL JDBC.
Substituting the old JDBC with the new one.
I had a problem similar to yours. This is the way to fix it:
open folder PostgreSQL\14\data, edit postgresql.config fix password_encryption to md5
alter all METHOD value to password in pg_hba.conf
restart postgres server
In my case, JRE version postgres being used in Pom.xml. Update it to the latest version and it should work

Connecting to DB2 using SQL Developer

I trying to connect to DB2 database through SQL Developer. I followed following steps create connection:
1. Open SQL Developer
2. Go to Tools > Preferences > Database > Third Party JDBC Drivers.
3. I added third-party JDBC driver path entries (db2jcc.jar and db2jcc_license_cu.jar)
As soon as I try to create connection I get below error
Oracle SQL-Developer Version 17.2 works fine for me with Db2 Version 11 for Linux x64 and I am using a recent Type-4 jdbc (db2jcc4.jar) driver from IBM.
You question shows that your Db2 jdbc driver version is very old (Version 9.7 fixpack 5) and out of support, so you should upgrade to the latest available Db2 client for your (unspecified) operating-system. Also you should ensure you are using the latest release of the Oracle-SQL-Developer for your operating system.
As your question gives no facts about your versions of Oracle or Db2 products or operating systems, this is the best advice that is possible.
I got the same problem, it turned out SQL Developer doesn't display tables for DB2, but still allows to perform SQL queries. If you know table names, you will be able to select data from those tables if you have enough permissions to do so.
You can test ability to perform SQL queries by selecting DB2 version (SQL below is valid for DB2 12.0)
SELECT GETVARIABLE('SYSIBM.VERSION') AS VERSION FROM SYSIBM.SYSDUMMY1;
Make sure you don't forget to specify schema while selecting data from your tables!
select * from schema.table_name;

uuid-ossp module for PostgreSQL 8.2 to generate UUID

I am trying to generate UUID in PostgreSQL 8.2. From the documentation I found uuid-ossp module can generate UUID but it supports only PostgreSQL 9+. Is there any way to use this uuid-ossp module in PostgreSQL 8.2 or generate UUID in PostgreSQL 8.2 by using query?
You may be confused about the packaging of that plugin for Postgres. Postgres 9.1 introduced a new packaging scheme called Extension. The idea is that the creator of a plugin does more work with regard to packaging so that the user of the plugin might do less work with regard to installation. The Create Extension command (a mis-nomer to my mind) installs a plugin into your Postgres cluster.
Previous to Postgres 9.1, you can install the UUID plugin, but doing so is not quite so simple. You must locate the "uuid-ossp" plugin appropriate to your version of Postgres. The plugin may well have been bundled with your Postgres cluster but not yet installed (activated). Within that plugin package find the SQL script used for installation. You then execute that script in your Postgres cluster.
For details, see my posting to the Postgres mailing list and my blog post on the old way to install and the new way to install the UUID plugin.
I cannot find the 8.2 doc, but did find the 8.3 doc for the uuid-ossp plugin. I do not know if 8.2 had a version of the uuid-ossp plugin, but I suppose so.
Postgres 8.2 reached end-of-life two years (2011-12). I strongly suggest planning an upgrade.
As Craig Ringer commented, you should be doing only the most basic maintenance to a Postgres 8.2 cluster. Asking about UUID support suggests some major changes. For such changes you really should first complete an upgrade to a more recent Postgres.
You could write a function PL/Perl or PL/Python that generates UUIDs using one of their modules.