| От | Andrus Moor |
|---|---|
| Тема | Changing referenced primary key column type |
| Дата | |
| Msg-id | 0B7510F8B13F4675934EA2A0C7023B74@andrusnotebook обсуждение |
| Ответы |
Re: Changing referenced primary key column type
|
| Список | pgsql-general |
8.x Db contains tables
create table ametikoh ( ametikoht numeric(7) NOT NULL DEFAULT
nextval('firma1.ametikoh_ametikoht_seq'::regclass) primary key );
create table iandmed ( ametikoht numeric(7) references ametikoh);
I created conversion script which normalizes column types:
alter table ametikoh alter column ametikoht type integer;
alter table iandmed alter column ametikoht type integer;
Running this script causes error:
ERROR: foreign key constraint "iandmed_ametikoht_fkey" cannot be
implemented
DETAIL: Key columns "ametikoht" and "ametikoht" are of incompatible types:
numeric and integer.
How to create script which performs this change and works in 8.0+ ?
Andrus.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера