forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbf2efc5
committed
Further fix dumping of views that contain just VALUES(...).
It turns out that commite9f1c01 missed a case: we must print aVALUES clause in long format if get_query_def is given a resultDescthat would require the query's output column name(s) to be differentfrom what the bare VALUES clause would produce.This applies in case an ALTER ... RENAME COLUMN has been done toa view that formerly could be printed in simple format, as shownin the added regression test case. It also explains bug #16119from Dmitry Telpt, because it turns out that (unlike CREATE VIEW)CREATE MATERIALIZED VIEW fails to apply any column aliases it'sgiven to the stored ON SELECT rule. So to get them to be printed,we have to account for the resultDesc renaming. It might be worthchanging the matview code so that it creates the ON SELECT rulewith the correct aliases; but we'd still need these messy checks inget_simple_values_rte to handle the case of a subsequent columnrename, so any such change would be just neatnik-ism not a bug fix.Like the previous patch, back-patch to all supported branches.Discussion:https://postgr.es/m/16119-e64823f30a45a754@postgresql.org1 parent815bd57 commitbf2efc5
File tree
3 files changed
+38
-10
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+38
-10
lines changedLines changed: 24 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5370 | 5370 |
| |
5371 | 5371 |
| |
5372 | 5372 |
| |
5373 |
| - | |
5374 |
| - | |
| 5373 | + | |
| 5374 | + | |
| 5375 | + | |
5375 | 5376 |
| |
5376 | 5377 |
| |
5377 |
| - | |
| 5378 | + | |
5378 | 5379 |
| |
5379 | 5380 |
| |
5380 | 5381 |
| |
5381 | 5382 |
| |
5382 | 5383 |
| |
5383 |
| - | |
5384 |
| - | |
5385 |
| - | |
| 5384 | + | |
| 5385 | + | |
| 5386 | + | |
5386 | 5387 |
| |
5387 | 5388 |
| |
5388 | 5389 |
| |
| |||
5405 | 5406 |
| |
5406 | 5407 |
| |
5407 | 5408 |
| |
5408 |
| - | |
5409 |
| - | |
| 5409 | + | |
| 5410 | + | |
| 5411 | + | |
5410 | 5412 |
| |
5411 | 5413 |
| |
5412 | 5414 |
| |
5413 | 5415 |
| |
| 5416 | + | |
5414 | 5417 |
| |
5415 | 5418 |
| |
5416 | 5419 |
| |
| 5420 | + | |
5417 | 5421 |
| |
5418 | 5422 |
| |
5419 | 5423 |
| |
5420 | 5424 |
| |
| 5425 | + | |
5421 | 5426 |
| |
5422 | 5427 |
| |
5423 | 5428 |
| |
5424 |
| - | |
| 5429 | + | |
| 5430 | + | |
| 5431 | + | |
| 5432 | + | |
| 5433 | + | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
| 5438 | + | |
5425 | 5439 |
| |
5426 | 5440 |
| |
5427 | 5441 |
| |
| |||
5449 | 5463 |
| |
5450 | 5464 |
| |
5451 | 5465 |
| |
5452 |
| - | |
| 5466 | + | |
5453 | 5467 |
| |
5454 | 5468 |
| |
5455 | 5469 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3025 | 3025 |
| |
3026 | 3026 |
| |
3027 | 3027 |
| |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
3028 | 3040 |
| |
3029 | 3041 |
| |
3030 | 3042 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1047 | 1047 |
| |
1048 | 1048 |
| |
1049 | 1049 |
| |
| 1050 | + | |
| 1051 | + | |
1050 | 1052 |
| |
1051 | 1053 |
| |
1052 | 1054 |
| |
|
0 commit comments
Comments
(0)