Re: Partitioning...

From: "Milen Kulev" <makulev(at)gmx(dot)net>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Partitioning...
Date: 2006-06-12 22:25:05
Message-ID: 007701c68e6f$0e992770$0a00a8c0@trivadis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the prompt reply Tom,
What is wrong with random() ?

The following snipped is working ...

insert into part(id1, id2, filler)
select
11 + round( (random()*9)::bigint,0) as id1, --- 11-20 range for id1 , as of definition
round( (random()*20)::bigint,0) as id2,
'TTTTTTTTTTTESTTTTTZZZZZZZZZZZZZZZZZZZ'
from generate_series(0,100000);

Regards. Milen

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Tuesday, June 13, 2006 12:18 AM
To: Milen Kulev
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Partitioning...

"Milen Kulev" <makulev(at)gmx(dot)net> writes:
> But When I issue:
> insert into part(id1, id2, filler)
> select
> round( (random()*20)::bigint,0) as id1, <---!!! Note that both partitions should be populated!
> round( (random()*20)::bigint,0) as id2,
> 'TTTTTTTTTTTESTTTTTZZZZZZZZZZZZZZZZZZZ'
> from generate_series(0,100000);

> ERROR: new row for relation "part_id1_0_10" violates check
> constraint "part_id1_0_10_id1_check"

Don't use random() in your test case.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Milen Kulev 2006-06-12 22:34:44 Re: Partitioning...
Previous Message James Watson 2006-06-12 22:18:29 Searching BLOB