Skip site navigation (1) Skip section navigation (2)

Re: Upgrading PostgreSQL

From: Aarni Ruuhimäki <aarni(dot)ruuhimaki(at)kymi(dot)com>
To: MagnuM <MagnuM(dot)13mbpy(at)mail(dot)webservertalk(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Upgrading PostgreSQL
Date: 2004-03-27 13:23:14
Message-ID: 200403271323.14595.aarni.ruuhimaki@kymi.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

Would this be of any help ? It's on Trustix but should work fine on other 
distros as well.


Take a dump from your databases: 

pg_dumpall -c > local_for_74x_c 

Shutdown postmaster: 

kill -9 postmaster process number 

Datadir out of the way: 

mv /usr/share/pgdata /usr/share/pgdata_old 

New datadir: 

mkdir /usr/share/pgdata
 chown postgres /usr/share/pgdata 

Previous install out of the way: 

mv /usr/share/pgsql /usr/share/pgsql_old 

Extract your new Pg: 

gunzip postgresql-7.4.x.tar.gz
 tar -xf postgresql-7.4.x.tar 

Configure, make and install, with --prefix=/path/ you can specify install 
directory, ie. the -L swicth in initdb, default is /usr/local/pgsql/: 

cd postgresql-7.4.x
 ./configure (--with-or-without-this-and-that)
 gmake
 gmake install 

Initdb: 

chown -R postgres /usr/local/pgsql/
 su postgres
 /usr/local/pgsql/bin/initdb -D /usr/share/pgdata -L /usr/local/pgsql/share 

Edit and save /usr/share/pgdata/postgresql.conf. Find line 

unix_socket_directory = '' 

and change it to: 

unix_socket_directory = '/var/run/postgresql' 

Edit /usr/share/pgdata/pg_hba.conf 

Add line(s) like this (at the bottom, where the actual configuration is): 

host all postgres your ip-adress your ip-mask trust 

e.g. 

host all postgres 192.168.16.100 255.255.255.0 trust 

Save the file. 

Ok, let's start the server: 

/usr/local/pgsql/bin/postmaster -D /usr/share/pgdata -B 256 -N 128 & 

-B is for buffers, -N is for number of connections, you might want to add -i 
for outside connections (edit pg_hba.conf accordingly) 

Finally, read your dump file in: 

psql -E template1 < local_for_74x_c 


BR,

Aarni



On Wednesday 24 March 2004 10:35, you wrote:
> Hello, can anyone tell me the exact steps to upgrading from 7.4.1 to
> 7.4.2.
> I didn't upgrade PostgreSQL until now, but I need to do that now, so I
> don't want to brake something.
>
> Thanks.

-- 
-------------------------------------------------
Aarni Ruuhimäki | Megative Tmi | KYMI.com
Pääsintie 26 | 45100 Kouvola | FINLAND
www.kymi.com | cfm.kymi.com
aarni(dot)ruuhimaki(at)kymi(dot)com | info(at)kymi(dot)com
+358-5-3755 035 | +358-50-4910 037
-------------------------------------------------
This is a bugfree broadcast to you from a linux system.

In response to

pgsql-novice by date

Next:From: Marcus Andree S. MagalhaesDate: 2004-03-27 13:52:40
Subject: problem (bug?) when killing client program
Previous:From: M. BastinDate: 2004-03-27 12:52:05
Subject: Re: Images in Database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group