Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB7J9Gm96249 for ; Fri, 7 Dec 2001 14:09:16 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fB7IeNg43075 for pgsql-sql@postgresql.org; Fri, 7 Dec 2001 13:40:23 -0500 (EST) (envelope-from news) From: mcornell@spamcop.net (mcornell) X-Newsgroups: comp.databases.postgresql.sql Subject: DISCTINCT and literals - Unable to identify an ordering operator Date: 7 Dec 2001 10:40:19 -0800 Organization: http://groups.google.com/ Lines: 25 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200112/98 X-Sequence-Number: 5921 Hi Folks, We're new to postgres and we have a question. We're using 7.1.x on Linux and we've had to change all of our code with "SELECT DISTINCT" and character literals to work around what looks like an SQL bug. Here's an example of the problem: template1=# SELECT DISTINCT 'foo'; ERROR: Unable to identify an ordering operator '<' for type 'unknown' Use an explicit ordering operator or modify the query template1=# SELECT DISTINCT CAST ('foo' AS CHAR(3)); ?column? ---------- foo (1 row) template1=# Notice that we have to use a CAST to avoid the bug, and it doesn't seem necessary - all other RDBMSs we use don't require this. Please tell us: Are there plans for fixing this? It's a pain to have to change all our queries... Thanks! matt mcornell@spamcop.net