X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7CF96474E42 for ; Tue, 4 Feb 2003 07:15:38 -0500 (EST) Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) by postgresql.org (Postfix) with ESMTP id E1BF1474E53 for ; Tue, 4 Feb 2003 07:15:37 -0500 (EST) Received: from p50818a9b.dip0.t-ipconnect.de ([80.129.138.155] helo=web.de) by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18g1zH-0005l0-00 for pgsql-performance@postgresql.org; Tue, 04 Feb 2003 13:15:40 +0100 Message-ID: <3E3FAEF2.5080302@web.de> Date: Tue, 04 Feb 2003 13:15:46 +0100 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: SELECT DISTINCT is picky about constants Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/10 X-Sequence-Number: 1066 The query SELECT DISTINCT keycol, 'constant' FROM myTable or SELECT DISTINCT keycol, NULL FROM myTable will result in an error message (7.3.1) Unable to identify an ordering operator '<' for type "unknown" Use explicit ordering operator or modify query If I use 'constant'::varchar or NULL::varchar everything's fine. Unfortunately, this SELECT DISTINCT will appear quite often in my app. I'd rather like PostgreSQL to use implicit type casting for such constants. The final type chosen doesn't matter anyway and life would be easier.