static remoteConn *pconn = NULL;
static HTAB *remoteConnHash = NULL;
+/* custom wait event values, retrieved from shared memory */
+static uint32 dblink_we_connect = 0;
+static uint32 dblink_we_get_conn = 0;
+
/*
* Following is list that holds multiple remote connections.
* Calling convention of each dblink function changes to accept
connstr = conname_or_str;
dblink_connstr_check(connstr);
+ /* first time, allocate or get the custom wait event */
+ if (dblink_we_get_conn == 0)
+ dblink_we_get_conn = WaitEventExtensionNew("DblinkGetConnect");
+
/* OK to make connection */
- conn = libpqsrv_connect(connstr, WAIT_EVENT_EXTENSION);
+ conn = libpqsrv_connect(connstr, dblink_we_get_conn);
if (PQstatus(conn) == CONNECTION_BAD)
{
/* check password in connection string if not superuser */
dblink_connstr_check(connstr);
+ /* first time, allocate or get the custom wait event */
+ if (dblink_we_connect == 0)
+ dblink_we_connect = WaitEventExtensionNew("DblinkConnect");
+
/* OK to make connection */
- conn = libpqsrv_connect(connstr, WAIT_EVENT_EXTENSION);
+ conn = libpqsrv_connect(connstr, dblink_we_connect);
if (PQstatus(conn) == CONNECTION_BAD)
{
session.
+ dblink can report the following wait events under the wait
+ event type Extension.
+
+
+
+
+ DblinkConnect
+
+ Waiting to establish a connection to a remote server.
+
+
+
+
+
+ DblinkGetConnect
+
+ Waiting to establish a connection to a remote server when it could not
+ be found in the list of already-opened connections.
+
+
+
+
+
See also , which provides roughly the same
functionality using a more modern and standards-compliant infrastructure.