Re: autogenerated column names + views are a dump hazard

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: kathy(dot)forte(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: autogenerated column names + views are a dump hazard
Date: 2015-03-02 21:45:28
Message-ID: 20150302214528.GG22160@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-03-02 16:32:53 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > The easiest way to solve this would teach ruleutils.c to simply always
> > attach AS clauses for auto-generated columnnames. Won't look too pretty
> > though. Does somebody have a better idea?
>
> No, it would look awful :-(. But I think we might have enough
> infrastructure in there to notice whether the column is actually
> referenced or not. So we could label the columns only if necessary,
> which would at least limit the ugliness.

Yea, that'd be better. I guess I'll try to figure out how that code
works...

> Another idea would be to reconsider whether we need to force display
> of the cast, though I'm a bit worried about the possible side-effects.

Seems like a fair bit riskier approach to me, so I'm not inclined to
follow it. Might have been the better idea originally, but it seems like
a change would be far more likely to affect people.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-03-02 21:47:01 Re: Proposal: knowing detail of config files via SQL
Previous Message Robert Haas 2015-03-02 21:42:35 Re: How about to have relnamespace and relrole?