Re: Error with DISTINCT and AS keywords - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Error with DISTINCT and AS keywords
Date
Msg-id 200207101431.14115.dev@archonet.com
Whole thread Raw
In response to Re: Error with DISTINCT and AS keywords  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: Error with DISTINCT and AS keywords  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Wednesday 10 Jul 2002 1:25 pm, Achilleus Mantzios wrote:
> On Wed, 10 Jul 2002, Andreas Schlegel wrote:

> > select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel;
> > ERROR:  Unable to identify an ordering operator '<' for type 'unknown'
> >          Use an explicit ordering operator or modify the query
>
> Do it as
>
> select DISTINCT tnr, titel, 'TEST'::text AS testcol from tTitel;

Does anyone know what type a quoted literal has? The error message reports
"unknown" - is that because it may be a date? It does strike me as a little
unexpected that a quoted string doesn't default to text.

- Richard Huxton


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Help with function optimisation
Next
From: Tom Lane
Date:
Subject: Re: Error with DISTINCT and AS keywords