Alter table alter column using question - Mailing list pgsql-admin

From Craig Servin
Subject Alter table alter column using question
Date
Msg-id 200604271040.29326.cservin@cromagnon.com
Whole thread Raw
In response to Re: IsDate function in plpgsql  (Ketema Harris <ketema@gmail.com>)
List pgsql-admin
I have a table called type:

type
-------
type_id integer
tvalue smallint
...
..
..

tvalue was a second key on this table which now turns out to be unnecessary.
Before I can remove it I need to change the columns which reference it.  I
wanted to do this with

alter table alter column using

But the using clause I am using does not work.  I think I may just be
misunderstanding how this is done, but I could only find a few examples.

Here is an example of what I have tried:

alter table service.service
alter column environment_tvalue type integer
using select type.type.type_id where tvalue = environment_tvalue and
typeset_id = 1;

Does the expression in the using clause have to be a function?

Any advice would be appreciated.

Thanks,

Craig

pgsql-admin by date:

Previous
From: "Benjamin Krajmalnik"
Date:
Subject: Re: New system recommendations
Next
From: Robin Iddon
Date:
Subject: Re: New system recommendations