Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDwsJ-0000wd-EJ for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 23:43:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDwsG-0005C9-KV for pgsql-general@arkaria.postgresql.org; Tue, 19 Jul 2022 23:43:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDwsG-0004x9-9w for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 23:43:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDwsB-000691-HB for pgsql-general@lists.postgresql.org; Tue, 19 Jul 2022 23:43:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26JNhNBR1539767; Tue, 19 Jul 2022 19:43:23 -0400 From: Tom Lane To: Jean Carlo Giambastiani Lopes cc: "pgsql-general@lists.postgresql.org" Subject: Re: citext on exclude using gist In-reply-to: References: Comments: In-reply-to Jean Carlo Giambastiani Lopes message dated "Tue, 19 Jul 2022 23:31:08 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1539765.1658274203.1@sss.pgh.pa.us> Date: Tue, 19 Jul 2022 19:43:23 -0400 Message-ID: <1539766.1658274203@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jean Carlo Giambastiani Lopes writes: > I'm trying to use a citext column in the following manner without success: > create extension btree_gist; > create extension citext; > create table my_table( > foo citext, > bar numrange, > primary key (foo, bar), > exclude using gist (foo with =, bar with &&) > ); > is this possible? If so, what's wrong on this snippet? btree_gist knows nothing of citext, so it's not providing any suitable operator class. (Code-wise it probably wouldn't be that hard to add, but I see no good way to deal with the inter-extension connection other than to give btree_gist a hard dependency on citext, which people wouldn't appreciate too much.) You could fake it with exclude using gist (lower(foo) with =, bar with &&) which is surely conceptually ugly, but I think it gives compatible semantics. regards, tom lane