Search Postgresql Archives

copying indexes and f.keys from a template table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux