Re: Make length(char(n)) return 'true' length

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Make length(char(n)) return 'true' length
Date: 2004-02-01 06:31:27
Message-ID: 13994.1075617087@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry <swm(at)linuxworld(dot)com(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nicolai Tufar 2004-02-01 07:56:29 Re: 7.4.1 release status - Turkish Locale
Previous Message Tom Lane 2004-02-01 04:23:04 Re: 7.4.1 release status - Turkish Locale