Fix a Oracle-compatible instr function in the documentation

2017-12-29 Thread Yugo Nagata
Hi, Attached is a patch to fix a very trivial issue of the documentation. The documentation of PL/pgSQL provides sample codes of Oracle-compatible instr functions. However, the behaviour is a little differet. Oracle's instr raises an error when the forth argument value is less than zero, but the

Fix a Oracle-compatible instr function in the documentation

2017-12-29 Thread Yugo Nagata
Hi, Attached is a patch to fix a very trivial issue of the documentation. The documentation of PL/pgSQL provides sample codes of Oracle-compatible instr functions. However, the behaviour is a little differet. Oracle's instr raises an error when the forth argument value is less than zero, but the

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-10 Thread Tom Lane
I wrote: > Evidently, they consider that negative beg_index indicates > the last place where the target substring can *begin*, whereas > our code thinks it is the last place where the target can *end*. > After a bit of fooling around with it, I produced code that agrees > with Oracle as far as I c

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-10 Thread Tatsuo Ishii
> I spent some more time comparing this version's behavior with > rextester's Oracle instance, and couldn't find any other > discrepancies, so I pushed it. Great! I agree with your commit message: > Back-patch to all supported branches. Although this patch only touches > documentation, we shoul

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-29 Thread Tatsuo Ishii
> Hi, > > Attached is a patch to fix a very trivial issue of the documentation. > > The documentation of PL/pgSQL provides sample codes of Oracle-compatible > instr functions. However, the behaviour is a little differet. > Oracle's instr raises an error when the forth argument value is less than

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Tatsuo Ishii
>> Hi, >> >> Attached is a patch to fix a very trivial issue of the documentation. >> >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible >> instr functions. However, the behaviour is a little differet. >> Oracle's instr raises an error when the forth argument value is les

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Yugo Nagata
On Sun, 31 Dec 2017 17:52:49 +0900 (JST) Tatsuo Ishii wrote: > >> Hi, > >> > >> Attached is a patch to fix a very trivial issue of the documentation. > >> > >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible > >> instr functions. However, the behaviour is a little diffe

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Tatsuo Ishii
> The documentation of PL/pgSQL provides sample codes of Oracle-compatible > instr functions. However, the behaviour is a little differet. > Oracle's instr raises an error when the forth argument value is less than > zero, but the sample code returns zero. This patch fixes this. Your patch fixes o

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-06 Thread Tom Lane
Tatsuo Ishii writes: >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible >> instr functions. However, the behaviour is a little differet. >> Oracle's instr raises an error when the forth argument value is less than >> zero, but the sample code returns zero. This patch fixes

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-06 Thread Tom Lane
Tatsuo Ishii writes: >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible >> instr functions. However, the behaviour is a little differet. >> Oracle's instr raises an error when the forth argument value is less than >> zero, but the sample code returns zero. This patch fixes

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-10 Thread Tom Lane
I wrote: > Evidently, they consider that negative beg_index indicates > the last place where the target substring can *begin*, whereas > our code thinks it is the last place where the target can *end*. > After a bit of fooling around with it, I produced code that agrees > with Oracle as far as I c

Re: Fix a Oracle-compatible instr function in the documentation

2018-01-10 Thread Tatsuo Ishii
> I spent some more time comparing this version's behavior with > rextester's Oracle instance, and couldn't find any other > discrepancies, so I pushed it. Great! I agree with your commit message: > Back-patch to all supported branches. Although this patch only touches > documentation, we shoul

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-29 Thread Tatsuo Ishii
> Hi, > > Attached is a patch to fix a very trivial issue of the documentation. > > The documentation of PL/pgSQL provides sample codes of Oracle-compatible > instr functions. However, the behaviour is a little differet. > Oracle's instr raises an error when the forth argument value is less than

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Tatsuo Ishii
>> Hi, >> >> Attached is a patch to fix a very trivial issue of the documentation. >> >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible >> instr functions. However, the behaviour is a little differet. >> Oracle's instr raises an error when the forth argument value is les

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Yugo Nagata
On Sun, 31 Dec 2017 17:52:49 +0900 (JST) Tatsuo Ishii wrote: > >> Hi, > >> > >> Attached is a patch to fix a very trivial issue of the documentation. > >> > >> The documentation of PL/pgSQL provides sample codes of Oracle-compatible > >> instr functions. However, the behaviour is a little diffe

Re: Fix a Oracle-compatible instr function in the documentation

2017-12-31 Thread Tatsuo Ishii
> The documentation of PL/pgSQL provides sample codes of Oracle-compatible > instr functions. However, the behaviour is a little differet. > Oracle's instr raises an error when the forth argument value is less than > zero, but the sample code returns zero. This patch fixes this. Your patch fixes o