#endif
+/*
+ * This macro lists the backend message types that could be "long" (more
+ * than a couple of kilobytes).
+ */
+#define VALID_LONG_MESSAGE_TYPE(id) \
+ ((id) == 'T' || (id) == 'D' || (id) == 'd' || (id) == 'V' || \
+ (id) == 'E' || (id) == 'N' || (id) == 'A')
+
+
static void handleSyncLoss(PGconn *conn, char id, int msgLength);
static int getRowDescriptions(PGconn *conn);
static int getAnotherTuple(PGconn *conn, int msgLength);
handleSyncLoss(conn, id, msgLength);
return;
}
- if (msgLength > 30000 &&
- !(id == 'T' || id == 'D' || id == 'd'))
+ if (msgLength > 30000 && !VALID_LONG_MESSAGE_TYPE(id))
{
handleSyncLoss(conn, id, msgLength);
return;
handleSyncLoss(conn, id, msgLength);
break;
}
- if (msgLength > 30000 &&
- !(id == 'T' || id == 'D' || id == 'd' || id == 'V'))
+ if (msgLength > 30000 && !VALID_LONG_MESSAGE_TYPE(id))
{
handleSyncLoss(conn, id, msgLength);
break;