Re: Changing column question.. - Mailing list pgsql-general

From Tom Lane
Subject Re: Changing column question..
Date
Msg-id 7357.1040338828@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing column question..  (Neil Conway <neilc@samurai.com>)
List pgsql-general
Neil Conway <neilc@samurai.com> writes:
> On Thu, 2002-12-19 at 16:07, Williams, Travis L, NPONS wrote:
>> I want it to insert everything up to 20 chars then drop the rest..

> Then call substring() on the value you're inserting to chop it down to
> 20 chars or less.

Or do an explicit cast.  'foobar'::varchar(3) produces 'foo' (in 7.3
anyway), whereas assigning 'foobar' directly to a varchar(3) column
produces an error.  Yeah, it's a little weird, but by my reading of
the SQL spec, that's the spec-mandated behavior.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: trouble caused by change in 7.3 handling of '' in
Next
From: "Ian Harding"
Date:
Subject: Re: trouble caused by change in 7.3 handling of ''