forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9fcdf2c
committed
Add support for COPY TO callback functions
This is useful as a way for extensions to process COPY TO rows in theway they see fit (say auditing, analytics, backend, etc.) without theneed to invoke an external process running as the OS user running thebackend through PROGRAM that requires superuser rights. COPY FROMalready provides a similar callback for logical replication. For COPYTO, the callback is triggered when we are ready to send a row inCopySendEndOfRow(), which is the same code path as when sending a rowto a frontend or a pipe/file.A small test module, test_copy_callbacks, is added to provide somecoverage for this facility.Author: Bilva Sanaba, Nathan BossartDiscussion:https://postgr.es/m/253C21D1-FCEB-41D9-A2AF-E6517015B7D7@amazon.com1 parent0e87dfe commit9fcdf2c
File tree
14 files changed
+175
-5
lines changed- src
- backend/commands
- include/commands
- test/modules
- test_copy_callbacks
- expected
- sql
- tools/pgindent
14 files changed
+175
-5
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
313 |
| - | |
| 313 | + | |
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
|
Lines changed: 28 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
| 54 | + | |
54 | 55 |
| |
55 | 56 |
| |
56 | 57 |
| |
| |||
85 | 86 |
| |
86 | 87 |
| |
87 | 88 |
| |
| 89 | + | |
88 | 90 |
| |
89 | 91 |
| |
90 | 92 |
| |
| |||
247 | 249 |
| |
248 | 250 |
| |
249 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
250 | 255 |
| |
251 | 256 |
| |
252 | 257 |
| |
| |||
336 | 341 |
| |
337 | 342 |
| |
338 | 343 |
| |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
339 | 355 |
| |
340 | 356 |
| |
341 | 357 |
| |
| |||
344 | 360 |
| |
345 | 361 |
| |
346 | 362 |
| |
| 363 | + | |
347 | 364 |
| |
348 | 365 |
| |
349 | 366 |
| |
350 | 367 |
| |
351 |
| - | |
| 368 | + | |
352 | 369 |
| |
353 | 370 |
| |
354 | 371 |
| |
| |||
656 | 673 |
| |
657 | 674 |
| |
658 | 675 |
| |
659 |
| - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
660 | 683 |
| |
661 | 684 |
| |
662 | 685 |
| |
| |||
765 | 788 |
| |
766 | 789 |
| |
767 | 790 |
| |
| 791 | + | |
| 792 | + | |
768 | 793 |
| |
769 | 794 |
| |
770 | 795 |
| |
771 | 796 |
| |
772 |
| - | |
| 797 | + | |
773 | 798 |
| |
774 | 799 |
| |
775 | 800 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
| |||
91 | 92 |
| |
92 | 93 |
| |
93 | 94 |
| |
94 |
| - | |
| 95 | + | |
95 | 96 |
| |
96 | 97 |
| |
97 | 98 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + |
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + |
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + |
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + |
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + |
Lines changed: 51 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + |
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3177 | 3177 |
| |
3178 | 3178 |
| |
3179 | 3179 |
| |
| 3180 | + | |
3180 | 3181 |
| |
3181 | 3182 |
| |
3182 | 3183 |
| |
|
0 commit comments
Comments
(0)