Fix build after upstream changes in postgres 9.5 -- 12 made functions

AcquireDeletionLock() and ReleaseDeletionLock() extern rather than
static in:

   5be594caf8

The function definitions in the postgresql sources are identical to
those in the pglogical sources, so let's just link against the
postgresql versions.

postgresql-9.4 is EoL, so didn't receive the same changes in the
latest round of postgresql updates.

While here, fix another of the patches which should no be applied when
compiling against all versions of postgresql.  Plus fix the pkg-plist
-- how did this port ever package previously?
This commit is contained in:
Matthew Seaman 2020-05-23 14:01:39 +00:00
parent f5c6bd6e41
commit 7920a67f2d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=536298
4 changed files with 73 additions and 2 deletions

View File

@ -4,6 +4,7 @@
PORTNAME= pglogical
DISTVERSIONPREFIX= REL
DISTVERSION= 2_3_1
PORTREVISION= 1
CATEGORIES= databases
MAINTAINER= matthew@FreeBSD.org
@ -35,10 +36,14 @@ PLIST_SUB+= PGSQL94=""
PLIST_SUB+= PGSQL94="@comment "
.endif
.if ${PGSQL_VER} >= 11
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-pglogical__apply__spi.c
.if ${PGSQL_VER} >= 9.5
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-pglogical__dependency.c
.endif
#.if ${PGSQL_VER} >= 11
#EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-pglogical__apply__spi.c
#.endif
# FFI
#TEST_DEPENDS= pg_regress:databases/postgresql${PGSQL_VER_NODOT}-pg_regress
#TEST_TARGET= do-test

View File

@ -0,0 +1,63 @@
--- pglogical_dependency.c.orig 2020-04-06 19:40:00 UTC
+++ pglogical_dependency.c
@@ -232,8 +232,6 @@ static void reportDependentObjects(const ObjectAddress
DropBehavior behavior,
int msglevel,
const ObjectAddress *origObject);
-static void AcquireDeletionLock(const ObjectAddress *object, int flags);
-static void ReleaseDeletionLock(const ObjectAddress *object);
static bool find_expr_references_walker(Node *node,
find_expr_references_context *context);
static void eliminate_duplicate_dependencies(ObjectAddresses *addrs);
@@ -926,51 +924,6 @@ reportDependentObjects(const ObjectAddresses *targetOb
pfree(clientdetail.data);
pfree(logdetail.data);
-}
-
-/*
- * AcquireDeletionLock - acquire a suitable lock for deleting an object
- *
- * We use LockRelation for relations, LockDatabaseObject for everything
- * else. Note that dependency.c is not concerned with deleting any kind of
- * shared-across-databases object, so we have no need for LockSharedObject.
- */
-static void
-AcquireDeletionLock(const ObjectAddress *object, int flags)
-{
- if (object->classId == RelationRelationId)
- {
- /*
- * In DROP INDEX CONCURRENTLY, take only ShareUpdateExclusiveLock on
- * the index for the moment. index_drop() will promote the lock once
- * it's safe to do so. In all other cases we need full exclusive
- * lock.
- */
- if (flags & PERFORM_DELETION_CONCURRENTLY)
- LockRelationOid(object->objectId, ShareUpdateExclusiveLock);
- else
- LockRelationOid(object->objectId, AccessExclusiveLock);
- }
- else
- {
- /* assume we should lock the whole object not a sub-object */
- LockDatabaseObject(object->classId, object->objectId, 0,
- AccessExclusiveLock);
- }
-}
-
-/*
- * ReleaseDeletionLock - release an object deletion lock
- */
-static void
-ReleaseDeletionLock(const ObjectAddress *object)
-{
- if (object->classId == RelationRelationId)
- UnlockRelationOid(object->objectId, AccessExclusiveLock);
- else
- /* assume we should lock the whole object not a sub-object */
- UnlockDatabaseObject(object->classId, object->objectId, 0,
- AccessExclusiveLock);
}
/*

View File

@ -21,8 +21,11 @@ share/postgresql/extension/pglogical--2.2.0.sql
share/postgresql/extension/pglogical--2.2.1--2.2.2.sql
share/postgresql/extension/pglogical--2.2.1.sql
share/postgresql/extension/pglogical--2.2.2--2.3.0.sql
share/postgresql/extension/pglogical--2.2.2--2.3.1.sql
share/postgresql/extension/pglogical--2.2.2.sql
share/postgresql/extension/pglogical--2.3.0--2.3.1.sql
share/postgresql/extension/pglogical--2.3.0.sql
share/postgresql/extension/pglogical--2.3.1.sql
share/postgresql/extension/pglogical.control
share/postgresql/extension/pglogical_origin--1.0.0.sql
share/postgresql/extension/pglogical_origin.control