From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jean Carlo Giambastiani Lopes <jean.lopes@hotmail.com.br>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: citext on exclude using gist
Date: Tue, 19 Jul 2022 19:43:23 -0400
Message-ID: <1539766.1658274203@sss.pgh.pa.us> (raw)
In-Reply-To: <DM8PR16MB44858A184A49F3A7076D51D6BA8F9@DM8PR16MB4485.namprd16.prod.outlook.com>
References: <DM8PR16MB44858A184A49F3A7076D51D6BA8F9@DM8PR16MB4485.namprd16.prod.outlook.com>
Jean Carlo Giambastiani Lopes <jean.lopes@hotmail.com.br> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, jean.lopes@hotmail.com.br
Subject: Re: citext on exclude using gist
In-Reply-To: <1539766.1658274203@sss.pgh.pa.us>
References: <DM8PR16MB44858A184A49F3A7076D51D6BA8F9@DM8PR16MB4485.namprd16.prod.outlook.com> <1539766.1658274203@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox