forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3422955
committed
Consider only relations part of partition trees in partition functions
This changes the partition functions so as tables and indexes which arenot part of partition trees are handled the same way as what is done forundefined objects and unsupported relkinds: pg_partition_tree() returnsno rows and pg_partition_root() returns a NULL result. Hence,partitioned tables, partitioned indexes and relations whose flagpg_class.relispartition is set are considered as valid objects toprocess.Previously, tables and indexes not included in a partition tree wereprocessed the same way as a partition or a partitioned table, whichcaused the functions to return inconsistent results for inheritedtables, especially when inheriting from multiple tables.Reported-by: Álvaro HerreraAuthor: Amit Langote, Michael PaquierReviewed-by: Tom LaneDiscussion:https://postgr.es/m/20190228193203.GA26151@alvherre.pgsql1 parent70b9bda commit3422955
File tree
3 files changed
+55
-23
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+55
-23
lines changedLines changed: 3 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| 45 | + | |
44 | 46 |
| |
45 | 47 |
| |
46 |
| - | |
47 |
| - | |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 | 192 |
| |
200 | 193 |
| |
201 | 194 |
| |
|
Lines changed: 37 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 |
| |
37 | 40 |
| |
38 | 41 |
| |
| |||
45 | 48 |
| |
46 | 49 |
| |
47 | 50 |
| |
| 51 | + | |
| 52 | + | |
48 | 53 |
| |
49 | 54 |
| |
50 | 55 |
| |
| |||
54 | 59 |
| |
55 | 60 |
| |
56 | 61 |
| |
| 62 | + | |
57 | 63 |
| |
58 | 64 |
| |
59 |
| - | |
| 65 | + | |
60 | 66 |
| |
61 | 67 |
| |
62 | 68 |
| |
| |||
77 | 83 |
| |
78 | 84 |
| |
79 | 85 |
| |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 |
| |
81 | 96 |
| |
82 | 97 |
| |
| |||
87 | 102 |
| |
88 | 103 |
| |
89 | 104 |
| |
| 105 | + | |
90 | 106 |
| |
91 | 107 |
| |
92 |
| - | |
| 108 | + | |
93 | 109 |
| |
94 | 110 |
| |
95 | 111 |
| |
| |||
100 | 116 |
| |
101 | 117 |
| |
102 | 118 |
| |
| 119 | + | |
103 | 120 |
| |
104 | 121 |
| |
105 |
| - | |
| 122 | + | |
106 | 123 |
| |
107 | 124 |
| |
108 | 125 |
| |
| |||
123 | 140 |
| |
124 | 141 |
| |
125 | 142 |
| |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
126 | 152 |
| |
127 | 153 |
| |
128 | 154 |
| |
| |||
133 | 159 |
| |
134 | 160 |
| |
135 | 161 |
| |
| 162 | + | |
136 | 163 |
| |
137 | 164 |
| |
138 |
| - | |
| 165 | + | |
139 | 166 |
| |
140 | 167 |
| |
141 |
| - | |
| 168 | + | |
142 | 169 |
| |
143 | 170 |
| |
144 | 171 |
| |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
149 | 175 |
| |
150 | 176 |
| |
151 | 177 |
| |
152 | 178 |
| |
153 |
| - | |
| 179 | + | |
154 | 180 |
| |
155 | 181 |
| |
156 | 182 |
| |
|
Lines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 |
| |
20 | 23 |
| |
21 | 24 |
| |
| |||
29 | 32 |
| |
30 | 33 |
| |
31 | 34 |
| |
| 35 | + | |
| 36 | + | |
32 | 37 |
| |
33 | 38 |
| |
34 | 39 |
| |
| |||
41 | 46 |
| |
42 | 47 |
| |
43 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 |
| |
45 | 54 |
| |
46 | 55 |
| |
| |||
57 | 66 |
| |
58 | 67 |
| |
59 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
60 | 73 |
| |
61 | 74 |
| |
62 | 75 |
| |
63 | 76 |
| |
64 | 77 |
| |
65 | 78 |
| |
66 | 79 |
| |
67 |
| - | |
| 80 | + | |
68 | 81 |
| |
69 | 82 |
| |
70 | 83 |
| |
|
0 commit comments
Comments
(0)