Re: [GENERAL] looking for a globally unique row ID

Поиск
Список
Период
Сортировка
От Rafal Pietrak
Тема Re: [GENERAL] looking for a globally unique row ID
Дата
Msg-id d629a9e8-99ae-79bb-6500-9edb4fcdd742@ztk-rp.eu
обсуждение исходный текст
Ответ на Re: [GENERAL] looking for a globally unique row ID  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: [GENERAL] looking for a globally unique row ID  (Alban Hertroys <haramrae@gmail.com>)
Re: [GENERAL] looking for a globally unique row ID  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general

W dniu 14.09.2017 o 23:15, Rob Sargent pisze:
> 
> 
> On 09/14/2017 02:39 PM, Rafal Pietrak wrote:
>>
>> W dniu 14.09.2017 o 19:30, Rob Sargent pisze:
>>>
>>> On 09/14/2017 11:11 AM, Rafal Pietrak wrote:

[------------------]
>>
>> Throwing actual numbers: 12 basic classes of documents; 17 tables
>> registering various operations document may undergo during its lifetime.
>> Variant (2) above make it 12*17 = 204 tables, which I'm currently
>> maintaining.... and it's too much. With variant (1) I simply wasn't able
>> to effectively keep document attributes consistent.
>>
>> Thus I'm searching for tools (paradigms/sql-idioms) that would fit the
>> problem.
> 
> Isn't this typically handled with an inheritance (parent-children)
> setup.  MasterDocument has id, subtype and any common columns (create
> date etc) then dependents use the same id from master to complete the
> data for a given type.  This is really common in ORM tools.  Not clear
> from the description if the operations could be similarly handled
> (operation id, operation type as master of 17 dependent
> operationSpecifics; there is also the "Activity Model")

I do that, but may be I do that badly.

Currently I do have 6 levels of inheritance which partition my
document-class space. But I cannot see any way to have a unique index
(unique constraint) to cover all those partitions at once.

This is actually the core of my question: How to make one?

So far I only have separate unique indexes on all those 12 child-table
document-class subtables. Is there a way to combine those indexes? I
experimented, and an index created on parent table does not cover
content of child/inheriting tables. If it was, that would solve the problem.

.... or I've just missinterpreted you MasterDocument suggestion?


-R


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [GENERAL] pg_rewind copy so much data
Следующее
От: s19n
Дата:
Сообщение: [GENERAL] "Canceling authentication due to timeout" with idle transaction andreindex