- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8388468
committed
psql: include intra-query "--" comments in what's sent to the server.
psql's lexer has historically deleted dash-dash (single-line) commentsfrom what's collected and sent to the server. This is inconsistentwith what it does for slash-star comments, and people have complainedbefore that they wish such comments would be captured in the server log.Undoing the decision completely seems like too big a behavioral change,however. In particular, comments on lines preceding the start of aquery are generally not thought of as being part of that query.What we can do to improve the situation is to capture comments thatare clearly *within* a query, that is after the first non-whitespace,non-comment token but before the query's ending semicolon or backslashcommand. This is a nearly trivial code change, and it affects only afew regression test results.(It is tempting to try to apply the same rule to slash-star comments.But it's hard to see how to do that without getting strange historybehavior for comments that cross lines, especially if the user thenstarts a new query on the same line as the star-slash. In view ofthe lack of complaints, let's leave that case alone.)Discussion:https://postgr.es/m/CAJcOf-cAdMVr7azeYR7nWKsNp7qhORzc84rV6d7m7knG5Hrtsw@mail.gmail.com1 parent89d1c15 commit8388468
File tree
5 files changed
+11
-12
lines changed- contrib/pg_stat_statements/expected
- src
- fe_utils
- test/regress/expected
5 files changed
+11
-12
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
104 |
| - | |
| 104 | + | |
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
378 | 378 |
| |
379 | 379 |
| |
380 | 380 |
| |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
385 | 384 |
| |
386 |
| - | |
| 385 | + | |
387 | 386 |
| |
388 | 387 |
| |
389 | 388 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1905 | 1905 |
| |
1906 | 1906 |
| |
1907 | 1907 |
| |
1908 |
| - | |
| 1908 | + | |
1909 | 1909 |
| |
1910 | 1910 |
| |
1911 | 1911 |
| |
1912 | 1912 |
| |
1913 | 1913 |
| |
1914 | 1914 |
| |
1915 |
| - | |
| 1915 | + | |
1916 | 1916 |
| |
1917 | 1917 |
| |
1918 | 1918 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
928 | 928 |
| |
929 | 929 |
| |
930 | 930 |
| |
931 |
| - | |
| 931 | + | |
932 | 932 |
| |
933 | 933 |
| |
934 | 934 |
| |
935 | 935 |
| |
936 | 936 |
| |
937 | 937 |
| |
938 | 938 |
| |
939 |
| - | |
| 939 | + | |
940 | 940 |
| |
941 | 941 |
| |
942 | 942 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2100 | 2100 |
| |
2101 | 2101 |
| |
2102 | 2102 |
| |
2103 |
| - | |
| 2103 | + | |
2104 | 2104 |
| |
2105 | 2105 |
| |
2106 | 2106 |
| |
| |||
2124 | 2124 |
| |
2125 | 2125 |
| |
2126 | 2126 |
| |
2127 |
| - | |
| 2127 | + | |
2128 | 2128 |
| |
2129 | 2129 |
| |
2130 | 2130 |
| |
|
0 commit comments
Comments
(0)