pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix sample INSTR() functions in the plpgsql documentation.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3c1e9fd23269849e32c73683a8457fb3095309e3

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 82 ++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/08adf688f3e9218890929b5d687078974fb8d3de

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 82 ++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1226051948e00c3fcadf82da47e9513572a1d5dc

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 82 ++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/10bcd4165aff91fd8c0e365d74e27105d3a35223

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 82 ++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/493cdc8ee503eeb2a48736a3c5c2a59d52d26838

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 86 +++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix sample INSTR() functions in the plpgsql documentation.
@ 2018-01-10 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-01-10 22:13 UTC (permalink / raw)
  To: pgsql-committers

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 or
negative fourth parameter (occur_index), Oracle throws an error.
Further testing by me showed that there was also a discrepancy in the
interpretation of a negative third parameter (beg_index): Oracle thinks
that a 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*.

Adjust the sample code to behave like Oracle in both these respects.
Also change it to be a CDATA[] section, simplifying copying-and-pasting
out of the documentation source file.  And fix minor problems in the
introductory comment, which wasn't very complete or accurate.

Back-patch to all supported branches.  Although this patch only touches
documentation, we should probably call it out as a bug fix in the next
minor release notes, since users who have adopted the functions will
likely want to update their versions.

Yugo Nagata and Tom Lane

Discussion: https://postgr.es/m/20171229191705.c0b43a8c.nagata@sraoss.co.jp

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/45bfef7fbae98a076c86e23f3b59eab81e3cb70b

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 86 +++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 44 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-01-10 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>
2018-01-10 22:13 pgsql: Fix sample INSTR() functions in the plpgsql documentation. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox