Thread: Postgresql community edition upgrade

Postgresql community edition upgrade

From
Ebin Jozer
Date:
Hi all,
Can we upgrade the postgresql community edition version from 11 to 14 directly??

Re: Postgresql community edition upgrade

From
Holger Jakobs
Date:
Am 12.10.22 um 15:43 schrieb Ebin Jozer:
> Hi all,
> Can we upgrade the postgresql community edition version from 11 to 14 
> directly??


Yes, all versions from 8.4 can be upgraded to the latest version directly.



-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012


Attachment

Re: Postgresql community edition upgrade

From
Ebin Jozer
Date:
Thanks holger.
How to find it??
And 
What would be the rollback step in case the upgrade failed while using pg_upgrade??

On Wed, 12 Oct, 2022, 7:24 pm Holger Jakobs, <holger@jakobs.com> wrote:
Am 12.10.22 um 15:43 schrieb Ebin Jozer:
> Hi all,
> Can we upgrade the postgresql community edition version from 11 to 14
> directly??


Yes, all versions from 8.4 can be upgraded to the latest version directly.



--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

Re: Postgresql community edition upgrade

From
Scott Ribe
Date:
> On Oct 12, 2022, at 11:18 AM, Ebin Jozer <ebinjozer@gmail.com> wrote:
>
> What would be the rollback step in case the upgrade failed while using pg_upgrade??

- pg_upgrade does pretty extensive pre-flight checks before proceeding

- it does not modify original files, but copies (& modifies the copied catalog files as needed)

(I think even if you use link mode, it doesn't modify original catalog files, so you can start the old one until you
havestarted the new one. I'd look for more info from someone more knowledgeable about this exact process.) 

I've personally never seen a problem once the pre-flight passes and it proceeds.


Re: Postgresql community edition upgrade

From
Laurenz Albe
Date:
On Wed, 2022-10-12 at 22:48 +0530, Ebin Jozer wrote:
> What would be the rollback step in case the upgrade failed while using pg_upgrade??

If you don't use --link, the old cluster will still be there and can be used.
If you use --link, restore your backup.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



Re: Postgresql community edition upgrade

From
Paul Smith
Date:


On 12 October 2022 18:29:12 Scott Ribe <scott_ribe@elevated-dev.com> wrote:
(I think even if you use link mode, it doesn't modify original catalog files, so you can start the old one until you have started the new one. I'd look for more info from someone more knowledgeable about this exact process.)

Correct. I've had it go wrong with link mode. As long as you don't start the new cluster, the old one still works absolutely fine with a minor (documented) step. 

IIRC, the data files (in /data/base) are linked (and unchanged by the process). The control files, transaction logs, etc aren't, but the old control files are "disabled" to prevent accidental starting of the old cluster (it's easy to re-enable it) 

See (17) of the Usage notes


Paul


--

Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53

Re: Postgresql community edition upgrade

From
Ebin Jozer
Date:
Hi thanks for the response so far.

We have master and slave environment. So for upgrade we have upgrade first in slave and then in master environment. Please confirm

On Thu, 13 Oct, 2022, 2:13 am Paul Smith, <paul@pscs.co.uk> wrote:


On 12 October 2022 18:29:12 Scott Ribe <scott_ribe@elevated-dev.com> wrote:
(I think even if you use link mode, it doesn't modify original catalog files, so you can start the old one until you have started the new one. I'd look for more info from someone more knowledgeable about this exact process.)

Correct. I've had it go wrong with link mode. As long as you don't start the new cluster, the old one still works absolutely fine with a minor (documented) step. 

IIRC, the data files (in /data/base) are linked (and unchanged by the process). The control files, transaction logs, etc aren't, but the old control files are "disabled" to prevent accidental starting of the old cluster (it's easy to re-enable it) 

See (17) of the Usage notes


Paul


--

Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53

Re: Postgresql community edition upgrade

From
Scott Ribe
Date:
> On Oct 13, 2022, at 3:42 AM, Ebin Jozer <ebinjozer@gmail.com> wrote:
>
> We have master and slave environment. So for upgrade we have upgrade first in slave and then in master environment.
Pleaseconfirm 

Depends on your HA requirements.

Easiest: shut down primary and all db access, upgrade one, bring it back up as primary, upgrade other and bring it back
onlineas replica. 

Harder: use a replication scheme that works across versions (publish/subscribe, pglogical, londiste, bucardo) so that
youcan bring up a new replica on the new version, switch over to it with minimal downtime (just enough to make sure
changesfrom master have been replicated), then turn the former primary into a new  replica.