Commit fcc2817
committed
Clean up and simplify code in a couple of set-returning functions
The following set-returning functions have their logic simplified, to be
more consistent with other in-core areas:
- pg_prepared_statement()'s tuple descriptor is now created with
get_call_result_type() instead of being created from scratch, saving
from some duplication with pg_proc.dat.
- show_all_file_settings(), similarly, now uses get_call_result_type()
to build its tuple descriptor instead of creating it from scratch.
- pg_options_to_table() made use of a static routine called only once.
This commit removes this internal routine to make the function easier to
follow.
- pg_config() was using a unique logic style, doing checks on the tuple
descriptor passed down in expectedDesc, but it has no need to do so.
This switches the function to use a tuplestore with a tuple descriptor
retrieved from get_call_result_type(), instead.
This simplifies an upcoming patch aimed at refactoring the way
tuplestores are created and checked in set-returning functions, this
change making sense as its own independent cleanup by shaving some
code.
Author: Melanie Plageman, Michael Paquier
Reviewed-by: Justin Pryzby
Discussion: https://postgr.es/m/CAAKRu_azyd1Z3W_r7Ou4sorTjRCs+PxeHw1CWJeXKofkE6TuZg@mail.gmail.com1 parent 04e706d commit fcc2817
File tree
5 files changed
+48
-128
lines changed- src/backend
- commands
- foreign
- utils
- misc
- mmgr
5 files changed
+48
-128
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
719 | 723 | | |
720 | 724 | | |
721 | 725 | | |
722 | 726 | | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | 727 | | |
744 | 728 | | |
745 | 729 | | |
746 | 730 | | |
747 | 731 | | |
748 | 732 | | |
749 | 733 | | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
750 | 737 | | |
751 | 738 | | |
752 | 739 | | |
| |||
778 | 765 | | |
779 | 766 | | |
780 | 767 | | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | 768 | | |
786 | 769 | | |
787 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
503 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
504 | 505 | | |
505 | | - | |
506 | | - | |
| 506 | + | |
| 507 | + | |
507 | 508 | | |
| 509 | + | |
508 | 510 | | |
| 511 | + | |
| 512 | + | |
509 | 513 | | |
510 | 514 | | |
511 | | - | |
512 | | - | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
| |||
524 | 526 | | |
525 | 527 | | |
526 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
527 | 532 | | |
528 | 533 | | |
529 | 534 | | |
| |||
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
| 544 | + | |
| 545 | + | |
539 | 546 | | |
540 | 547 | | |
541 | 548 | | |
| 549 | + | |
| 550 | + | |
542 | 551 | | |
543 | 552 | | |
544 | 553 | | |
| |||
555 | 564 | | |
556 | 565 | | |
557 | 566 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | 567 | | |
575 | 568 | | |
576 | 569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10174 | 10174 | | |
10175 | 10175 | | |
10176 | 10176 | | |
| 10177 | + | |
| 10178 | + | |
| 10179 | + | |
10177 | 10180 | | |
10178 | 10181 | | |
10179 | 10182 | | |
10180 | 10183 | | |
10181 | 10184 | | |
10182 | 10185 | | |
10183 | 10186 | | |
10184 | | - | |
10185 | | - | |
10186 | | - | |
10187 | | - | |
10188 | | - | |
10189 | | - | |
10190 | | - | |
10191 | | - | |
10192 | | - | |
10193 | | - | |
10194 | | - | |
10195 | | - | |
10196 | | - | |
10197 | | - | |
10198 | | - | |
10199 | | - | |
10200 | | - | |
10201 | 10187 | | |
10202 | 10188 | | |
10203 | 10189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | | - | |
| 40 | + | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | | - | |
51 | | - | |
| 45 | + | |
| 46 | + | |
52 | 47 | | |
53 | | - | |
54 | | - | |
| 48 | + | |
| 49 | + | |
55 | 50 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 51 | + | |
71 | 52 | | |
| 53 | + | |
| 54 | + | |
72 | 55 | | |
73 | | - | |
74 | | - | |
| 56 | + | |
75 | 57 | | |
76 | 58 | | |
77 | 59 | | |
78 | 60 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 61 | + | |
| 62 | + | |
85 | 63 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 64 | + | |
| 65 | + | |
91 | 66 | | |
92 | | - | |
| 67 | + | |
| 68 | + | |
93 | 69 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 70 | + | |
| 71 | + | |
103 | 72 | | |
104 | 73 | | |
105 | 74 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
1152 | 1153 | | |
1153 | 1154 | | |
1154 | 1155 | | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1156 | + | |
| 1157 | + | |
1172 | 1158 | | |
1173 | 1159 | | |
1174 | 1160 | | |
| |||
1177 | 1163 | | |
1178 | 1164 | | |
1179 | 1165 | | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1180 | 1169 | | |
1181 | 1170 | | |
1182 | 1171 | | |
| |||
0 commit comments