Re: [HACKERS] char_length()?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] char_length()?
Date: 2000-01-23 08:16:35
Message-ID: 20000123171635Q.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> > char_length()/octet_length() for char() datatype returns a character
> > length *except* the trailing blanks. Is this what the standard
> > expects? Oracle's length() returns 3 in the case below.
>
> AFAICT Oracle is right --- the spec just says
>
> i) If the data type of S is a character data type, then the
> result is the number of characters in the value of S.
>
> and I can't see anything there about stripping pad characters. You
> could ask for length(trim(S)) if you don't want to count blanks.

Ok, I have committed fixes for this. Maybe we should add this
incompatible changes to the release note:

char_length()/octet_length() for the char() datatype now returns a
character length (or byte length) including the trailing blanks.
--
Tatsuo Ishii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message acroyear 2000-01-23 08:17:03 Re: [HACKERS] foreign keys?
Previous Message Alfred Perlstein 2000-01-23 07:05:11 Re: pg_dump possible fix, need testers. (was: Re: [HACKERS] pg_dump disaster)