Re: [HACKERS] char_length()?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] char_length()?
Date: 2000-01-23 04:16:17
Message-ID: 4741.948600977@sss.pgh.pa.us
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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2000-01-23 04:23:16 Re: [HACKERS] Happy column dropping
Previous Message Tom Lane 2000-01-23 03:49:42 Re: [HACKERS] Happy column dropping