forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita438582
Allow \watch queries to stop on minimum rows returned
When running a repeat query with \watch in psql, it can behelpful to be able to stop the watch process when the queryno longer returns the expected amount of rows. An examplewould be to watch for the presence of a certain event inpg_stat_activity and stopping when the event is no longerpresent, or to watch an index creation and stop when theindex is created.This adds a min_rows=MIN parameter to \watch which can beset to a non-negative integer, and the watch query willstop executing when it returns less than MIN rows.Author: Greg Sabino Mullane <htamfids@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/CAKAnmmKStATuddYxP71L+p0DHtp9Rvjze3XRoy0Dyw67VQ45UA@mail.gmail.com1 parent9664c62 commita438582
File tree
6 files changed
+72
-15
lines changed- doc/src/sgml/ref
- src/bin/psql
- t
6 files changed
+72
-15
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3566 | 3566 |
| |
3567 | 3567 |
| |
3568 | 3568 |
| |
3569 |
| - | |
| 3569 | + | |
3570 | 3570 |
| |
3571 | 3571 |
| |
3572 | 3572 |
| |
3573 | 3573 |
| |
3574 |
| - | |
3575 |
| - | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
3576 | 3577 |
| |
3577 | 3578 |
| |
3578 | 3579 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
165 |
| - | |
| 165 | + | |
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
| |||
2775 | 2775 |
| |
2776 | 2776 |
| |
2777 | 2777 |
| |
| 2778 | + | |
2778 | 2779 |
| |
2779 | 2780 |
| |
| 2781 | + | |
2780 | 2782 |
| |
2781 | 2783 |
| |
2782 | 2784 |
| |
2783 | 2785 |
| |
2784 |
| - | |
| 2786 | + | |
2785 | 2787 |
| |
2786 | 2788 |
| |
2787 | 2789 |
| |
| |||
2838 | 2840 |
| |
2839 | 2841 |
| |
2840 | 2842 |
| |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2841 | 2863 |
| |
2842 | 2864 |
| |
2843 | 2865 |
| |
| |||
2874 | 2896 |
| |
2875 | 2897 |
| |
2876 | 2898 |
| |
2877 |
| - | |
| 2899 | + | |
2878 | 2900 |
| |
2879 | 2901 |
| |
2880 | 2902 |
| |
| |||
5144 | 5166 |
| |
5145 | 5167 |
| |
5146 | 5168 |
| |
5147 |
| - | |
| 5169 | + | |
5148 | 5170 |
| |
5149 | 5171 |
| |
5150 | 5172 |
| |
| |||
5274 | 5296 |
| |
5275 | 5297 |
| |
5276 | 5298 |
| |
5277 |
| - | |
| 5299 | + | |
5278 | 5300 |
| |
5279 | 5301 |
| |
5280 | 5302 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
| |||
632 | 633 |
| |
633 | 634 |
| |
634 | 635 |
| |
635 |
| - | |
| 636 | + | |
636 | 637 |
| |
637 | 638 |
| |
638 | 639 |
| |
| |||
646 | 647 |
| |
647 | 648 |
| |
648 | 649 |
| |
649 |
| - | |
| 650 | + | |
650 | 651 |
| |
651 | 652 |
| |
652 | 653 |
| |
| |||
1134 | 1135 |
| |
1135 | 1136 |
| |
1136 | 1137 |
| |
1137 |
| - | |
| 1138 | + | |
1138 | 1139 |
| |
1139 | 1140 |
| |
1140 | 1141 |
| |
| |||
1415 | 1416 |
| |
1416 | 1417 |
| |
1417 | 1418 |
| |
1418 |
| - | |
| 1419 | + | |
1419 | 1420 |
| |
1420 | 1421 |
| |
1421 | 1422 |
| |
1422 | 1423 |
| |
| 1424 | + | |
1423 | 1425 |
| |
1424 | 1426 |
| |
1425 | 1427 |
| |
| |||
1461 | 1463 |
| |
1462 | 1464 |
| |
1463 | 1465 |
| |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
1464 | 1470 |
| |
1465 | 1471 |
| |
1466 | 1472 |
| |
| |||
1683 | 1689 |
| |
1684 | 1690 |
| |
1685 | 1691 |
| |
1686 |
| - | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1687 | 1696 |
| |
1688 | 1697 |
| |
1689 | 1698 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
204 | 206 |
| |
205 | 207 |
| |
206 | 208 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
355 | 355 |
| |
356 | 356 |
| |
357 | 357 |
| |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
358 | 381 |
| |
359 | 382 |
| |
360 | 383 |
| |
|
0 commit comments
Comments
(0)