Re: beta4 accepts foreign key of different type than column

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: beta4 accepts foreign key of different type than column
Дата
Msg-id 4780F14B.2050707@dunslane.net
обсуждение исходный текст
Ответ на beta4 accepts foreign key of different type than column  (Louis-David Mitterrand <vindex+lists-pgsql-hackers@apartia.org>)
Ответы my bad (was: Re: beta4 accepts foreign key of different type than column  (Louis-David Mitterrand <vindex+lists-pgsql-hackers@apartia.org>)
Re: beta4 accepts foreign key of different type than column  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers

Louis-David Mitterrand wrote:
> Hi, 
>
> I changed the data type on a column (to an enum) but the previous 
> foreign key to the old table (replaced by the enum) is still accepted 
> event though the data types are now different. Is that the expected 
> behavior?
>
> CREATE TABLE person_to_event (
>     id_person integer NOT NULL,
>     id_event integer NOT NULL,
>     person_type person_type_new NOT NULL, -- new ENUM type
>     "character" text
> )
>
> ALTER TABLE ONLY person_to_event
>     ADD CONSTRAINT person_to_event_person_type_fkey FOREIGN KEY (person_type) REFERENCES person_type(person_type); --
oldperson_type table, text column
 
>
>
>   

Please send us a more complete example. Also, using the same name for a 
table, a field and a type makes reading it very confusing. Please make 
sure your example uses names for just one purpose.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: beta4 accepts foreign key of different type than column
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: my bad (was: Re: beta4 accepts foreign key of different type than column