pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Determine PG version used for initdb
12+ messages / 7 participants
[nested] [flat]

* Determine PG version used for initdb
@ 2005-07-20 13:21  Hannes Dorbath <light@theendofthetunnel.de>
  0 siblings, 2 replies; 12+ messages in thread

From: Hannes Dorbath @ 2005-07-20 13:21 UTC (permalink / raw)
  To: pgsql-admin

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 :(

Do I have to fear corruption btw?

Thanks



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 13:40  Joshua D. Drake <jd@commandprompt.com>
  parent: Hannes Dorbath <light@theendofthetunnel.de>
  1 sibling, 1 reply; 12+ messages in thread

From: Joshua D. Drake @ 2005-07-20 13:40 UTC (permalink / raw)
  To: Hannes Dorbath <light@theendofthetunnel.de>; +Cc: pgsql-admin

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 :(
> 

show server_version;

from psql.

> Do I have to fear corruption btw?
> 
> Thanks
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>               http://www.postgresql.org/docs/faq


-- 
Your PostgreSQL solutions provider, Command Prompt, Inc.
24x7 support - 1.800.492.2240, programming, and consulting
Home of PostgreSQL Replicator, plPHP, plPerlNG and pgPHPToolkit
http://www.commandprompt.com / http://www.postgresql.org



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 13:52  Hannes Dorbath <light@theendofthetunnel.de>
  parent: Joshua D. Drake <jd@commandprompt.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Hannes Dorbath @ 2005-07-20 13:52 UTC (permalink / raw)
  To: pgsql-admin

On 20.07.2005 15:40, Joshua D. Drake wrote:
> show server_version;
> 
> from psql.

That tells the server version running, but does it tell the initdb 
binary version used to init the cluster?



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 13:55  Dario <dario_d_s@unitech.com.ar>
  parent: Hannes Dorbath <light@theendofthetunnel.de>
  0 siblings, 2 replies; 12+ messages in thread

From: Dario @ 2005-07-20 13:55 UTC (permalink / raw)
  To: Hannes Dorbath <light@theendofthetunnel.de>; pgsql-admin

There shouldn't be problems. "Updating" from 8.0.1 to 8.0.3 is just matter
of changing binaries.
"Upgrading" from 8.0 to 8.1 or 7.3 to 7.4 requires dump, cleaning
directories and restore.

Take a look at forum archives anyway, to confirm this and read about
experiences.

Greetings (saludos /sah loo dohs/)

-----Mensaje original-----
De: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]En nombre de Hannes Dorbath
Enviado el: miƩrcoles, 20 de julio de 2005 10:53
Para: pgsql-admin@postgresql.org
Asunto: Re: [ADMIN] Determine PG version used for initdb


On 20.07.2005 15:40, Joshua D. Drake wrote:
> show server_version;
>
> from psql.

That tells the server version running, but does it tell the initdb
binary version used to init the cluster?

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend




^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dario <dario_d_s@unitech.com.ar>
  1 sibling, 3 replies; 12+ messages in thread

From: Tom Lane @ 2005-07-20 14:05 UTC (permalink / raw)
  To: Dario <dario_d_s@unitech.com.ar>; +Cc: Hannes Dorbath <light@theendofthetunnel.de>; pgsql-admin

> That tells the server version running, but does it tell the initdb
> binary version used to init the cluster?

Normally there's not any difference between dot-release initdb's.
In this case there is; read the 8.0.3 release notes:
http://developer.postgresql.org/docs/postgres/release.html#RELEASE-8-0-3
You could determine which was used by looking at the declared arguments
of the conversion functions.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:15  Hannes Dorbath <light@theendofthetunnel.de>
  parent: Dario <dario_d_s@unitech.com.ar>
  1 sibling, 0 replies; 12+ messages in thread

From: Hannes Dorbath @ 2005-07-20 14:15 UTC (permalink / raw)
  To: pgsql-admin

On 20.07.2005 15:55, Dario wrote:
> There shouldn't be problems. "Updating" from 8.0.1 to 8.0.3 is just matter
> of changing binaries.

I recall that as well, but I remember security problems in < 8.0.3 that 
are fixed by the 8.0.3 initdb, that's why I wanted to know exactly what 
I have..

Thanks so far



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:21  Hannes Dorbath <light@theendofthetunnel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 12+ messages in thread

From: Hannes Dorbath @ 2005-07-20 14:21 UTC (permalink / raw)
  To: pgsql-admin

On 20.07.2005 16:05, Tom Lane wrote:
> You could determine which was used by looking at the declared arguments
> of the conversion functions.

Seems to be 8.0.1, so I'll follow the manual repair instructions in the 
7.4.8 release notes.

Thanks for the fast help.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:33  Joel Fradkin <jfradkin@wazagua.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 1 reply; 12+ messages in thread

From: Joel Fradkin @ 2005-07-20 14:33 UTC (permalink / raw)
  To: 'Tom Lane' <tgl@sss.pgh.pa.us>; 'Dario' <dario_d_s@unitech.com.ar>; +Cc: 'Hannes Dorbath' <light@theendofthetunnel.de>; pgsql-admin

Not being a postgres guru can you give me a simple plan to follow to re init
db.
I am running on linux redhat as4.
I have links to spindles for my wal and my data.
I am on 8.0.3, but did not initdb the database, so security issues have not
been addressed.
I can do a dump, initdb (this is where I am not 100% sure what to do, to get
rid of the existing intdb stuff) and do a restore.

I am guessing I would just stop postgres delete the data folder in
/var/lib/pgsql.

Go into the pgsql folder and do a initdb database name? prefer to do it
Unicode if I can get my drivers and such figured and tested (still having
serious issues there).

Re-link the wal and base folders

And I am done?

What would be the exact syntax for the initdb command?


Joel Fradkin
 
Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305
 
jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and delete and destroy
all copies of the original message, including attachments.
 

 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Wednesday, July 20, 2005 10:05 AM
To: Dario
Cc: Hannes Dorbath; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Determine PG version used for initdb 

> That tells the server version running, but does it tell the initdb
> binary version used to init the cluster?

Normally there's not any difference between dot-release initdb's.
In this case there is; read the 8.0.3 release notes:
http://developer.postgresql.org/docs/postgres/release.html#RELEASE-8-0-3
You could determine which was used by looking at the declared arguments
of the conversion functions.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:44  Michael Fuhr <mike@fuhr.org>
  parent: Hannes Dorbath <light@theendofthetunnel.de>
  1 sibling, 0 replies; 12+ messages in thread

From: Michael Fuhr @ 2005-07-20 14:44 UTC (permalink / raw)
  To: Hannes Dorbath <light@theendofthetunnel.de>; +Cc: 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/



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 14:51  Hannes Dorbath <light@theendofthetunnel.de>
  parent: Joel Fradkin <jfradkin@wazagua.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Hannes Dorbath @ 2005-07-20 14:51 UTC (permalink / raw)
  To: pgsql-admin

On 20.07.2005 16:33, Joel Fradkin wrote:
> What would be the exact syntax for the initdb command?

initdb -D /var/lib/pgsql/data --locale=de_DE.utf8

replace de_DE.utf8 with your locale..



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 15:59  Jim C. Nasby <decibel@decibel.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 1 reply; 12+ messages in thread

From: Jim C. Nasby @ 2005-07-20 15:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dario <dario_d_s@unitech.com.ar>; Hannes Dorbath <light@theendofthetunnel.de>; pgsql-admin

On Wed, Jul 20, 2005 at 10:05:22AM -0400, Tom Lane wrote:
> > That tells the server version running, but does it tell the initdb
> > binary version used to init the cluster?
> 
> Normally there's not any difference between dot-release initdb's.
> In this case there is; read the 8.0.3 release notes:
> http://developer.postgresql.org/docs/postgres/release.html#RELEASE-8-0-3
> You could determine which was used by looking at the declared arguments
> of the conversion functions.

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.
-- 
Jim C. Nasby, Database Consultant               decibel@decibel.org 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Determine PG version used for initdb
@ 2005-07-20 17:50  Michael Fuhr <mike@fuhr.org>
  parent: Jim C. Nasby <decibel@decibel.org>
  0 siblings, 0 replies; 12+ messages in thread

From: Michael Fuhr @ 2005-07-20 17:50 UTC (permalink / raw)
  To: Jim C. Nasby <decibel@decibel.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dario <dario_d_s@unitech.com.ar>; Hannes Dorbath <light@theendofthetunnel.de>; 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/



^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2005-07-20 17:50 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 13:21 Determine PG version used for initdb Hannes Dorbath <light@theendofthetunnel.de>
2005-07-20 13:40 ` Joshua D. Drake <jd@commandprompt.com>
2005-07-20 13:52   ` Hannes Dorbath <light@theendofthetunnel.de>
2005-07-20 13:55     ` Dario <dario_d_s@unitech.com.ar>
2005-07-20 14:05       ` Tom Lane <tgl@sss.pgh.pa.us>
2005-07-20 14:21         ` Hannes Dorbath <light@theendofthetunnel.de>
2005-07-20 14:33         ` Joel Fradkin <jfradkin@wazagua.com>
2005-07-20 14:51           ` Hannes Dorbath <light@theendofthetunnel.de>
2005-07-20 15:59         ` Jim C. Nasby <decibel@decibel.org>
2005-07-20 17:50           ` Michael Fuhr <mike@fuhr.org>
2005-07-20 14:15       ` Hannes Dorbath <light@theendofthetunnel.de>
2005-07-20 14:44 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox