Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3hAj-0007Zs-D0 for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 13:42:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3hAi-000506-16 for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 13:42:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3hAh-0004wP-LB for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 13:42:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3hAe-0008KO-OY for pgsql-general@postgresql.org; Fri, 30 Aug 2019 13:42:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7UDgQMR014606; Fri, 30 Aug 2019 09:42:26 -0400 From: Tom Lane To: Ken Tanzer cc: PG-General Mailing List Subject: Re: Exclusion constraints on overlapping text arrays? In-reply-to: References: Comments: In-reply-to Ken Tanzer message dated "Thu, 29 Aug 2019 17:42:24 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14604.1567172546.1@sss.pgh.pa.us> Date: Fri, 30 Aug 2019 09:42:26 -0400 Message-ID: <14605.1567172546@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ken Tanzer 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