So, I wanted to clean up my developer installations and decided to install only one instance of postgress with a database per developer instance underneath.
OS X 10.12.1
Java 1.8.0_65
Servoy version 6.0.11, 6.1.6, 7.4.8 and 8.1.0 (all the same result)
Postgres version 9.6.1
This was a completely clean install of Postgress as well as the four Servoy installations.
After the first time this failed I re-installed everything again.
The databases and schemas were created manually before running the script.
At first run with ‘./servoy_server.sh -upgradeRepository &’ this is the message in the log file:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Upgrading repository.
Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: relation "servoy_repository.servoy_elements" does not exist
Then when doing the same a second time this is in the log file:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Upgrading repository.
Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: relation "servoy_content_spec" already exists
When you install the different developer instances have you made a separate servoy_repository database for each instance? I usually use the following procedure to install each developer instance:
Set up a DB with the default name (servoy_repository)
install the developer version you need
Run the repository upgrade
Close all developer instances
Use pgAdmin to rename the DB servoy_repository_vX.X.X according to the developer version that will be accessing it
Edit the servoy.properties file for the developer instance and change the server URL to point to the renamed DB (e.g. server.0.URL=jdbc:postgresql://localhost:5432/servoy_repository_v8.1.0)
This ensures that each instance has the correct repository version and they don’t interfere with each other.
So, from what you write I understand that you make just one database, name it servoy_repository and run the upgrade script without changing the database connections at first run (an unmodified, clean properties file).
Do I interpret that correct?
Yes - but as soon as the upgrade is run I then rename the DB and change the properties file. This has to be done before trying to install the next developer instance. In your case you will then end up with 4 repository database (one for each developer instance) and all will be named according to the version the work with.
Not sure about the PG version. I am currently running 9.4 as I use a tool to synchronise data between DBs that won’t work with 9.5 or 9.6. Waiting for the company to release an update.
PostgreSQL 9.6 made a change in it’s catalog and Servoy queries that directly when doing the -upgradeRepository. So it fails and stops after creating 10 of the 14 tables leaving your repository crippled.
I haven’t tested it but my guess is that it will also affect any upgrading of existing repositories.
I filled a bug report in Jira, you can add your vote to it.
So for now I suggest you use PostgreSQL up to version 9.5.x for your Servoy repository.
UPDATE: turns out that it’s the JDBC driver. After installing the latest version from the PostgreSQL JDBC driver site it works.
Be aware that the Java version is important in what version you have to download.
If you are using the 1.6 then you should use the JDBC4 version. If you are using 1.7 then you should use the JDBC41 version. If you are using 1.8 then you should use the JDBC42 version.