copying indexes and f.keys from a template table

Поиск
Список
Период
Сортировка
От Enrico Sirola
Тема copying indexes and f.keys from a template table
Дата
Msg-id 2B2C0810-C67D-4759-A79B-8EFE2559BF4E@gmail.com
обсуждение исходный текст
Список pgsql-general
Hello,
I'm trying to build a set of plpgsql functions in order to ease partitioning by date, let's say 
one table per day for a total of 30 days.
I have plpgsql functions to create the partition tables (having a date suffix) and to manage
a retention period, however I still need to solve a problem with indexes/foreign keys.
The partition tables are inherited from a template table, and while inheriting I loose
the information on indexes/keys. One possibility would be to write a facility to execute
a set of ddl statements on all the partition tables using a template (e.g. using a 
placeholder for the table name) or maybe one could use the information on Primary/foreign keys 
and indexes present also in the system tables so I guess one should be able to use it to build 
the PK/FKs and indexes on the partition tables. Any advice?
Thanks in advance,

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

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: [NOVICE] Recursive relationship - preventing cross-index entries.
Следующее
От: "Rhys Stewart"
Дата:
Сообщение: Re: regexp searching in arrays not working?