Re: ALTER TABLE

From: Scott Marlowe <scott(dot)marlowe(at)ihs(dot)com>
To: Erwin Ambrosch <ambre(at)ebutec(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: ALTER TABLE
Date: 2002-06-04 15:28:48
Message-ID: Pine.LNX.4.33.0206040923280.29507-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can't change it in place safely.

But you can use select into syntax with an explicit cast like so:

select field1::varchar(64) into newtable from oldtable

On Mon, 3 Jun 2002, Erwin Ambrosch wrote:

> Hi,
>
> I want to change the type of a column from VARCHAR(32) to VARCHAR(64) without
> dropping and recreating the table. Can one give me a hint how I can do this.
>
> Thanks Erwin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

  • ALTER TABLE at 2002-06-03 11:37:16 from Erwin Ambrosch

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2002-06-04 15:59:47 return true / false instead of int4 value
Previous Message Jan Wieck 2002-06-04 14:16:10 Re: ctid & updates