v13-0002-Remove-PGRES_POLLING_ACTIVE-case.patch
application/x-patch
Filename: v13-0002-Remove-PGRES_POLLING_ACTIVE-case.patch
Type: application/x-patch
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v13-0002
Subject: Remove PGRES_POLLING_ACTIVE case
| File | + | − |
|---|---|---|
| src/bin/psql/command.c | 2 | 5 |
| src/interfaces/libpq/libpq-fe.h | 1 | 2 |
From 76cef25162b44adc20172afee47836ca765d3b5c Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
Date: Wed, 3 Apr 2024 15:21:52 +0200
Subject: [PATCH v13 2/2] Remove PGRES_POLLING_ACTIVE case
This enum variant has been unused for at least 21 years
44aba280207740d0956160c0288e61f28f024a71. It's been there only for
backwards compatibility of the ABI, so no need to check for it.
Also update the comment on PGRES_POLLING_ACTIVE, since we're stuck with
it forever due to ABI compatibility guarantees.
---
src/bin/psql/command.c | 7 ++-----
src/interfaces/libpq/libpq-fe.h | 3 +--
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index dc3cc7c10b7..5b31d08bf70 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3802,17 +3802,14 @@ wait_until_connected(PGconn *conn)
switch (PQconnectPoll(conn))
{
- case PGRES_POLLING_OK:
- case PGRES_POLLING_FAILED:
- return;
case PGRES_POLLING_READING:
forRead = true;
continue;
case PGRES_POLLING_WRITING:
forRead = false;
continue;
- case PGRES_POLLING_ACTIVE:
- pg_unreachable();
+ default:
+ return;
}
}
}
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 8d3c5c6f662..c184e853889 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -91,8 +91,7 @@ typedef enum
PGRES_POLLING_READING, /* These two indicate that one may */
PGRES_POLLING_WRITING, /* use select before polling again. */
PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE /* unused; keep for awhile for backwards
- * compatibility */
+ PGRES_POLLING_ACTIVE /* unused; keep for backwards compatibility */
} PostgresPollingStatusType;
typedef enum
--
2.34.1