Postgresql update a partitioned table, where update affects multiple partitions

partitioningpostgresqlupdate

If I have a partitioned table partitioned on PKey column, can I update (or merge etc) the table like below (or more complex jonining to another table) which will cause multiple partitions to be modified?
If yes does it depend on which postgresql version?

PartitionedTable

PKey    SomeOtherValue
1       10
1       11
2       10
2       11
3       11


UPDATE PartitionedTable
    SET SomeOtherValue = SomeOtherValue + 1
WHERE SomeOtherValue > 10

Best Answer

You can update tuples from multiple partitions in one statement.

If you are using declarative partitioning, then the ability to update tuples in a way that causes them to move partitions was added in v11. If you are using partitioning by inheritance, then what it does in this case is up to your triggers.