forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb142068
committed
Allow CREATE FOREIGN TABLE to include SERIAL columns.
The behavior is that the required sequence is created locally, which isappropriate because the default expression will be evaluated locally.Per gripe from Brad Nicholson that this case was refused with a confusingerror message. We could have improved the error message but it seemsbetter to just allow the case.Also, remove ALTER TABLE's arbitrary prohibition against being applied toforeign tables, which was pretty inconsistent considering we allow it forviews, sequences, and other relation types that aren't even called tables.This is needed to avoid breaking pg_dump, which sometimes emits columndefaults using separate ALTER TABLE commands. (I think this can happeneven when the default is not associated with a sequence, so that was apre-existing bug once we allowed column defaults for foreign tables.)1 parenta2a480a commitb142068
File tree
4 files changed
+58
-12
lines changed- contrib/postgres_fdw
- expected
- sql
- src/backend/commands
4 files changed
+58
-12
lines changedLines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2339 | 2339 |
| |
2340 | 2340 |
| |
2341 | 2341 |
| |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + |
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
369 | 369 |
| |
370 | 370 |
| |
371 | 371 |
| |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + |
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1440 | 1440 |
| |
1441 | 1441 |
| |
1442 | 1442 |
| |
1443 |
| - | |
1444 |
| - | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1445 | 1446 |
| |
1446 | 1447 |
| |
1447 |
| - | |
| 1448 | + | |
1448 | 1449 |
| |
1449 | 1450 |
| |
1450 | 1451 |
| |
|
Lines changed: 6 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10518 | 10518 |
| |
10519 | 10519 |
| |
10520 | 10520 |
| |
10521 |
| - | |
10522 |
| - | |
10523 |
| - | |
10524 |
| - | |
10525 |
| - | |
10526 |
| - | |
10527 | 10521 |
| |
10528 | 10522 |
| |
10529 | 10523 |
| |
10530 | 10524 |
| |
10531 |
| - | |
10532 |
| - | |
10533 |
| - | |
| 10525 | + | |
| 10526 | + | |
| 10527 | + | |
| 10528 | + | |
| 10529 | + | |
| 10530 | + | |
10534 | 10531 |
| |
10535 | 10532 |
| |
10536 | 10533 |
| |
|
0 commit comments
Comments
(0)