Re: Inheritance in PostgreSQL

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Inheritance in PostgreSQL
Дата
Msg-id CAHyXU0y85n2ZzCPzZbxLk+WDeUjQXzoi=f1TumoYpPqKTWJVAw@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Inheritance in PostgreSQL  (Jeff Laing <Jeff.Laing@synchronoss.com>)
Ответы Re: Inheritance in PostgreSQL
Список pgsql-general
On Tue, Oct 17, 2023 at 5:36 PM Jeff Laing <Jeff.Laing@synchronoss.com> wrote:

“Don’t use table inheritance” IS on that page


Yeah, inheritance probably would have been removed a long time ago except that it was underneath the partitioning feature.  The basic idea of implementing polymorphic record storage essentially hacks SQL in a way it doesn't want to be hacks, thus the feature never really worked properly.  If you want variant storage, use hstore, json, etc. or use the various techniques that split the entity across multiple tables. 

The only thing you can't really do in SQL easily without writing nasty triggers are things like, 'this table must be linked from one and only one of these candidate tables'.  I think the language probably ought to support this, but I don't think postgres would unless the standard did.  I try to avoid handwriting RI when possible in triggers, but in this case it's the only approach that works within language constraints and can formally validate the model.

merlin

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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: Need efficient way to remove (almost) duplicate rows from a table
Следующее
От: Michael Nolan
Дата:
Сообщение: Fwd: Need efficient way to remove (almost) duplicate rows from a table