Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

bug in 8.3? foreign key refers to different type



These create table commands succeed, even tho the foreign key refers to a 'different' type (int2 product_id column refers to an int8 column):

CREATE TABLE products (
    id int8 primary key,
    name text not null
);

CREATE TABLE orders (
    id int8 PRIMARY KEY,
    product_id int2 not null REFERENCES products (id)
);

If I replace int2 with numeric, real, text, etc it fails as expected ("key columns are of incompatible types"). 

Expected: integer types should match exactly (or at least be large enough to hold the referenced value).

thanks,
--craig





      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group