Fix oversight in new code for printing rangetable aliases.
In commit 11e131854f8231a21613f834c40fe9d046926387, I missed the case of
a CTE RTE that doesn't have a user-defined alias, but does have an
alias assigned by set_rtable_names(). Per report from Peter Eisentraut.
While at it, refactor slightly to reduce code duplication.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/8b728e5c6e0ce6b6d6f54b92b390f14aa1aca6db
Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 31 +++++++++++++++++++++----------
src/test/regress/expected/with.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/with.sql | 11 +++++++++++
3 files changed, 56 insertions(+), 10 deletions(-)