2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
989 stars 152 forks source link

Fix building against Postgres 9.6 #414

Closed jcoleman closed 1 year ago

jcoleman commented 1 year ago

The root cause here appears to be that ReadDirExtended in Postgres core is defined as static up until PG10.2. At that point it's available publicly.

There seems to be some confusion on previous issues reported on this repo: in #227 @petere says "You need at least PostgreSQL 10.2." -- presumably in context he must mean "to use 10.x you need at least 10.2" since the compat9{4,5,6} directories clearly imply the intent to support versions prior to 10. Later in #275 @petere says "pglogical 2.3.2 builds correct against PostgreSQL 9.5." -- but I don't see how this can be the case given this function is used but not available in the public API.

Here I've copied the function directly from Postgres core (but without the static declaration) to support the usage in this project.

petere commented 1 year ago

ReadDirExtended() was made non-static in PostgreSQL 9.6 in postgres/postgres@543d8c2f5d. This patch was also backpatched to 9.5 and 9.4. So this issue no longer exists in any PostgreSQL version supported by pglogical 2.