Minor mistake in string functions docs - overlay

Started by Roy Tateover 11 years ago2 messagesdocs
Jump to latest
#1Roy Tate
roy.l.tate@gmail.com

I found a minor mistake in the documentation of string functions.

http://www.postgresql.org/docs/9.4/static/functions-string.html

In table 9-6 examples and results columns, look at the overlay function,
which has 4 x characters, but overlays 3 characters. Please remove an x.

overlay('T*xxxx*as' placing 'hom' from 2 for 4) Thomas

Please change the call to { *overlay('Txxxas'* ... }

Have a good day, and thanks for creating such amazing documentation.

Roy Tate

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Roy Tate (#1)
Re: Minor mistake in string functions docs - overlay

Roy Tate <roy.l.tate@gmail.com> writes:

I found a minor mistake in the documentation of string functions.
http://www.postgresql.org/docs/9.4/static/functions-string.html

In table 9-6 examples and results columns, look at the overlay function,
which has 4 x characters, but overlays 3 characters. Please remove an x.

Really? The example works as stated for me:

regression=# select overlay('Txxxxas' placing 'hom' from 2 for 4);
overlay
---------
Thomas
(1 row)

Removing an 'x' would give

regression=# select overlay('Txxxas' placing 'hom' from 2 for 4);
overlay
---------
Thoms
(1 row)

I think the example is trying to point out that the replacement string
need not be the same length as what is replaced.

regards, tom lane

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs