Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Alter table alter column using question



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group