Re: non-integer constant in ORDER BY: why exactly, and documentation?

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>
Cc: Postgres-General General <pgsql-general(at)postgresql(dot)org>
Subject: Re: non-integer constant in ORDER BY: why exactly, and documentation?
Date: 2012-10-11 21:46:03
Message-ID: CAL_0b1u+ChOy8sifP5-BdJDSPsC14D1zjEx8Pc=+Vd3ndD6tKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 11, 2012 at 2:07 PM, A.M. <agentm(at)themactionfaction(dot)com> wrote:
> On Oct 11, 2012, at 4:48 PM, Ken Tanzer wrote:
> select * from generate_series(1,10) order by coalesce('foo');

Another workaround is

select bar.* from generate_series(1,3) as bar, (values ('foo')) as foo
order by foo;

or even simpler

select * from generate_series(1,3) order by (values ('foo'));

or my favorite

select * from generate_series(1,3) order by 'foo'::text;

--
Sergey Konoplev

a database and software architect
http://www.linkedin.com/in/grayhemp

Jabber: gray(dot)ru(at)gmail(dot)com Skype: gray-hemp Phone: +14158679984

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2012-10-11 21:57:24 Re: Expensive log_line_prefix ?
Previous Message A.M. 2012-10-11 21:07:28 Re: non-integer constant in ORDER BY: why exactly, and documentation?