Skip site navigation (1) Skip section navigation (2)

Re: table partitioning pl/pgsql helpers

From: Enrico Sirola <enrico(dot)sirola(at)gmail(dot)com>
To: Robert Treat <robert(at)omniti(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: table partitioning pl/pgsql helpers
Date: 2007-06-04 09:30:50
Message-ID: 703C285B-6BA9-4C4F-8A61-BABFEFDE5D5B@gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Hi Robert,

Il giorno 01/giu/07, alle ore 04:08, Robert Treat ha scritto:

[...]

> We I set these up for our clients, I typically seperate the  
> partition creation
> piece from the data insertion piece.  (Mostly as partition creation,
> especially with rules, is a table locking event, which is better  
> done in a
> non-critical path).  If you really must do it all in one go, you'll  
> have a

I see, and now I agree with you it's better to decouple partition  
creation
and data insertion.

> much better chance of accomplishing this using all triggers (and  
> triggers are
> better anyway)... i think you could do it with a combination of  
> rules and a
> trigger (on insert to parent, create new parition and insert into  
> it and
> delete from parent) but it would certainly need testing to make  
> sure you dont
> have multi-rule evaluation... course since your making a trigger  
> anyway...

Even more importantly, I just discovered (trying and then reading  
pgsql docs) that the rule
system is completely bypassed by the COPY FROM statement, so I think  
I'll rewrite
everything using some sort of trigger-generating procedure because I  
want this stuff
to work transparently (and we do lots of copy from).
Thanks for the advices,

Enrico Sirola
enrico(dot)sirola(at)gmail(dot)com



In response to

pgsql-hackers by date

Next:From: Zeugswetter Andreas ADI SDDate: 2007-06-04 10:02:33
Subject: Re: What is happening on buildfarm member baiji?
Previous:From: Enrico SirolaDate: 2007-06-04 08:53:36
Subject: Re: [HACKERS] table partitioning pl/pgsql helpers

pgsql-general by date

Next:From: Richard HuxtonDate: 2007-06-04 09:32:18
Subject: Re: simple select question
Previous:From: Erol KAHRAMANDate: 2007-06-04 09:12:01
Subject: simple select question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group