Fix oversight in new code for printing rangetable aliases.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/ruleutils.c | modified | +21 −10 |
| src/test/regress/expected/with.out | modified | +24 −0 |
| src/test/regress/sql/with.sql | modified | +11 −0 |