Re: pg_upgrade documentation improvement patch - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_upgrade documentation improvement patch
Date
Msg-id 570E3BA5.8060809@gmx.net
Whole thread Raw
In response to pg_upgrade documentation improvement patch  (Yuri Niyazov <yuri@academia.edu>)
Responses Re: pg_upgrade documentation improvement patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 03/20/2016 06:40 PM, Yuri Niyazov wrote:
> [4:35pm] yuri_niyazov: "Again, use compatible initdb flags that match
> the old cluster" - this is when running initdb before running pg_upgrade
> [4:36pm] RhodiumToad: same encoding, locale, and checksum settings
> [4:36pm] yuri_niyazov: Can I recover those from the data directory? The
> previous initdb was ran 3 admins ago
> [4:37pm] RhodiumToad: psql -l  against the old server and look at the
> encoding and locale for template0
> [4:37pm] RhodiumToad: checksums are almost certainly not enabled, but
> you can check that by running pg_controldata against the old data dir
> [4:38pm] yuri_niyazov: thank you!
> [4:38pm] RhodiumToad: (if the old server is too old for checksums, then
> don't enable them in the new initdb)
> 
> I took RhodiumToad's comments and made them into a patch to pg_upgrade's
> documentation.

I think it's worth clarifying the documentation along the lines you
suggest, but I'm not sure about the details.  A better way to get the
*cluster* locale is from pg_controldata.  I don't know to what extent
pg_upgrade actually requires the encoding to match, since that is mostly
determined by the locale, and in the cases it's not, it might not matter.

Interesting to me would be a way, perhaps with an option in initdb, to
just say, initialize this cluster compatibly with that other cluster, so
you don't have to worry about these details.



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Missing PG_INT32_MIN in numutils.c
Next
From: Robert Haas
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <