From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | partitioned lookup table? |
Date: | 2010-04-16 14:48:18 |
Message-ID: | 20100416144818.GA21126@tux |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi @all,
A question, found in the german PG-Forum:
is it possible to partitionate a lookup-table? What i mean is:
test=# create table foo(i int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
CREATE TABLE
test=*# create table bla ( i int references foo);
CREATE TABLE
test=*# insert into foo values (1);
INSERT 0 1
test=*# insert into bla values (1);
INSERT 0 1
test=*# create table foo_2 () inherits (foo);
CREATE TABLE
test=*# alter table foo_2 add primary key (i);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "foo_2_pkey" for table "foo_2"
ALTER TABLE
Well, now i'd like to move data from foo into foo_2:
test=*# insert into foo_2 select * from foo;
INSERT 0 1
test=*# delete from foo;
ERROR: update or delete on table "foo" violates foreign key constraint "bla_i_fkey" on table "bla"
DETAIL: Key (i)=(1) is still referenced from table "bla".
Can i do that in an other way, or is it impossible? I think, it's
impossible, right?
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
From | Date | Subject | |
---|---|---|---|
Next Message | Vick Khera | 2010-04-16 15:13:05 | Re: partitioned lookup table? |
Previous Message | Tom Lane | 2010-04-16 14:36:10 | Re: readline library not found |