Re: Feature request - Mailing list pgsql-general

From Scott Miller
Subject Re: Feature request
Date
Msg-id 76bb504a0805040557q4f70d320ye81d9854fbf8a98d@mail.gmail.com
Whole thread Raw
In response to Re: Feature request  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general


On Sun, May 4, 2008 at 12:31 AM, Scott Marlowe <scott.marlowe@gmail.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

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Autocast script of peter e in PostgreSQL 8.3
Next
From: Ivan Sergio Borgonovo
Date:
Subject: storing long live parameters