Re: Changing column question..

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: "Williams, Travis L, " NPONS <tlw(at)att(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Changing column question..
Date: 2002-12-19 23:00:28
Message-ID: 7357.1040338828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Neil Conway <neilc(at)samurai(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michelle Konzack 2002-12-19 23:55:34 How to backup a postgreSQL of 80 GByte ?
Previous Message Tom Lane 2002-12-19 22:50:09 Re: trouble caused by change in 7.3 handling of '' in