Received: from femail11.sdc1.sfba.home.com (femail11.sdc1.sfba.home.com [24.0.95.107]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4K1QBA66190 for ; Sat, 19 May 2001 21:26:11 -0400 (EDT) (envelope-from jconway2@home.com) Received: from jecw2k1 ([24.0.42.111]) by femail11.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20010520012607.HAFT22926.femail11.sdc1.sfba.home.com@jecw2k1>; Sat, 19 May 2001 18:26:07 -0700 Message-ID: <020d01c0e0cb$d8c0a2a0$0205a8c0@jecw2k1> From: "Joe Conway" To: "Peter Eisentraut" , References: Subject: Re: Truncation of char, varchar, bit, varbit types (fwd) Date: Sat, 19 May 2001 18:26:07 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200105/213 X-Sequence-Number: 3030 > Implementation proposal as information for the user community. Speak now > or... FWIW . . . > insert into test values ('not ok'); > ERROR: value too long for type character varying(4) /* * MSSQL 7 */ create table test (a varchar(4)); The command(s) completed successfully. insert into test values ('not ok'); Server: Msg 8152, Level 16, State 9, Line 1 String or binary data would be truncated. The statement has been terminated. /* * Oracle 8.1.6 */ SQL> create table test (a varchar(4)); Table created. SQL> insert into test values ('not ok'); insert into test values ('not ok') * ERROR at line 1: ORA-01401: inserted value too large for column > insert into test values ('good '); > [truncates spaces that are too long] /* * MSSQL 7 */ insert into test values ('good '); (1 row(s) affected) select datalength(a) from test; ----------- 4 (1 row(s) affected) /* * Oracle 8.1.6 */ SQL> insert into test values ('good '); insert into test values ('good ') * ERROR at line 1: ORA-01401: inserted value too large for column > > I think this behaviour is desirable over the old one because it makes the > char and varchar types useful in the first place. I agree with your assessment. There are implications for people porting Oracle applications however. Regards, -- Joe