Re: DDL problems: Referential issue? - Mailing list pgsql-sql

From Leif Biberg Kristensen
Subject Re: DDL problems: Referential issue?
Date
Msg-id 200911041953.11714.leif@solumslekt.org
Whole thread Raw
In response to Re: DDL problems: Referential issue?  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: DDL problems: Referential issue?  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-sql
On Wednesday 4. November 2009 19.37.41 Scott Marlowe wrote:
> On Wed, Nov 4, 2009 at 11:36 AM, Leif Biberg Kristensen
> <leif@solumslekt.org> wrote:
>> I'd missed that particular syntax.
>>
>> This table is now without a primary key, but is that a problem? I don't
>> expect it to grow beyond maybe a few thousand rows.
> 
> Hard to say, but if you really need a PK, you can always create one later.

This looks strange to me, but it works:

pgslekt=> CREATE TABLE participant_notes (
pgslekt(>     person_fk   INTEGER NOT NULL,
pgslekt(>     event_fk    INTEGER NOT NULL,
pgslekt(>     part_note   TEXT,
pgslekt(>     PRIMARY KEY (person_fk, event_fk),
pgslekt(>     FOREIGN KEY (person_fk, event_fk) REFERENCES participants 
(person_fk, event_fk)
pgslekt(> );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
"participant_notes_pkey" for table "participant_notes"
CREATE TABLE

And is probably what I want.
-- 
Leif Biberg Kristensen
http://solumslekt.org


pgsql-sql by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: DDL problems: Referential issue?
Next
From: Scott Marlowe
Date:
Subject: Re: DDL problems: Referential issue?