Re: References not being checked while creating tables? - Mailing list pgsql-novice

From Tom Lane
Subject Re: References not being checked while creating tables?
Date
Msg-id 25896.984772944@sss.pgh.pa.us
Whole thread Raw
In response to References not being checked while creating tables?  (Bas van der Linden <bas@mike.amaze.nl>)
List pgsql-novice
Bas van der Linden <bas@mike.amaze.nl> writes:
> CREATE TABLE test (
> id        serial
> );

> CREATE TABLE test2 (
> another_id    text REFERENCES test(id)
> );

> This is accepted by the database, however, it obviously is of no use
> whatsoever as the data types are incompatible.

Yes, the type mismatch should be detected sooner.  I thought we had
fixed this for 7.1, but I see it still doesn't notice the problem
until runtime.  Oh well, another TODO item for 7.2 ...

            regards, tom lane

pgsql-novice by date:

Previous
From: Laurel Williams
Date:
Subject: installing/running ODBC
Next
From: Randy Hall
Date:
Subject: Re: pg_dump & BLOBs ?