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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to