Re: bug with distinct?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alfonso Peniche <alfonso(at)iteso(dot)mx>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug with distinct?
Date: 2001-02-10 01:23:23
Message-ID: 12736.981768203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alfonso Peniche <alfonso(at)iteso(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Arnold 2001-02-10 01:28:47 ODBC 7.1
Previous Message Peter Eisentraut 2001-02-10 01:17:19 Re: bug with distinct?