aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/connection.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-07-03 11:01:02 +0900
committerMichael Paquier <michael@paquier.xyz>2023-07-03 11:01:02 +0900
commit2aeaf80e578ed48af88d54caf2ffcf7ca62617e8 (patch)
treea322df445b8663e7e6dbbaa970ae856d40d36902 /contrib/postgres_fdw/connection.c
parent8c12838001c2d974d3608fe55c228f601818a729 (diff)
downloadpostgresql-2aeaf80e578ed48af88d54caf2ffcf7ca62617e8.tar.gz
postgresql-2aeaf80e578ed48af88d54caf2ffcf7ca62617e8.zip
Refactor some code related to wait events "BufferPin" and "Extension"
The following changes are done: - Addition of WaitEventBufferPin and WaitEventExtension, that hold a list of wait events related to each category. - Addition of two functions that encapsulate the list of wait events for each category. - Rename BUFFER_PIN to BUFFERPIN (only this wait event class used an underscore, requiring a specific rule in the automation script). These changes make a bit easier the automatic generation of all the code and documentation related to wait events, as all the wait event categories are now controlled by consistent structures and functions. Author: Bertrand Drouvot Discussion: https://postgr.es/m/c6f35117-4b20-4c78-1df5-d3056010dcf5@gmail.com Discussion: https://postgr.es/m/77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com
Diffstat (limited to 'contrib/postgres_fdw/connection.c')
-rw-r--r--contrib/postgres_fdw/connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index f839308b400..7e12b722ec9 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -530,7 +530,7 @@ connect_pg_server(ForeignServer *server, UserMapping *user)
/* OK to make connection */
conn = libpqsrv_connect_params(keywords, values,
false, /* expand_dbname */
- PG_WAIT_EXTENSION);
+ WAIT_EVENT_EXTENSION);
if (!conn || PQstatus(conn) != CONNECTION_OK)
ereport(ERROR,
@@ -863,7 +863,7 @@ pgfdw_get_result(PGconn *conn, const char *query)
WL_LATCH_SET | WL_SOCKET_READABLE |
WL_EXIT_ON_PM_DEATH,
PQsocket(conn),
- -1L, PG_WAIT_EXTENSION);
+ -1L, WAIT_EVENT_EXTENSION);
ResetLatch(MyLatch);
CHECK_FOR_INTERRUPTS();
@@ -1567,7 +1567,7 @@ pgfdw_get_cleanup_result(PGconn *conn, TimestampTz endtime, PGresult **result,
WL_LATCH_SET | WL_SOCKET_READABLE |
WL_TIMEOUT | WL_EXIT_ON_PM_DEATH,
PQsocket(conn),
- cur_timeout, PG_WAIT_EXTENSION);
+ cur_timeout, WAIT_EVENT_EXTENSION);
ResetLatch(MyLatch);
CHECK_FOR_INTERRUPTS();