Re: Unintuitive behavior regarding inheritance

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Unintuitive behavior regarding inheritance
Дата
Msg-id 1310216968.2101.40.camel@laptop
обсуждение исходный текст
Ответ на Unintuitive behavior regarding inheritance  (Chris Travers <chris.travers@gmail.com>)
Ответы Re: Unintuitive behavior regarding inheritance  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
On Sat, 2011-07-09 at 05:59 -0700, Chris Travers wrote:
> Hi all;
>
> I started trying to use table partitioning to handle a rather odd case
> in the software I am working on.  I ran into an issue (one I can
> correct in my code) that strikes me as extremely unintuitive.  I
> figured I would report it here as behavior I would like to see change.
>
> The basic problem is that while nearly all table contraints are
> inherited, unique constraints are not.  This means that primary keys
> and so forth end up having to be redefined on all child tables
> explicitly as part of the table creation process.  This is
> sufficiently unintuitive that as a result I am having to go back and
> amend contributions of people far more knowledgeable on this than I
> am.
>
> It would be really helpful in the future if unique constraints and
> primary keys were inherited.
>
> At least I can adjust code, but this is a pretty big gotcha which
> could go unnoticed until you have duplicates for primary key fields in
> specific child tables.
>

To have a primary key or a unique key on an partitioned table, it would
mean that we should be able to have one index on multiple tables.
Because primary key and unique constraints are enforced with an index.
That's not something easy to do, and I guess it would make the index
bigger, which isn't performance savvy.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


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

Предыдущее
От: Chris Travers
Дата:
Сообщение: Unintuitive behavior regarding inheritance
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Unintuitive behavior regarding inheritance