inheritence behavior question ....

From: <tsmets(at)brutele(dot)be>
To: <pgsql-general(at)postgresql(dot)org>
Subject: inheritence behavior question ....
Date: 2002-03-25 01:11:37
Message-ID: 003b01c1d39a$2d7f8240$6501a8c0@calvin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I did the following which sounds illogical to me :
<snip>
test=> create table father (col1 integer not null unique);
NOTICE: CREATE TABLE/UNIQUE will create implicit index 'father_col1_key'
for table 'father'
CREATE
test=> create table son (col2 integer) inherits (father);
CREATE
test=> insert into father (1);
ERROR: parser: parse error at or near "1"
test=> insert into father values (1);
INSERT 19423 1
test=> insert into father values (2);
INSERT 19424 1
test=> insert into father values (3);
INSERT 19425 1
test=> insert into son values (1, 3);
INSERT 19426 1
test=> select * from father;
col1
------
1
2
3
1
(4 rows)

</snip>

Could some one explain why the last insert did not fail ?
I understand why it could work !
But I would still expect it to fail as the user requested to have the tabl
containing unique values and it obviously doesn't contain only uniques ..

Much tx,

thomas,

--
Thomas SMETS
rue J. Wytsmanstraat 62
1050 Bruxelles
yahoo-id : smetsthomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Langille 2002-03-25 01:26:43 Re: SOUNDEX - plans for SQL function?
Previous Message Kym Farnik 2002-03-25 00:59:15 SOUNDEX - plans for SQL function?