partitioning example - Mailing list pgsql-general

From Scott Marlowe
Subject partitioning example
Date
Msg-id dcc563d10906171419jf15c10bpe62f451457ca9870@mail.gmail.com
Whole thread Raw
List pgsql-general
So, I threw this together last night.  It's not pretty, it's not
perfect, but it works well enough.  There are two files, attached,
mkstp and mktrig.  Both are php programs.  The first, mkstp makes
partitions.  mkstp checks to see if a partition table already exists,
if it does it goes on to the next date, otherwise it creates the new
partition and (in this case) creates indexes.  You can throw in grants
there as well.  mktrig prints out the text needed to create the
trigger.  It requires to be run something like ./mktrig | psql mydb to
work.  So it's easy to see your trigger creation script.  Feel free to
make it work just by hitting the db if it helps you.  These scripts,
in a very similar form are working quite well for me.  A third small
.sql script is included called moveit.  It's designed to move data
from the parent table into its children, 100000 rows at a time.
Suggestions welcome.

Attachment

pgsql-general by date:

Previous
From: Maxim Boguk
Date:
Subject: Some strange bug with drop table with slony cluster
Next
From: Konstantin Izmailov
Date:
Subject: Re: issue with lo_lseek - it returns 4