On 2012-10-11, David Johnston <polobo@xxxxxxxxx> wrote: > This is a multipart message in MIME format. > > ------=_NextPart_000_0400_01CDA7D1.CAF1CC60 > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: 7bit > > From: pgsql-general-owner@xxxxxxxxxxxxxx > [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Ken Tanzer > Sent: Thursday, October 11, 2012 4:49 PM > To: pgsql-general@xxxxxxxxxxxxxx > Subject: non-integer constant in ORDER BY: why exactly, and > documentation? > > > > Hi. I recently ran a query that generate the same error as this: > > SELECT * FROM generate_series(1,10) ORDER BY 'foo'; > ERROR: non-integer constant in ORDER BY > LINE 1: SELECT * FROM generate_series(1,10) ORDER BY 'foo'; yeah, it seems there's a difference between a constant and a constant-valued expression SELECT * FROM generate_series(1,10) ORDER BY 'foo'::text; SELECT * FROM generate_series(1,10) ORDER BY 1::int desc; SELECT * FROM generate_series(1,10) ORDER BY 1 desc; -- ⚂⚃ 100% natural -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general