Re: select distinct null

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: <karol(at)gmweltel(dot)com(dot)pl>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: select distinct null
Date: 2001-01-04 14:44:51
Message-ID: 005501c0765c$e69272c0$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

----- Original Message -----
From: <karol(at)gmweltel(dot)com(dot)pl>

> INSERT INTO table1 VALUES SELECT DISTINCT null,table2.atr1 FROM table2
> WHERE table2.atr1 > 0;
>
> It works in PostgreSQL 6.4.2 but in 7.0.3 it returns:
>
> ERROR: Unable to identify an ordering operator '<' for type 'unknown'
> Use an explicit ordering operator or modify the query
>
> I discovered that PostgreSQL 7.0.3 doesn't accept the querry:
>
> select distinct null;
>

Casting the null seems to do it.

select distinct null::text,a from foo;

works OK on my 7.0 here

- Richard Huxton

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2001-01-04 15:24:33 Re: (not) freeing cursors
Previous Message karol 2001-01-04 13:38:58 select distinct null