Re: Making view dump/restore safe at the column-alias level - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making view dump/restore safe at the column-alias level
Date
Msg-id 24797.1356967630@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making view dump/restore safe at the column-alias level  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> I do wonder whether the SQL standard will do something obtuse enough
> that that's the only option for a large swathe of queries. Or is that
> the case already? The query syntax you're using here, is it standard
> SQL? Is it widely supported?

Yeah, it's standard --- there's nothing here that wasn't in SQL92.
(Although I notice that SQL still hasn't got any ALTER TABLE RENAME
command, much less a column rename command.  I wonder whether the
committee is aware of these difficulties and has shied away from adding
RENAME because of them?)

As for widely supported, I can't imagine that the big boys don't have
this, although a quick test shows that mysql only has table aliases
not column aliases, ie you can do "FROM t1 AS t1x" but not
"FROM t1 AS t1x(y)".  Still, if that's a consideration, inventing
our own syntax would be even further away from the goal.  Also, the
patch goes to some lengths to not print column aliases unnecessarily
--- in fact, there are cases where the old code would print column
aliases but the patch will not.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Making view dump/restore safe at the column-alias level
Next
From: Guillaume Lelarge
Date:
Subject: Re: Behaviour of bgworker with SIGHUP