Bug? inheriting primary key

From: Jim Cromie <jimcr(at)bwn(dot)net>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Bug? inheriting primary key
Date: 1999-10-02 09:52:59
Message-ID: 37F5D5FA.65734791@bwn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


-- RI inherits right ?
-- no ! A has primary key, A1 doesnt
-- but A1 should have all columns of A
-- and I assumed properties on them

-- apparently 2 stage drop is needed
-- drop derived 1st, then base
drop table A1;
drop table A;

create table A ( -- common elements,
name varchar(20) not null, -- key field
primary key ( name )
);

create table A1 (
-- name,
rank text
-- primary key ( name ) -- err if uncommented
) inherits ( A );

insert into A values ('yo');
insert into A values ('hey');
-- insert into a values ('hey'); -- disallowed

select * from A;

insert into A1 values ('yo');
insert into A1 values ('hey');
insert into A1 values ('hey'); -- allowed

select * from A1;

-- seems last should be disallowed

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Perkins 1999-10-02 10:03:01 PostgreSQL vs Mysql comparison
Previous Message Adriaan Joubert 1999-10-02 05:25:45 Re: [GENERAL] alpha and true64 port