Re: bug with distinct?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alfonso Peniche <alfonso@iteso.mx>
Cc: pgsql-general@postgresql.org
Date: 2001-02-10T01:23:23Z
Lists: 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