- Notifications
You must be signed in to change notification settings - Fork5k
Commite6c178b
committed
Refactor our checks for valid function and aggregate signatures.
pg_proc.c and pg_aggregate.c had near-duplicate copies of the logicto decide whether a function or aggregate's signature is legal.This seems like a bad thing even without the problem that theupcoming "anycompatible" patch would roughly double the complexityof that logic. Hence, refactor so that the rules are localizedin new subroutines supplied by parse_coerce.c. (One could quibbleabout just where to add that code, but putting it besideenforce_generic_type_consistency seems not totally unreasonable.)The fact that the rules are about to change would mandate somechanges in the wording of the associated error messages in any case.I ended up spelling things out in a fairly literal fashion in theerrdetail messages, eg "A result of type anyelement requires atleast one input of type anyelement, anyarray, anynonarray, anyenum,or anyrange." Perhaps this is overkill, but once there's more thanone subgroup of polymorphic types, people might get confused bymore-abstract messages.Discussion:https://postgr.es/m/24137.1584139352@sss.pgh.pa.us1 parentdbbb553 commite6c178b
File tree
8 files changed
+176
-122
lines changed- src
- backend
- catalog
- parser
- include/parser
- test/regress/expected
8 files changed
+176
-122
lines changedLines changed: 27 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 |
| - | |
97 |
| - | |
98 | 96 |
| |
99 | 97 |
| |
100 | 98 |
| |
| |||
103 | 101 |
| |
104 | 102 |
| |
105 | 103 |
| |
| 104 | + | |
106 | 105 |
| |
107 | 106 |
| |
108 | 107 |
| |
| |||
131 | 130 |
| |
132 | 131 |
| |
133 | 132 |
| |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 | 133 |
| |
146 | 134 |
| |
147 | 135 |
| |
148 | 136 |
| |
149 |
| - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
150 | 141 |
| |
151 | 142 |
| |
152 | 143 |
| |
153 |
| - | |
| 144 | + | |
154 | 145 |
| |
155 | 146 |
| |
156 | 147 |
| |
157 | 148 |
| |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
164 | 160 |
| |
165 | 161 |
| |
166 | 162 |
| |
| |||
492 | 488 |
| |
493 | 489 |
| |
494 | 490 |
| |
495 |
| - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
496 | 495 |
| |
497 | 496 |
| |
498 | 497 |
| |
499 |
| - | |
500 |
| - | |
| 498 | + | |
501 | 499 |
| |
502 | 500 |
| |
503 | 501 |
| |
504 | 502 |
| |
505 | 503 |
| |
506 | 504 |
| |
507 | 505 |
| |
508 |
| - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
509 | 510 |
| |
510 | 511 |
| |
511 | 512 |
| |
512 |
| - | |
| 513 | + | |
513 | 514 |
| |
514 | 515 |
| |
515 | 516 |
| |
|
Lines changed: 45 additions & 70 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
35 | 36 |
| |
36 | 37 |
| |
37 | 38 |
| |
| |||
97 | 98 |
| |
98 | 99 |
| |
99 | 100 |
| |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 | 101 |
| |
107 | 102 |
| |
108 | 103 |
| |
| |||
116 | 111 |
| |
117 | 112 |
| |
118 | 113 |
| |
| 114 | + | |
119 | 115 |
| |
120 | 116 |
| |
121 | 117 |
| |
| |||
178 | 174 |
| |
179 | 175 |
| |
180 | 176 |
| |
181 |
| - | |
182 |
| - | |
| 177 | + | |
| 178 | + | |
183 | 179 |
| |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
203 | 188 |
| |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
204 | 205 |
| |
205 | 206 |
| |
206 | 207 |
| |
| |||
210 | 211 |
| |
211 | 212 |
| |
212 | 213 |
| |
213 |
| - | |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
223 |
| - | |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
229 | 230 |
| |
230 | 231 |
| |
231 | 232 |
| |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
256 |
| - | |
257 |
| - | |
258 |
| - | |
| 233 | + | |
259 | 234 |
| |
260 | 235 |
| |
261 | 236 |
| |
|
Lines changed: 71 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1971 | 1971 |
| |
1972 | 1972 |
| |
1973 | 1973 |
| |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
1974 | 2045 |
| |
1975 | 2046 |
| |
1976 | 2047 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
83 | 90 |
| |
84 | 91 |
| |
85 | 92 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1811 | 1811 |
| |
1812 | 1812 |
| |
1813 | 1813 |
| |
1814 |
| - | |
| 1814 | + | |
1815 | 1815 |
| |
1816 | 1816 |
| |
1817 | 1817 |
| |
|
0 commit comments
Comments
(0)