Re: Error with DISTINCT and AS keywords

From: Richard Huxton <dev(at)archonet(dot)com>
To: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Error with DISTINCT and AS keywords
Date: 2002-07-10 13:31:14
Message-ID: 200207101431.14115.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-07-10 13:34:36 Re: Help with function optimisation
Previous Message Christoph Haller 2002-07-10 13:00:42 Re: Variables in PSQL