- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit66d947b
committed
Adjust behavior of single-user -j mode for better initdb error reporting.
Previously, -j caused the entire input file to be read in and executed asa single command string. That's undesirable, not least because any errorcauses the entire file to be regurgitated as the "failing query". Someexperimentation suggests a better rule: end the command string when we seea semicolon immediately followed by two newlines, ie, an empty line aftera query. This serves nicely to break up the existing examples such asinformation_schema.sql and system_views.sql. A limitation is that it'sno longer possible to write such a sequence within a string literal ormultiline comment in a file meant to be read with -j; but there are noinstances of such a problem within the data currently used by initdb.(If someone does make such a mistake in future, it'll be obvious becausethey'll get an unterminated-literal or unterminated-comment syntax error.)Other than that, there shouldn't be any negative consequences; you're notforced to end statements that way, it's just a better idea in most cases.In passing, remove src/include/tcop/tcopdebug.h, which is dead codebecause it's not included anywhere, and hasn't been for more thanten years. One of the debug-support symbols it purported to describehas been unreferenced for at least the same amount of time, and theother is removed by this commit on the grounds that it was useless:forcing -j mode all the time would have broken initdb. The lack ofcomplaints about that, or about the missing inclusion, shows thatno one has tried to use TCOP_DONTUSENEWLINE in many years.1 parentaee7705 commit66d947b
File tree
7 files changed
+116
-109
lines changed- doc/src/sgml/ref
- src
- backend
- catalog
- snowball
- tcop
- include/tcop
7 files changed
+116
-109
lines changedLines changed: 29 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
529 | 529 |
| |
530 | 530 |
| |
531 | 531 |
| |
532 |
| - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
533 | 535 |
| |
534 | 536 |
| |
535 | 537 |
| |
| |||
558 | 560 |
| |
559 | 561 |
| |
560 | 562 |
| |
561 |
| - | |
| 563 | + | |
562 | 564 |
| |
563 | 565 |
| |
564 | 566 |
| |
| |||
567 | 569 |
| |
568 | 570 |
| |
569 | 571 |
| |
570 |
| - | |
| 572 | + | |
| 573 | + | |
571 | 574 |
| |
572 | 575 |
| |
573 | 576 |
| |
| |||
760 | 763 |
| |
761 | 764 |
| |
762 | 765 |
| |
763 |
| - | |
764 |
| - | |
| 766 | + | |
| 767 | + | |
765 | 768 |
| |
766 | 769 |
| |
767 | 770 |
| |
| |||
778 | 781 |
| |
779 | 782 |
| |
780 | 783 |
| |
781 |
| - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
782 | 787 |
| |
783 | 788 |
| |
784 | 789 |
| |
785 |
| - | |
786 |
| - | |
787 |
| - | |
788 |
| - | |
789 |
| - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
790 | 803 |
| |
791 | 804 |
| |
792 | 805 |
| |
793 | 806 |
| |
794 | 807 |
| |
795 |
| - | |
796 |
| - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
797 | 811 |
| |
798 | 812 |
| |
799 | 813 |
| |
800 | 814 |
| |
801 | 815 |
| |
802 |
| - | |
803 |
| - | |
804 |
| - | |
| 816 | + | |
| 817 | + | |
805 | 818 |
| |
806 | 819 |
| |
807 | 820 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 |
| |
9 | 17 |
| |
10 | 18 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 |
| |
8 | 16 |
| |
9 | 17 |
| |
|
Lines changed: 18 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
2 | 19 |
| |
3 |
| - | |
4 | 20 |
| |
5 | 21 |
| |
6 | 22 |
| |
|
Lines changed: 18 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
2 | 19 |
| |
3 | 20 |
| |
4 | 21 |
| |
|
Lines changed: 35 additions & 46 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
161 | 160 |
| |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
| 161 | + | |
172 | 162 |
| |
173 | 163 |
| |
174 | 164 |
| |
| |||
219 | 209 |
| |
220 | 210 |
| |
221 | 211 |
| |
222 |
| - | |
223 |
| - | |
224 | 212 |
| |
225 | 213 |
| |
226 | 214 |
| |
| |||
230 | 218 |
| |
231 | 219 |
| |
232 | 220 |
| |
233 |
| - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
234 | 225 |
| |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
| 226 | + | |
240 | 227 |
| |
241 |
| - | |
| 228 | + | |
242 | 229 |
| |
243 |
| - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
244 | 250 |
| |
245 | 251 |
| |
246 | 252 |
| |
247 |
| - | |
| 253 | + | |
248 | 254 |
| |
249 | 255 |
| |
250 | 256 |
| |
251 | 257 |
| |
252 |
| - | |
| 258 | + | |
253 | 259 |
| |
254 | 260 |
| |
255 | 261 |
| |
256 | 262 |
| |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 | 263 |
| |
264 | 264 |
| |
265 |
| - | |
266 |
| - | |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
| 265 | + | |
| 266 | + | |
279 | 267 |
| |
280 | 268 |
| |
281 |
| - | |
| 269 | + | |
| 270 | + | |
282 | 271 |
| |
283 | 272 |
| |
284 | 273 |
| |
| |||
3391 | 3380 |
| |
3392 | 3381 |
| |
3393 | 3382 |
| |
3394 |
| - | |
| 3383 | + | |
3395 | 3384 |
| |
3396 | 3385 |
| |
3397 | 3386 |
| |
| |||
3901 | 3890 |
| |
3902 | 3891 |
| |
3903 | 3892 |
| |
3904 |
| - | |
| 3893 | + | |
3905 | 3894 |
| |
3906 | 3895 |
| |
3907 | 3896 |
| |
|
Lines changed: 0 additions & 44 deletions
This file was deleted.
0 commit comments
Comments
(0)