Thread: Upgrade from 8.4.13 to 9.2.0.1 successful but it still displays 8.4.13 if SELECT version();

Hi,

I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted postgresql, it displayed my postgresql is 9.2 but
whenI log into postgresql, show version, it is still 8.4.13, see a) and b) below,  

a)
* Restarting PostgreSQL 9.2 database server
   ...done.


b)
psql (8.4.13)
Type "help" for help.
postgres=# SELECT version();
                                                   version
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.4.13 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3, 32-bit
(1 row)




Anything I have missed in my upgrade? please help.
Regards
Arthur

On 2012-09-23 14:47, ac@hsk.hk wrote:
> Hi,
>
> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted
> postgresql, it displayed my postgresql is 9.2 but when I log into
> postgresql, show version, it is still 8.4.13, see a) and b) below,
>
> a)
> * Restarting PostgreSQL 9.2 database server
>    ...done.

AFAIK,
postgres does not have any similar message like that :

  * Restarting PostgreSQL 9.2 database server
     ...done.


This message probably is from your OS upgrade tool, not from postgres.
>
> b)
> psql (8.4.13)
> Type "help" for help.
> postgres=# SELECT version();
>                                                    version
>
>
> --------------------------------------------------------------------------------------------------------------
>  PostgreSQL 8.4.13 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real
> (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3, 32-bit
> (1 row)
>
>

That is the true version that you have installed.


>
>
> Anything I have missed in my upgrade? please help.


Check logs of your installation tool, the problems can be different:
Like bug in your installation tool, bug in restarting part of that tool
unable to restart server.

Cheers,
C.




On 09/23/2012 04:47 AM, ac@hsk.hk wrote:
> Hi,
>
> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted postgresql, it displayed my postgresql is 9.2 but
whenI log into postgresql, show version, it is still 8.4.13, see a) and b) below, 
>
> a)
> * Restarting PostgreSQL 9.2 database server
>     ...done.
>
>
> b)
> psql (8.4.13)
> Type "help" for help.
> postgres=# SELECT version();
>                                                     version
> --------------------------------------------------------------------------------------------------------------
>   PostgreSQL 8.4.13 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3, 32-bit
> (1 row)
>
>
>
>
> Anything I have missed in my upgrade? please help.

My guess is it installed a parallel version of Postgres for 9.2 and that
8.4.13 is listening to the default port of 5432 which is what you are
connecting to. The 9.2 version is probably listening on another port(at
a guess 5433). I would do a ps ax to confirm there is more than one
instance of Postgres running.

> Regards
> Arthur
>


--
Adrian Klaver
adrian.klaver@gmail.com


On 23/09/12 11:48, Adrian Klaver wrote:
> On 09/23/2012 04:47 AM, ac@hsk.hk wrote:
>> Hi,
>>
>> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted
>>  postgresql, it displayed my postgresql is 9.2 but when I log into
>>  postgresql, show version, it is still 8.4.13, see a) and b)
>> below,
>>
>
> My guess is it installed a parallel version of Postgres for 9.2 and
> that 8.4.13 is listening to the default port of 5432 which is what
> you are connecting to. The 9.2 version is probably listening on
> another port(at a guess 5433). I would do a ps ax to confirm there is
> more than one instance of Postgres running.

This is correct. Ubuntu (Debian really) installs the new vesion in
parallel and provides the pg_upgradecluster tool to migrate your old
data to the new version. Once you are satisfied that everything is
working you can use pg_dropcluster to remove the old data and you can
then uninstall 8.4.

Martin


On 23/09/2012 19:31, Martin Collins wrote:
> On 23/09/12 11:48, Adrian Klaver wrote:
>> On 09/23/2012 04:47 AM, ac@hsk.hk wrote:
>>> Hi,
>>>
>>> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted
>>>  postgresql, it displayed my postgresql is 9.2 but when I log into
>>>  postgresql, show version, it is still 8.4.13, see a) and b)
>>> below,
>>>
>>
>> My guess is it installed a parallel version of Postgres for 9.2 and
>> that 8.4.13 is listening to the default port of 5432 which is what
>> you are connecting to. The 9.2 version is probably listening on
>> another port(at a guess 5433). I would do a ps ax to confirm there is
>> more than one instance of Postgres running.
>
> This is correct. Ubuntu (Debian really) installs the new vesion in
> parallel and provides the pg_upgradecluster tool to migrate your old
> data to the new version. Once you are satisfied that everything is
> working you can use pg_dropcluster to remove the old data and you can
> then uninstall 8.4.

I've just discovered pg_lsclusters, another Debian tool, which lists all
installed Postgres clusters, their ports, data directories, etc - really
handy.

Ray.


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


Hi thanks,

I ran ps and found there were TWO postgresql

postgres  1124  0.0  0.1  45116  5480 ?        S    Sep23   0:01 /usr/lib/postgresql/8.4/bin/postgres -D
/var/lib/postgresql/8.4/main-c config_file=/etc/postgresql/8.4/main/postgresql.conf 
postgres  1133  0.0  0.0  45116  1984 ?        Ss   Sep23   0:03 postgres: writer process
                                                                     
postgres  1134  0.0  0.0  45116  1292 ?        Ss   Sep23   0:03 postgres: wal writer process
                                                                     
postgres  1135  0.0  0.0  45252  1560 ?        Ss   Sep23   0:01 postgres: autovacuum launcher process
                                                                     
postgres  1136  0.0  0.0  13284  1252 ?        Ss   Sep23   0:01 postgres: stats collector process
                                                                     
postgres  9429  0.0  0.1  43644  7140 ?        S    Sep23   0:00 /usr/lib/postgresql/9.2/bin/postgres -D
/var/lib/postgresql/9.2/main-c config_file=/etc/postgresql/9.2/main/postgresql.conf 
postgres  9431  0.0  0.0  43644  1272 ?        Ss   Sep23   0:00 postgres: checkpointer process
                                                                     
postgres  9432  0.0  0.0  43644  1408 ?        Ss   Sep23   0:00 postgres: writer process
                                                                     
postgres  9433  0.0  0.0  43644  1212 ?        Ss   Sep23   0:00 postgres: wal writer process
                                                                     
postgres  9434  0.0  0.0  44040  2148 ?        Ss   Sep23   0:00 postgres: autovacuum launcher process
                                                                     
postgres  9435  0.0  0.0  13868  1140 ?        Ss   Sep23   0:00 postgres: stats collector process
                                                                     

Regards
Arthur

On 24 Sep 2012, at 4:45 AM, Raymond O'Donnell wrote:

> On 23/09/2012 19:31, Martin Collins wrote:
>> On 23/09/12 11:48, Adrian Klaver wrote:
>>> On 09/23/2012 04:47 AM, ac@hsk.hk wrote:
>>>> Hi,
>>>>
>>>> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted
>>>> postgresql, it displayed my postgresql is 9.2 but when I log into
>>>> postgresql, show version, it is still 8.4.13, see a) and b)
>>>> below,
>>>>
>>>
>>> My guess is it installed a parallel version of Postgres for 9.2 and
>>> that 8.4.13 is listening to the default port of 5432 which is what
>>> you are connecting to. The 9.2 version is probably listening on
>>> another port(at a guess 5433). I would do a ps ax to confirm there is
>>> more than one instance of Postgres running.
>>
>> This is correct. Ubuntu (Debian really) installs the new vesion in
>> parallel and provides the pg_upgradecluster tool to migrate your old
>> data to the new version. Once you are satisfied that everything is
>> working you can use pg_dropcluster to remove the old data and you can
>> then uninstall 8.4.
>
> I've just discovered pg_lsclusters, another Debian tool, which lists all
> installed Postgres clusters, their ports, data directories, etc - really
> handy.
>
> Ray.
>
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod@iol.ie
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general



On 2012-09-23, ac@hsk.hk <ac@hsk.hk> wrote:
> Hi,
>
> I have upgraded postgresql 8.4.13 to 9.2.0.1 O/S Ubuntu, restarted postgresql,
> it displayed my postgresql is 9.2 but when I log into postgresql, show version,
> it is still 8.4.13, see a) and b) below,

read the man pages for pg_upgradecluster and postgresql-common



--
⚂⚃ 100% natural