- Notifications
You must be signed in to change notification settings - Fork5
Commitcb1ca4d
committed
Allow foreign tables to participate in inheritance.
Foreign tables can now be inheritance children, or parents. Much of thesystem was already ready for this, but we had to fix a few things ofcourse, mostly in the area of planner and executor handling of row locks.As side effects of this, allow foreign tables to have NOT VALID CHECKconstraints (and hence to accept ALTER ... VALIDATE CONSTRAINT), and toaccept ALTER SET STORAGE and ALTER SET WITH/WITHOUT OIDS. Continuing todisallow these things would've required bizarre and inconsistent specialcases in inheritance behavior. Since foreign tables don't enforce CHECKconstraints anyway, a NOT VALID one is a complete no-op, but that doesn'tmean we shouldn't allow it. And it's possible that some FDWs might haveuse for SET STORAGE or SET WITH OIDS, though doubtless they will be no-opsfor most.An additional change in support of this is that when a ModifyTable nodehas multiple target tables, they will all now be explicitly identifiedin EXPLAIN output, for example: Update on pt1 (cost=0.00..321.05 rows=3541 width=46) Update on pt1 Foreign Update on ft1 Foreign Update on ft2 Update on child3 -> Seq Scan on pt1 (cost=0.00..0.00 rows=1 width=46) -> Foreign Scan on ft1 (cost=100.00..148.03 rows=1170 width=46) -> Foreign Scan on ft2 (cost=100.00..148.03 rows=1170 width=46) -> Seq Scan on child3 (cost=0.00..25.00 rows=1200 width=46)This was done mainly to provide an unambiguous place to attach "Remote SQL"fields, but it is useful for inherited updates even when no foreign tablesare involved.Shigeru Hanada and Etsuro Fujita, reviewed by Ashutosh Bapat and KyotaroHoriguchi, some additional hacking by me1 parent8ac356c commitcb1ca4d
File tree
29 files changed
+1761
-185
lines changed- contrib
- file_fdw
- input
- output
- postgres_fdw
- expected
- sql
- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- executor
- optimizer
- plan
- prep
- parser
- bin/pg_dump
- include
- nodes
- optimizer
- test/regress
- expected
- sql
29 files changed
+1761
-185
lines changedLines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
136 |
| - | |
| 136 | + | |
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
| |||
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
151 | 165 |
| |
152 | 166 |
| |
153 | 167 |
| |
|
Lines changed: 41 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
212 | 212 |
| |
213 | 213 |
| |
214 | 214 |
| |
215 |
| - | |
| 215 | + | |
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
252 | 292 |
| |
253 | 293 |
| |
254 | 294 |
| |
|
0 commit comments
Comments
(0)