Re: fkey + primary key does not work in current

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: fkey + primary key does not work in current
Date: 2000-10-17 00:51:10
Message-ID: 200010170051.UAA25724@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Has this been resolved?

>
> On Fri, 15 Sep 2000, Tatsuo Ishii wrote:
>
> > It seems that foreign key does not work in current, if specified with
> > primary key definition. Take a look at following example(works in
> > 7.0.2.):
> >
> > test=# CREATE TABLE PKTABLE ( ptest1 int, ptest2 int, ptest3 int, ptest4 text, PRIMARY KEY(ptest1, ptest2, ptest3) );
> > NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable'
> > CREATE
> > test=# CREATE TABLE FKTABLE ( ftest1 int, ftest2 int, ftest3 int, ftest4 int, primary key (ftest1,ftest2,ftest3,ftest4), CONSTRAINT constrname3 FOREIGN KEY(ftest1, ftest2, ftest3) REFERENCES PKTABLE);
> > NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'fktable_pkey' for table 'fktable'
> > NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
> > ERROR: columns referenced in foreign key constraint not found.
>
> Hmm, that's very strange. I wonder which columns it think didn't exist.
> It shouldn't be checking the pktable in that case, which would imply
> it doesn't believe the existance of ftest1,ftest2,ftest3. Probably
> a stupid mistake on my part. As soon as I clear off space to compile
> current, I'll look.
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Hollomon 2000-10-17 00:53:01 Re: Re: New relkind for views
Previous Message Tom Lane 2000-10-17 00:39:56 Re: Possible performance improvement: buffer replacemen t policy