Re: Feature request

From: "Scott Miller" <smiller(at)duels(dot)com>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Feature request
Date: 2008-05-04 12:57:29
Message-ID: 76bb504a0805040557q4f70d320ye81d9854fbf8a98d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, May 4, 2008 at 12:31 AM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
wrote:

>
> You have the same type of problem if you have this query:
>
> select count(id), count(int2) from table.
>
> They both are named count. The simple answer is to always alias your
> select fields.
>
> select count(id) as idcount, count(int2) as intcount from table.
>

Of course. This is the a limitation stemming from the CakePHP web
development framework. In this case, it would assign those two fields to an
unnamed table/bucket, but for columns stemming from the from clause, it
splits them into buckets based on the table alias name. I can alias the
table names, but it means rewriting all the custom queries in the app, or
the resulting processing code which has been relying on the bucketizing.
Which is what I will do. Just another small speedbump moving my app away
from MySQL.

Scott

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2008-05-04 13:01:48 SQL window functions
Previous Message Martijn van Oosterhout 2008-05-04 11:16:55 Re: User Defined C Function with minGW