BUG #2355: Problem with INHERITS

Lists: pgsql-bugs
From: "Jaime Lara Alvarez" <jimmy_tec(at)yahoo(dot)com(dot)mx>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2355: Problem with INHERITS
Date: 2006-03-24 01:21:56
Message-ID: 200603240121.k2O1Luut048607@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2355
Logged by: Jaime Lara Alvarez
Email address: jimmy_tec(at)yahoo(dot)com(dot)mx
PostgreSQL version: 8.1.3
Operating system: Windows
Description: Problem with INHERITS
Details:

// ----------- 1 --------------------------- //

CREATE TABLE cities (
id varchar(5) PRIMARY KEY,
name text
);

CREATE TABLE capitals (
state text
) INHERITS (cities);

//------------ 2 ------------------------------//
insert into cities values ('C-001','Houston');
insert into cities values ('C-002','San Antonio');

insert into capitals values ('C-003','Dallas','TX');

// ------------3 --------------------------------//
insert into cities values ('C-004','Washington')

insert into capitals values ('C-004','Washington','W')

//------------ 4 ---------------------------------//

select * from cities

Data Output
Row id(varchar) name(text)
1 "C-001" "Houston"
2 "C-002" "San Antonio"
3 "C-004" "Washington" <------
4 "C-003" "Dallas"
5 "C-004" "Washington" <------

That's a problem with the primary key


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jaime Lara Alvarez" <jimmy_tec(at)yahoo(dot)com(dot)mx>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2355: Problem with INHERITS
Date: 2006-03-24 21:40:58
Message-ID: 10798.1143236458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Jaime Lara Alvarez" <jimmy_tec(at)yahoo(dot)com(dot)mx> writes:
> That's a problem with the primary key

Please note the caveats at the bottom of
http://www.postgresql.org/docs/8.1/static/ddl-inherit.html

regards, tom lane