MCPcopy Create free account
hub / github.com/apache/cloudberry / PrintNotifications

Function PrintNotifications

src/bin/psql/common.c:684–703  ·  view source on GitHub ↗

* PrintNotifications: check for asynchronous notifications, and print them out */

Source from the content-addressed store, hash-verified

682 * PrintNotifications: check for asynchronous notifications, and print them out
683 */
684static void
685PrintNotifications(void)
686{
687 PGnotify *notify;
688
689 PQconsumeInput(pset.db);
690 while ((notify = PQnotifies(pset.db)) != NULL)
691 {
692 /* for backward compatibility, only show payload if nonempty */
693 if (notify->extra[0])
694 fprintf(pset.queryFout, _("Asynchronous notification \"%s\" with payload \"%s\" received from server process with PID %d.\n"),
695 notify->relname, notify->extra, notify->be_pid);
696 else
697 fprintf(pset.queryFout, _("Asynchronous notification \"%s\" received from server process with PID %d.\n"),
698 notify->relname, notify->be_pid);
699 fflush(pset.queryFout);
700 PQfreemem(notify);
701 PQconsumeInput(pset.db);
702 }
703}
704
705
706/*

Callers 1

SendQueryFunction · 0.85

Calls 3

PQconsumeInputFunction · 0.85
PQnotifiesFunction · 0.85
PQfreememFunction · 0.85

Tested by

no test coverage detected