partitioning example

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: partitioning example
Date: 2009-06-17 21:19:16
Message-ID: dcc563d10906171419jf15c10bpe62f451457ca9870@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
mktrig application/octet-stream 1.7 KB
moveit application/octet-stream 234 bytes
mkstp application/octet-stream 1.0 KB

Browse pgsql-general by date

  From Date Subject
Next Message Konstantin Izmailov 2009-06-17 22:15:03 Re: issue with lo_lseek - it returns 4
Previous Message Maxim Boguk 2009-06-17 20:17:28 Some strange bug with drop table with slony cluster