]> granicus.if.org Git - postgresql/commit
Remove dead code for temporary relations in partition planning
authorMichael Paquier <michael@paquier.xyz>
Wed, 4 Jul 2018 01:41:44 +0000 (10:41 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 4 Jul 2018 01:41:44 +0000 (10:41 +0900)
commit5fca035903a2ad2fd143b14eccf5a58af85c189d
tree808ce9c7c268a9dd903865091666ed0de84e9973
parent31658f794370547eb19b233956afe92a07cd6fdd
Remove dead code for temporary relations in partition planning

Since recent commit 1c7c317c, temporary relations cannot be mixed with
permanent relations within the same partition tree, and the same counts
for temporary relations created by other sessions, which the planner
simply discarded.  Instead be paranoid and issue an error, as those
should be blocked at definition time, at least for now.

At the same time, a test case is added to stress what has been moved
when expand_partitioned_rtentry gets called recursively but bumps on a
partitioned relation with no partitions which should be handled the same
way as the non-inheritance case.  This code may be reworked in a close
future, and covering this code path will limit surprises.

Reported-by: David Rowley
Author: David Rowley
Reviewed-by: Amit Langote, Robert Haas, Michael Paquier
Discussion: https://postgr.es/m/CAKJS1f_HyV1txn_4XSdH5EOhBMYaCwsXyAj6bHXk9gOu4JKsbw@mail.gmail.com
src/backend/optimizer/prep/prepunion.c
src/test/regress/expected/select.out
src/test/regress/sql/select.sql