On Mon, Apr 30, 2018 at 2:14 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Not *nearly* as much as I'd object to mostly-breaking postfix operators. > Now admittedly, if the Berkeley guys had never put those in, nobody > would miss them. But they're there, and I'm afraid that users are > likely depending on them. Neither of your suggestions above would be > any less damaging to such users than removing the feature altogether.
Well, that sounds different than what you said upthread in August of 2016: tgl> Agreed, if postfix operators were the only thing standing between us and tgl> fixing that, it would be a pretty strong argument for removing them. I agree that there could be some people using numeric_fac, the only postfix operator we ship. Probably not many, since it's an inefficient implementation of an operation that overflows for all but a few tens of thousands of possible input values, but some. But we could keep that operator working without supporting the facility in general. Do we have any evidence at all that anybody has got a user-defined postfix operator out there? I'm reluctant to keep a feature that's blocking such an important improvement unless we can come up with some real examples of it being used. I've never run across it, and a Google search didn't turn up any examples of anybody else using it, either. The basic problem here, for those following along from home, is that if we allow "SELECT h hour FROM tab" to mean select column h with column alias hour, then "SELECT hour + 24 * day" becomes ambiguous in the face of postfix operators: it could either mean what it obviously is intended to mean, or it could mean that you should look for a postfix * operator, apply that to 24, add hour to the result, and then call the resulting column "day". This is less obviously insane when you use a differently-named operator and columns -- who knows which way "SELECT thunk + squidge!!! snarkke FROM frobnitz" is intended to be interpreted. But I'm just a bit doubtful that anyone is going to stop using PostgreSQL because we take away their ability to make !!! a postfix operator, whereas I think the inability to alias columns without using AS when the column label happens to be a keyword IS a problem for adoption. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company