- Notifications
You must be signed in to change notification settings - Fork5k
Commit17caf66
committed
psql: Add \sendpipeline to send query buffers while in a pipeline
In the initial pipeline support for psql added in41625ab, \g wasused as the way to push extended query into an ongoing pipeline. \gxwas blocked.These two meta-commands have format-related options that can be appliedwhen fetching a query result (expanded, etc.). As the results of apipeline are fetched asynchronously, not at the moment of themeta-command execution but at the moment of a \getresults or a\endpipeline, authorizing \g while blocking \gx leads to a confusingimplementation, making one think that psql should be smart enough toremember the output format options defined from the time when \g or \gxwere executed. Doing so would lead to more code complications whenretrieving a batch of results. There is an extra argument other thansimplicity here: the output format options defined at the point of a\getresults or a \endpipeline execution should be what affect the outputformat for a batch of results.To avoid any confusion, we have settled to the introduction of a newmeta-command called \sendpipeline, replacing \g when within a pipeline.An advantage of this design is that it is possible to add new optionsspecific to pipelines when sending a query buffer, independent of \gand \gx, should it prove to be necessary.Most of the changes of this commit happen in the regression tests, where\g is replaced by \sendpipeline. More tests are added to check that \gis not allowed.Per discussion between the author, Daniel Vérité and me.Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>Discussion:https://postgr.es/m/ad4b9f1a-f7fe-4ab8-8546-90754726d0be@manitou-mail.org1 parentda72269 commit17caf66
File tree
8 files changed
+305
-225
lines changed- doc/src/sgml/ref
- src
- bin/psql
- test/regress
- expected
- sql
8 files changed
+305
-225
lines changedLines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3677 | 3677 |
| |
3678 | 3678 |
| |
3679 | 3679 |
| |
| 3680 | + | |
3680 | 3681 |
| |
3681 | 3682 |
| |
3682 | 3683 |
| |
| |||
3701 | 3702 |
| |
3702 | 3703 |
| |
3703 | 3704 |
| |
3704 |
| - | |
3705 |
| - | |
3706 |
| - | |
3707 |
| - | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
3708 | 3709 |
| |
3709 | 3710 |
| |
3710 | 3711 |
| |
| |||
3738 | 3739 |
| |
3739 | 3740 |
| |
3740 | 3741 |
| |
3741 |
| - | |
| 3742 | + | |
3742 | 3743 |
| |
3743 | 3744 |
| |
3744 | 3745 |
| |
|
Lines changed: 42 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
| 134 | + | |
134 | 135 |
| |
135 | 136 |
| |
136 | 137 |
| |
| |||
417 | 418 |
| |
418 | 419 |
| |
419 | 420 |
| |
| 421 | + | |
| 422 | + | |
420 | 423 |
| |
421 | 424 |
| |
422 | 425 |
| |
| |||
1734 | 1737 |
| |
1735 | 1738 |
| |
1736 | 1739 |
| |
1737 |
| - | |
1738 |
| - | |
| 1740 | + | |
1739 | 1741 |
| |
1740 |
| - | |
| 1742 | + | |
1741 | 1743 |
| |
1742 | 1744 |
| |
1743 | 1745 |
| |
| |||
2776 | 2778 |
| |
2777 | 2779 |
| |
2778 | 2780 |
| |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
2779 | 2818 |
| |
2780 | 2819 |
| |
2781 | 2820 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
181 | 181 |
| |
182 | 182 |
| |
183 | 183 |
| |
| 184 | + | |
184 | 185 |
| |
185 | 186 |
| |
186 | 187 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1895 | 1895 |
| |
1896 | 1896 |
| |
1897 | 1897 |
| |
1898 |
| - | |
| 1898 | + | |
| 1899 | + | |
1899 | 1900 |
| |
1900 | 1901 |
| |
1901 | 1902 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4706 | 4706 |
| |
4707 | 4707 |
| |
4708 | 4708 |
| |
| 4709 | + | |
4709 | 4710 |
| |
4710 | 4711 |
| |
4711 | 4712 |
| |
|
0 commit comments
Comments
(0)