Re: non-integer constant in ORDER BY: why exactly, and documentation?
От | Jasen Betts |
---|---|
Тема | Re: non-integer constant in ORDER BY: why exactly, and documentation? |
Дата | |
Msg-id | k5bbse$8hk$1@reversiblemaps.ath.cx обсуждение исходный текст |
Ответ на | non-integer constant in ORDER BY: why exactly, and documentation? (Ken Tanzer <ken.tanzer@gmail.com>) |
Список | pgsql-general |
On 2012-10-11, David Johnston <polobo@yahoo.com> 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@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Ken Tanzer > Sent: Thursday, October 11, 2012 4:49 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] 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
В списке pgsql-general по дате отправления: