Thread: PostgreSQL Upgrade Procedure

PostgreSQL Upgrade Procedure

From
Carlos Mennens
Date:
I've had PG 9.0 installed and working fine however it's Friday and I'm
running updates on the server & see that 9.1 is available. I know when
I upgrade, I will now have two instances of PostgreSQL installed under
/etc/postgresql:

Code:

slave:~# cd /etc/postgresql
slave:/etc/postgresql# ls -l
total 8
drwxr-xr-x 3 postgres postgres 4096 Aug 31 13:02 9.0
drwxr-xr-x 3 postgres postgres 4096 Sep  9 10:08 9.1

EndCode:

My question is what is the official procedure for removing the old
version and then running 9.1 only on my system. I don't want to leave
9.0 config files or directories so can someone please point me into
the clean and correct way of properly upgrading from 9.0 to 9.1? I did
do a pg_dump on my two databases & the default 'postgres' database and
backed them up so I can import them into the new 9.1 instance.

Re: PostgreSQL Upgrade Procedure

From
Raymond O'Donnell
Date:
On 09/09/2011 16:35, Carlos Mennens wrote:
> I've had PG 9.0 installed and working fine however it's Friday and I'm
> running updates on the server & see that 9.1 is available. I know when
> I upgrade, I will now have two instances of PostgreSQL installed under
> /etc/postgresql:
>
> Code:
>
> slave:~# cd /etc/postgresql
> slave:/etc/postgresql# ls -l
> total 8
> drwxr-xr-x 3 postgres postgres 4096 Aug 31 13:02 9.0
> drwxr-xr-x 3 postgres postgres 4096 Sep  9 10:08 9.1
>
> EndCode:
>
> My question is what is the official procedure for removing the old
> version and then running 9.1 only on my system. I don't want to leave
> 9.0 config files or directories so can someone please point me into
> the clean and correct way of properly upgrading from 9.0 to 9.1? I did
> do a pg_dump on my two databases & the default 'postgres' database and
> backed them up so I can import them into the new 9.1 instance.

Removing the older installation depends on whatever package manager your
system uses, if that's how you installed it.

e.g. Debian:

  apt-get remove postgresql-9.0

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: PostgreSQL Upgrade Procedure

From
Steve Crawford
Date:
On 09/09/2011 08:35 AM, Carlos Mennens wrote:
> I've had PG 9.0 installed and working fine however it's Friday and I'm
> running updates on the server&  see that 9.1 is available....

First!!! Although certain packages like Martin Pitt's PPA for Ubuntu
will show PostgreSQL 9.1 as available this is the current
release-candidate of PostgreSQL 9.1. PostgreSQL 9.1 final has not been
released. Do not install it on a critical production system.

What OS? The different package managers vary in how they deal with this.
I just went through some frustration on CentOS as the directions I was
reading actually applied to how the packages install on CentOS version
6, which can do parallel installs and not to CentOS 5x, which can not.

On my Ubuntu systems which have the PPA installed (and granted, I've
only spent a few minutes so far), it is showing 9.1 as an upgrade and
wants to automatically remove 9.0.

So to (sort of) answer your question. There is no single official method
of upgrading - it depends on how you want to upgrade (dump/restore,
in-place with pg_upgrade, etc.) and what OS and package you are using.

Cheers,
Steve