Re: About partitioning

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: About partitioning
Date: 2010-01-21 09:28:59
Message-ID: 3eff28921001210128y60044d44pa77362627f55fcd2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/1/21 Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>:
> http://www.pubbs.net/pgsql/201001/16503/
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Grzegorz,
Thanks for the reference, which officially is here:
http://archives.postgresql.org/pgsql-general/2010-01/msg00331.php

I confirm it wasn't easy to find that out. Maybe you can add the
snippet into the Postgresql Wiki.

One thing to add here is that I would advise against the CREATE
TABLE...INHERITS.
I find much more useful:

-- code
CREATE TABLE <partition> (
LIKE <master>
INCLUDING INDEXES,
CHECK( <the condition> )
);
ALTER TABLE <partition> INHERIT <master>;
-- end code

because very often I still need the indexes in the partitions.
And in case you need the (other) constraints and the defaults, uyou
can ask for it with the INCLUDING clause.

And, BTW:
EXECUTE 'INSERT INTO '||partition-table-name||' SELECT $1.*' USING NEW;

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2010-01-21 09:43:31 Re: 64bits or 32 bits on ESX?
Previous Message Grzegorz Jaśkiewicz 2010-01-21 09:15:05 Re: About partitioning