Commit f622300
committed
PostgreSQL: Add support for
Add support for the PostgreSQL TRUNCATE syntax `TRUNCATE TABLE name *`
which indicates that descendant tables should also be truncated. This is
the opposite of the `ONLY` keyword, and Postgres doesn't allow both. We
are more permissive when parsing it and allow both to appear.
Adds a `has_asterisk` field to `TruncateTableTarget` that is set to true
when the `*` token follows a table name. This could be called
`include_descendants` or something more semantically meaningful, but
it's kind of peculiar syntax, so just mirroring the syntax itself seemed
less confusing.* (descendant) option in TRUNCATE1 parent 6550ec8 commit f622300
4 files changed
Lines changed: 89 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6412 | 6412 | | |
6413 | 6413 | | |
6414 | 6414 | | |
6415 | | - | |
6416 | | - | |
| 6415 | + | |
| 6416 | + | |
| 6417 | + | |
| 6418 | + | |
6417 | 6419 | | |
6418 | 6420 | | |
| 6421 | + | |
| 6422 | + | |
| 6423 | + | |
| 6424 | + | |
| 6425 | + | |
| 6426 | + | |
6419 | 6427 | | |
6420 | 6428 | | |
6421 | 6429 | | |
6422 | 6430 | | |
6423 | 6431 | | |
6424 | 6432 | | |
6425 | 6433 | | |
6426 | | - | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
| 6437 | + | |
| 6438 | + | |
6427 | 6439 | | |
6428 | 6440 | | |
6429 | 6441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1066 | 1069 | | |
1067 | 1070 | | |
1068 | 1071 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16806 | 16806 | | |
16807 | 16807 | | |
16808 | 16808 | | |
| 16809 | + | |
16809 | 16810 | | |
16810 | 16811 | | |
16811 | 16812 | | |
16812 | 16813 | | |
| 16814 | + | |
16813 | 16815 | | |
16814 | 16816 | | |
16815 | 16817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5083 | 5083 | | |
5084 | 5084 | | |
5085 | 5085 | | |
| 5086 | + | |
5086 | 5087 | | |
5087 | 5088 | | |
5088 | 5089 | | |
| |||
5107 | 5108 | | |
5108 | 5109 | | |
5109 | 5110 | | |
| 5111 | + | |
5110 | 5112 | | |
5111 | 5113 | | |
5112 | 5114 | | |
| |||
5136 | 5138 | | |
5137 | 5139 | | |
5138 | 5140 | | |
| 5141 | + | |
5139 | 5142 | | |
5140 | 5143 | | |
5141 | 5144 | | |
5142 | 5145 | | |
| 5146 | + | |
5143 | 5147 | | |
5144 | 5148 | | |
5145 | 5149 | | |
| |||
5157 | 5161 | | |
5158 | 5162 | | |
5159 | 5163 | | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
| 5167 | + | |
| 5168 | + | |
| 5169 | + | |
| 5170 | + | |
| 5171 | + | |
| 5172 | + | |
| 5173 | + | |
| 5174 | + | |
| 5175 | + | |
| 5176 | + | |
| 5177 | + | |
| 5178 | + | |
| 5179 | + | |
| 5180 | + | |
| 5181 | + | |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
5160 | 5222 | | |
5161 | 5223 | | |
5162 | 5224 | | |
| |||
0 commit comments