Commit c7b7311
committed
Avoid doing catalog lookups in postgres_fdw's conversion_error_callback.
As in 50371df, this is a bad idea since the callback can't really
know what error is being thrown and thus whether or not it is safe
to attempt catalog accesses. Rather than pushing said accesses into
the mainline code where they'd usually be a waste of cycles, we can
look at the query's rangetable instead.
This change does mean that we'll be printing query aliases (if any
were used) rather than the table or column's true name. But that
doesn't seem like a bad thing: it's certainly a more useful definition
in self-join cases, for instance. In any case, it seems unlikely that
any applications would be depending on this detail, so it seems safe
to change.
Patch by me. Original complaint by Andres Freund; Bharath Rupireddy
noted the connection to conversion_error_callback.
Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de1 parent ab2e199 commit c7b7311
File tree
3 files changed
+49
-51
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+49
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4096 | 4096 | | |
4097 | 4097 | | |
4098 | 4098 | | |
4099 | | - | |
| 4099 | + | |
4100 | 4100 | | |
4101 | | - | |
4102 | | - | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
4103 | 4104 | | |
4104 | | - | |
4105 | | - | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
4106 | 4108 | | |
4107 | | - | |
| 4109 | + | |
4108 | 4110 | | |
4109 | 4111 | | |
4110 | 4112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | 305 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 306 | + | |
315 | 307 | | |
316 | 308 | | |
317 | 309 | | |
| |||
7082 | 7074 | | |
7083 | 7075 | | |
7084 | 7076 | | |
7085 | | - | |
7086 | 7077 | | |
7087 | 7078 | | |
7088 | 7079 | | |
| |||
7185 | 7176 | | |
7186 | 7177 | | |
7187 | 7178 | | |
| 7179 | + | |
| 7180 | + | |
| 7181 | + | |
| 7182 | + | |
7188 | 7183 | | |
7189 | 7184 | | |
7190 | 7185 | | |
7191 | 7186 | | |
| 7187 | + | |
| 7188 | + | |
| 7189 | + | |
| 7190 | + | |
| 7191 | + | |
7192 | 7192 | | |
7193 | 7193 | | |
7194 | 7194 | | |
7195 | | - | |
7196 | 7195 | | |
7197 | | - | |
| 7196 | + | |
7198 | 7197 | | |
7199 | 7198 | | |
7200 | | - | |
7201 | | - | |
7202 | | - | |
7203 | | - | |
7204 | | - | |
7205 | | - | |
7206 | | - | |
7207 | | - | |
7208 | | - | |
| 7199 | + | |
| 7200 | + | |
7209 | 7201 | | |
7210 | 7202 | | |
7211 | 7203 | | |
7212 | 7204 | | |
7213 | | - | |
7214 | | - | |
7215 | | - | |
7216 | 7205 | | |
7217 | 7206 | | |
7218 | 7207 | | |
7219 | 7208 | | |
7220 | 7209 | | |
7221 | 7210 | | |
7222 | 7211 | | |
7223 | | - | |
| 7212 | + | |
7224 | 7213 | | |
7225 | 7214 | | |
7226 | 7215 | | |
7227 | 7216 | | |
7228 | | - | |
7229 | 7217 | | |
7230 | 7218 | | |
7231 | | - | |
7232 | | - | |
7233 | | - | |
7234 | | - | |
7235 | | - | |
7236 | | - | |
7237 | | - | |
7238 | | - | |
| 7219 | + | |
| 7220 | + | |
7239 | 7221 | | |
7240 | | - | |
7241 | | - | |
7242 | | - | |
7243 | 7222 | | |
7244 | 7223 | | |
7245 | | - | |
| 7224 | + | |
7246 | 7225 | | |
7247 | | - | |
7248 | | - | |
7249 | | - | |
7250 | | - | |
| 7226 | + | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
| 7235 | + | |
| 7236 | + | |
7251 | 7237 | | |
| 7238 | + | |
| 7239 | + | |
| 7240 | + | |
| 7241 | + | |
| 7242 | + | |
| 7243 | + | |
| 7244 | + | |
| 7245 | + | |
7252 | 7246 | | |
7253 | 7247 | | |
7254 | 7248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1135 | 1137 | | |
1136 | 1138 | | |
1137 | 1139 | | |
| |||
0 commit comments