Re: Determine PG version used for initdb

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dario <dario_d_s(at)unitech(dot)com(dot)ar>, Hannes Dorbath <light(at)theendofthetunnel(dot)de>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Determine PG version used for initdb
Date: 2005-07-20 17:50:47
Message-ID: 20050720175047.GA44720@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Jul 20, 2005 at 10:59:34AM -0500, Jim C. Nasby wrote:
>
> Hrm. Is there no definative way to determine what version of initdb was
> used on a cluster? ISTM that would be a useful feature to have.

The query I posted in another message appears to work in 7.4 and
later (i.e., versions that have the Information Schema):

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

Unless I'm misreading what set_info_version() and setup_schema()
do in initdb.c, the above query will return a value based on the
value of PG_VERSION that was current when the initdb that initialized
the cluster was built. Although that raises a question: is that
the desired behavior, or should 'DBMS VERSION' return the version
currently running?

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jiang Ma 2005-07-20 20:02:42 help! I can not start postgreSQL service!
Previous Message Chris Travers 2005-07-20 17:48:52 Re: caching table/query