- Notifications
You must be signed in to change notification settings - Fork5
Commit917bbeb
committed
Apply a simple solution to the problem of making INSERT/UPDATE/DELETE
RETURNING play nice with views/rules. To wit, have the rule rewriterrewrite any RETURNING clause found in a rule to produce what the rule'striggering query asked for in its RETURNING clause, in particular dropthe RETURNING clause if no RETURNING in the triggering query. Thisleaves the responsibility for knowing how to produce the view's outputcolumns on the rule author, without requiring any fundamental changesin rule semantics such as adding new rule event types would do. Theinitial implementation constrains things to ensure that there isexactly one, unconditionally invoked RETURNING clause among the rulesfor an event --- later we might be able to relax that, but for a postfeature freeze fix it seems better to minimize how much invention we do.Per gripe from Jaime Casanova.1 parent74924d2 commit917bbeb
File tree
6 files changed
+496
-92
lines changed- doc/src/sgml
- ref
- src
- backend/rewrite
- test/regress
- expected
- sql
6 files changed
+496
-92
lines changedLines changed: 24 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 |
| |
75 | 77 |
| |
76 | 78 |
| |
| |||
87 | 89 |
| |
88 | 90 |
| |
89 | 91 |
| |
90 |
| - | |
| 92 | + | |
| 93 | + | |
91 | 94 |
| |
92 | 95 |
| |
93 | 96 |
| |
| |||
201 | 204 |
| |
202 | 205 |
| |
203 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
204 | 224 |
| |
205 | 225 |
| |
206 | 226 |
| |
207 | 227 |
| |
208 | 228 |
| |
209 | 229 |
| |
210 |
| - | |
| 230 | + | |
211 | 231 |
| |
212 | 232 |
| |
213 | 233 |
| |
|
Lines changed: 36 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
873 | 873 |
| |
874 | 874 |
| |
875 | 875 |
| |
876 |
| - | |
| 876 | + | |
877 | 877 |
| |
878 | 878 |
| |
879 | 879 |
| |
| |||
920 | 920 |
| |
921 | 921 |
| |
922 | 922 |
| |
923 |
| - | |
| 923 | + | |
| 924 | + | |
924 | 925 |
| |
925 | 926 |
| |
926 | 927 |
| |
| |||
932 | 933 |
| |
933 | 934 |
| |
934 | 935 |
| |
935 |
| - | |
| 936 | + | |
936 | 937 |
| |
937 | 938 |
| |
938 | 939 |
| |
939 | 940 |
| |
940 |
| - | |
941 |
| - | |
942 |
| - | |
943 |
| - | |
944 |
| - | |
945 |
| - | |
946 |
| - | |
947 |
| - | |
948 |
| - | |
949 |
| - | |
950 |
| - | |
| 941 | + | |
| 942 | + | |
951 | 943 |
| |
952 | 944 |
| |
953 | 945 |
| |
| |||
1283 | 1275 |
| |
1284 | 1276 |
| |
1285 | 1277 |
| |
1286 |
| - | |
| 1278 | + | |
1287 | 1279 |
| |
1288 | 1280 |
| |
1289 | 1281 |
| |
| |||
1338 | 1330 |
| |
1339 | 1331 |
| |
1340 | 1332 |
| |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1341 | 1361 |
| |
1342 | 1362 |
| |
1343 | 1363 |
| |
|
0 commit comments
Comments
(0)