Re: [COMMITTERS] pgsql: Improve the manual's discussion of partitioning.

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Improve the manual's discussion of partitioning.
Date: 2007-12-03 03:23:56
Message-ID: 20071203120241.632B.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

tgl(at)postgresql(dot)org (Tom Lane) wrote:

> Log Message:
> -----------
> Improve the manual's discussion of partitioning. Recommend using a
> trigger instead of a rule to redirect insertions, use NEW.* notation
> where appropriate, some other updates and adjustments. David Fetter
> and Tom Lane

I have a fix (1) and two comments (2 and 3) in the documentation.

1. "IF (logdate)" should be "IF (NEW.logdate)" in the trigger function.
INSERT fails without "NEW." before logdate.
=# INSERT INTO measurement VALUES(1, DATE '2007-12-03', 0, 0);
ERROR: column "logdate" does not exist

2. What is the purpose of "2. Next we create one partition ..." ?
We will recreate tables in "3. We must add non-overlapping table
constraints...". Is the chapter 2 useless? When users copy-and-paste
the codes in the topic, they run into errors at the chapter 3.

3. Is it worth reversing the order of checking date in the trigger function?
I think the newer partions are more often inserted in this case.
If we check the newer partion first, we can skip the remaining checks.
This is one of the advantage of by-trigger partitioning than by-rule.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2007-12-03 04:18:47 pgsql: Add SGML documentation for contrib/spi and contrib/test_parser.
Previous Message Tom Lane 2007-12-03 03:05:47 pgsql: Update SGML contrib documentation to catch up with recent changes

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-12-03 04:33:55 Re: [COMMITTERS] pgsql: Improve the manual's discussion of partitioning.
Previous Message Tom Lane 2007-12-03 03:03:08 Propose removing contrib/spi/preprocessor/