Alter table alter column using question

Поиск
Список
Период
Сортировка
От Craig Servin
Тема Alter table alter column using question
Дата
Msg-id 200604271040.29326.cservin@cromagnon.com
обсуждение исходный текст
Ответ на Re: IsDate function in plpgsql  (Ketema Harris <ketema@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Benjamin Krajmalnik"
Дата:
Сообщение: Re: New system recommendations
Следующее
От: Robin Iddon
Дата:
Сообщение: Re: New system recommendations