forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit08adf68
committed
Fix sample INSTR() functions in the plpgsql documentation.
These functions are stated to be Oracle-compatible, but they weren't.Yugo Nagata noticed that while our code returns zero for a zero ornegative fourth parameter (occur_index), Oracle throws an error.Further testing by me showed that there was also a discrepancy in theinterpretation of a negative third parameter (beg_index): Oracle thinksthat a negative beg_index indicates the last place where the targetsubstring can *begin*, whereas our code thinks it is the last placewhere the target can *end*.Adjust the sample code to behave like Oracle in both these respects.Also change it to be a CDATA[] section, simplifying copying-and-pastingout of the documentation source file. And fix minor problems in theintroductory comment, which wasn't very complete or accurate.Back-patch to all supported branches. Although this patch only touchesdocumentation, we should probably call it out as a bug fix in the nextminor release notes, since users who have adopted the functions willlikely want to update their versions.Yugo Nagata and Tom LaneDiscussion:https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp1 parent7eb0187 commit08adf68
1 file changed
+38
-44
lines changedLines changed: 38 additions & 44 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5634 | 5634 |
| |
5635 | 5635 |
| |
5636 | 5636 |
| |
5637 |
| - | |
| 5637 | + | |
5638 | 5638 |
| |
5639 | 5639 |
| |
5640 |
| - | |
| 5640 | + | |
| 5641 | + | |
5641 | 5642 |
| |
5642 |
| - | |
5643 |
| - | |
5644 |
| - | |
| 5643 | + | |
| 5644 | + | |
| 5645 | + | |
| 5646 | + | |
| 5647 | + | |
| 5648 | + | |
5645 | 5649 |
| |
5646 | 5650 |
| |
5647 | 5651 |
| |
5648 |
| - | |
5649 |
| - | |
5650 | 5652 |
| |
5651 |
| - | |
5652 |
| - | |
| 5653 | + | |
5653 | 5654 |
| |
5654 | 5655 |
| |
5655 | 5656 |
| |
5656 | 5657 |
| |
5657 |
| - | |
| 5658 | + | |
| 5659 | + | |
5658 | 5660 |
| |
5659 | 5661 |
| |
5660 | 5662 |
| |
| |||
5663 | 5665 |
| |
5664 | 5666 |
| |
5665 | 5667 |
| |
5666 |
| - | |
| 5668 | + | |
5667 | 5669 |
| |
5668 |
| - | |
| 5670 | + | |
5669 | 5671 |
| |
5670 | 5672 |
| |
5671 | 5673 |
| |
5672 | 5674 |
| |
5673 | 5675 |
| |
5674 | 5676 |
| |
5675 |
| - | |
5676 |
| - | |
| 5677 | + | |
| 5678 | + | |
5677 | 5679 |
| |
5678 |
| - | |
| 5680 | + | |
5679 | 5681 |
| |
5680 |
| - | |
| 5682 | + | |
5681 | 5683 |
| |
5682 |
| - | |
5683 |
| - | |
5684 |
| - | |
| 5684 | + | |
5685 | 5685 |
| |
5686 | 5686 |
| |
5687 | 5687 |
| |
| |||
5696 | 5696 |
| |
5697 | 5697 |
| |
5698 | 5698 |
| |
5699 |
| - | |
| 5699 | + | |
5700 | 5700 |
| |
5701 | 5701 |
| |
5702 | 5702 |
| |
| |||
5708 | 5708 |
| |
5709 | 5709 |
| |
5710 | 5710 |
| |
5711 |
| - | |
5712 |
| - | |
5713 |
| - | |
| 5711 | + | |
| 5712 | + | |
| 5713 | + | |
| 5714 | + | |
5714 | 5715 |
| |
| 5716 | + | |
| 5717 | + | |
5715 | 5718 |
| |
5716 |
| - | |
5717 |
| - | |
5718 |
| - | |
5719 |
| - | |
5720 |
| - | |
5721 |
| - | |
5722 |
| - | |
5723 |
| - | |
5724 | 5719 |
| |
| 5720 | + | |
| 5721 | + | |
| 5722 | + | |
| 5723 | + | |
| 5724 | + | |
5725 | 5725 |
| |
5726 | 5726 |
| |
5727 |
| - | |
5728 |
| - | |
5729 |
| - | |
5730 |
| - | |
5731 |
| - | |
5732 |
| - | |
5733 |
| - | |
| 5727 | + | |
| 5728 | + | |
| 5729 | + | |
5734 | 5730 |
| |
5735 |
| - | |
| 5731 | + | |
5736 | 5732 |
| |
5737 |
| - | |
| 5733 | + | |
5738 | 5734 |
| |
5739 |
| - | |
5740 |
| - | |
5741 |
| - | |
| 5735 | + | |
5742 | 5736 |
| |
5743 |
| - | |
5744 | 5737 |
| |
5745 | 5738 |
| |
5746 | 5739 |
| |
| |||
5755 | 5748 |
| |
5756 | 5749 |
| |
5757 | 5750 |
| |
| 5751 | + | |
5758 | 5752 |
| |
5759 | 5753 |
| |
5760 | 5754 |
| |
|
0 commit comments
Comments
(0)