Flyway: Support for older DB's - postgresql

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.

Related

Can't connect to databases in DBeaver

I'm having problems trying to connect to databases with DBeaver. I've managed to connect to one database fine with no problems. However, any additional connections is causing issues.
I keep getting the error
SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" versions)
I've tried the exact same details in pgadmin, and can get into the database just fine.
I just much prefer DBeaver as pgadmin seems to lack some really basic features like autocompletion.
I've reinstalled postgres and dbeaver multiple times, ensuring that its the latest version of each, still nothing.
Fixed the issue. It appears that DBeaver was holding on to an outdated library, which was being checked first, and therefore failing the test.
Steps to solve issue.
Download latest JDBC and move to \Program Files\DBeaver\shared_drivers
Open DBeaver and click Database -> Driver Manager
Double click on PostgreSQL
Under libraries click Add file and find the new JDBC
Delete any of the previous libraries, so it remains the only one

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.

How to connect PostgreSQL to web2py?

How do I connect a postgresql to a web2py application? The web2py documetation says that I can connect it using the command db = DAL("postgres://myuser:mypassword#localhost:5432/mydb") but upon doing it, it produces an error saying RuntimeError: No driver of supported ones ('psycopg2',) is available.
I already installed psycopg2 but I don't know how to use it in the web2py app. There are not a lot of resources out there about this so I'm having a lot of trouble.
Your DAL code is correct. I think psycopg2 is not installed correctly.
Maybe you want to install psycopg2-binary.

What does 'Building new PostgreSQL source with configure flags mean' from the PGSQL Docs?

I've been tasked with upgrading our Postgresql database to 9.4 and I'm following the instructions found on the documentation found here:
Upgrading Postgresql
The second step for upgrading to 9.4 says this:
For source installs, build the new version
Build the new PostgreSQL source with configure flags that are compatible
with the old cluster. pg_upgrade will check pg_controldata to make sure all settings
are compatible before starting the upgrade.
I rarely have to go into the internals of PGSQL and I'm not sure what is meant by the term 'configure flags'. Is this a specfic term in reference to PGSQL or does this refer tot he command line options at the top of the documentation page? In fact, do I even need to do this? The very nex st sentence says that pg_ugprade will do it for me. I'm upgrading our database that has a lot of sensitive data and I need to get this right. Obviously I have a sandbox though to play with but if someone can help me understand what that means, I'd appreciate it. I've come to find that dealing with PGSQL can be frustrating as hell. Thanks.

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.