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 1ufuRb-00DMsd-9J for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jul 2025 06:01:11 +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 1ufuRZ-00EogH-As for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Jul 2025 06:01:09 +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 1ufuRZ-00Eog8-15 for pgsql-hackers@lists.postgresql.org; Sun, 27 Jul 2025 06:01:09 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ufuRU-0014nD-0B for pgsql-hackers@lists.postgresql.org; Sun, 27 Jul 2025 06:01:09 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3e3d7b135c2so3619135ab.1 for ; Sat, 26 Jul 2025 23:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753596063; x=1754200863; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zXPf0hiXfnb1O9YlHk0fSTJ4ONNH1ywMFzWPIarweNI=; b=AiAw88huO1J+ympiVeikfDZz+V939QZQblg8w9C2dF8UmXOSxZUf1exubyAxGTu1vG RoVXl26QYFS3ojIyYB2+yP4k0khIZ/2i+9i3xxMu4gak/jaVDufzktRrpNojsTPZw+sl 49mYuXKyAAir5ubDU7tpV738HMYOKdkdb34udyhcUQYV1Jcpjm/mn+fOZuKBVh9qMx7e rRywGHLPqjD7T2/1g6l7tQJZFEL4IqIn99PNJdrLy4Ow0PI/m2f8sNq/OK0s16YHzt4c 9dzlr+ktKvLztJxLRMKfgQJF5vM8FiDd3Ypayr9PTrb8xFo4vkSBPdgGkVMsoKkRnctU QjQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753596063; x=1754200863; h=content-transfer-encoding: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=zXPf0hiXfnb1O9YlHk0fSTJ4ONNH1ywMFzWPIarweNI=; b=r4xSXvBpW64GpgSXo9avmM/DZboaQQsXUk+KjH/v48mO6B3ApJ5ZShY/NePXg8girW UY2FOmEj12thLUWCce+x1F3rUHyz5VNrVz5vmUFWu01BogetuC4hlYG+4MRDMzlIYMQl cByojVQpKfxcGCvex+pPrwD1qiwaTgUSceaP0yp0h5pZBpyYufKFW3dWFpw7FvGQ4bot /7JQjtfS4iITa4TyPmZ+2+7WsQLcg/uYeGm+l82WXptKtLiXMunFF6JaPv++z/qD/NQe sxrB1Ymc8k+YmdfWHX536F64GF/meYJP6nnm2e5e60hGvoVKkhUHAukUaC9mCW9MTH6d mUyw== X-Gm-Message-State: AOJu0YxEKjp7JmjbxnYmDARvVyUhhiN+Xml1t/NcTS9yl+IxB5fif1ew wNZBuAWKpCsStTRPwr0Ui+t/gxzaS3VLcJB/zevKC02Zg5NCVVDJxXycTJRoT+NWrbl8TcVJiT0 mtlieAwndy85rYZ/h2gh+McpOvKrHA+2uZB0E/Y0= X-Gm-Gg: ASbGncvnQe0viEPdxv26DVZjSaIIBjbH7SKI8TM+Dw5M+IlmdOZsGX1+GCSUyPhO3az lQ2ZbN5Rh9ZqnTCGdF9jxr9GV67glGOg93eFJ5XK+3Vi9atXVsvrLnhPxVTJe5SRuaJB+SCV/QB Ot0kZReLcw+a/K0ZQWdfyYHUtHM+tiBIoI3k1GAcjIn3pDNyuLbBuPaWD0ffW10/jmIVN7evTas GXOMvg= X-Google-Smtp-Source: AGHT+IFVr2mr8WPhcbBtx2v1PczURownFt4/dFre9B5QP7/22BW0QwoNWTp/odaWO0NRv0aErFgs/te7qrFcN03JwbI= X-Received: by 2002:a05:6e02:4419:10b0:3e3:c847:99a3 with SMTP id e9e14a558f8ab-3e3c8479b9dmr81803615ab.12.1753596063241; Sat, 26 Jul 2025 23:01:03 -0700 (PDT) MIME-Version: 1.0 References: <202507262156.sb455angijk6@alvherre.pgsql> In-Reply-To: <202507262156.sb455angijk6@alvherre.pgsql> From: Fujii Masao Date: Sun, 27 Jul 2025 15:00:51 +0900 X-Gm-Features: Ac12FXzXZlKrjOlZt023dFUrO4Wi3kHvoTcVLV4f-_WLWURgsGQTCVZWt5gd9Vk Message-ID: Subject: Re: Adding REPACK [concurrently] To: Alvaro Herrera Cc: Pg Hackers , Antonin Houska Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jul 27, 2025 at 6:56=E2=80=AFAM Alvaro Herrera wrote: > > Hello, > > Here's a patch to add REPACK and eventually the CONCURRENTLY flag to it. > This is coming from [1]. The ultimate goal is to have an in-core tool > to allow concurrent table rewrite to get rid of bloat; +1 > right now, VACUUM > FULL does that, but it's not concurrent. Users have resorted to using > the pg_repack third-party tool, which is ancient and uses a weird > internal implementation, as well as pg_squeeze, which uses logical > decoding to capture changes that occur during the table rewrite. The > patch submitted here, largely by Antonin Houska with some changes by me, > is based on the the pg_squeeze code which he authored, and first > introduces a new command called REPACK to absorb both VACUUM FULL and > CLUSTER, followed by addition of a CONCURRENTLY flag to allow some forms > of REPACK to operate online using logical decoding. Does this mean REPACK CONCURRENTLY requires wal_level =3D logical, while plain REPACK (without CONCURRENTLY) works with any wal_level setting? If we eventually deprecate VACUUM FULL and CLUSTER, I think plain REPACK should still be allowed with wal_level =3D minimal or replica, so users with those settings can perform equivalent processing. + if (!cluster_is_permitted_for_relation(tableOid, userid, + CLUSTER_COMMAND_CLUSTER)) As for the patch you attached, it seems to be an early WIP and might not be ready for review yet?? BTW, I got the following compilation failure and probably CLUSTER_COMMAND_CLUSTER the above should be GetUserId(). ----------------- cluster.c:455:14: error: use of undeclared identifier 'CLUSTER_COMMAND_CLUS= TER' 455 | CLUSTER_COMMAND_CLUSTER)) | ^ 1 error generated. ----------------- Regards, --=20 Fujii Masao