SELECT DISTINCT is picky about constants - Mailing list pgsql-performance

From Andreas Pflug
Subject SELECT DISTINCT is picky about constants
Date
Msg-id 3E3FAEF2.5080302@web.de
Whole thread Raw
Responses Re: SELECT DISTINCT is picky about constants  (Rod Taylor <rbt@rbt.ca>)
List pgsql-performance
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.




pgsql-performance by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres 7.3.1 poor insert/update/search performance
Next
From: Rod Taylor
Date:
Subject: Re: SELECT DISTINCT is picky about constants