Re: citext on exclude using gist - Mailing list pgsql-general

From Tom Lane
Subject Re: citext on exclude using gist
Date
Msg-id 1539766.1658274203@sss.pgh.pa.us
Whole thread Raw
In response to citext on exclude using gist  (Jean Carlo Giambastiani Lopes <jean.lopes@hotmail.com.br>)
Responses Re: citext on exclude using gist  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Jean Carlo Giambastiani Lopes
Date:
Subject: citext on exclude using gist
Next
From: Imre Samu
Date:
Subject: Re: postgis