Обсуждение: Checking database version

Поиск
Список
Период
Сортировка

Checking database version

От
"George Wilk"
Дата:

Is there a reliable way of verifying version of the database by looking at the PGDATA directory?

 

Let me explain why this is important in our case.  Originally, our product utilized version 8.1 of Postgres.  We have since moved on to version 8.2.  Our existing customer base will need to be upgraded to version 8.2 as well.  There might be legitimate cases where our customers might be running other software products on their systems, which utilize earlier versions of Postgres, therefore we cannot uninstall earlier packages and install ours indiscriminately.  Our install scripts must reliably determine if the database files related to our product need to be upgraded or not, before installing Postgres 8.2 package, performing dump, etc.

 

What I’m looking for is a sure way of determining version of Postgres based on the files contained in a specific PGDATA location.  Is it possible, and if so how can it be done?

 

Thanks in advance,

~george

Re: Checking database version

От
Richard Broersma Jr
Дата:
--- George Wilk <gwilk@ellacoya.com> wrote:

> Is there a reliable way of verifying version of the database by looking at
> the PGDATA directory?

Does the file "PG_VERSION" not tell what you need?

Regards,
Richard Broersma Jr.

Re: Checking database version

От
"Kevin Grittner"
Дата:
>>> On Fri, Jul 27, 2007 at  9:49 AM, in message
<02b201c7d05d$56cf9890$1f7ca8c0@ellacoya.com>, "George Wilk"
<gwilk@ellacoya.com> wrote:
> Is there a reliable way of verifying version of the database by looking at
> the PGDATA directory?

Could you use the first couple lines of output from pg_controldata?

-Kevin




Re: Checking database version

От
"George Wilk"
Дата:
Yes, it does.  However, in one test case after running dump, restoring, and
upgrading to 8.2 the PG_VERSION was still showing 8.1.  This could have been
a result of us monkeying around, but still I wasn't sure when the PG_VERSION
was being updated, and whether it provided reliable source of versioning
information.

-----Original Message-----
From: Richard Broersma Jr [mailto:rabroersma@yahoo.com]
Sent: Friday, July 27, 2007 11:19 AM
To: George Wilk; pgsql-admin@postgresql.org
Cc: 'Gez Saunders'
Subject: Re: [ADMIN] Checking database version


--- George Wilk <gwilk@ellacoya.com> wrote:

> Is there a reliable way of verifying version of the database by looking at
> the PGDATA directory?

Does the file "PG_VERSION" not tell what you need?

Regards,
Richard Broersma Jr.