Re: Foreign key data type mismatches

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Foreign key data type mismatches
Дата
Msg-id 200312011447.hB1Elcg07417@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Foreign key data type mismatches  (Andreas Pflug <pgadmin@pse-consulting.de>)
Список pgsql-hackers
Andreas Pflug wrote:
> Peter Eisentraut wrote:
> 
> >I was just annoyed to find out that a foreign key doesn't check whether
> >the referenced column has a sufficiently similar data type, it only checks
> >whether an = operator exists.  This masks schema design errors and typos.
> >Should this be tightened up, for example using the castability
> >characteristics between the two data types?
> >  
> >
> 
> Sounds like a good idea. IMHO normally only *equal* data types should be 
> referenced in a good data model design, but there's probably the need 
> for some relaxed check option too.

Yes, we already talked about throwing a warning if the primary/foreign
key data types are mismatched.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: default operator class: btree or hash
Следующее
От: Tom Lane
Дата:
Сообщение: Re: initdb should create a warning message [was Re: [ADMIN] Size on Disk]