Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C18C29FA5A0 for ; Thu, 12 Jul 2007 14:36:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 91077-04 for ; Thu, 12 Jul 2007 14:35:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.richard-group.com (db1.richard-group.com [66.231.181.240]) by postgresql.org (Postfix) with ESMTP id E59BF9FA06E for ; Thu, 12 Jul 2007 14:35:56 -0300 (ADT) Received: from [192.168.1.103] (wsip-70-167-243-23.dc.dc.cox.net [70.167.243.23]) by mail.richard-group.com (Postfix) with ESMTP id 419B4E9505; Thu, 12 Jul 2007 13:35:52 -0400 (EDT) In-Reply-To: <634.1184260980@sss.pgh.pa.us> References: <746273.93291.qm@web54305.mail.re2.yahoo.com> <634.1184260980@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: sql pgsql Content-Transfer-Encoding: 7bit From: Joel Richard Subject: Re: Converting from MS Access field aliases Date: Thu, 12 Jul 2007 13:36:05 -0400 To: Tom Lane X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/69 X-Sequence-Number: 28804 On Jul 12, 2007, at 1:23 PM, Tom Lane wrote: > chester c young writes: >>> SELECT field1 / 2 AS foo, >>> field2 * 2 AS bar, >>> foo + bar AS total >>> WHERE foo < 12; > >> First, I think it would be great if this worked - like the alias >> to an >> update table added in 8.2 - saves a lot of typing and makes queries >> much more readable. > > This is not an "extension", it is *directly* contrary to both the > letter > and spirit of the SQL standard. I can hardly believe that M$ did that > ... oh, actually, I can entirely believe it. The OP has a serious > problem of vendor lockin now, and that's exactly what M$ wants. > > regards, tom lane Hear hear! What's really screwy is what I found when I hooked access into my PostgreSQL database using pgsqlODBC (I know, it's an abomination) and I logged the statements that PostgreSQL was processing. In MS Access this query: SELECT foo AS bar, bar * 2 AS gleep FROM table; became this in PostgreSQL's logs SELECT foo FROM table; Vewwy Intewesting! I think Microsoft and ODBC might be making extra work for themselves (obviously they are since they are allowing these aliases) Or maybe not. Maybe I can glean something from this. Who knows. --Joel