forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit967a7b0
committed
Avoid reporting "cache lookup failed" for some user-reachable cases.
We have a not-terribly-thoroughly-enforced-yet project policy that internalerrors with SQLSTATE XX000 (ie, plain elog) should not be triggerable fromSQL. record_in, domain_in, and PL validator functions all failed to meetthis standard, because they threw plain elog("cache lookup failed for XXX")errors on bad OIDs, and those are all invokable from SQL.For record_in, the best fix is to upgrade typcache.c (lookup_type_cache)to throw a user-facing error for this case. That seems consistent becauseit was more than halfway there already, having user-facing errors for shelltypes and non-composite types. Having done that, tweak domain_in to relyon the typcache to throw an appropriate error. (This costs little becauseInitDomainConstraintRef would fetch the typcache entry anyway.)For the PL validator functions, we already have a single choke point atCheckFunctionValidatorAccess, so just fix its error to be user-facing.Dilip Kumar, reviewed by Haribabu KommiDiscussion: <87wpxfygg9.fsf@credativ.de>1 parentec253de commit967a7b0
3 files changed
+31
-11
lines changedLines changed: 13 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| 75 | + | |
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
78 | 79 |
| |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 |
| |
84 | 89 |
| |
85 | 90 |
| |
86 | 91 |
| |
87 | 92 |
| |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
88 | 97 |
| |
89 | 98 |
| |
90 | 99 |
| |
|
Lines changed: 11 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
185 |
| - | |
| 185 | + | |
186 | 186 |
| |
187 |
| - | |
188 |
| - | |
| 187 | + | |
| 188 | + | |
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 |
| - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
228 | 230 |
| |
229 | 231 |
| |
230 | 232 |
| |
231 | 233 |
| |
232 | 234 |
| |
233 | 235 |
| |
234 |
| - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
235 | 239 |
| |
236 | 240 |
| |
237 | 241 |
| |
| |||
1230 | 1234 |
| |
1231 | 1235 |
| |
1232 | 1236 |
| |
| 1237 | + | |
| 1238 | + | |
1233 | 1239 |
| |
1234 | 1240 |
| |
1235 | 1241 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2455 | 2455 |
| |
2456 | 2456 |
| |
2457 | 2457 |
| |
2458 |
| - | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
2459 | 2462 |
| |
2460 | 2463 |
| |
2461 |
| - | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
2462 | 2467 |
| |
2463 | 2468 |
| |
2464 | 2469 |
| |
|
0 commit comments
Comments
(0)