Re: Determine PG version used for initdb

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Hannes Dorbath <light(at)theendofthetunnel(dot)de>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Determine PG version used for initdb
Date: 2005-07-20 14:44:22
Message-ID: 20050720144422.GA43670@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Jul 20, 2005 at 03:21:42PM +0200, Hannes Dorbath wrote:
> Is it possible to determine if PG 8.0.1's initdb or PG 8.0.3's initdb
> was used to init a cluster? I fear I am accidental running a 8.0.1
> postmaster on a 8.0.3 cluster due to wrong env vars :(

That shouldn't matter -- the postmaster will refuse to start if it
doesn't like the catalog version; otherwise you should be okay.

In general you don't have to initdb when upgrading to a new point
release, and the Release Notes should tell you if it's necessary
or not. Sometimes an initdb might be desirable, however, to fix
certain catalog problems -- this is the case with 8.0.3, for example.
If you don't want to initdb then there's a manual fix procedure:

http://www.postgresql.org/docs/8.0/static/release.html#RELEASE-8-0-3

I think the following query shows the version of initdb that
initialized the cluster, but somebody please correct me if I'm
mistaken:

SELECT character_value
FROM information_schema.sql_implementation_info
WHERE implementation_info_name = 'DBMS VERSION';

The value displayed appears to have been created by set_info_version()
in initdb.c.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Hannes Dorbath 2005-07-20 14:51:44 Re: Determine PG version used for initdb
Previous Message Joel Fradkin 2005-07-20 14:33:53 Re: Determine PG version used for initdb