From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | PostgreSQL www <pgsql-www(at)postgresql(dot)org> |
Subject: | Comments to www list |
Date: | 2005-01-05 19:37:45 |
Message-ID: | 200501051937.j05Jbjv08789@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-www |
Are we going to continue to see all interactive document comments posted
to the www list?
---------------------------------------------------------------------------
nobody wrote:
> Author: Alex French <alexfrench(at)gmail(dot)com>
> ----
> Note that pg does not support changing the type of a column. Instead, use something like the code below to change, say, a varchar(32) into varchar(64) (assuming the collumn is called abc):
>
> BEGIN;
> ALTER TABLE mytable ADD COLUMN abc_new varchar(64);
> UPDATE mytable SET abc_new = abc;
> ALTER TABLE mytable RENAME abc TO abc_old;
> ALTER TABLE mytable RENAME abc_new TO abc;
> COMMIT;
>
> If you're chaning the type of the column radically, you need to do more fancy type casting, but that's the theory.
> ----
> Manual page: http://wwwmaster.postgresql.org/docs/7.4/interactive/ddl-alter.html
> Reject: http://wwwmaster.postgresql.org/admin/comments.php?action=reject&id=1966
> Edit: http://wwwmaster.postgresql.org/admin/comment-edit.php?id=1966
> Delete: http://wwwmaster.postgresql.org/admin/comments.php?action=delete&id=1966
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2005-01-05 19:48:45 | All should be well ... |
Previous Message | Josh Berkus | 2005-01-05 19:32:09 | Re: New News Entry (id: 268) |