Обсуждение: PostgreSQL Replication between Different Major Version (11-13)

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

PostgreSQL Replication between Different Major Version (11-13)

От
Ram Pratap Maurya
Дата:

Hi Support,

 

We would like to perform PostgreSQL Replication between Different Major Version to avoid database upgrade. Scenario is as follows.

 

1.       PostgreSQL Replication from PostgreSQL Version 11 To PostgreSQL Version 13.

2.       Want to Setup Production Read Only Replication from Primary (11 Version) To Secondary (13 Version)

 

We want to perform above activity to avoid Database Upgrade. Please let us know if this is possible to setup Replication between Different Major Version (11-13).

 

 

Regards,

Ram Pratap.

 

 

RE: PostgreSQL Replication between Different Major Version (11-13)

От
Alvaro Aguayo
Дата:

Hi.

 

Not with PostgreSQL itself, but you can achieve that with pglogical: https://www.2ndquadrant.com/en/resources-old/pglogical/

 

It supports replication across different versions. One of its intended usages is version migration with minimal (almost zero) downtime.

 

But please note that it won’t create a read only replica: The replica will always be writable. You should look for some way to restrict writing, via triggers or permissions, if you really want the replica to be read only.

 

Regards,

 

Alvaro Aguayo

Operations Manager

Jr. Prolongación Ayacucho 177 Urb. Santa Eulalia - San Miguel

Telf. (+51-1) 680-5726

E-mail: aaguayo@ocs.pe

 

From: Ram Pratap Maurya <ram.maurya@lavainternational.in>
Sent: 29 December 2021 07:31
To: pgsql-admin@lists.postgresql.org
Cc: Ashish Chugh <ashish.chugh@lavainternational.in>
Subject: PostgreSQL Replication between Different Major Version (11-13)

 

Hi Support,

 

We would like to perform PostgreSQL Replication between Different Major Version to avoid database upgrade. Scenario is as follows.

 

  1. PostgreSQL Replication from PostgreSQL Version 11 To PostgreSQL Version 13.
  2. Want to Setup Production Read Only Replication from Primary (11 Version) To Secondary (13 Version)

 

We want to perform above activity to avoid Database Upgrade. Please let us know if this is possible to setup Replication between Different Major Version (11-13).

 

 

Regards,

Ram Pratap.

 

 

Re: PostgreSQL Replication between Different Major Version (11-13)

От
Adarsh Sharma
Дата:
Is it recommended to use pglogical for PostgreSQL 9.6 -> PostgreSQL 12 Upgrade?
I have the similar use case but wondering if there are known issues or things to watch out for before using pglogical for setting replication across different PostgreSQL version.

On Wed, Dec 29, 2021 at 6:17 PM Alvaro Aguayo <aaguayo@opensysperu.com> wrote:

Hi.

 

Not with PostgreSQL itself, but you can achieve that with pglogical: https://www.2ndquadrant.com/en/resources-old/pglogical/

 

It supports replication across different versions. One of its intended usages is version migration with minimal (almost zero) downtime.

 

But please note that it won’t create a read only replica: The replica will always be writable. You should look for some way to restrict writing, via triggers or permissions, if you really want the replica to be read only.

 

Regards,

 

Alvaro Aguayo

Operations Manager

Jr. Prolongación Ayacucho 177 Urb. Santa Eulalia - San Miguel

Telf. (+51-1) 680-5726

E-mail: aaguayo@ocs.pe

 

Re: PostgreSQL Replication between Different Major Version (11-13)

От
Magnus Hagander
Дата:
On Wed, Dec 29, 2021 at 1:47 PM Alvaro Aguayo <aaguayo@opensysperu.com> wrote:
>
> Hi.
>
>
>
> Not with PostgreSQL itself, but you can achieve that with pglogical:
https://www.2ndquadrant.com/en/resources-old/pglogical/

Sure, you can do that with PostgreSQL itself as well, with logical
replication, as of version 10. It has the same caveats as with
pglogical, but the basic functionality is there.

You cannot do it with *physical* replication, that's still true.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



Re: PostgreSQL Replication between Different Major Version (11-13)

От
Magnus Rolf
Дата:
Just use the build in logical replication of PostgreSQL. It works perfectly between PG v-11 and PG v-13.
Only requirement is each table must have a primary key to assure data object consistency and integrity.
Tables which are not updated by client tool (archive tables) might be migrated by using normal pgdump/psql or pg_restore.

Magnus Rolf


From: Magnus Hagander <magnus@hagander.net>
Sent: Wednesday, December 29, 2021 2:27:36 PM
To: Alvaro Aguayo <aaguayo@opensysperu.com>
Cc: Ram Pratap Maurya <ram.maurya@lavainternational.in>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>; Ashish Chugh <ashish.chugh@lavainternational.in>
Subject: Re: PostgreSQL Replication between Different Major Version (11-13)
 
On Wed, Dec 29, 2021 at 1:47 PM Alvaro Aguayo <aaguayo@opensysperu.com> wrote:
>
> Hi.
>
>
>
> Not with PostgreSQL itself, but you can achieve that with pglogical: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.2ndquadrant.com%2Fen%2Fresources-old%2Fpglogical%2F&amp;data=04%7C01%7C%7C96bf1d76cf834c68d2a008d9cacf0b82%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637763812856863122%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=0BLJG2KtahzHLz%2BN1OywxZfddiQuEPJkHZdl84htDOI%3D&amp;reserved=0

Sure, you can do that with PostgreSQL itself as well, with logical
replication, as of version 10. It has the same caveats as with
pglogical, but the basic functionality is there.

You cannot do it with *physical* replication, that's still true.

--
 Magnus Hagander
 Me: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.hagander.net%2F&amp;data=04%7C01%7C%7C96bf1d76cf834c68d2a008d9cacf0b82%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637763812856863122%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=0XTfuZVDL67iuBdow8awywhdvtSgRGC%2FhvGmopcerk0%3D&amp;reserved=0
 Work: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.redpill-linpro.com%2F&amp;data=04%7C01%7C%7C96bf1d76cf834c68d2a008d9cacf0b82%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637763812856863122%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mQta930fhAvHwFz3OyzvLOfJknayamNoUwPj%2FCFj6cU%3D&amp;reserved=0


Re: PostgreSQL Replication between Different Major Version (11-13)

От
Scott Ribe
Дата:
> On Dec 29, 2021, at 5:30 AM, Ram Pratap Maurya <ram.maurya@lavainternational.in> wrote:
>
> We want to perform above activity to avoid Database Upgrade. Please let us know if this is possible to setup
Replicationbetween Different Major Version (11-13). 

You might also try a trial with pg_upgrade -k on a copy of your database. You might find that it's fast enough that the
complexityof logical replication is not worth it.