Search Postgresql Archives

inheritance. more.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux