Re: another foreign key question - Mailing list pgsql-general

From Roderick A. Anderson
Subject Re: another foreign key question
Date
Msg-id Pine.LNX.4.10.10112182203010.13269-100000@tincan.org
Whole thread Raw
In response to another foreign key question  ("Adam Fisher" <black@cia.com.au>)
List pgsql-general
On Wed, 19 Dec 2001, Adam Fisher wrote:

> alter table invhistory
> add constraint fk_invhist_invid_inventory
> foreign key ("invid") references "inventory" ("invid")

Wasn't there something about foreign keys having to be of the same data
type?  (This pops to mind without doing a search of the archives)  The
inventory table is using integer (INT4?) and the invhistory uses
NUMERIC(14,0).  Seems a cast between types will be some extra overhead.
Isn't NUMERIC what was called BCD (binary coded decimal)
in-the-olden-days.


Rod
--
                      Let Accuracy Triumph Over Victory

                                                       Zetetic Institute
                                                        "David's Sling"
                                                         Marc Stiegler


pgsql-general by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: Way to use count() and LIMIT?
Next
From: Paulo Jan
Date:
Subject: Query hangs when getting too complex...