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?


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

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.