Re: Substring auto trim - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Substring auto trim
Date
Msg-id 14774.1263402847@sss.pgh.pa.us
Whole thread Raw
In response to Re: Substring auto trim  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Substring auto trim  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> What's the data type of the value being compared to?  I get, for
>> instance,
>>
>> postgres=# select substr('ab  '::char(4), 1, 4) = 'ab  '::char(4);

> This looks like another situation where we're running into trouble
> because of non-standard behavior when people might be expecting
> something consistent with other products and the explicit language
> in the standard.

If we were to change that so that 'ab  ' were implicitly typed as
char(4), then we'd start getting bug reports from people complaining
that "select 'ab' = 'ab  '" yields true.  I remain of the opinion that
char(n) is so hopelessly brain-damaged that we should be very careful
to NOT bring it into our mainstream behavior.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5269: postgres backend terminates with SIGSEGV
Next
From: "Kevin Grittner"
Date:
Subject: Re: Substring auto trim