On 02/08/2016 06:00 PM, David G. Johnston wrote:
> On Monday, February 8, 2016, <dominik.kosiorek@infobright.com
> This calls for another round of "don't use char=E2=80=9D advice...
>=20
> It is not a bug but a result of the fact that trailing white space in
> char values is able to be trimmed away thus leaving you the empty strin=
g
> and no splitting.
In other words, when you insert ' ' into string1postgres.a3pattern,
which is defined as char(15), the single space is trimmed leaving an
empty string:
test=3D# select '***' || a3pattern || '!!!' from string1postgres;
?column?
----------
***!!!
(1 row)
And if you feed an actual space to split_part(), it works as expected.
test=3D# select split_part(a2,' ',a4field) from string1postgres;
split_part
------------
abcd
(1 row)
HTH,
Joe
--=20
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development