substring wrong example in manual

Started by Thomas T. Thaialmost 25 years ago2 messagesgeneral
Jump to latest
#1Thomas T. Thai
tom@minnesota.com

RE: http://www.postgresql.org/idocs/index.php?functions-string.html

In Table 4-6. SQL String Functions and Operators

FUNCTION RETURN TYPE DESC
...
substring( text extract
string substring
[from integer]
[for integer])

EXAMPLE RESULT
substring('Thomas' oma
from 2 for 3)
...

The result should be 'hom' instead of 'oma':

1 2 3 4 5 6
T h o m a s
from 1 2
^-------^
for 1 2 3

#2Bruce Momjian
bruce@momjian.us
In reply to: Thomas T. Thai (#1)
Re: substring wrong example in manual

RE: http://www.postgresql.org/idocs/index.php?functions-string.html

In Table 4-6. SQL String Functions and Operators

FUNCTION RETURN TYPE DESC
...
substring( text extract
string substring
[from integer]
[for integer])

EXAMPLE RESULT
substring('Thomas' oma
from 2 for 3)
...

The result should be 'hom' instead of 'oma':

1 2 3 4 5 6
T h o m a s
from 1 2
^-------^
for 1 2 3

Confirmed:

test=> select substring('Thomas' from 2 for 3);
substring
-----------
hom
(1 row)

Patch applied. Thanks.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/bjm/difftext/plainDownload+2-2