Re: [SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Jean-Luc Lachance
PostgreSQL does not know how to sort 'TEST'. You must help it be telling it what tpe it is. Add ::text after 'TEST' as in 'TEST'::text. Maybe PostgreSQL should default to text for unknown types... JLL Andreas Schlegel wrote: > > Hi, > > I need some help to let this sql statement run with Po

Re: [SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Does anyone know what type a quoted literal has? It's assigned the placeholder type UNKNOWN until the parser can figure out from context what type it should be. Unfortunately in this case there's no context the parser knows how to work with. > It doe

Re: [SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Richard Huxton
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 mo

Re: [SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Achilleus Mantzios
On Wed, 10 Jul 2002, Andreas Schlegel wrote: > Hi, > > I need some help to let this sql statement run with Postgres 7.2.1 > > Doesn't work: > select DISTINCT tnr, titel, 'TEST' AS testcol from tTitel; > ERROR: Unable to identify an ordering operator '<' for type 'unknown' > Use an exp

[SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Andreas Schlegel
Hi, I need some help to let this sql statement run with Postgres 7.2.1 Doesn't work: 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 If I remove the D