forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit691e8b2
committed
pageinspect: Fix types used for bt_metap() columns.
The data types that contrib/pageinspect's bt_metap() function weredeclared to return as OUT arguments were wrong in some cases. Forexample, the oldest_xact column (a TransactionId/xid field) was declaredinteger/int4 within the pageinspect extension's sql file. This led toerrors when an oldest_xact value that exceeded 2^31-1 was encountered.Some of the other columns were defined incorrectly ever sincepageinspect was first introduced, though they were far less likely toproduce problems in practice.Fix these issues by changing the declaration of bt_metap() toconsistently use data types that can reliably represent all possiblevalues. This fixes things on HEAD only. No backpatch, since it doesn'tseem like there is a safe way to fix the issue without including a newversion of the pageinspect extension (HEAD/Postgres 13 alreadyintroduced a new version of the extension). Besides, the oldest_xactissue has been around since the release of Postgres 11, and we haven'theard any complaints about it before now.Also, throw an error when we detect a bt_metap() declaration that mustbe from an old version of the pageinspect extension by examining thenumber of attributes from the tuple descriptor for the return tuples.It seems better to throw an error in a reliable and obvious wayfollowing a Postgres upgrade, rather than letting bt_metap() failunpredictably. The problem is fundamentally with the CREATE FUNCTIONdeclared data types themselves, so I see no sensible alternative.Reported-By: Victor YegorovBug: #16285Discussion:https://postgr.es/m/16285-df8fc1000ab3d5fc@postgresql.org1 parentb9c3de6 commit691e8b2
2 files changed
+29
-10
lines changedLines changed: 23 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
597 | 597 |
| |
598 | 598 |
| |
599 | 599 |
| |
| 600 | + | |
| 601 | + | |
600 | 602 |
| |
601 | 603 |
| |
602 | 604 |
| |
| |||
653 | 655 |
| |
654 | 656 |
| |
655 | 657 |
| |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
656 | 675 |
| |
657 | 676 |
| |
658 | 677 |
| |
659 |
| - | |
660 |
| - | |
661 |
| - | |
662 |
| - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
663 | 682 |
| |
664 | 683 |
| |
665 | 684 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
|
0 commit comments
Comments
(0)