Fix ruleutils.c for domain-over-array cases, too.
authorTom Lane <[email protected]>
Wed, 12 Jul 2017 22:00:04 +0000 (18:00 -0400)
committerTom Lane <[email protected]>
Wed, 12 Jul 2017 22:00:04 +0000 (18:00 -0400)
commit75670ec373628378fac68fdf2748ffac18076321
tree605e9c3fec83db99c6b23c589d0256b06d39f123
parent40ba61b447829a328963f5a868b291ecb24762d6
Fix ruleutils.c for domain-over-array cases, too.

Further investigation shows that ruleutils isn't quite up to speed either
for cases where we have a domain-over-array: it needs to be prepared to
look past a CoerceToDomain at the top level of field and element
assignments, else it decompiles them incorrectly.  Potentially this would
result in failure to dump/reload a rule, if it looked like the one in the
new test case.  (I also added a test for EXPLAIN; that output isn't broken,
but clearly we need more test coverage here.)

Like commit b1cb32fb6, this bug is reachable in cases we already support,
so back-patch all the way.
src/backend/utils/adt/ruleutils.c
src/test/regress/expected/domain.out
src/test/regress/sql/domain.sql