Re: Make length(char(n)) return 'true' length - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Make length(char(n)) return 'true' length
Date
Msg-id 13994.1075617087@sss.pgh.pa.us
Whole thread Raw
In response to Make length(char(n)) return 'true' length  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:
> The attached patch changes the existing behaviour of length(char(n)).

Applied, with some simplifications (there wasn't any particular need to
make a temporary copy of the string).

I also added some documentation stating that trailing spaces are
semantically insignificant in char(n), which I believe is now generally
true (have we missed any places?).  There didn't seem to be any place to
specifically mention length() in this connection.

Interestingly, our regression tests did not detect this change of
behavior.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.4.1 release status - Turkish Locale
Next
From: "Nicolai Tufar"
Date:
Subject: Re: 7.4.1 release status - Turkish Locale