forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3ce3575
committed
psql: Add pipeline status to prompt and some state variables
This commit adds %P to psql prompts, able to report the status of apipeline depending on PQpipelineStatus(): on, off or abort.The following variables are added to report the state of an ongoingpipeline:- PIPELINE_SYNC_COUNT: reports the number of piped syncs.- PIPELINE_COMMAND_COUNT: reports the number of piped commands, acommand being either \bind, \bind_named, \close or \parse.- PIPELINE_RESULT_COUNT: reports the results available to read with\getresults.These variables can be used with \echo or in a prompt, using "%:name:"in PROMPT1, PROMPT2 or PROMPT3. Some basic regression tests are addedfor these. The suggestion to use variables to show the details aboutthe status counters comes from me. The original patch proposed was lessextensible, hardcoding the output in the prompt.Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>Discussion:https://postgr.es/m/CAO6_XqroE7JuMEm1sWz55rp9fAYX2JwmcP_3m_v51vnOFdsLiQ@mail.gmail.com1 parentcbb9086 commit3ce3575
File tree
6 files changed
+128
-1
lines changed- doc/src/sgml/ref
- src
- bin/psql
- test/regress
- expected
- sql
6 files changed
+128
-1
lines changedLines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3728 | 3728 |
| |
3729 | 3729 |
| |
3730 | 3730 |
| |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
3731 | 3737 |
| |
3732 | 3738 |
| |
3733 | 3739 |
| |
| |||
4502 | 4508 |
| |
4503 | 4509 |
| |
4504 | 4510 |
| |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
4505 | 4544 |
| |
4506 | 4545 |
| |
4507 | 4546 |
| |
| |||
4901 | 4940 |
| |
4902 | 4941 |
| |
4903 | 4942 |
| |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
4904 | 4954 |
| |
4905 | 4955 |
| |
4906 | 4956 |
| |
|
Lines changed: 26 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
524 | 524 |
| |
525 | 525 |
| |
526 | 526 |
| |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
527 | 547 |
| |
528 | 548 |
| |
529 | 549 |
| |
| |||
1661 | 1681 |
| |
1662 | 1682 |
| |
1663 | 1683 |
| |
| 1684 | + | |
| 1685 | + | |
1664 | 1686 |
| |
1665 | 1687 |
| |
1666 | 1688 |
| |
| |||
1669 | 1691 |
| |
1670 | 1692 |
| |
1671 | 1693 |
| |
1672 |
| - | |
| 1694 | + | |
| 1695 | + | |
1673 | 1696 |
| |
| 1697 | + | |
1674 | 1698 |
| |
1675 | 1699 |
| |
1676 | 1700 |
| |
| |||
2105 | 2129 |
| |
2106 | 2130 |
| |
2107 | 2131 |
| |
| 2132 | + | |
2108 | 2133 |
| |
2109 | 2134 |
| |
2110 | 2135 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| |||
181 | 182 |
| |
182 | 183 |
| |
183 | 184 |
| |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
184 | 198 |
| |
185 | 199 |
| |
186 | 200 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
208 | 213 |
| |
209 | 214 |
| |
210 | 215 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 |
| |
61 | 67 |
| |
62 | 68 |
| |
63 | 69 |
| |
64 | 70 |
| |
65 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
66 | 78 |
| |
67 | 79 |
| |
68 | 80 |
| |
| |||
303 | 315 |
| |
304 | 316 |
| |
305 | 317 |
| |
| 318 | + | |
| 319 | + | |
306 | 320 |
| |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
307 | 325 |
| |
308 | 326 |
| |
309 | 327 |
| |
310 | 328 |
| |
311 | 329 |
| |
312 | 330 |
| |
| 331 | + | |
| 332 | + | |
313 | 333 |
| |
314 | 334 |
| |
315 | 335 |
| |
| |||
322 | 342 |
| |
323 | 343 |
| |
324 | 344 |
| |
| 345 | + | |
| 346 | + | |
325 | 347 |
| |
326 | 348 |
| |
327 | 349 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 |
| |
31 | 34 |
| |
32 | 35 |
| |
33 | 36 |
| |
34 | 37 |
| |
35 | 38 |
| |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 |
| |
37 | 43 |
| |
38 | 44 |
| |
| |||
174 | 180 |
| |
175 | 181 |
| |
176 | 182 |
| |
| 183 | + | |
177 | 184 |
| |
| 185 | + | |
| 186 | + | |
178 | 187 |
| |
| 188 | + | |
179 | 189 |
| |
180 | 190 |
| |
| 191 | + | |
181 | 192 |
| |
182 | 193 |
| |
183 | 194 |
| |
|
0 commit comments
Comments
(0)