- Notifications
You must be signed in to change notification settings - Fork28
Commit59029b6
committed
Update docs & tests to reflect that unassigned OLD/NEW are now NULL.
For a long time, plpgsql has allowed trigger functions to parsereferences to OLD and NEW even if the current trigger event type didn'tassign a value to one or the other variable; but actually executing sucha reference would fail. The v11 changes to use "expanded records" forDTYPE_REC variables changed the behavior so that the unassigned variablenow reads as a null composite value. While this behavioral change wasmore or less unintentional, it seems that leaving it like this is betterthan adding code and complexity to be bug-compatible with the old way.The change doesn't break any code that worked before, and it eliminatesa gotcha that often required extra code to work around.Hence, update the docs to say that these variables are "null" not"unassigned" when not relevant to the event type. And add a regressiontest covering the behavior, so that we'll notice if we ever break itagain.Per report from Kristjan Tammekivi.Discussion:https://postgr.es/m/CAABK7uL-uC9ZxKBXzo_68pKt7cECfNRv+c35CXZpjq6jCAzYYA@mail.gmail.com1 parenta2b22d8 commit59029b6
File tree
6 files changed
+86
-9
lines changed- doc/src/sgml
- src/pl/plpgsql/src
- expected
- sql
6 files changed
+86
-9
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3849 | 3849 |
| |
3850 | 3850 |
| |
3851 | 3851 |
| |
3852 |
| - | |
| 3852 | + | |
3853 | 3853 |
| |
3854 | 3854 |
| |
3855 | 3855 |
| |
| |||
3861 | 3861 |
| |
3862 | 3862 |
| |
3863 | 3863 |
| |
3864 |
| - | |
| 3864 | + | |
3865 | 3865 |
| |
3866 | 3866 |
| |
3867 | 3867 |
| |
|
Lines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1033 | 1033 |
| |
1034 | 1034 |
| |
1035 | 1035 |
| |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1036 | 1053 |
| |
1037 | 1054 |
| |
1038 | 1055 |
| |
| |||
2574 | 2591 |
| |
2575 | 2592 |
| |
2576 | 2593 |
| |
2577 |
| - | |
2578 | 2594 |
| |
2579 | 2595 |
| |
2580 | 2596 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
| 30 | + | |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
|
Lines changed: 36 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 | + |
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
891 | 891 |
| |
892 | 892 |
| |
893 | 893 |
| |
894 |
| - | |
895 |
| - | |
896 |
| - | |
897 |
| - | |
898 |
| - | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
899 | 900 |
| |
900 | 901 |
| |
901 | 902 |
| |
|
Lines changed: 24 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 | + |
0 commit comments
Comments
(0)