Re: LIKE, CHAR(), and trailing spaces - Mailing list pgsql-hackers

From Tom Lane
Subject Re: LIKE, CHAR(), and trailing spaces
Date
Msg-id 24381.1296752879@sss.pgh.pa.us
Whole thread Raw
In response to Re: LIKE, CHAR(), and trailing spaces  (Kenneth Marshall <ktm@rice.edu>)
List pgsql-hackers
Kenneth Marshall <ktm@rice.edu> writes:
> On Wed, Feb 02, 2011 at 07:48:38PM -0500, Bruce Momjian wrote:
>>> It seems LIKE is considering the trailing CHAR(10) field spaces as
>>> significant, even though our documentations says:

> +10 for leaving the behavior as is.

Yeah, we've been around on this before if memory serves.  I don't think
there's a case for changing it that's strong enough to outweigh
backwards-compatibility considerations.

Also, anyone who does want the spaces to be stripped can just add an
explicit cast to text first:   char_variable::text LIKE ...
If we change it then we'll have to provide some other weird notation
to allow people to get at the old behavior (I suppose there are some
people out there relying on it).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: ALTER EXTENSION UPGRADE, v3
Next
From: Robert Haas
Date:
Subject: Re: ALTER EXTENSION UPGRADE, v3