Received: from hood.tvd.be (hood.tvd.be [195.162.196.21]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBUMkmL17872 for ; Sat, 30 Dec 2000 17:46:48 -0500 (EST) (envelope-from tsmets@altern.org) Received: from altern.org (cable-213-132-132-244.upc.chello.be [213.132.132.244]) by hood.tvd.be (8.9.3/8.9.3/RELAY-1.1) with ESMTP id XAA19886; Sat, 30 Dec 2000 23:46:36 +0100 (MET) Message-ID: <3A4E650A.9F682D@altern.org> Date: Sat, 30 Dec 2000 23:43:22 +0100 From: Thomas SMETS Organization: Private X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.9-27mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: "Brett W. McCoy" CC: psql sql Subject: Re: References to SERIAL References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200012/314 X-Sequence-Number: 654 Yeap, Tx Brett. The syntaxe you gave means much more to me than the one I got from the Book "PostresSQL : Introduction & Concept" from Bruce Momjian seems a bit short while the PostgreSQL user guide from Thomas LOCKHART has the full theorical description. I'll probably stick more with the second one in the future. Thomas, > > You mean as a foreign key? You would do something like > > create table books_authors ( > book integer references book(book_pk) > on delete no action, > author integer references author(author_pk) > on delete no action, > ... > ); > > This forces integrity between the tables so the only allowable values in > the books_authors table are those values in the referenced fields (foreign > keys). > > You will probably want to look up the documentation on contraints and > foreign keys (I believe they are under the CREATE TABLE documentation). > -- Sat Dec 30 15:23:42 CET 2000 Thomas SMETS e-mail : tsmets@altern.org Av. de la Brabançonne 133 / 3 Tel. : +32 (0)2 742. 05. 94. 1030 Bruxelles ======= Quote of the Day ========= "In the long run, every program becomes rococo, and then rubble." -- Alan Perlis ========= End of Quote ===========