>>Why should it be forbidden?  Not everything that's dumb is disallowed. 

Because it can cause problem if someone do this not intentionally.
Also if your system must work with many databases it is then not compatibile. 
(e.g. not compatibile with MSSQL)

regards,
Karol Bieniaszewski


From: Ann Harrison aharri...@ibphoenix.com [firebird-support] 
Sent: Tuesday, June 20, 2017 4:46 PM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Foreign key different field type

  

On Mon, Jun 19, 2017 at 1:21 PM, Thomas Steinmaurer t...@iblogmanager.com 
[firebird-support] <firebird-support@yahoogroups.com> wrote:

  ,
  >
  > Can someone show me example when it is usefull to have different field
  > type in [referenced and referencing keys of a foreign key relationship]?
  >
  >
  > Why this is not forbidden?


Why should it be forbidden?  Not everything that's dumb is disallowed. 

  Perhaps cause the referenced column in table test1 can only store a
  subset (SMALLINT) of the value range of the INTEGER used in test2?

  Even if this works at DDL time, I wonder how strict the optimizer then
  is in JOIN statements using an index. Haven't tried.


Nor have I tried, but Firebird uses the same key representation for most numeric
columns, so having mixed sizes of numbers - or different scales -  in a foreign 
key
shouldn't matter to the optimizer.  The exception - which may have been changed 
- 
was the representation of int64. Having a single key format for numbers makes 
it simple to increase the size of columns or change the scale.

Good luck,

Ann



---
Ta wiadomość została sprawdzona na obecność wirusów przez oprogramowanie 
antywirusowe Avast.
https://www.avast.com/antivirus
  • ... 'liviusliv...@poczta.onet.pl' liviusliv...@poczta.onet.pl [firebird-support]
    • ... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
      • ... 'livius' liviusliv...@poczta.onet.pl [firebird-support]
      • ... Ann Harrison aharri...@ibphoenix.com [firebird-support]
        • ... 'livius' liviusliv...@poczta.onet.pl [firebird-support]
    • ... Svein Erling Tysvær setys...@gmail.com [firebird-support]

Reply via email to