Re: 7.1beta4 bug creating a certain table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: 7.1beta4 bug creating a certain table
Date: 2001-01-29 22:32:52
Message-ID: 25974.980807572@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu> writes:
> CREATE TABLE pakolas_cikktetel (
> pakolas int4 not null,
> cikk int4 not null,
> minoseg int4 not null,
> sorszam int4 check (sorszam > 0),
> helyrol int4,
> helyre int4,
> mennyi numeric(14,4) not null ,
> lezarva bool default 'f',
> primary key (pakolas, cikk, minoseg, sorszam),
> unique (pakolas, cikk, minoseg, helyrol, helyre));

> CREATE TABLE keszlet_bevetel (
> keszletnovekedes int4 not null primary key,
> pakolas int4 not null,
> cikk int4 not null,
> minoseg int4 NOT NULL,
> foreign key (pakolas, cikk, minoseg)
> references pakolas_cikktetel(pakolas, cikk, minoseg));

> ERROR: UNIQUE constraint matching given keys for referenced table
> "pakolas_cikktetel" not found

It appears to me that this is correct, since there is no constraint
on the first column that says that those three columns form a unique
key *by themselves*. I believe there were bugs in the code that checked
for this error before ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2001-01-29 22:37:08 NOCREATETABLE patch (was: Re: Please, help!(about Postgres))
Previous Message eschmid+sic 2001-01-29 22:13:27 Re: [HACKERS] Book enters second printing

Browse pgsql-sql by date

  From Date Subject
Next Message Joseph Shraibman 2001-01-30 01:14:49 Re: PostgreSQL HOWTO
Previous Message Kovacs Zoltan 2001-01-29 21:07:15 7.1beta4 bug creating a certain table