How to use PostgreSQL partitions with Django


Partitions in PostgreSQL(and MySQL too :)) are very useful when we have to store large data dividing them by attribute for future works. In my case I have logs of working on projects, which are stored in partition for each project.

Using partitions in django project is not very difficult, but there is one issue with “returning id” for insert statement in database. Function, which will insert a record to right table, must return trigger, but not id of last record as django expects.

read full ⇝

    2014-10-04 10:00:30      django postgresql partition