Re: [SQL] Converting from MS Access field aliases

2007-08-08 Thread Enrico Weigelt
* Tom Lane <[EMAIL PROTECTED]> wrote: Hi, > This is not an "extension", it is *directly* contrary to both > the letter and spirit of the SQL standard. at which point is this breaking the specification ? What would happen if postgres would allow this ? IMHO supporting aliases in where clauses

Re: [SQL] Converting from MS Access field aliases

2007-07-13 Thread Andrej Ricnik-Bay
On 7/13/07, Nis Jørgensen <[EMAIL PROTECTED]> wrote: Don't attribute to malice what can be adequately explained by incompetence. He didn't :) Nis Cheers, Andrej -- Please don't top post, and don't use HTML e-Mail :} Make your quotes concise. http://www.american.edu/econ/notes/htmlmail.htm

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Nis Jørgensen
Tom Lane skrev: > 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.

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Tom Lane
Adam Tauno Williams <[EMAIL PROTECTED]> writes: > On Thu, 2007-07-12 at 13:23 -0400, Tom Lane wrote: >> chester c young <[EMAIL PROTECTED]> writes: >>> SELECT field1 / 2 AS foo, >>> field2 * 2 AS bar, >>> foo + bar AS total >>> WHERE foo < 12; >> This is not an "extension", it is *directly* contra

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Gregory Stark
"Adam Tauno Williams" <[EMAIL PROTECTED]> writes: > "AS" works in Informix, and I believe, in DB2 as well. So it is at > least pretty common; I'm not saying it is correct. Since Informix > predates M$-SQL they at least didn't invent it. AS works in Postgres too. But the defined aliases are onl

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Adam Tauno Williams
On Thu, 2007-07-12 at 13:23 -0400, Tom Lane wrote: > chester c young <[EMAIL PROTECTED]> 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

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread paallen
inal Message- From: Joel Richard <[EMAIL PROTECTED]> Date: Thu, 12 Jul 2007 13:36:05 To:Tom Lane <[EMAIL PROTECTED]> Cc:sql pgsql Subject: Re: [SQL] Converting from MS Access field aliases On Jul 12, 2007, at 1:23 PM, Tom Lane wrote: > chester c young <[EMAIL PROTECTED]>

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Tom Lane
Joel Richard <[EMAIL PROTECTED]> writes: > 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, b

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Joel Richard
On Jul 12, 2007, at 1:23 PM, Tom Lane wrote: chester c young <[EMAIL PROTECTED]> 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

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Tom Lane
chester c young <[EMAIL PROTECTED]> 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 readab

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread chester c young
>SELECT field1 / 2 AS foo, > field2 * 2 AS bar, > foo + bar AS total >WHERE foo < 12; > > The first two fields are fine, it's the third that's a problem. The > database reports > >ERROR: column "foo" does not exist > First, I think it would be great if this w

Re: [SQL] Converting from MS Access field aliases

2007-07-12 Thread Nicholas Barr
> Good morning, > > Oh joyous day! We are upgrading a legacy database system from MS > Access to PostgreSQL! Yay! > > Ok, rejoicing over. Here's our issue and PLEASE point me to the right > place if this has been discussed before. > > In MS Access one can reuse field aliases later in the same query

[SQL] Converting from MS Access field aliases

2007-07-12 Thread Joel Richard
Good morning, Oh joyous day! We are upgrading a legacy database system from MS Access to PostgreSQL! Yay! Ok, rejoicing over. Here's our issue and PLEASE point me to the right place if this has been discussed before. In MS Access one can reuse field aliases later in the same query. For