Re: Howto change column length

From: bpalmer <bpalmer(at)crimelabs(dot)net>
To: DC <danc(at)bspmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Howto change column length
Date: 2001-11-06 16:49:41
Message-ID: Pine.BSO.4.33.0111061147140.8406-100000@mizer.crimelabs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I have a column (ie name varchar(10))
> and I want to alter it to varchar(20)
> I've looked throught the docementation and web for examples (no luck),
> can anyone help?

That can't be done. Once the datatype has been set, it can't be changed
(how would changing it from 20 to 10 work? how about from varchar to int,
etc). With the limitation of not being able to drop a column yet, you
would need to create the new table and copy all the data from one to the
other.

- Brandon

----------------------------------------------------------------------------
c: 646-456-5455 h: 201-798-4983
b. palmer, bpalmer(at)crimelabs(dot)net pgp:crimelabs.net/bpalmer.pgp5

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Nasser 2001-11-06 17:01:25 Re: functions, shell script
Previous Message Jeff Eckermann 2001-11-06 16:38:42 Re: copy command with PSQL