Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance - Mailing list pgsql-docs

From Robert Haas
Subject Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance
Date
Msg-id BANLkTin1u+x6gnHq38W9dkmQyTh+24iqyA@mail.gmail.com
Whole thread Raw
In response to 5.3.5. Foreign Keys (The SQL Language) possible enhance  (Grzegorz Szpetkowski <gszpetkowski@gmail.com>)
Responses Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance
Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance
List pgsql-docs
On Fri, May 6, 2011 at 9:50 PM, Grzegorz Szpetkowski
<gszpetkowski@gmail.com> wrote:
> I have some remark about
>
> "Now it is impossible to create orders with product_no entries that do
> not appear in the products table."
>
> http://www.postgresql.org/docs/9.0/static/ddl-constraints.html#DDL-CONSTRAINTS-FK
[...]
>
> There is still possibility to add product_no (exactly NULL) value,
> which does not appear (cannot because of primary key nature) in
> products table. To get "full solution" you need create orders table as
>
> CREATE TABLE orders (
>    order_id integer PRIMARY KEY,
>    product_no integer REFERENCES products (product_no) NOT NULL,
>    quantity integer
> );

I don't think we should change the example, but we could probably
clarify the wording.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-docs by date:

Previous
From: Robert Haas
Date:
Subject: Re: createuser/dropuser username
Next
From: Robert Haas
Date:
Subject: Re: ALTER TABLE doc small thing