Skip site navigation (1) Skip section navigation (2)

BUG #1171: select distinct 'value',... fails.

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1171: select distinct 'value',... fails.
Date: 2004-06-17 14:54:43
Message-ID: 20040617145443.240E8CF5493@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1171
Logged by:          Harro Lock

Email address:      harro1(at)dataleaf(dot)nl

PostgreSQL version: 7.4

Operating system:   Linux

Description:        select distinct 'value',... fails.

Details: 

'select distinct' fails when using a string value in the columnlist.

Here is a minimal query that reproduces the bug:

	select distinct 'value';

This should give "value" as a result, but it produces this error-message:

ERROR:  Unable to identify an ordering operator '<' for type '"unknown"'
        Use an explicit ordering operator or modify the query


A work-around for this bug is to cast the string to a known type:

	select distinct cast('value' as varchar);



Responses

pgsql-bugs by date

Next:From: Robert OsowieckiDate: 2004-06-17 15:52:56
Subject: Re: BUG #1169: Select table.oid from view seems to loop
Previous:From: Stephan SzaboDate: 2004-06-17 14:47:45
Subject: Re: BUG #1169: Select table.oid from view seems to loop

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group