just little BUG

Started by Jonathan davisalmost 27 years ago4 messagesgeneral
Jump to latest
#1Jonathan davis
haj@idianet.net

hello all

normaly a UNIQUE PRIMARY KEY is unique but
when you use a heritage, you can insert a duplicate key !!!!

#2Bruce Momjian
bruce@momjian.us
In reply to: Jonathan davis (#1)
Re: [GENERAL] just little BUG

[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?

-- 
  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
#3Jonathan davis
haj@idianet.net
In reply to: Bruce Momjian (#2)
Re: [GENERAL] just little BUG

[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

#4Bruce Momjian
bruce@momjian.us
In reply to: Jonathan davis (#3)
Re: [GENERAL] just little BUG

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