Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxmdT-003SdW-Lw for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Oct 2023 11:10:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxmdS-001wM1-1E for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Oct 2023 11:10:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxmdR-001wLt-P9 for pgsql-bugs@lists.postgresql.org; Tue, 31 Oct 2023 11:10:13 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qxmdM-003Fqn-5N for pgsql-bugs@lists.postgresql.org; Tue, 31 Oct 2023 11:10:12 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9d2e7726d5bso347073366b.0 for ; Tue, 31 Oct 2023 04:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698750606; x=1699355406; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=6IXEvvq2Gi7Ju0i5ZhEaEN2IZH0g48lLU8p5eBbOMgQ=; b=uj1wh49MXV0mO+c9e8mjnTWDiqciVZlCMHLIP/+cIzcUQ8TqJySW+ohNVDm9bY2iDy pofoDeiFC39BQfuagUx1OH5aStNfwLHziTZMKO1bPlKB685yHhrDA+OUobO20NlhZkCG 5ZDepmCEDPCTExyawH9JyXB7JMgtvRwXh/JfgAXKc14hUFul/4gBR4ePush2bKAAY0FQ VoNEnCjM2u66/ZDLIsCfaiXJtfKJCHCyWyOSl9fbnLmXMxTauw90/Lf8af9mJpftz0F7 3zEbQkc+i/bMYkpc08CyvbGfSezYFXix38A2xRxOfWdq6rgAPLu97OAiRe/JlD+AL585 rDTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698750606; x=1699355406; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6IXEvvq2Gi7Ju0i5ZhEaEN2IZH0g48lLU8p5eBbOMgQ=; b=aufk+LUlFyGC/92q0m9wjNVwIUmVgzOsYz15sOkfdWb5EQYD3FdBsc0h8SM7OtDyvS UhgOFCadDjXtycGHXl0dJWPUnIr7E46wsPrOIUbUxp9gc0iPZQTXWLsvvYTLok5PPiyl OCpUv7/+zS85VU7iIRV3ulv1CDU8Kqo/j4Vd0246WY5PsFWb+vNbvReW9TchqIQTVTs5 vEz8AWPyj7xI15y3w0azxhsleQfSltaBGdRGnwr/bW4N9MDneI/PEPeyKglG00CqWFik Cx+xUw7p/9tD9fIedgMikmWHe4bHk+7KmwXYgPclKHax+PB2+hIIY8WeX/7QIv9fWN+H xjOQ== X-Gm-Message-State: AOJu0YxpB8U69MnydWECurZHTJIBN4xDEb509y4GV2ISyfmoQjsAqNeU Z+Y2RSalShUK9CfNa41v4LvNcg== X-Google-Smtp-Source: AGHT+IHjY0kruFmeGwdXfMsG/hfJjtbOhnFa7l0LO7SvW1eYvyOvgpzDCehu4t2nZLquE5zwR33lNQ== X-Received: by 2002:a17:907:9347:b0:9be:2963:5671 with SMTP id bv7-20020a170907934700b009be29635671mr9785912ejc.69.1698750606506; Tue, 31 Oct 2023 04:10:06 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:191:64d0:7629:41d2:568e]) by smtp.gmail.com with ESMTPSA id mb18-20020a170906eb1200b009b9f87b34b6sm791972ejb.189.2023.10.31.04.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 04:10:06 -0700 (PDT) Message-ID: <52e52bddd9d5396ca07f103f799518f82e2c8aad.camel@cybertec.at> Subject: Re: BUG #18173: ERROR: could not identify a comparison function for type unknown From: Laurenz Albe To: 409800246@qq.com, pgsql-bugs@lists.postgresql.org Date: Tue, 31 Oct 2023 12:10:05 +0100 In-Reply-To: <18173-c971c32eb961e810@postgresql.org> References: <18173-c971c32eb961e810@postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-10-30 at 13:24 +0000, PG Bug reporting form wrote: > PostgreSQL version: 16.0 >=20 > postgres=3D# CREATE TABLE test_v(id int,name varchar(30)); > CREATE TABLE > postgres=3D# insert into test_v values(9,'abc'),(9,'def'),(9,'gh'), > (9,'gh'); > INSERT 0 4 > postgres=3D# explain (costs off) select distinct > (id,name,'D3Q84xpymM',123,'123') from test_v; > QUERY PLAN =20 > ------------------------------------------------------------- > Unique > -> Sort > Sort Key: (ROW(id, name, 'D3Q84xpymM', 123, '123')) > -> Seq Scan on test_v > (4 rows) >=20 > postgres=3D# 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