Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdhLG-0001ge-Ie for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Mar 2023 00:56:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pdhLF-0001IS-AJ for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Mar 2023 00:56:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdhLF-0001IJ-2E for pgsql-bugs@lists.postgresql.org; Sun, 19 Mar 2023 00:56:09 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdhLC-0008Ch-7w for pgsql-bugs@lists.postgresql.org; Sun, 19 Mar 2023 00:56:08 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by mail.gandi.net (Postfix) with ESMTPSA id 9A4F4C0004; Sun, 19 Mar 2023 00:55:59 +0000 (UTC) Message-ID: <3b32d6df-c6a4-c3fa-0eef-d4e2a8789fb6@postgresfriends.org> Date: Sun, 19 Mar 2023 01:55:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY Content-Language: en-US To: branko.radovanovic.zg@gmail.com, pgsql-bugs@lists.postgresql.org References: <17853-57fa4c939f613eb6@postgresql.org> From: Vik Fearing In-Reply-To: <17853-57fa4c939f613eb6@postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/18/23 23:44, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17853 > Logged by: Branko Radovanovic > Email address: branko.radovanovic.zg@gmail.com > PostgreSQL version: 13.4 > Operating system: Debian > Description: > > The following SQL: > > values ('a') > order by 1 collate "C"; > > ...returns an error: SQL Error [42804]: ERROR: collations are not supported > by type integer > > In the above query, "1" is not an integer but a column reference, so it > should be treated as well-formed and work the same as with the actual column > label: There is an argument that this should work. There is also an argument that using numerical column references is not (or rather, is no longer) Standard SQL and should not be used. -- Vik Fearing