From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Exclusion constraints on overlapping text arrays?
Date: Fri, 30 Aug 2019 10:20:10 +0300
Message-ID: <df6ca4ee-1408-2154-fdff-4ea3ab9c1256@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAD3a31WW3qFAhe19OEvgDOegr_cJZVAQ4bVpSZ83bZCmWe1=mw@mail.gmail.com>
References: <CAD3a31WW3qFAhe19OEvgDOegr_cJZVAQ4bVpSZ83bZCmWe1=mw@mail.gmail.com>
On 30/8/19 3:42 π.μ., Ken Tanzer wrote:
> Hi. Using 9.6.14, I was setting up a table with this:
>
> EXCLUDE using gist (EXCLUDE using gist (grant_number_codes with &&)
>
> Where grant_numbers is a varchar[]. I get this error:
>
> ERROR: data type character varying[] has no default operator class for access method "gist"
> HINT: You must specify an operator class for the index or define a default operator class for the data type.
>
> I did some Googling, and it looks like you could do this for integer arrays with the intarray extension. I didn't see anything I'd recognize as an equivalent for varchar (or text) arrays. Is there
> any way to do this now? And if not, is there much prospect of this being implemented at some point?
>
> I found a couple of old threads about this. Not sure if they are still relevant, but listed below.
>
> Also, on a side note, I tried using grant_number_codes::text[] with &&, but that got a syntax error. Does that mean casting isn't allowed at all in these constraints?
Maybe take a look at https://dba.stackexchange.com/questions/185174/error-data-type-text-has-no-default-operator-class-fo...>
> Thanks in advance,
> Ken
>
> 1) This 2014 thread asked about this:
>
> _*array exclusion constraints*_
> https://www.postgresql.org/message-id/flat/20141113183843.E8AC620362%40smtp.hushmail.com
>
> and pointed toward this 2013 discussion:
>
> _*Todo item: Support amgettuple() in GIN*_
> https://www.postgresql.org/message-id/flat/5297DC17.7000608%40proxel.se
>
>
>
> --
> AGENCY Software
> A Free Software data system
> By and for non-profits
> /http://agency-software.org//
> /https://demo.agency-software.org/client/
> ken.tanzer@agency-software.org <mailto:ken.tanzer@agency-software.org>
> (253) 245-3801
>
> Subscribe to the mailing list <mailto:agency-general-request@lists.sourceforge.net?body=subscribe> to
> learn more about AGENCY or
> follow the discussion.
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
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: achill@matrix.gatewaynet.com
Subject: Re: Exclusion constraints on overlapping text arrays?
In-Reply-To: <df6ca4ee-1408-2154-fdff-4ea3ab9c1256@matrix.gatewaynet.com>
References: <CAD3a31WW3qFAhe19OEvgDOegr_cJZVAQ4bVpSZ83bZCmWe1=mw@mail.gmail.com> <df6ca4ee-1408-2154-fdff-4ea3ab9c1256@matrix.gatewaynet.com>
* 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