hello again!
since there was a problem with my email and the reply
was not sent, so I'm re-posting my reply..
Again.. the structure as I exported it from phpPgAdmin is:
*-- My table 'foo'
*
*CREATE TABLE foo (
*
*foo_id integer NOT NULL,*
*blaa_id integer NOT NULL,*
*blaa_num integ
That because you are generating table name from from_value which is
distinct everytime.
Like,
INSERT INTO foo VALUES (1, 11, 11, 1, '2013-06-26 16:38:58.466');
NOTICE: table_name = (foo_1_to_21)
NOTICE: CREATE TABLE foo_1_to_21 (CHECK ( foo_id >= 1 AND foo_id <= 21 ))
INHERITS (foo)
INSERT 0 0
p
I solved the problem with the error! thank you very much!
But there is still 1 issue:
when I insert multiple rows (for exaple with the attachment in my fist
email)
it creates 100 partition tables that contain 1 entry instead of 5
partitions with
20 entries..
Any ideas in that??
Thanks again!
D
Yes, you missed the trigger part. And also you will get error like below
during insert:
INSERT INTO foo VALUES (99, 109, 109, 99, '2013-06-26 16:38:58.466');
NOTICE: table_name = (foo_100_to_119)
NOTICE: CREATE TABLE foo_100_to_119 (CHECK ( foo_id >= 100 AND foo_id <=
119 )) INHERITS (foo)
ERROR
You forgot to set the trigger on foo:
CREATE TRIGGER foo_insert
BEFORE INSERT ON foo
FOR EACH ROW EXECUTE PROCEDURE foo_insert_trigger();
2013/6/26 dafNi zaf
> one note: I create a table of 100 entries in order to test it so I want 5
> partition of 20 entries each.
> (And not a table
one note: I create a table of 100 entries in order to test it so I want 5
partition of 20 entries each.
(And not a table of 10 entries)
thanks again!
dafni
On Wed, Jun 26, 2013 at 4:47 PM, dafNi zaf wrote:
> Hello!
>
> I want to dynamically create partition tables that inherit a main tabl
Hello!
I want to dynamically create partition tables that inherit a main table
called "foo".
The creation must occur when needed.
For example, lets say that I want to insert 10 entries and I want 5
partition
tables (with 2 entries each).
So, first I need a partition for the first 2 e