Re: Converting from MS Access field aliases - Mailing list pgsql-sql

From paallen@attglobal.net
Subject Re: Converting from MS Access field aliases
Date
Msg-id 1996625737-1184263783-cardhu_decombobulator_blackberry.rim.net-1685167243-@bxe119.bisx.prod.on.blackberry
Whole thread Raw
In response to Re: Converting from MS Access field aliases  (Joel Richard <postgres@joelrichard.com>)
List pgsql-sql
Joel,

To avoid ms access from managing the query, use a pass-through query.  Then access will send the raw sql statment to
psqland psql will return just the results to access.
 

It will speed things up a bit too for large datasets.

Phillip allen
Sent via BlackBerry by AT&T

-----Original Message-----
From: Joel Richard <postgres@joelrichard.com>

Date: Thu, 12 Jul 2007 13:36:05 
To:Tom Lane <tgl@sss.pgh.pa.us>
Cc:sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: [SQL] Converting from MS Access field aliases 


On Jul 12, 2007, at 1:23 PM, Tom Lane wrote:

> chester c young <chestercyoung@yahoo.com> 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



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
              http://www.postgresql.org/docs/faq

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Converting from MS Access field aliases
Next
From: Adam Tauno Williams
Date:
Subject: Re: Converting from MS Access field aliases