On 2018-Nov-12, Jürgen Strobel wrote: > With all due respect I suspect your view of implementation issues biases > your judgement here. For me the partition's default handling was > completely unexpected, especially with the documentation silent about > default-applying behavior, and inconsistent with how check constraints > work with partitions.
This is valuable input. It would be good to have more opinions from users, particularly those accustomed to how things work in other RDBMS systems, so that we can inform our own opinions on how we should make it work here in PG going forward. One of the guiding principles that I think we should hold for partitioning is that operating directly into the partition should be seen as only an optimization compared to inserting into the parent table -- thus it should not behave differently. Applying different default values depending on where you're inserting into goes counter to that principle. > Maybe there's another way to implement this. Like mark early and apply > defaults later, and handle meta data like constraints. Sorry if this > sounds stupid. It does not sound stupid -- it seems exactly what I was thinking. Admittedly, it's a bit hand-wavy and we'd need to understand more how it work in more detail, as well as how it works currently (and why it does). However, I'm not ATM in a position to design or write a patch for this. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services