Here is an updated patch that I think fixes all the cases that you
identified. (The issue of what kinds of constants or expressions to
accept for cycle marks has not been touched.) To fix the star expansion
I had to add a little bit of infrastructure that could also be used as a
more general facility "don't include this column in star expansion", so
this could perhaps use some consideration from a more general angle as well.
More tests and breakage reports welcome.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services