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

Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org
Subject: Re: 5.3.5. Foreign Keys (The SQL Language) possible enhance
Date: 2011-10-12 20:59:04
Message-ID: 201110122059.p9CKx4K06548@momjian.us (view raw or flat)
Thread:
Lists: pgsql-docs
Robert Haas wrote:
> On Fri, May 6, 2011 at 9:50 PM, Grzegorz Szpetkowski
> <gszpetkowski(at)gmail(dot)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.

Done with the attached patch.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachment: /rtmp/null
Description: text/x-diff (660 bytes)

In response to

pgsql-docs by date

Next:From: Bruce MomjianDate: 2011-10-12 21:21:19
Subject: Re: non-ASCII characters in SGML documentation (and elsewhere)
Previous:From: Robert HaasDate: 2011-10-12 19:34:30
Subject: Re: Document DELETE/UPDATE command tag vs triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group