Subject | Re: [firebird-support] Foreign key different field type |
---|---|
Author | livius |
Post date | 2017-06-19T17:33:08Z |
ID/ID1?>>At DDL time: What happens if you flip the used data types for
No difference – constraint created
regards,
Karol Bieniaszewski
Sent: Monday, June 19, 2017 7:21 PM
Subject: Re: [firebird-support] Foreign key different field
type
have different field> Hi,
>
> Can someone show me example when it is usefull to
> type in relationCreate table test1 (id smallint not null primary key)
>
> Sample
>
>table test2 (id1 integer)
> Create
>(id1) references test1(id)
> Alter table test2 Add foreign key
>forbidden?
> Why this is not
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.
At DDL time: What happens if you flip the used data types for ID/ID1?
--
With regards,
Thomas Steinmaurer
http://www.upscene.com/
Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.