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.96) (envelope-from ) id 1vLCrv-008FqV-2K for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 03:59:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vLCrt-003nNO-0D for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 03:59:01 +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.96) (envelope-from ) id 1vLCrs-003nNF-2F for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 03:59:01 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vLCro-0006p2-1v for pgsql-hackers@postgresql.org; Tue, 18 Nov 2025 03:59:00 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-8a479c772cfso322888285a.0 for ; Mon, 17 Nov 2025 19:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763438335; x=1764043135; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iRj+w0XJf+GHNUmAoKz0gcCVQi8+c8KKBYpbV5q54rE=; b=MXq3Efze8S/bdSf/ZqJ0xC8hOL9Q0XGbjWj2KWH2WkA1/YpnyAndwJ9/G1ceX5HigU XvdjBqO7jgKMG9x4ZKiyYCyE7rV4KGI0GMHYnoSxAmy4XB+6wF8MW0WaqNV55Pi6VIM7 M6hDaQkeM9K0hi+f1mmCkU7IFJloK6P/++8H6G2B0/Z0OuKFG5NchVndQNwE6tvzQktL rUIqRP/LJvmzbLpawjINfECpkoefZcdrfDWcSQEcj84bgL095A+S37g3MBGBTk9QYSMZ WKvGJxhI6ZcIP0hDkdEVVWXyRKkeboa9qP6HQNH+zirqhW6sfK+jjousugrGO6m0rick DZ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763438335; x=1764043135; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iRj+w0XJf+GHNUmAoKz0gcCVQi8+c8KKBYpbV5q54rE=; b=evHUe7DoqLmY5T3tw1fozTxjlkeC55sMZlZpdipBCUS5WuGL3DrjwJrsldqkG3KnBd kbIKwghK6SHrEsfCVNTFW4z0ZSZ87YzZk8bQmdyf+9HKDRyb6POzkFM7GWxnZBKXHCDU +gEMjmd7Qlu+wuAGh24WtWkmQekuUCNns1mnbrpoFmkxYybO9co8admxevD09vsJZ7r9 7fa+YfGCbZVt3FeyIvWhRUXodm2EoQVxAE+KpRwt9qcICz5VPpXUePFnn2RT1xCbFqi2 m9IkjAaxbHNdI2fJf8UR841xmeCjUYcYGcFq7fCVz4HFwpMqxM4a4peXCHraQ6seWpf/ 4hEw== X-Forwarded-Encrypted: i=1; AJvYcCXwx8HKFak4pcK+bPfcVM4fwXRA2SRfZMLxQIzkw2qVFhXTQZRhkj0BwaCVpzRFxKk/LxWJe/I2JYb3KnSj@postgresql.org X-Gm-Message-State: AOJu0YwYVt3jpeyqmje5BRtYynq/H0fr/KP5G+QRYiGkm6Z8kbisIpiM eQE05Cq9SmTPDKJNBcn2xxOmKleYigeidelewtkEXjGHy1Z94/PPX/7x X-Gm-Gg: ASbGncvhIyXTz+LM19YOEhq65km0MvDmIOzUy3jUn/LKhSJqEhcvfxwBf16Wd/I1mC1 Om+7LbIWb0vJkhq4ReJz6wSGXpqhM2mvGaU+efEIR02vdf4BMkPDBLeyN5+OoNRvuFF5hXuScm0 HdarmPUXh6YgsUzpN8dtundIjchRsOrtcauzLisjyDUxXNalIP63JKtdnprBgPAgdiFPQm7kqov uk4q2mGrUaG2Ba6OLiYQAqu9qTB2gdrd55KMdqcxO2pc/hSukE794HS9WMRyopzfPqGsBjl93U0 11UXOZvxDLpFNHcdJ/glbS5iK8w9A7DHSs+ed9S02d0sJHo1+HEpjTJuQgi6IvbdZ0q+6KUSRaW SUjV06yFOMY9cDhUnOQ8n7vmE491WaIP7JEofSM1aI4BBfRE1Wqki35W4FFaFYlFpvl0/Pmxxxk Mmbl/LQLxBJA== X-Google-Smtp-Source: AGHT+IFUHgseOpkoN21fiES6EvAUjzIzl7WKwga5hnvpkpNNkl0uq3NUCDeM3ejSCPZsdS0UwBdkdA== X-Received: by 2002:a05:620a:4506:b0:8b2:a0cd:90f1 with SMTP id af79cd13be357-8b2c31b43e7mr1768507685a.61.1763438334515; Mon, 17 Nov 2025 19:58:54 -0800 (PST) Received: from smtpclient.apple ([209.127.78.222]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8b2aef2f936sm1124404985a.29.2025.11.17.19.58.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2025 19:58:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: vacuumdb: add --dry-run From: Chao Li In-Reply-To: Date: Tue, 18 Nov 2025 11:58:16 +0800 Cc: Nathan Bossart , pgsql-hackers@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <3DB353E5-944D-4E18-9DA2-4151F44AA59B@gmail.com> References: To: Corey Huinker X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Nov 11, 2025, at 06:33, Corey Huinker = wrote: >=20 >=20 > My attempts to test this all got stuck in wait_on_slots(). I haven't > looked too closely, but I suspect the issue is that the socket never > becomes readable because we don't send a query. If I set = free_slot->inUse > to false before printing the command, it no longer hangs. We probably = want > to create a function in parallel_slot.c to mark slots that we don't = intend > to give a query as idle. >=20 > Would that be preferable to skipping the creation of extra connections = for parallel workers? I can see it both ways. On the one hand we want to = give as true a reflection of "what would happen with these options", and = on the other hand one could view the creation of extra workers as "real" = vs a dry run. >=20 > =20 I test the patch, but my first run was with no luck: ``` % vacuumdb --dry-run --echo -d evantest SELECT pg_catalog.set_config('search_path', '', false); vacuumdb: vacuuming database "evantest" RESET search_path; SELECT c.relname, ns.nspname FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace ns ON c.relnamespace = OPERATOR(pg_catalog.=3D) ns.oid CROSS JOIN LATERAL (SELECT c.relkind IN ('p', 'I')) as p (inherited) LEFT JOIN pg_catalog.pg_class t ON c.reltoastrelid = OPERATOR(pg_catalog.=3D) t.oid WHERE c.relpersistence OPERATOR(pg_catalog.!=3D) 't' AND c.relkind OPERATOR(pg_catalog.=3D) ANY (array['r', 'm']) ORDER BY c.relpages DESC; SELECT pg_catalog.set_config('search_path', '', false); VACUUM (SKIP_DATABASE_STATS) pg_catalog.pg_proc; (not executed) ^CCancel request sent ^CCancel request sent ^CCancel request sent ^CCancel request sent ``` After skip the first vacuum command, the process got stuck, and ctrl-c = couldn=E2=80=99t break it. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/