Re: create new field

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Chris Faulkner <chrisf(at)oramap(dot)com>
Cc: Pgsql-Sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: create new field
Date: 2003-10-06 16:56:09
Message-ID: 20031006165609.GC27925@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Oct 06, 2003 at 17:35:11 +0100,
Chris Faulkner <chrisf(at)oramap(dot)com> 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 how
> to get around it in my case ? I know that my character field has only
> integers in it ?

You want to use to_number to do the conversion.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ow 2003-10-07 00:37:33 Re: FK Constraints, indexes and performance
Previous Message Josh Berkus 2003-10-06 16:44:47 Re: create new field