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 1tixSz-004Dyn-LM for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2025 15:18:57 +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 1tixSx-00BIod-Ea for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2025 15:18:56 +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 1tixPZ-00BBZh-Co for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2025 15:15:26 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tixPX-000ox5-2J for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2025 15:15:25 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-8553e7d9459so54840139f.2 for ; Fri, 14 Feb 2025 07:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739546122; x=1740150922; 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=GBZEGE2+n8A/0ZOwhTp+MwyTQumPF9R+A8+7G8MggM0=; b=cTij0USiFzPNqmV/N90vqaZJS0gGN6RGIQBAn/iRcdeGLCLHsb15lwP9U+cPtiSoAY uUmX/bqYau2+mKG+2462R6io+tWwxctif4eqN6A9S+6tShfuKrBF9JH85ooDh/Dt0uSJ FoKzequ4PRHNkFoILP0Ahru7O2DUlT17/lnPZso+As18dwwjvPeCMen/EEnpcOCSFMv1 lMvu0di5kgMp2hEguD7rGbv7YlgV0KzJ2T+sEAeNDcluqcay+0wkf4n/MpK1DhFPnmED ptvpj8uZdaNXKASluYVykhavgwRGZhgbZr4qsEugyO1l8cfBKJpwVRHcCCYtVZV4b+V3 R2og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739546122; x=1740150922; 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=GBZEGE2+n8A/0ZOwhTp+MwyTQumPF9R+A8+7G8MggM0=; b=LikYDisjri5FF6YEAS3+f4hCl428BgFLIIO4u43tIxGELIYfzRvLSeHspMabnKMyE8 Mgo2GMUAm5UQ83JBiqCwFdYr03EDhv+AL9vyYyJA1DUrLATnrxiVJMYbicGU75P4atW1 x1OGPx+EegjzTMCBbHesz4JGXw7Lp3DFiRe7PJmbin3nKzANxTxPQEbGjWl8/LXmHuPU macfzP3y4dt5D1qr0biY03O5Ul2E3iUShFOVtjHAEhrQpI86Ynjb2aeS30j1WtKRlNwR O9jjqBqNPtaxueHmmby6fEavyMbgqhlnnsGCzpUTIjhTKc+RBN43M93R064OypCy/7IL GteA== X-Forwarded-Encrypted: i=1; AJvYcCWPWtBrS+rp/smB9czhSOwfG4MKG9yhs9FdC4Wa2XtGC5LIPmd0QoFNMJqAV5Ygc6dCUlmH58WD0eNsu+rv@lists.postgresql.org X-Gm-Message-State: AOJu0YwDlz99iUcj196wXPAEbDok5bcfl5zTVNn9Sv3tOEag9T83Yy+0 PssqYr+EqRlbIJmLc1aHwSsBsX890ANqhQF/pY4LZMboFx6H5+s9vBIUNmq+G1uiy4qtXQgmYjR IuX8GtOwMNN14fbmYoLCzmtT7ASNUTKHS X-Gm-Gg: ASbGncsEGuTv9NEZsJiKZa1nQs8jrXDUx5TjkInrQ3bkKoPmQI6dqybBL4XndLvJw9y o9T/Ll4/4KHxrKvkEaH8zmx8qPqrSIW0vGxTAHr7dnWQ7PkWMUlorcXbgmzjkrRrn9qz47EqXTe n7Dd42mfCUBa7JNbPTpCp/6IIspkbWzgM= X-Google-Smtp-Source: AGHT+IF+0jnN58o+I15aauNuc40Uu8K7MFOwBv9hG1ur2gX1FMf9eMYQax1LkiU3d2dzznFsa3S62WFnG0irxofpG0k= X-Received: by 2002:a05:6e02:164b:b0:3cf:cf25:ec83 with SMTP id e9e14a558f8ab-3d17bf30ed2mr89414565ab.11.1739546121806; Fri, 14 Feb 2025 07:15:21 -0800 (PST) MIME-Version: 1.0 References: <8ac6a1dd-db82-4ea7-8186-0c354d79049f@aklaver.com> <9fa75099-1ee9-43de-ac6e-945841b184eb@aklaver.com> <22406cdf-83f5-4b98-b07e-7827afe97f93@aklaver.com> <94e1205e-8ddf-403b-8477-02d7939f2905@aklaver.com> In-Reply-To: From: Greg Sabino Mullane Date: Fri, 14 Feb 2025 10:14:45 -0500 X-Gm-Features: AWEUYZlM9r_l8gbLRxMhBGzByri2iGxQd9hTIdMy_l3CcPpBlmR9JZqqJxMa5Aw Message-ID: Subject: Re: Best Approach for Swapping a Table with its Copy To: Laurenz Albe Cc: Marcelo Fernandes , Adrian Klaver , Dominique Devienne , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000a92ec0062e1ba45f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a92ec0062e1ba45f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 14, 2025 at 12:41=E2=80=AFAM Laurenz Albe wrote: > Moreover, you have to make sure to send out invalidation messages so that > every session that caches statistics or > execution plans for the tables discards them. Hmm...is that really necessary? Because if so, there is no direct SQL-level way to do that I am aware of, so we are back to a C extension. Or just restarting the cluster :) Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --000000000000a92ec0062e1ba45f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Feb 14, 2025 at 12:41=E2=80=AFAM = Laurenz Albe <laurenz.albe@c= ybertec.at> wrote:
Moreover, you have t= o make sure to send out invalidation messages so that every session that ca= ches statistics or
execution plans for the tables discards them.

Hmm...is that really necessary? Because if so, there is no direct SQL-le= vel way to do that I am aware of, so we are back to a C extension. Or just = restarting the cluster :)

Cheers,
Greg

--
Enterpr= ise Postgres Software Products & Tech Support

--000000000000a92ec0062e1ba45f--