Re: select issue with order v8.1

From: Terry <td3201(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select issue with order v8.1
Date: 2010-02-25 15:42:42
Message-ID: 8ee061011002250742g57eec968qd3e1f5e37714d9c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 24, 2010 at 10:30 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> On Wed, Feb 24, 2010 at 8:50 PM, Terry <td3201(at)gmail(dot)com> wrote:
>> Hello,
>>
>> I have an application that is doing something stupid in that it is
>> tacking on its own order clause at the end of the statement I am
>> providing.
>>
>> For example, I am putting this statement in:
>> select ev_id,type,ev_time,category,error,ev_text,userid,ex_long,client_ex_long,ex_text
>> from clients_event_log limit 100
>>
>> It is tacking on ORDER BY ev_id.  The problem is that isn't per the
>> syntax.  Can anyone think of anything clever to get around this stupid
>> application doing what it is doing?  For example, anything I can do
>> beside limit?
>>
>> I appreciate the thoughts!
>
> You could either wrap it in a subselect or make a view.
>
> select * from (select
> ev_id,type,ev_time,category,error,ev_text,userid,ex_long,client_ex_long,ex_text
> from clients_event_log limit 100) as a
>
> and an order by tacked on the end of that is ok.
>

This and the previous poster's advice both worked. Thank you.
However, I am having another issue where the application is not
viewing a 'serial' data type as a number. Clearly none of this is a
postgres issue. Stupid programming.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message akp geek 2010-02-25 15:46:27 Re: postgres password change
Previous Message Wappler, Robert 2010-02-25 15:22:21 Re: Restricting the CREATEROLE privilege