Search code examples
postgresqlplpgsqlzabbixdatabase-partitioningpostgresql-10

Automate Native Range Partitioning in PostgreSQL 10 for Zabbix 3.4


I would like to automate the process of partitioning a Zabbix 3.4 Database using PostgreSQL's Native Range Partitioning.

Would it be wiser to write a SQL function to perform the following below or to use a shell/python script?

  • Make sure at least one partition is created ahead of what's needed.
  • Delete any partition older than x weeks/months; for history 7 days and for trends 1 year

Solution

  • I have written detailed notes on using PostgreSQL version 11 together with pgpartman as the mechanism for native table partitioning with Zabbix (version 3.4 as of this writing).

    zabbix-postgres-partitioning