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

Re: 7.1beta4 bug creating a certain table

From: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org, ltibor(at)mail(dot)tiszanet(dot)hu
Subject: Re: 7.1beta4 bug creating a certain table
Date: 2001-01-30 16:55:53
Message-ID: Pine.LNX.4.21.0101301750200.3878-100000@pc10.radnoti-szeged.sulinet.hu (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
On Mon, 29 Jan 2001, Tom Lane wrote:

> 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
> 
I don't know the exact SQL definition whether my declaration is correct or
not. But, checking our model, we realized that our implementation is not
correct. So I should rewrite these definitions. Thanks! :-)

But, if this declaration is not correct in the sense of SQL standards, I
can imagine that PostgreSQL may allow such declarations. (A NOTICE may be
given instead of an ERROR.) Or, are there any drawbacks of allowing this?

Zoltan
-- 
                         Kov\'acs, Zolt\'an
                         kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu
                         http://www.math.u-szeged.hu/~kovzol
                         ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-01-30 17:18:52
Subject: Re: Size of TODO.detail
Previous:From: Jan WieckDate: 2001-01-30 16:32:24
Subject: I'm off

pgsql-sql by date

Next:From: Stef TelfordDate: 2001-01-30 17:23:01
Subject: Re: Archival of Live database to Historical database
Previous:From: cbellDate: 2001-01-30 16:50:43
Subject: Getting Results From Trigger

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