Kris Jurka wrote:
>
> The JDBC driver does not trim spaces. What it does is pass
> setString() values with a type of varchar, perhaps pljava is using
> text and exposing this subtle difference:
>
> # select 'a '::char(2) = 'a '::text;
> ?column?
> ----------
> f
> (1 row)
> # select 'a '::char(2) = 'a '::varchar;
> ?column?
> ----------
> t
> (1 row)
>
I'm missing something. Both text and varchar consider the space significant:
thhal=# select length(' '::char);
length
--------
0
(1 row)
thhal=# select length(' '::varchar);
length
--------
1
(1 row)
thhal=# select length(' '::text);
length
--------
1
(1 row)
so why does it make a difference to use varchar instead of text? I.e.
why are your comparison results different? Why is the space
insignificant when using char?
Regards,
Thomas Hallgren