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 1uTjFw-0090zp-PM for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jun 2025 15:38:48 +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 1uTjFu-004KTX-Pe for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jun 2025 15:38:47 +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 1uTjFu-004KTN-E8 for pgsql-hackers@lists.postgresql.org; Mon, 23 Jun 2025 15:38:47 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uTjFs-003f8R-1V for pgsql-hackers@postgresql.org; Mon, 23 Jun 2025 15:38:46 +0000 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-87653e3adc6so24544539f.3 for ; Mon, 23 Jun 2025 08:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750693122; x=1751297922; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3L5GRlrjbpY5piKXvDIAjWZPPV8idkKzwbG8UHMDGd4=; b=JjChjSVHo0ruNfbCEaRQiihQGUm37V4UFaYwNQGWnXhQ17sX53c0L65qGWZvLpS5gj cH8m3Z0imVuvNPRFSzFh33DNGZGL/TrJ4SINVPtOVvyT5UPQZANSUghCNgxUHCfDDGEf nd8kDTShGTg9tonnVpPboRmazWfLiHYcnET5Q5eK7XH+QksUGqTtrLGIpTWlUBfSq8O8 L0o0YONFsOHcGm+xr/gDj16mG2cTO55a5bdaVeEj/HD7Sri8yVjwt0UnT4P4TG1VXN+a I930L84oATH1JPFnhVo1Ww2vTMjavqoPLo54b7XsfHatVYq6BTs2OBh6z/315dhpUSyk aIeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750693122; x=1751297922; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3L5GRlrjbpY5piKXvDIAjWZPPV8idkKzwbG8UHMDGd4=; b=pVOli9T3T6MKw7qTrn5/KcANUVfm/bi9mNRk+8PAcY4auYzxzFrcH7Dm1sv0kBASCB HKPJzADNBNExmLtDMoGOrNjsClSntXZFQ7T+MRr5Ime9zvqrglgdYbdk/E0Ca3Hfvtht U6aS3WhR6jANB6bdaGECA2kWF7ZQFRRtPj+NtY379jLJIu8edtDVCZa+ou1DhR/22o+s 69a1kD/dZWemxjeHV01CcrZrNlI51bFCg02eREF+4oIT+h6XwQhHsXn7mzOxUwrDFRlx +CA6phmV1/gw2pPj3q9+PxBfv5S4a6usSRdpS9BoeEYsoyNUkvfuqUHgIkdiG5vLX9Ed j+LQ== X-Forwarded-Encrypted: i=1; AJvYcCUL6dpbw7U/T/hYaKXPtfptmc7+uSIoSks+VphYkm58YmGdHauxuwL1JjuqJkCxUxmqfjHGZnZn6T1jngoM@postgresql.org X-Gm-Message-State: AOJu0YzbNvDtyOK6JBYLPrrppBhSNbPBc/1a8tkvTWuyLEJplzVLcj/z JpfUN6uiXW3uE23Y0+7pOMhbyVzP75kbMHiPB1zWLU4yqQNFKkFZokQt17xvjA== X-Gm-Gg: ASbGncscDNcx9kfDdWvtLNzO+FTUH0Cjkiyxxwie/EgbtEFb3RXVQe02KXi8QsFpm2o ZJFq9Erl589wlqFj6uelYkmC1VMsHaxUBjnJeUR8nF1mm6PlnZcolfPXehVBuriZw8pGlZ9HMfB cVZjTB/dpQf8kTn+zFa0/j3z38YMBGN/3EAtKi9fKMRB+t9N/+1qdFbVGWXHlj2PK8/5w5ItdVr yiwg0c8qqgOr5SCH38KkvlKxGwXSHSMeSQXYTZX5gHF1u1NzZqq8gXeTrgNhj+TUII+uW46MXiS wU/xVXPbEyOkG3Exa9VYcRsq3/1RJBN93o8+KZXiKficeOtSTrekrr0XvzAawXxzpohLH+bGYIo Zr9xOsQ8AR9qfuLGQcapuNBr4CLeHFEe2Crua8aeDUoxuU9WGGnnP X-Google-Smtp-Source: AGHT+IGsNUie5VKJNUUTBRHPSZdBCPkjLHDX1AWmlVKETk2vU4v9HaCzdGqi/elB6WvXp/ej4vWN6A== X-Received: by 2002:a05:6602:750b:b0:86c:fdb3:2798 with SMTP id ca18e2360f4ac-8762d429d40mr1382364839f.11.1750693121969; Mon, 23 Jun 2025 08:38:41 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5019df00367sm1791594173.52.2025.06.23.08.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 08:38:41 -0700 (PDT) Date: Mon, 23 Jun 2025 10:38:40 -0500 From: Nathan Bossart To: Michael Paquier Cc: shihao zhong , PostgreSQL-development Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jun 23, 2025 at 08:48:35AM +0900, Michael Paquier wrote: > Anyway, here is an attempt at leaning all that. I am really tempted > to add a couple of const markers to force VacuumParams to be in > read-only mode, even if it means doing so for vacuum() but not touch > at vacuum_rel() where we double-check the reloptions for the truncate > and index cleanup options. That would be of course v19-only material. > Thoughts or opinions? Is the idea to do something like this for v19 and this [0] for the back-branches? I think the recurse-to-TOAST-table case is still broken with your patch. We should probably move the memcpy() for toast_vacuum_params to the very top of vacuum_rel(). Otherwise, your patch looks generally reasonable to me. [0] https://postgr.es/m/aFRzYhOTZcRgKPLu%40nathan -- nathan