forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc2fa113
committed
Close old gap in dependency checks for functions returning composite.
The dependency logic failed to register a column-level dependencywhen a view or rule contains a reference to a specific column ofthe result of a function-returning-composite. That meant you coulddrop the column from the composite type, causing trouble for futureexecutions of the view. We've known about this for years, but neversummoned the energy to actually fix it, instead installing variouslow-level defenses to prevent crashing on references to dropped columns.We had to do that to plug the hole in stable branches, where there mightbe pre-existing broken references; but let's fix the root cause today.To do that, add some logic (borrowed from get_rte_attribute_is_dropped)to find_expr_references_walker, to check whether a Var referencing anRTE_FUNCTION RTE is referencing a column of a composite type, and ifso add the proper dependency.However ... it seems mighty unwise to remove said low-level defenses,since there could be other bugs now or in the future that allowreaching them. By the same token, letting those defenses go untestedseems unwise. Hence, rather than just dropping the associated testcases, hack them to continue working by the expedient of manuallydropping the pg_depend entries that this fix installs.Back-patch into v15. I don't want to risk changing this behaviorin stable branches, but it seems not too late for v15. (Sincewe have already forced initdb for beta3, we can be sure that allproduction v15 installations will have these added dependencies.)Discussion:https://postgr.es/m/182492.1658431155@sss.pgh.pa.us1 parent00cf403 commitc2fa113
File tree
6 files changed
+267
-7
lines changed- src
- backend
- catalog
- utils/adt
- test/regress
- expected
- sql
6 files changed
+267
-7
lines changedLines changed: 68 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
| |||
205 | 206 |
| |
206 | 207 |
| |
207 | 208 |
| |
| 209 | + | |
| 210 | + | |
208 | 211 |
| |
209 | 212 |
| |
210 | 213 |
| |
| |||
1769 | 1772 |
| |
1770 | 1773 |
| |
1771 | 1774 |
| |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
1772 | 1781 |
| |
1773 | 1782 |
| |
1774 | 1783 |
| |
| |||
2343 | 2352 |
| |
2344 | 2353 |
| |
2345 | 2354 |
| |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
2346 | 2414 |
| |
2347 | 2415 |
| |
2348 | 2416 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7333 | 7333 |
| |
7334 | 7334 |
| |
7335 | 7335 |
| |
7336 |
| - | |
7337 |
| - | |
7338 |
| - | |
| 7336 | + | |
| 7337 | + | |
| 7338 | + | |
7339 | 7339 |
| |
7340 | 7340 |
| |
7341 | 7341 |
| |
|
Lines changed: 80 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1597 | 1597 |
| |
1598 | 1598 |
| |
1599 | 1599 |
| |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1600 | 1608 |
| |
1601 |
| - | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1602 | 1623 |
| |
1603 | 1624 |
| |
1604 | 1625 |
| |
| |||
1629 | 1650 |
| |
1630 | 1651 |
| |
1631 | 1652 |
| |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1632 | 1658 |
| |
1633 |
| - | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
1634 | 1673 |
| |
1635 | 1674 |
| |
1636 | 1675 |
| |
| |||
1653 | 1692 |
| |
1654 | 1693 |
| |
1655 | 1694 |
| |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1656 | 1734 |
| |
1657 | 1735 |
| |
1658 | 1736 |
| |
|
Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2247 | 2247 |
| |
2248 | 2248 |
| |
2249 | 2249 |
| |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
2250 | 2258 |
| |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
2251 | 2272 |
| |
2252 | 2273 |
| |
2253 | 2274 |
| |
2254 | 2275 |
| |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
2255 | 2294 |
| |
2256 | 2295 |
| |
2257 | 2296 |
| |
2258 | 2297 |
| |
| 2298 | + | |
2259 | 2299 |
| |
2260 | 2300 |
| |
2261 | 2301 |
| |
|
Lines changed: 43 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
575 | 575 |
| |
576 | 576 |
| |
577 | 577 |
| |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
578 | 584 |
| |
579 | 585 |
| |
580 |
| - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
581 | 596 |
| |
582 | 597 |
| |
583 | 598 |
| |
| |||
590 | 605 |
| |
591 | 606 |
| |
592 | 607 |
| |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
593 | 612 |
| |
594 | 613 |
| |
595 |
| - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
596 | 624 |
| |
597 | 625 |
| |
598 | 626 |
| |
| |||
603 | 631 |
| |
604 | 632 |
| |
605 | 633 |
| |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
606 | 647 |
| |
607 | 648 |
| |
608 | 649 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
682 | 682 |
| |
683 | 683 |
| |
684 | 684 |
| |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
685 | 692 |
| |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
686 | 703 |
| |
687 | 704 |
| |
688 | 705 |
| |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
689 | 721 |
| |
690 | 722 |
| |
| 723 | + | |
691 | 724 |
| |
692 | 725 |
| |
693 | 726 |
| |
|
0 commit comments
Comments
(0)