Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1trlcY-009Eok-2j for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 22:29:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1trlcV-001X2o-1E for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 22:29:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1trlcU-001X2g-GD for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 22:29:10 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1trlcS-0026q8-26 for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 22:29:09 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2ff6b9a7f91so1230474a91.3 for ; Mon, 10 Mar 2025 15:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741645748; x=1742250548; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=z6mZESWlm7AD6CrviuihmDFPuFM3E9WqhXaKLd+m02Q=; b=MceQb3FqkAFAdDROBNILI40maNaWdvk2XKyoBYgQRvhFxr535gjIBFoNsWCHxQxdiu foqA+oqPfIqr1PFui+KiIeGd3LOchFKqavrBj5URxrWCU8K8IrE8jepolgir9so4TAgG tWByoKdPAPcWDmqXGFu5uFJlWe5GG5B78DVWBPRrkquB2G+Lz5eNPFoLAFcIZ/r4at6W yP4mBVZ46v4OpivQ/AA0KqVrDpte/obztrSwVl3P/issFERSe7sSg9wZ2Exvi2Bly1zy UiCAC56CtpFeelDEiVFiy9x5Z6S7e9XTNiMPLxPhQlHbw41SnP2UPtk0YyhokrSEYPpH M1+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741645748; x=1742250548; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z6mZESWlm7AD6CrviuihmDFPuFM3E9WqhXaKLd+m02Q=; b=L8Laj2pV5rtGLEZoKSvFrTf/PQoIrOwqHAJcteQqtBR7IPsBKxnBXl5M/4e86dYl/5 eHE3wB6l+wcBoK3a/L8/ZX4HJ/NlkOxemSZ8f+rgmCd9iyHkNRZsbkLEVblg+TCSSMYp 8axgQqyzdCKj/3mF0gOpTPLVeZ33i9qBZDkEms9drXybFIbX+hcDqO+hnOCEMa2G7TF8 q9XAoFHhL3mr/M3MJ5X/Ly2+VR7QJ1IbDinbOzDySAuFsIehR8Dr0y8SDPwrIqbowW6u hxQtXAEm2vSg7t1WoPM4HM6eC4EMuUtZDzwH16ctznZruFUfr3+VnnAo13uSKugfHGWB tnkA== X-Gm-Message-State: AOJu0Yxg2utTxSYxrtnN1bMEyXsZmf+Z0RJJqbSDMSFt1wmK9tbkGF3l r/SXb6G0JnaKR8m7QC+xQn/rCX0/x9C4+hXZiTFAVRYgprFLRAH7fa5PwVur8hCdMG5xcGz1A/Y 0VNGCBqLfeoZP9l4vGx0qJcO/7Zs= X-Gm-Gg: ASbGncsLZuPl66hXVDFPrDFMCTVD8NVZbjj4kbW/64abNnRO5RHxawajs7u83QSWC91 lNMKm8B+3UXo0gdAS0M7NUbnkXh8L8G494hwxHC1kzAY/Evm1HTExbcM92ibw9NNsNJY6cOw6Q+ UM9Tos6IgiaH4/TOS1vX9OnYwRg5ZV X-Google-Smtp-Source: AGHT+IHV/jNKsBowwpoUcjJXml62TMqboktNVs1DNfbybOEfQ7kgm1hThCYoWDyUBWSSf8xzEmvhiL+o3fLX/foGyPo= X-Received: by 2002:a17:90b:4a81:b0:2ee:f59a:94d3 with SMTP id 98e67ed59e1d1-300a2891c23mr6247974a91.0.1741645747544; Mon, 10 Mar 2025 15:29:07 -0700 (PDT) MIME-Version: 1.0 References: <6f7fff13-fbc6-423b-b8cb-73762b0cc28b@cloud.gatewaynet.com> In-Reply-To: From: "Rhys A.D. Stewart" Date: Mon, 10 Mar 2025 17:28:39 -0500 X-Gm-Features: AQ5f1Jq9cUZBoKMOIO-4CbVLl9Hr-WWQLcp7XYVYaN6FwRgQQVrciWjq2G_VL_0 Message-ID: Subject: Re: exclusion constraint question To: Achilleas Mantzios - cloud Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greetings, > I think I got it : > > ALTER TABLE shelves ADD CONSTRAINT shelves_excl EXCLUDE USING gist( array_remove((ARRAY[l_mug_id,c_mug_id,r_mug_id]::int[]),NULL) WITH && ); > > but the caveat is I had to cast to 32-bit int array. Haven't found any opclass for int8 (bigint) in intarray extension. I tried this and got the opclass error for the int8 and (since postgres is so wonderfully extensible) considered trying to write the oppclass for bigint. But ultimately writing the trigger as suggested by Laurenz is much easier. So that is the route I went, Thanks all for your input. Rhys Peace & Love | Live Long & Prosper