Обсуждение: Re: [GENERAL] just little BUG

Поиск
Список
Период
Сортировка

Re: [GENERAL] just little BUG

От
"Jonathan davis"
Дата:

>[Charset iso-8859-1 unsupported, filtering to ASCII...]
>> hello all
>>
>> normaly a UNIQUE PRIMARY KEY is unique but
>> when you use a heritage, you can insert a duplicate key !!!!
>
>I assume you mean inheritance.
>
>Can you send us a little test sample please?
>
>--
hello all

this is the problem:

example:

test=> CREATE TABLE MAN(name char(10) UNIQUE PRIMARY KEY);T

test=> CREATE TABLE PROFESSOR(scool char(20))INHERITS(MAN);

test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
INSERT 54424 1

test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
INSERT 54425 1








Re: [GENERAL] just little BUG

От
Bruce Momjian
Дата:

Yikes, I see what you mean.  Added to TODO:

* Unique index on base column not honored on inserts from inherited table
  INSERT INTO inherit_table (unique_index_col) VALUES (dup) should fail

> >> normaly a UNIQUE PRIMARY KEY is unique but
> >> when you use a heritage, you can insert a duplicate key !!!!
> >
> >I assume you mean inheritance.
> >
> >Can you send us a little test sample please?
> >
> >--
> hello all
>
> this is the problem:
>
> example:
>
> test=> CREATE TABLE MAN(name char(10) UNIQUE PRIMARY KEY);T
>
> test=> CREATE TABLE PROFESSOR(scool char(20))INHERITS(MAN);
>
> test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
> INSERT 54424 1
>
> test=> INSERT INTO PROFESSOR(name) VALUES('DAVIS');
> INSERT 54425 1


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