char_length()?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: char_length()?
Date: 2000-01-23 03:47:47
Message-ID: 20000123124747W.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

test=> create table t2 (c char(3));
CREATE
test=> insert into t2 values('c');
INSERT 277385 1
test=> select * from t2;
c
-----
c
(1 row)

test=> select char_length(c) from t2;
length
--------
1
(1 row)

test=> select octet_length(c) from t2;
octet_length
--------------
1
(1 row)
--
Tatsuo Ishii

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-01-23 03:48:15 Re: [HACKERS] Happy column dropping
Previous Message Bruce Momjian 2000-01-23 03:41:15 Refusing patches