Re: 7.2 changes to varchar truncation - Mailing list pgsql-general

From Ian Harding
Subject Re: 7.2 changes to varchar truncation
Date
Msg-id sc397ea3.010@mail.tpchd.org
Whole thread Raw
In response to 7.2 changes to varchar truncation  ("Jeffrey W. Baker" <jwbaker@acm.org>)
Responses Re: 7.2 changes to varchar truncation  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
This brings up an interesting question, is there a reason to specify n?  In other words, what is the downside of
VARCHARcompared to VARCHAR(n)?  I will have the same problem soon, so I may change all of mine to plain old VARCHAR now
ifit makes sense... 

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org

>>> "Jeffrey W. Baker" <jwbaker@acm.org> 12/31/01 02:04PM >>>
Given a column of type varchar(n), postgres 7.1 allowed me to insert a
string s of length m where m > n by truncating s.  In 7.2, I get an error:
ERROR:  value too long for type character varying(64).  This is annoying
and breaks practically all of my programs.  The fact that this is
mentioned in the docs doesn't make this suck less.

What do I do to get back the old behavior?

If I have to change my datatypes to text or varchar without a limit, I'll
have to drop and reload my databases (again), about which I plan to have a
real bad attitude.

 -jwb


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-general by date:

Previous
From: "Aniket Kulkarni"
Date:
Subject: Integrating ADSM
Next
From: Marc Munro
Date:
Subject: Question about rules and permissions