Re: [SQL] create new field

2003-10-06 Thread Bruno Wolff III
On Mon, Oct 06, 2003 at 17:35:11 +0100, Chris Faulkner <[EMAIL PROTECTED]> wrote: > > OK - so I tried casting. > > template1=# update tab set new_col = "OLD_COL"::int4; > ERROR: Cannot cast type character to integer > > I understand this - some tables might have characters in the varchar but

Re: [SQL] create new field

2003-10-06 Thread Josh Berkus
Chris, > template1=# update tab set new_col = "OLD_COL"::int4; > ERROR: Cannot cast type character to integer > > I understand this - some tables might have characters in the varchar but > how to get around it in my case ? I know that my character field has only > integers in it ? Actually, you

[SQL] create new field

2003-10-06 Thread Chris Faulkner
Hello I would like to change the type of a column. At the moment, it is varchar(4) but I would like it to be int. All values in the field at the moment are actually integer. I tried a way I had seen in the archives - it foes along the lines of adding a column, using update, drop the old column an