From: | Frank Bax <fbax(at)sympatico(dot)ca> |
---|---|
To: | David A Dickson <david(dot)dickson(at)mail(dot)mcgill(dot)ca> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Change size of varchar(20) field |
Date: | 2002-02-04 17:46:49 |
Message-ID: | 3.0.6.32.20020204124649.007bd210@pop6.sympatico.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You can either:
a) create table unittemp as select field1, field2, cast(room as
varchar(20)), ..., fieldn from unit;
drop table unit;
alter table unittemp rename to unit;
b) pg_dump -t unit [dbname] > unit.pgsql
edit unit.pgsql and change varchar(20) to varchar(40) and add a line to
beginning of file "drop table unit"
pgsql [dbname] < unit.pgsql
Frank
At 12:03 PM 2/4/02 -0500, David A Dickson wrote:
>I have a tabl called 'unit' with a field 'room' of type character
>varying(20). I want to change the type to character varying(40).
>How do I do this without affecting any data in the table.
>
>Thanksâ
>
>--
>David A Dickson
>david(dot)dickson(at)mail(dot)mcgill(dot)ca
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Allan Engelhardt | 2002-02-04 19:00:23 | Surprise AT TIME ZONE behaviour (buglet?)? |
Previous Message | David A Dickson | 2002-02-04 17:03:36 | Change size of varchar(20) field |