On 06/10/11 11:02 AM, Carlos Mennens wrote:
On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote:
I don't think ALTER COLUMN TYPE will implicitly convert from varchar
to INT.
Try:
ALTER TABLE reference
ALTER COLUMN color
TYPE INT
USING CAST(color AS INT);
Your command suggestion worked
In response to Carlos Mennens :
> On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote:
> > I don't think ALTER COLUMN TYPE will implicitly convert from varchar
> > to INT.
> >
> > Try:
> > ALTER TABLE reference
> > ALTER COLUMN color
> > TYPE INT
> > USING CAST(color AS INT);
>
> Your comma
On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote:
> I don't think ALTER COLUMN TYPE will implicitly convert from varchar
> to INT.
>
> Try:
> ALTER TABLE reference
> ALTER COLUMN color
> TYPE INT
> USING CAST(color AS INT);
Your command suggestion worked perfect but can you explain why yo
Carlos Mennens wrote:
> For some reason I'm unable to change a column's TYPE from VARCHAR(20)
> to INTERGER or SMALLINT. I'm required to note the manufactures color
> code (value = 198) in the table data but keep getting this error and I
> don't understand why:
>
> The error I'm recieving is:
>
In response to Carlos Mennens :
> For some reason I'm unable to change a column's TYPE from VARCHAR(20)
> to INTERGER or SMALLINT. I'm required to note the manufactures color
> code (value = 198) in the table data but keep getting this error and I
> don't understand why:
>
> The error I'm recievi
For some reason I'm unable to change a column's TYPE from VARCHAR(20)
to INTERGER or SMALLINT. I'm required to note the manufactures color
code (value = 198) in the table data but keep getting this error and I
don't understand why:
The error I'm recieving is:
ERROR: column "color" cannot be cast