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 1tixUf-004EI2-3h for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2025 15:20:41 +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 1tixUd-00BJkl-3Z for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2025 15:20:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tixUc-00BJkW-MH for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2025 15:20:39 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tixUa-000p01-2u for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2025 15:20:39 +0000 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-84a012f7232so93901439f.0 for ; Fri, 14 Feb 2025 07:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739546435; x=1740151235; 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=3FsudWeFhZGh8mGHhwcytLHnHDnsW94F84mjqtf2KQ0=; b=TuKm11+CmWE6Lnv3SAWsh7m8MPKP62vaMXnWTF4f13SFJrE+4u+ejYSv/jAUl4bAdX eZ/OX/sqDYRCkJHkTWEFQYGtk4RSIBqJN7K9xuTqFMQE1RQ8jKtbURsZeEBQ/uwXZSRd fwtSH3BhYossSFzP2oSg0DzWKtxcthfSJxPB7xGPo88DDuoIrc64PLcsa8e91+LK0mK+ VpnybmejqO3wBOVlbwS+ah+X6jYCf8CdtB2845NVyXUtLUZfaav3vF5MHJXwOSkLbMwU is8gN+5CXnjdyr3V/w7VQrMhxuk6AuPtgS+8HOiafv5JEWGfVWkAGLcLcCIVRwn8p0zF A9lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739546435; x=1740151235; 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=3FsudWeFhZGh8mGHhwcytLHnHDnsW94F84mjqtf2KQ0=; b=eRALxIJCL07vr55rPv3GNMawixsyfjJKTgVahH8pVah1lFZKK5Rl1FasHFgv/NXsvp f5PUmfEDPAHF+SETJM+NqIm9RgeZozu897Wz/v5qSDStCP2PR1HuOtc3tl4aWLTTG78Q Y0TePl3qYo5Xr6kD+E2sif9qMyhxpphEvVqB56cvN/rSlEs9evIzSSq348EXLn9Al5mQ nhPWJkbtjAs4/SWZ5rrqHiX8ZZrYZu7bWmMIyaUhl1OrvkRQHztl/ru5UmRgN2OuTLe3 jdy2HRCs29l25ZG+RXqQ0EaJu2DpayEteotkCmqIOD/rK3T211uaoTm/FfXKfj3gLHgq XGeg== X-Forwarded-Encrypted: i=1; AJvYcCVydP1SmR3ctByx9yV02M/lop6YcIvzQbb+1rA2rghmK2V+pWSWEjYb4zyLOq/Gk87RTt5KbKg/g/6nQxfQ@lists.postgresql.org X-Gm-Message-State: AOJu0YytTmsT54mdPZUiWAUIL/0L+CA9fM2a1AIP2bcjXueK/Uu15EJh 1390B+ShjaY5EIUpeBB2Yht0ggWhY0SA4P88eWRAaMdiWi4Sshkh/TrxGVW6M+aoSoGZal+Cyx2 iCBQBVj7TnrvFiLf2QNFVgmTIA5Y= X-Gm-Gg: ASbGncv8lBZOoGJO3/6vQ2NwgeqimAVLl9UqgLQeKFrJFFvCc/tsrPBlaVYzSavQD1n 1ndxvnu4kJhp5l/yTE1gBy76jJ8TOliwsFZ9zC9COJ6XZJLbwkubUFcuK8aqtfsBs27/4MwAQzi Hs04mwAIzpiB2Z3pvXnuRfKicXIc7JO0c= X-Google-Smtp-Source: AGHT+IEsIO24GgSFn38j7T0OWtDUDHPpKHFibJCY36kXqanT3HVURGUFLNBlovwT9dGFavAVeiqc5jSrCKs+4VnrQE4= X-Received: by 2002:a05:6e02:1205:b0:3d1:84ad:165e with SMTP id e9e14a558f8ab-3d18cd0864emr47703665ab.7.1739546434888; Fri, 14 Feb 2025 07:20:34 -0800 (PST) MIME-Version: 1.0 References: <8ac6a1dd-db82-4ea7-8186-0c354d79049f@aklaver.com> <44BB6A74-0AB1-462C-B13A-2CF106DA70D6@kleczek.org> In-Reply-To: <44BB6A74-0AB1-462C-B13A-2CF106DA70D6@kleczek.org> From: Greg Sabino Mullane Date: Fri, 14 Feb 2025 10:19:57 -0500 X-Gm-Features: AWEUYZmwown-QBAjC1n8u1jIFbiDB67Z1Am87AOKje7ZCCIEMk3LtrHnxneIIX0 Message-ID: Subject: Re: Best Approach for Swapping a Table with its Copy To: =?UTF-8?B?TWljaGHFgiBLxYJlY3plaw==?= Cc: Marcelo Fernandes , Adrian Klaver , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000052736a062e1bb767" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000052736a062e1bb767 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 14, 2025 at 1:02=E2=80=AFAM Micha=C5=82 K=C5=82eczek wrote: > Create index concurrently and then fiddle with the catalog tables to > define the constraint using this index? > You mean an ALTER TABLE ... ADD CONSTRAINT ... EXCLUDE without actually doing an ALTER TABLE. Nope, that's far worse than the pg_repack shenanigans, as we would be creating new catalog objects. Ideally would be that someone adds support for USING INDEX for an exclusion constraint. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --00000000000052736a062e1bb767 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Feb 14, 2025 at 1:02=E2=80=AFAM M= icha=C5=82 K=C5=82eczek <michal@kl= eczek.org> wrote:
Create index concurre= ntly and then fiddle with the catalog tables to define the constraint using= this index?

You mean an ALTER TABLE ..= . ADD CONSTRAINT ... EXCLUDE without actually doing an ALTER TABLE. Nope, t= hat's far worse than the pg_repack shenanigans, as we would be creating= new catalog objects.

Ideally would be that someon= e adds support for USING INDEX for an exclusion constraint.=C2=A0

Cheers,
Greg

--
Enterprise Postgres Software Products &= ; Tech Support

--00000000000052736a062e1bb767--