简体   繁体   中英

PostgreSQL 9.6 Master on CentOS, Replica On Ubuntu?

I know it isn't ideal, but I'm wondering if there are any limitations preventing me from having a downstream replica be on Ubuntu (xenial), while its upstream replica is on CentOS?

I've got postgresql installed on the Ubuntu box and plan to set the $PGDATA dir and all of those settings the same as the CentOS boxes.

I'm just curious of anyone has tried this and run into any snags.

In principle that would work as long as both Linuxen are running on the same architecture. But read this mailing list post for an example of what can go wrong:

PostgreSQL uses the operating system's collations for ordering indexes, and if the two versions of glibc installed on both machines have a different idea of how to order strings, the indexes on string columns will be corrupted on the standby.

So if you need to replicate across distributions, make sure that one of the following applies:

  • You are using the C collation.

  • All indexes on string columns in your database are using the text_pattern_ops operator class.

  • You have the same version of glibc on both machines.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM