Alvaro Herrera <alvhe...@2ndquadrant.com> writes: > Tracing it down, turns out that transformPartitionBoundValue gets from > coerce_to_target_type a CoerceToDomain node. It then tries to apply > expression_planner() to simplify the expression, but that one doesn't > want anything to do with a domain coercion (for apparently good reasons, > given other comments in that file).
Quite. Suppose you did create domain overint as int; create table pt (a overint) partition by range (a); create table pt1 partition of pt for values from (0) to (100); and the system took it, and then you did alter domain overint add check (value > 100); What happens now? > However, if we take out the > expression_planner() and replace it with a call to > strip_implicit_coercions(), not only it magically starts working, but > also the regression tests start failing with the attached diff, which > seems a Good Thing to me. Why would you find that to be a good thing? The prohibition against mutable coercions seems like something we need here, for more or less the same reason in the domain example. regards, tom lane