]> granicus.if.org Git - postgresql/commitdiff
Correct replication origin's use of UINT16_MAX to PG_UINT16_MAX.
authorAndres Freund <andres@anarazel.de>
Wed, 29 Apr 2015 22:19:36 +0000 (00:19 +0200)
committerAndres Freund <andres@anarazel.de>
Wed, 29 Apr 2015 22:19:36 +0000 (00:19 +0200)
We can't rely on UINT16_MAX being present, which is why we introduced
PG_UINT16_MAX...

Buildfarm animal bowerbird via Andrew Gierth.

src/backend/replication/logical/origin.c
src/include/replication/origin.h

index ab9ae0b6c2fd47bea180c433907659d5fecdb5c9..baf6bb79b8054eac3ab7f2c49aad5a9d28482435 100644 (file)
@@ -266,7 +266,7 @@ replorigin_create(char *roname)
 
        rel = heap_open(ReplicationOriginRelationId, ExclusiveLock);
 
-       for (roident = InvalidOid + 1; roident < UINT16_MAX; roident++)
+       for (roident = InvalidOid + 1; roident < PG_UINT16_MAX; roident++)
        {
                bool            nulls[Natts_pg_replication_origin];
                Datum           values[Natts_pg_replication_origin];
index ca26bc3e64aeadd490a852cd5fdad0a7eaefb773..b814aeb4fd335799598c689cf519f6f6b6cc3d50 100644 (file)
@@ -30,7 +30,7 @@ typedef struct xl_replorigin_drop
 #define XLOG_REPLORIGIN_DROP           0x10
 
 #define InvalidRepOriginId 0
-#define DoNotReplicateId UINT16_MAX
+#define DoNotReplicateId PG_UINT16_MAX
 
 extern PGDLLIMPORT RepOriginId replorigin_sesssion_origin;
 extern PGDLLIMPORT XLogRecPtr replorigin_sesssion_origin_lsn;