Re: Exclusion constraints on overlapping text arrays?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Exclusion constraints on overlapping text arrays?
Date: 2019-08-30 13:42:26
Message-ID: 14605.1567172546@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com> writes:
> 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"

> 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 haven't heard of anyone working on it recently.

> 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?

As far as that goes, you'd just need to add parentheses.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-08-30 13:48:59 SQL equivalint of #incude directive ?
Previous Message Steven Lembark 2019-08-30 13:26:31 Re: Work hours?