On 2015-03-03 11:09:29 -0500, Tom Lane wrote: > Andres Freund <and...@2ndquadrant.com> writes: > > On 2015-03-03 09:39:03 -0500, Tom Lane wrote: > > I think this is the way to go though. There's different extremes we can > > go to though - the easiest is to simply remove the attname = "?column?" > > assignment from get_target_list(). That way plain Var references (aside > > from whole row vars/subplans and such that get_variable() deals with) > > don't get a forced alias, but everything else does. That seems like a > > good compromise between readability and safety. get_rule_expr() deals > > with most of the "nasty" stuff. > > I wasn't aware that there was any room for "compromise" on the safety > aspect.
Meh. I think that *not* printing an alias for a plain column reference is reasonable and doesn't present a relevant risk even in the face of future changes. "foo.bar AS bar" is just a bit too redundant imo. > That's why I was thinking that relying on the pretty flag might be a > reasonable thing. pg_dump would be unconditionally right, and we'd > not uglify EXPLAIN or \d+ output. I don't think EXPLAIN VERBOSE currently is affected - it doesn't seem to show aliases/generated column names at all. I personally do occasionally copy & paste from from \d+ output, so I'd rather have slightly more verbose output rather than wrong output. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers