Re: BUG #18173: ERROR: could not identify a comparison function for type iso-8859-1 - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: BUG #18173: ERROR: could not identify a comparison function for type iso-8859-1
Date
Msg-id 52e52bddd9d5396ca07f103f799518f82e2c8aad.camel@cybertec.at
Whole thread Raw
In response to BUG #18173: ERROR: could not identify a comparison function for type iso-8859-1  (PG Bug reporting form <noreply@postgresql.org>)
Responses 回复: BUG #18173: ERROR: could not identify a comparison function for type unknown  ("下雨天" <409800246@qq.com>)
Re: BUG #18173: ERROR: could not identify a comparison function for type iso-8859-1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Mon, 2023-10-30 at 13:24 +0000, PG Bug reporting form wrote:
> PostgreSQL version: 16.0
>
> postgres=# CREATE TABLE test_v(id int,name varchar(30));
> CREATE TABLE
> postgres=# insert into test_v values(9,'abc'),(9,'def'),(9,'gh'),
> (9,'gh');
> INSERT 0 4
> postgres=# explain (costs off) select distinct
> (id,name,'D3Q84xpymM',123,'123') from test_v;
>                          QUERY PLAN
> -------------------------------------------------------------
>  Unique
>    ->  Sort
>          Sort Key: (ROW(id, name, 'D3Q84xpymM', 123, '123'))
>          ->  Seq Scan on test_v
> (4 rows)
>
> postgres=# select distinct (id,name,'D3Q84xpymM',123,'123') from test_v;
> ERROR:  could not identify a comparison function for type unknown

This is not a bug.  You probably want to remove the parentheses.

Yours,
Laurenz Albe



pgsql-bugs by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: BUG #18170: Unexpected error: no relation entry for relid 3
Next
From: "下雨天"
Date:
Subject: 回复: BUG #18173: ERROR: could not identify a comparison function for type unknown