forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8ff1c94
committed
Allow TRUNCATE command to truncate foreign tables.
This commit introduces new foreign data wrapper API for TRUNCATE.It extends TRUNCATE command so that it accepts foreign tables asthe targets to truncate and invokes that API. Also it extends postgres_fdwso that it can issue TRUNCATE command to foreign servers, by addingnew routine for that TRUNCATE API.The information about options specified in TRUNCATE command, e.g.,ONLY, CACADE, etc is passed to FDW via API. The list of foreign tables totruncate is also passed to FDW. FDW truncates the foreign data sourcesthat the passed foreign tables specify, based on those information.For example, postgres_fdw constructs TRUNCATE command using themand issues it to the foreign server.For performance, TRUNCATE command invokes the FDW routine forTRUNCATE once per foreign server that foreign tables to truncate belong to.Author: Kazutaka Onishi, Kohei KaiGai, slightly modified by Fujii MasaoReviewed-by: Bharath Rupireddy, Michael Paquier, Zhihong Yu, Alvaro Herrera, Stephen Frost, Ashutosh Bapat, Amit Langote, Daniel Gustafsson, Ibrar Ahmed, Fujii MasaoDiscussion:https://postgr.es/m/CAOP8fzb_gkReLput7OvOK+8NHgw-RKqNv59vem7=524krQTcWA@mail.gmail.comDiscussion:https://postgr.es/m/CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com1 parent50e17ad commit8ff1c94
File tree
17 files changed
+725
-31
lines changed- contrib/postgres_fdw
- expected
- sql
- doc/src/sgml
- ref
- src
- backend
- commands
- replication/logical
- include
- commands
- foreign
- utils
- test/regress/expected
- tools/pgindent
17 files changed
+725
-31
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
96 | 95 |
| |
97 | 96 |
| |
98 | 97 |
| |
| |||
568 | 567 |
| |
569 | 568 |
| |
570 | 569 |
| |
571 |
| - | |
| 570 | + | |
572 | 571 |
| |
573 | 572 |
| |
574 | 573 |
| |
|
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
59 | 60 |
| |
60 | 61 |
| |
61 | 62 |
| |
| |||
2172 | 2173 |
| |
2173 | 2174 |
| |
2174 | 2175 |
| |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
2175 | 2213 |
| |
2176 | 2214 |
| |
2177 | 2215 |
| |
|
Lines changed: 200 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8215 | 8215 |
| |
8216 | 8216 |
| |
8217 | 8217 |
| |
| 8218 | + | |
| 8219 | + | |
| 8220 | + | |
| 8221 | + | |
| 8222 | + | |
| 8223 | + | |
| 8224 | + | |
| 8225 | + | |
| 8226 | + | |
| 8227 | + | |
| 8228 | + | |
| 8229 | + | |
| 8230 | + | |
| 8231 | + | |
| 8232 | + | |
| 8233 | + | |
| 8234 | + | |
| 8235 | + | |
| 8236 | + | |
| 8237 | + | |
| 8238 | + | |
| 8239 | + | |
| 8240 | + | |
| 8241 | + | |
| 8242 | + | |
| 8243 | + | |
| 8244 | + | |
| 8245 | + | |
| 8246 | + | |
| 8247 | + | |
| 8248 | + | |
| 8249 | + | |
| 8250 | + | |
| 8251 | + | |
| 8252 | + | |
| 8253 | + | |
| 8254 | + | |
| 8255 | + | |
| 8256 | + | |
| 8257 | + | |
| 8258 | + | |
| 8259 | + | |
| 8260 | + | |
| 8261 | + | |
| 8262 | + | |
| 8263 | + | |
| 8264 | + | |
| 8265 | + | |
| 8266 | + | |
| 8267 | + | |
| 8268 | + | |
| 8269 | + | |
| 8270 | + | |
| 8271 | + | |
| 8272 | + | |
| 8273 | + | |
| 8274 | + | |
| 8275 | + | |
| 8276 | + | |
| 8277 | + | |
| 8278 | + | |
| 8279 | + | |
| 8280 | + | |
| 8281 | + | |
| 8282 | + | |
| 8283 | + | |
| 8284 | + | |
| 8285 | + | |
| 8286 | + | |
| 8287 | + | |
| 8288 | + | |
| 8289 | + | |
| 8290 | + | |
| 8291 | + | |
| 8292 | + | |
| 8293 | + | |
| 8294 | + | |
| 8295 | + | |
| 8296 | + | |
| 8297 | + | |
| 8298 | + | |
| 8299 | + | |
| 8300 | + | |
| 8301 | + | |
| 8302 | + | |
| 8303 | + | |
| 8304 | + | |
| 8305 | + | |
| 8306 | + | |
| 8307 | + | |
| 8308 | + | |
| 8309 | + | |
| 8310 | + | |
| 8311 | + | |
| 8312 | + | |
| 8313 | + | |
| 8314 | + | |
| 8315 | + | |
| 8316 | + | |
| 8317 | + | |
| 8318 | + | |
| 8319 | + | |
| 8320 | + | |
| 8321 | + | |
| 8322 | + | |
| 8323 | + | |
| 8324 | + | |
| 8325 | + | |
| 8326 | + | |
| 8327 | + | |
| 8328 | + | |
| 8329 | + | |
| 8330 | + | |
| 8331 | + | |
| 8332 | + | |
| 8333 | + | |
| 8334 | + | |
| 8335 | + | |
| 8336 | + | |
| 8337 | + | |
| 8338 | + | |
| 8339 | + | |
| 8340 | + | |
| 8341 | + | |
| 8342 | + | |
| 8343 | + | |
| 8344 | + | |
| 8345 | + | |
| 8346 | + | |
| 8347 | + | |
| 8348 | + | |
| 8349 | + | |
| 8350 | + | |
| 8351 | + | |
| 8352 | + | |
| 8353 | + | |
| 8354 | + | |
| 8355 | + | |
| 8356 | + | |
| 8357 | + | |
| 8358 | + | |
| 8359 | + | |
| 8360 | + | |
| 8361 | + | |
| 8362 | + | |
| 8363 | + | |
| 8364 | + | |
| 8365 | + | |
| 8366 | + | |
| 8367 | + | |
| 8368 | + | |
| 8369 | + | |
| 8370 | + | |
| 8371 | + | |
| 8372 | + | |
| 8373 | + | |
| 8374 | + | |
| 8375 | + | |
| 8376 | + | |
| 8377 | + | |
| 8378 | + | |
| 8379 | + | |
| 8380 | + | |
| 8381 | + | |
| 8382 | + | |
| 8383 | + | |
| 8384 | + | |
| 8385 | + | |
| 8386 | + | |
| 8387 | + | |
| 8388 | + | |
| 8389 | + | |
| 8390 | + | |
| 8391 | + | |
| 8392 | + | |
| 8393 | + | |
| 8394 | + | |
| 8395 | + | |
| 8396 | + | |
| 8397 | + | |
| 8398 | + | |
| 8399 | + | |
| 8400 | + | |
| 8401 | + | |
| 8402 | + | |
| 8403 | + | |
| 8404 | + | |
| 8405 | + | |
| 8406 | + | |
| 8407 | + | |
| 8408 | + | |
| 8409 | + | |
| 8410 | + | |
| 8411 | + | |
| 8412 | + | |
| 8413 | + | |
| 8414 | + | |
| 8415 | + | |
| 8416 | + | |
8218 | 8417 |
| |
8219 | 8418 |
| |
8220 | 8419 |
| |
| |||
8917 | 9116 |
| |
8918 | 9117 |
| |
8919 | 9118 |
| |
8920 |
| - | |
| 9119 | + | |
8921 | 9120 |
| |
8922 | 9121 |
| |
8923 | 9122 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| 111 | + | |
111 | 112 |
| |
112 | 113 |
| |
113 | 114 |
| |
| |||
213 | 214 |
| |
214 | 215 |
| |
215 | 216 |
| |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 |
| |
217 | 221 |
| |
218 | 222 |
| |
|
0 commit comments
Comments
(0)