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 1vi1M5-00Cqv1-28 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 02:20:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vi1M4-00FLEb-1S for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 02:20:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vi1M4-00FLET-0V for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 02:20:28 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vi1M2-001LC0-0E for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 02:20:27 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-42fbc305914so3978285f8f.0 for ; Mon, 19 Jan 2026 18:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768875625; cv=none; d=google.com; s=arc-20240605; b=bfJAS3vQBv0XCW8xeeq8UGYVbnXpNqyETefPs5iYGa0KvjxzC/nTxLPPPYL7EZP6nd xmjGyM2oLxPIinPugaAVTVgr7WLLxas77CWT/xswYsQkh2Jy2wP1mPLR3Yzge8Y69tkQ OWGtF/rCpyj14Se7hg/9juswc4FJK49v0mI/YOUO2U7YROCJzNTkW0bO5Twgs3G2ptE+ EiFdr6UXksw+xEtHKteJ5ZcN8CVildbCsmSF2oMhOAQC9DgohNUX4rQ0OB58rcE+g1sV nAXknqy4dSh4zZfcHuXik0xLQUL0H/iFGYnWTvFeM1gie5qmWi7+Lua1PxIa8uilUowB yygw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=f+oJLMKTxN/DN5EuCyHZWedOnszR64JKCJumfoAfTuA=; fh=zpzDagzqeNvpV6sDfrKfqsYs3YpuI4My5lO7QvOpG9E=; b=ShfgchbtlhHl+4i6m7Jcl2YXx7VPf+7VF/JoeaDOwtXLqhd47VVqufaRa6TbrxulUn 0xBB2KXAHp1Fg90a2NUa81aCacVJBCzLDlhi0wK8kRj9doro4mnZxHrwzJI/xosVUsHM rjJPo4FAVMJubvjIb/A9vM7gfebo/F7HChdOaTvdZr90r0T8ZM1JqV4VYAFtOMr7w+13 FpSFW42nS/Md7IKDc1TMf3JhBLWDds1UKaNo91Jnxm8pcbzTeOPt3NMMsNQDg+57a1WC EH90Yr04jW+H3VnHwTyVW00MXkUikHBEbtP7+RZk0GRWKRMuonz/Yd5txVSae8tZeuaG HiYQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768875625; x=1769480425; 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=f+oJLMKTxN/DN5EuCyHZWedOnszR64JKCJumfoAfTuA=; b=DaSIDSP0hif8T6kFgpRHcSc9jj/kzxe+xLb/sw4FY8+GWxs0riQ6c3rv7fxMBnApuV WlybMqo+ao/gJ+KM2CXPPIQ2Cqb813jYMd2FirpvBG42bonyRHC1me9H6GHiP+UzFuup yM/gY/58mw0jVxbCJf7MDtQTUqMRd4yzdNI/TyarOUmkeVhbHagPEKKM9EflQx1a8HcQ 881gJgUonSN/2im2oeh6uubFPLkYRaf/kR/1SmjLDxegIq5bcbhqClV4vJrRO20k6x4O rdHPlKcOIdc8kJeltRjcV+loHa1esU5cbV3odG0sJQopp3ECXDSN2WMWED+QcdgSh1Cg /hkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768875625; x=1769480425; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f+oJLMKTxN/DN5EuCyHZWedOnszR64JKCJumfoAfTuA=; b=dUFMTBA7+gzF2iO//Rmx01DJzADBvJmlxDJE19oBvb0skGXHTc++8j/UQBZpgeL0di 5lmBLRsi3AM4waTiVjneZVvXEUmj0LOc/lK7FCldTEstVbbuSMDp39hgXkrrMK1RHIvh ixCb5mtcVvgRAmkAuh+QnrMa9xG70Q85PA3GQYq4ZCMJ+lSR0B+kESIjpi4Oq4b4t9kt rZXF7dzTTlIjUG9KQwEEueORIwUosAg7y3OLwvGkbhIVUtK5DTR/3r4wgmH1q6SaHZyZ HzYoHhmTTwVMkxs85pGLk5kvInq3pIPZKjQv4vHZAiYo/DRqkBs9Vq/lDXrllHibDA3f Rlpw== X-Forwarded-Encrypted: i=1; AJvYcCXvQN/4fx7c+yoNV37hlUzaxgBfSBit3rzM41mS+S+SI13yII+CSsyg/t9dahGGw36k7ygG61fzTcAHXf5B@lists.postgresql.org X-Gm-Message-State: AOJu0Yz5pC0pm1uw50eeo9v8OCunrXqQZw754f0qrmPc1N2bM/nQNt6Z 2u9k54at+6JHR1QXtnsuiLAsAZ6e1ZpCyMuweYi358ZvaFoepolm049NnHbT0DnKYds7epTDk56 Plz3ANGHevuaz8+izg5Jdr9AaGnmbkx8= X-Gm-Gg: AZuq6aInkOgkRXglzKaai0YJ5+eGE3zty50RCVeuU4CzL7hrJbPwa+fhOgxcXIKppi6 d0cXRXGxG/hUsVayo4TJSnYW6aSVmeyVDFYh4RpxTrcLRyq20AHwfqQKVPNIiNQ7Tr1pDbm3JIj dsTUzEpPLemJiyJjIyy1ok889zEn9Hf3dVyvp7krYtFzx6fXxmITSk0A9oZfzUMHfwRMkY2flJE GZlrEfZc97zPIIjK8pxGbB90QMBcdsMAz0Uj2v8J7c2Pb7CRjva7zrB7oA7p07N75BDLzXJLCMi vVEydFrjH7PhS4wLgJpboTVgyRV2CYDchznZKL4WJ/NWeDXtR9ORkX3oXd1n8g== X-Received: by 2002:a05:6000:4383:b0:430:f7ae:af3e with SMTP id ffacd0b85a97d-4358ff26aa2mr416155f8f.32.1768875625137; Mon, 19 Jan 2026 18:20:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Tue, 20 Jan 2026 15:20:13 +1300 X-Gm-Features: AZwV_QgeUpVjridFAPh3E1CmFQH5zpgXGeRQK6iilC_4eq72arThA7h4ybwSy9E Message-ID: Subject: Re: Patch: dumping tables data in multiple chunks in pg_dump To: Hannu Krosing Cc: Ashutosh Bapat , PostgreSQL Hackers , Nathan Bossart Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 20 Jan 2026 at 08:01, Hannu Krosing wrote: > I changed the last open-ended chunk to use ctid >= (N,1) for clarity > but did not change anything else. You have: int max_table_segment_pages; /* chunk when relpages is above this */ and: opts->max_table_segment_pages = UINT32_MAX; /* == InvalidBlockNumber, disable chunking by default */ It's not valid to assign UINT32_MAX to a signed int. > To me it looked like having a loop around the whole thing when there > is no chunking would complicate things for anyone reading the code. The problem I have with it is the duplicate code. If you don't want to loop around the standard code, then make a function and call that instead of copying and pasting the code. I'd also get rid of the "chunking" boolean and make use of InvalidBlockNumber to determine if the range is constrained. It also seems very strange that you opted to do that just for endPage and not for startPage. > > 4. I think using "int" here is a future complaint waiting to happen. > > > > + if (!option_parse_int(optarg, "--huge-table-chunk-pages", 1, INT32_MAX, > > + &dopt.huge_table_chunk_pages)) > > > > I bet we'll eventually see a complaint that someone can't make the > > segment size larger than 16TB. I think option_parse_uint32() might be > > called for. > > I have not yet done anything with this yet, so the maximum chunk size > for now is half of the maximum relpages. OK. I can look again once all that's done. David