Пример #1
0
/*
 * Async_UnlistenAll
 *
 *		This is invoked by UNLISTEN "*" command, and also at backend exit.
 */
static void
Async_UnlistenAll(void)
{
	if (Trace_notify)
		elog(DEBUG1, "Async_UnlistenAll(%d)", MyProcPid);

	queue_listen(LISTEN_UNLISTEN_ALL, "");
}
Пример #2
0
/*
 * Async_Listen
 *
 *		This is executed by the SQL listen command.
 */
void
Async_Listen(const char *relname)
{
	if (Trace_notify)
		elog(DEBUG1, "Async_Listen(%s,%d)", relname, MyProcPid);

	queue_listen(LISTEN_LISTEN, relname);
}
Пример #3
0
/*
 * Async_UnlistenAll
 *
 *		This is invoked by UNLISTEN * command, and also at backend exit.
 */
void
Async_UnlistenAll(void)
{
	if (Trace_notify)
		elog(DEBUG1, "Async_UnlistenAll(%d)", MyProcPid);

	/* If we couldn't possibly be listening, no need to queue anything */
	if (pendingActions == NIL && !unlistenExitRegistered)
		return;

	queue_listen(LISTEN_UNLISTEN_ALL, "");
}
Пример #4
0
/*
 * Async_Unlisten
 *
 *		This is executed by the SQL unlisten command.
 */
void
Async_Unlisten(const char *relname)
{
	if (Trace_notify)
		elog(DEBUG1, "Async_Unlisten(%s,%d)", relname, MyProcPid);

	/* If we couldn't possibly be listening, no need to queue anything */
	if (pendingActions == NIL && !unlistenExitRegistered)
		return;

	queue_listen(LISTEN_UNLISTEN, relname);
}
Пример #5
0
/*
 * Async_Unlisten
 *
 *		This is executed by the SQL unlisten command.
 */
void
Async_Unlisten(const char *relname)
{
	/* Handle specially the `unlisten "*"' command */
	if ((!relname) || (*relname == '\0') || (strcmp(relname, "*") == 0))
	{
		Async_UnlistenAll();
	}
	else
	{
		if (Trace_notify)
			elog(DEBUG1, "Async_Unlisten(%s,%d)", relname, MyProcPid);

		queue_listen(LISTEN_UNLISTEN, relname);
	}
}