- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit35c8dd9
committed
Simplify some logic around setting pg_attribute.atthasdef.
DefineRelation was of the opinion that it could usefully pre-fillatthasdef flags to eliminate work for StoreAttrDefault. This is notthe case, however: the tupledesc that it's filling is not the one thatInsertPgAttributeTuples will work from. The tupledesc used there ismade by RelationBuildLocalRelation, which deliberately doesn't copyatthasdef. Moreover, if this did happen as the code thinks, it wouldbe wrong for the case of plain "DEFAULT NULL" clauses, since we detectand ignore simple-null-Const defaults later on. Hence, remove theuseless code.It also emerges that it's not really worth a special-case path inStoreAttrDefault() for atthasdef already being set, because as far aswe can see that never happens: cases where an existing default getsupdated always do RemoveAttrDefault first, so as to clean uppossibly-no-longer-correct dependency entries. If it were the casethe code would still work, anyway.Also remove a nearby comment made moot by5eaa0e9.Author: jian he <jian.universality@gmail.com>Discussion:https://postgr.es/m/CACJufxHFssPvkP1we7WMhPD_1kwgbG52o=kQgL+TnVoX5LOyCQ@mail.gmail.com1 parent4528768 commit35c8dd9
2 files changed
+10
-24
lines changedLines changed: 9 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 |
| |
47 | 50 |
| |
48 | 51 |
| |
| |||
92 | 95 |
| |
93 | 96 |
| |
94 | 97 |
| |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 | 98 |
| |
101 |
| - | |
102 |
| - | |
| 99 | + | |
| 100 | + | |
103 | 101 |
| |
104 |
| - | |
105 |
| - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
106 | 106 |
| |
107 |
| - | |
108 |
| - | |
109 | 107 |
| |
110 | 108 |
| |
111 | 109 |
| |
|
Lines changed: 1 addition & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
941 | 941 |
| |
942 | 942 |
| |
943 | 943 |
| |
944 |
| - | |
945 |
| - | |
946 |
| - | |
947 |
| - | |
948 | 944 |
| |
949 | 945 |
| |
950 | 946 |
| |
| |||
953 | 949 |
| |
954 | 950 |
| |
955 | 951 |
| |
956 |
| - | |
957 | 952 |
| |
958 | 953 |
| |
959 |
| - | |
960 |
| - | |
961 | 954 |
| |
962 | 955 |
| |
963 | 956 |
| |
| |||
969 | 962 |
| |
970 | 963 |
| |
971 | 964 |
| |
972 |
| - | |
973 | 965 |
| |
974 | 966 |
| |
975 | 967 |
| |
| |||
987 | 979 |
| |
988 | 980 |
| |
989 | 981 |
| |
990 |
| - | |
991 | 982 |
| |
992 |
| - | |
993 |
| - | |
994 | 983 |
| |
995 | 984 |
| |
996 | 985 |
| |
| |||
7363 | 7352 |
| |
7364 | 7353 |
| |
7365 | 7354 |
| |
7366 |
| - | |
7367 |
| - | |
| 7355 | + | |
7368 | 7356 |
| |
7369 | 7357 |
| |
7370 | 7358 |
| |
|
0 commit comments
Comments
(0)