Skip site navigation (1) Skip section navigation (2)

Re: 7.2 changes to varchar truncation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jeffrey W(dot) Baker" <jwbaker(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 7.2 changes to varchar truncation
Date: 2001-12-31 22:23:09
Message-ID: 14517.1009837389@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
"Jeffrey W. Baker" <jwbaker(at)acm(dot)org> writes:
> What do I do to get back the old behavior?

You don't.  Unfortunately, SQL92 specifies the new behavior.

You might think about declaring the columns plain text and using
triggers to do the truncation, if you really want truncation to a
length limit.

> 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.

Consider hacking pg_attribute.atttypmod or pg_attribute.atttypid, if the
reload time is too daunting.  (However, if you failed to reload your
data because of this error, it seems like you aren't in position to
avoid a reload anyway...)

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: Thomas LockhartDate: 2002-01-01 01:49:56
Subject: Re: 7.2 changes to varchar truncation
Previous:From: Tom LaneDate: 2001-12-31 22:14:06
Subject: Re: Large Tables/clustering/terrible performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group