[SQL] Partitoning not working with RETURNING and INSERT/UPDATE

2009-02-10 Thread Frank Jördens
I created a partitioned table and am now finding that it won't (at least not trivially) support the RETURNING syntax with insert or update: If I take the trigger approach (as in the online manual), allowing for RETURNING to work means that I have to let the BEFORE INSERT trigger return the row rat

[SQL] Make the planner smarter about idiosyncratic (or broken) ORM behaviour

2009-05-22 Thread Frank Jördens
Almost all of the 8k queries per second that are hitting our database are generated by a web development framework's ORM (Django), and some of the syntax there is quite mad. Possibly the worst tic exhibited by the translation layer is that if you filter a query on an object by more than one propert