Re: About partitioning

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: About partitioning
Дата
Msg-id 3eff28921001210128y60044d44pa77362627f55fcd2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: About partitioning  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Ответы Re: About partitioning  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Список pgsql-general
2010/1/21 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
> http://www.pubbs.net/pgsql/201001/16503/
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: About partitioning
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: 64bits or 32 bits on ESX?