This Release Note covers all point releases for the PostgreSQL 9.4 branch that are offered by eApps. Upgrade instructions are included.
NOTE - eApps maintains PostgreSQL 9.4 for CentOS 6 OS Templates. If you are using a CentOS 7 OS Template the latest version of PostgreSQL that is currently available from the CentOS community will be installed, or you can install a specific version if needed. If you are using a CentOS 6 OS Template and wish to move to a CentOS 7 OS Template, please contact eApps Sales.
PostgreSQL 9.4 is a major release of the PostgreSQL database server. This release has introduced new functionality and significant changes to the existing PostgreSQL database server. If you are upgrading from any prior version of PostgreSQL to PostgreSQL 9.4, there is a HIGH RISK of data loss and downtime if you do not carefully test your existing database and application with this new version. |
eApps recommends, as a best practice, to maintain a staging server where you can test software upgrades before moving them into production. This approach will allow you to minimize the risk of data loss and downtime of your production service when performing software upgrades. If necessary, you can rebuild your staging Virtual Server on demand so that you have a fresh installation to test on. If you need more information about setting up a staging Virtual Server, please contact eApps Sales.
IMPORTANT: PostgreSQL 9.4 has an extensive list of new features and changes. See the Official PostgreSQL 9.4 Release Notes for a list of changes that may cause issues when upgrading: http://www.postgresql.org/docs/9.4/static/release-9-4.html. Please read this document carefully to understand all the changes in the PostgreSQL 9.4 release. Upgrading to this version may significantly impact the operation of your database and applications. All PostgreSQL 9.4 documentation is located here: http://www.postgresql.org/docs/9.4/static/index.html
phpPgAdmin users please note - phpPgAdmin does not officially support PostgreSQL 9.4. If you use phpPgAdmin to manage your PostgreSQL 9.4 database, please contact eApps Support for assistance. A workaround is available to allow phpPgAdmin to work with this new version of PostgreSQL.
eApps Release Notes for PostgreSQL 9.4.6
eApps Release Notes for PostgreSQL 9.4.5
eApps Release Notes for PostgreSQL 9.4.4
eApps Release Notes for PostgreSQL 9.4.2
eApps Release Notes for PostgreSQL 9.4.1
eApps Release Notes for PostgreSQL 9.4.0
How to Upgrade
PostgreSQL 9.2 or 9.3 to PostgreSQL 9.4
PostgreSQL 9.4.x to PostgreSQL 9.4.y (newer version)
NOTE - PostgreSQL 9.4.6 has a security fix for CVE-2015-7499. From the release notes:
Add variant regression test expected-output file to match behavior of current
libxml2
(Tom Lane)
The fix for libxml2's CVE-2015-7499 causes it not to output error context reports in some cases where it used to do so. This seems to be a bug, but we'll probably have to live with it for some time, so work around it.
PostgreSQL 9.4.6 is a bug fix and security release, no new features have been added.
tzdata
time zone files updated to include DST law changes in certain countriesThe official Release Notes for PostgreSQL 9.4.6 are here - http://www.postgresql.org/docs/9.4/static/release-9-4-6.html
PostgreSQL is a bug fix and security release, no new features have been added.
json
parsingdatetime
inputThe official Release Notes for PostgreSQL 9.4.5 are here - http://www.postgresql.org/docs/9.4/static/release-9-4-5.html
PostgreSQL 9.4.4 is a bug fix and security release, no new features have been added.
CREATE/DROP DATABASE
The official Release Notes for PostgreSQL 9.4.4 are here - http://www.postgresql.org/docs/9.4/static/release-9-4-4.html
PostgreSQL 9.4.2 is a bug fix and security release, no new features have been added.
json
/jsonb
populate_record()
and to_record()
functions to handle empty input properlytzdata
release 2015d for DST law changes in several countriesThe official Release Notes for PostgreSQL 9.4.2 are here - http://www.postgresql.org/docs/9.4/static/release-9-4-2.html
PostgreSQL 9.4.1 is a bug fix and security release, no new features have been added.
jsonb
*printf()
buffer overrunEXPLAIN
with large range tablesThe official Release Notes for PostgreSQL 9.4.1 are here - http://www.postgresql.org/docs/9.4/static/release-9-4-1.html
Some major feature enhancements for PostgreSQL 9.4:
jsonb
, a more efficient data type for storing JSON
dataALTER SYSTEM
for changing postgresql.conf
configuration file entriesALTER TABLE
commandsssl_ciphers
settinglog_connections
now shows the SSL encryption informationwork_mem
and maintenance_work_mem
by four times (to 4 MB and 64 MB respectively)The Official Release Notes for PostgreSQL 9.4.0 are available here - http://www.postgresql.org/docs/9.4/static/release-9-4.html
It is your responsibility to ensure that your database and application will work on the newer version of PostgreSQL. There may be incompatibilities that will affect how your databases and application works. Please make sure that you have read the official Release Notes and have done any necessary testing before upgrading a production database and application.
Before upgrading PostgreSQL, make a backup of your databases. The instructions for backing up PostgreSQL are here: http://support.eapps.com/ispmgr/postgresql9#backing-up-postgresql-databases
You should also make a backup of your applications, your configurations, and any tunings or changes you have made. If you do not have current backups and something goes wrong during the upgrade process, you could have downtime and data loss.
To upgrade PostgreSQL, you will need to work from the command line using SSH, and you will need to be able to work as the root user. You will need to use yum to upgrade the application.
The upgrade from PostgreSQL 9.2 or 9.3 to 9.4 is a major version update. There is no direct upgrade path between major PostgreSQL versions. Please follow the steps below to update PostgreSQL. If you try to upgrade PostgreSQL without following the correct steps you run a high risk of data loss and corruption.
Before starting the upgrade, make sure that no transactions are being written to the PostgreSQL database. You may need to restrict access to the database to just yourself before starting the upgrade, or do the upgrade during a time when no one will be using the database. Any transactions written to the database after running the pg_dumpall
command (described below) will be lost.
The steps to upgrade PostgreSQL are as follows:
pg_dumpall
command to dump all your databasespg_dumpall
back into the new version of PostgreSQLpg_dumpall
command to dump all your databasesThe pg_dumpall
command will dump all PostgreSQL databases. This command must be run as the postgres user. The command is pg_dumpall > outputfile.sql
. Make sure that the name of the output file is not already in use.
[root@eapps-example ]# su - postgres
-bash-4.1$ pg_dumpall > outputfile.sql
-bash-4.1$
The pg.conf and postgresql.conf files often have customizations that are not preserved across upgrades, and the upgrade will replace your original copies of these files. Make a copy of each of these files so that you can put them back if needed.
Use the cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.bak
and cp /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.bak
commands to copy the files.
[root@eapps-example ~]# cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.bak
[root@eapps-example ~]# cp /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.bak
For CentOS 6, use the service postgresql stop
command:
[root@eapps-example ~]# service postgresql stop
Before doing the upgrade, move the existing PostgreSQL database file to a new location. This will allow you to restore the old version if something goes wrong with the upgrade. Use the mv /var/lib/pgsql /var/lib/pgsql.old
command.
[root@eapps-example ~]# mv /var/lib/pgsql /var/lib/pgsql.old
[root@eapps-example ~]#
Before updating PostgreSQL, update the yum cache with the yum clean all
command. Then update both the PostgreSQL client and server using the yum -y update postgres postgresql-server
command.
[root@eapps-example ~]# yum clean all
[root@eapps-example ~]# yum -y update postgres postgresql-server
If you have customizations in your pg_hba.conf and postgresql.conf files that need to be put back in place, copy those files back to their original locations. You may want to review the file created by the upgrade and your existing files to see if there are new changes that are relevant to your configuration. Because you moved the original pgsql directory to pgsql.old, these files will now be in the .old directory.
Use the cp /var/lib/pgsql.old/data/pg_hba.conf.bak /var/lib/pgsql/data/pg_hba.conf
and cp /var/lib/pgsql.old/data/postgresql.conf.bak /var/lib/pgsql/data/postgresql.conf
commands to copy the files.
[root@eapps-example ~]# cp /var/lib/pgsql.old/data/pg_hba.conf.bak /var/lib/pgsql/data/pg_hba.conf
[root@eapps-example ~]# cp /var/lib/pgsql.old/data/postgresql.conf.bak /var/lib/pgsql/data/postgresql.conf
pg_dumpall
back into the new version of PostgreSQLOnce the upgrade completes, import the databases back into the new version of PostgreSQL. This must be done as the postgres user, using the /usr/bin/psql -d postgres -f outputfile.sql
command.
[root@eapps-example ~]# su - postgres
-bash-4.1$ /usr/lib/psql -d postgres -f all_db.sql
-bash-4.1$
To update PostgreSQL you will need to connect to your Virtual Machine via SSH. More information can be found in the SSH User Guide
As always, make sure to backup your databases before upgrading.
Once you are connected to the Virtual Machine, you will need to run the following commands as the root user: yum clean all
and yum -y update postgresql-server
[root@eapps-example ~]# yum clean all
Loaded plugins: fastestmirror, priorities, remove-with-leaves
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@eapps-example ~]#
[root@eapps-example ~]# yum -y update postgresql-server
You will know that the new version of PostgreSQL is installed when you see a Complete! message and you are returned to the command prompt. Once the installation has completed, restart PostgreSQL.
For CentOS 6, use the service postgresql restart
command:
[root@eapps-example ~]# service postgresql restart