Re: another foreign key question

From: "Roderick A(dot) Anderson" <raanders(at)tincan(dot)org>
To: Adam Fisher <black(at)cia(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: another foreign key question
Date: 2001-12-19 06:09:31
Message-ID: Pine.LNX.4.10.10112182203010.13269-100000@tincan.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Giorgio Ponza 2001-12-19 13:03:50 Stupid question on INDEXES
Previous Message Darren Ferguson 2001-12-19 05:04:40 Re: Way to use count() and LIMIT?