About postgres pg_upgrade

Started by Rama Krishnanabout 2 years ago3 messagesgeneral
Jump to latest
#1Rama Krishnan
raghuldrag@gmail.com

Hi Team,

Could you please explain me how does pg_upgrade works one of my friends it
works based on pg_restore I am bit confused

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Rama Krishnan (#1)
Re: About postgres pg_upgrade

On 5 Apr 2024, at 06:47, Rama Krishnan <raghuldrag@gmail.com> wrote:

Could you please explain me how does pg_upgrade works one of my friends it works based on pg_restore I am bit confused

The documentation does a fairly good job explaining how it works, and there are
multiple blogposts and presentations on the subject to be found.

https://www.postgresql.org/docs/devel/pgupgrade.html

To summarize in a few words, pg_upgrade does a dump/restore of the schema from
the old cluster into the new, but copies the table data. Your friend is thus
isn't wrong, it does use pg_restore but only for the schema, not the data.

--
Daniel Gustafsson

#3Bruce Momjian
bruce@momjian.us
In reply to: Daniel Gustafsson (#2)
Re: About postgres pg_upgrade

On Fri, Apr 5, 2024 at 09:41:05AM +0200, Daniel Gustafsson wrote:

On 5 Apr 2024, at 06:47, Rama Krishnan <raghuldrag@gmail.com> wrote:

Could you please explain me how does pg_upgrade works one of my friends it works based on pg_restore I am bit confused

The documentation does a fairly good job explaining how it works, and there are
multiple blogposts and presentations on the subject to be found.

https://www.postgresql.org/docs/devel/pgupgrade.html

To summarize in a few words, pg_upgrade does a dump/restore of the schema from
the old cluster into the new, but copies the table data. Your friend is thus
isn't wrong, it does use pg_restore but only for the schema, not the data.

This presentation shows how it works internally:

https://momjian.us/main/writings/pgsql/pg_upgrade.pdf

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.