Re: bug with distinct? - Mailing list pgsql-general

From Tom Lane
Subject Re: bug with distinct?
Date
Msg-id 12736.981768203@sss.pgh.pa.us
Whole thread Raw
In response to bug with distinct?  (Alfonso Peniche <alfonso@iteso.mx>)
Responses Re: bug with distinct?
List pgsql-general
Alfonso Peniche <alfonso@iteso.mx> writes:
>      SELECT distinct 'mod_type' ,currval('mytable_idmytable_seq') from
> mytable;
> ERROR:  Unable to identify an ordering operator '<' for type 'unknown'
>  Use an explicit ordering operator or modify the query

You need to give the literal an explicit type, eg,

     SELECT distinct 'mod_type'::text, currval('mytable_idmytable_seq') from
     mytable;

7.1 will default to assuming that you meant 'text' in this scenario,
but older releases are pickier.

            regards, tom lane

pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: Re: Re: PostgreSQL over NFS?
Next
From: Mike Castle
Date:
Subject: Re: Re: Re: PostgreSQL over NFS?