Re: [BUGS] Substring auto trim

2010-01-14 Thread Charles O'Farrell
On Thu, Jan 14, 2010 at 3:21 AM, Kevin Grittner wrote: > > I'm inclined to agree with you, but it does present a barrier to > those migrating. Are there any "migration considerations" documents > where we should mention this? Standards compliance notes in the > docs? Some form of this question

Re: [BUGS] Substring auto trim

2010-01-13 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> 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

Re: [BUGS] Substring auto trim

2010-01-13 Thread Tom Lane
"Kevin Grittner" writes: > Tom Lane 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 be

Re: [BUGS] Substring auto trim

2010-01-13 Thread Kevin Grittner
Tom Lane 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); > ?column? > -- > t > (1 row) This looks like another situation where we're running into trouble because of non-stan

Re: [BUGS] Substring auto trim

2010-01-13 Thread Tom Lane
"Charles O'Farrell" writes: > We have a column 'foo' which is of type character (not varying). > select substr(foo, 1, 10) from bar > The result of this query are values whose trailing spaces have been trimmed > automatically. This causes incorrect results when comparing to a value that > may co

Re: [BUGS] Substring auto trim

2010-01-13 Thread Pavel Stehule
2010/1/13 Pavel Stehule : > Hello > > 2010/1/13 Charles O'Farrell : >> Hi guys, >> >> I'm not sure whether this a really dumb question, but I'm curious as to what >> might be the problem. >> >> We have a column 'foo' which is of type character (not varying). >> >> select substr(foo, 1, 10) from bar

Re: [BUGS] Substring auto trim

2010-01-13 Thread Pavel Stehule
Hello 2010/1/13 Charles O'Farrell : > Hi guys, > > I'm not sure whether this a really dumb question, but I'm curious as to what > might be the problem. > > We have a column 'foo' which is of type character (not varying). > > select substr(foo, 1, 10) from bar > > The result of this query are value