pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedCOPY and partitioning
3+ messages / 3 participants
[nested] [flat]
* COPY and partitioning
@ 2005-11-17 14:55 Colton A Smith <smith@cs.utk.edu>
0 siblings, 2 replies; 3+ messages in thread
From: Colton A Smith @ 2005-11-17 14:55 UTC (permalink / raw)
To: pgsql-admin
Hi
I understand v8.1 implements table partitioning. Very exciting!
I have a big table (30 G) that is a real headache. I'd like to
partition it. My plan is the following: (1) use pg_dump -t to
dump the data; (2) create a partitioning schema with check constraints;
and (3) repopulate using the COPY utility.
My question: does the COPY utility consult check constraints
before populating tables?
Thanks as always.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COPY and partitioning
@ 2005-11-19 00:29 Guido Barosio <gbarosio@gmail.com>
parent: Colton A Smith <smith@cs.utk.edu>
1 sibling, 0 replies; 3+ messages in thread
From: Guido Barosio @ 2005-11-19 00:29 UTC (permalink / raw)
To: Colton A Smith <smith@cs.utk.edu>; +Cc: pgsql-admin
Thinking about dumping the schema, rewriting that structure with your
partitioning needs, and after copy the data.
Why not?
Just 2 cents, never done it.
to dump a schema:
pg_dump -s dbname > dbname.schema
Then just restore the data, it should work I guess.
Best regards,
Guido
On 11/17/05, Colton A Smith <smith@cs.utk.edu> wrote:
>
> Hi
>
> I understand v8.1 implements table partitioning. Very exciting!
>
> I have a big table (30 G) that is a real headache. I'd like to
> partition it. My plan is the following: (1) use pg_dump -t to
> dump the data; (2) create a partitioning schema with check constraints;
> and (3) repopulate using the COPY utility.
>
> My question: does the COPY utility consult check constraints
> before populating tables?
>
> Thanks as always.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
--
"Adopting the position that you are smarter than an automatic
optimization algorithm is generally a good way to achieve less
performance, not more" - Tom Lane.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: COPY and partitioning
@ 2005-11-20 17:33 Simon Riggs <simon@2ndquadrant.com>
parent: Colton A Smith <smith@cs.utk.edu>
1 sibling, 0 replies; 3+ messages in thread
From: Simon Riggs @ 2005-11-20 17:33 UTC (permalink / raw)
To: Colton A Smith <smith@cs.utk.edu>; +Cc: pgsql-admin
On Thu, 2005-11-17 at 09:55 -0500, Colton A Smith wrote:
> My question: does the COPY utility consult check constraints
> before populating tables?
No.
I'd dump it piece by piece using a WHERE clause exactly the same as the
constraints you will use, then reload using COPY into the partitions.
Best Regards, Simon Riggs
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-11-20 17:33 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 14:55 COPY and partitioning Colton A Smith <smith@cs.utk.edu>
2005-11-19 00:29 ` Guido Barosio <gbarosio@gmail.com>
2005-11-20 17:33 ` Simon Riggs <simon@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox