* PrintNotifications: check for asynchronous notifications, and print them out */
| 682 | * PrintNotifications: check for asynchronous notifications, and print them out |
| 683 | */ |
| 684 | static void |
| 685 | PrintNotifications(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 | /* |
no test coverage detected