Skip site navigation (1) Skip section navigation (2)

inheritance. more.

From: Tom Allison <tom(at)tacocat(dot)net>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: inheritance. more.
Date: 2008-04-28 01:23:12
Message-ID: 48152700.6020802@tacocat.net (view raw or flat)
Thread:
Lists: pgsql-general
create table master (
id serial,
mdn varchar(11),
meid varchar(18),
min varchar(11),
constraint mmm_master unique (mdn, meid, min)
);
insert into master(mdn, meid, min)
select mdn, meid, min from test_data where meid != '000000000000000000' 
limit 10;

Everything works up to this point...

insert into master(mdn, meid, min)
select mdn, meid, min from test_data where meid != '000000000000000000' 
limit 10;

And this fails, like I would expect it to.


create table slave (
deleted boolean default false
) inherits (master);

insert into slave(mdn, meid, min)
select mdn, meid, min from test_data where meid != '000000000000000000' 
limit 10;
insert into slave(mdn, meid, min)
select mdn, meid, min from test_data where meid != '000000000000000000' 
limit 10;

I now have 30 rows in the master table, with duplicates...

Responses

pgsql-general by date

Next:From: Klint GoreDate: 2008-04-28 01:23:28
Subject: Re: inheritance...
Previous:From: Tom AllisonDate: 2008-04-28 01:13:12
Subject: inheritance...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group