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 1u2wn6-008AZM-4K for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Apr 2025 18:38:20 +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 1u2wn4-00G1pr-Ge for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Apr 2025 18:38:18 +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.94.2) (envelope-from ) id 1u2wn4-00G1pj-2d for pgsql-hackers@lists.postgresql.org; Thu, 10 Apr 2025 18:38:18 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2wn2-0046TS-1A for pgsql-hackers@lists.postgresql.org; Thu, 10 Apr 2025 18:38:17 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-30572effb26so1133761a91.0 for ; Thu, 10 Apr 2025 11:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744310295; x=1744915095; 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=XauYI174dXxjMjr3/8lfcDZ8Bu9lz0bN28tWkKKrkag=; b=XDW9tTTLhYOMG4CXp5FWH157346zXX7PtxxoOdcurAN54NTMLl7KFMADbwTkdaTGdO Ze73np06nR5oSPDkCbvIcdCYMkoWQWU5+tSrfHRzV3PBSmykBAd4eA4rREa2fvqY9495 7+JuLb6HUmVAEk2gafOIalnKI+xCrwKuoL7eI7fGNCV9o5UCuio7I720a0kxAWDlM5UC M5p2q6d2qgpdN2YPqGmIIxfMCMbRaRjFYOLBGvnahSFcMQi05DLtyeSAhUUrlWYugS6u LlcaNHJIPQQFmlyqkFQOkRjp87sunViAY+d8yCTfRe1DFdSn+GpSFbCt2EfcSNi3MpmI gSrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744310295; x=1744915095; 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=XauYI174dXxjMjr3/8lfcDZ8Bu9lz0bN28tWkKKrkag=; b=LeWLZnwEu66xDcalVz7QC9SU5xhHdHAwSYpnLrTGGeJ1rpngYQj+ZsFZXvTQd+7K9n 5kfLgHgH1j7NMFNL5t/f+hAaVTn4tAZdt/61OQSl3rLzLEnOS2lolYujWvEUSZCYt1Xx QG5UOS3GWytJOUYCu0zJ2WTPNTMbOo5Nb3l2T0DTqTuuS7/1uFbkSFCioh/HiJXZu5LE zUJJTwswIN/6LXOwTQslzgR6WELf68iP/ClydFdn4kQb4K76N18RorYqjyqjekywwX49 xSwSQC11Fr6d6zE9xEcs5VJsX0irfy6os+tWX9sMKBQp8Hmh2BhczqXyQFFYkVgP8vmf TtcA== X-Forwarded-Encrypted: i=1; AJvYcCVaak4wt951Zd/8WSSFbea/XUchUK/N2Dr1sOLP7IIocpP5gjDICMTv1ZwFtbo0FXubmICve8ygSvuV5IpB@lists.postgresql.org X-Gm-Message-State: AOJu0YyFUcHsQCWlsC7c9mwVHzJXY4FnJBalLPHZYYRV6rm7RHrRr2aO dRK/dcjQtiBLNx8vdZyLLd41RjtIkR42uRRg9jH6BmHb6up/Aqm7r1U81Bv1bOlU0Jr4V+Ac0xu K7I2sRdfw4genLOlb7XQgAf8Hk3g= X-Gm-Gg: ASbGncs4TSRdJ4nXxki455enmG9FFD0V6o8Jb4O2m6CRloD4H26eTmGPg+NfFQhmvUu vVl2Epmyg+hPM4A3LxfNSMhZpxZixEF6wxZ6bDg5xJS+vAXYkwSFGne0wv8mBFvJavqku10wTS3 Vb7mXfrAn0SAwW6YI4aFXCiQ== X-Google-Smtp-Source: AGHT+IHEjBU+1vzwASuQD9v4gVTRvbWXsnNOFsA5sA6bJh/UgaicjuuKbxziyc2hjwa/M3a614GjStHdlOZBCFJ1jKs= X-Received: by 2002:a17:90b:1f83:b0:2fe:8a84:e033 with SMTP id 98e67ed59e1d1-30823660344mr39164a91.2.1744310295369; Thu, 10 Apr 2025 11:38:15 -0700 (PDT) MIME-Version: 1.0 References: <202503311812.vxg5b7rzfgf6@alvherre.pgsql> <616efe2c-3986-43cf-b88c-4435849acf9e@dunslane.net> <948154fe-0278-4f4c-8f5a-085e12f03163@dunslane.net> In-Reply-To: <948154fe-0278-4f4c-8f5a-085e12f03163@dunslane.net> From: Ranier Vilela Date: Thu, 10 Apr 2025 15:38:18 -0300 X-Gm-Features: ATxdqUFurkYbe3caJpYfJ4mZ9GuIjjdmViRnYHtbraFJfiTKB_QL43GxzfqFs3k Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Andrew Dunstan Cc: Mahendra Singh Thalor , =?UTF-8?Q?=C3=81lvaro_Herrera?= , jian he , Srinath Reddy , pgsql-hackers@lists.postgresql.org Content-Type: multipart/mixed; boundary="00000000000088b714063270e399" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000088b714063270e399 Content-Type: multipart/alternative; boundary="00000000000088b713063270e397" --00000000000088b713063270e397 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi. Em sex., 4 de abr. de 2025 =C3=A0s 17:11, Andrew Dunstan escreveu: > > On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: > > On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor <= mahi6run@gmail.com> wrote: > > On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan wrote: > > On 2025-04-01 Tu 1:59 AM, Mahendra Singh Thalor wrote: > > On Mon, 31 Mar 2025 at 23:43, =C3=81lvaro Herrera wrote: > > Hi > > FWIW I don't think the on_exit_nicely business is in final shape just > yet. We're doing something super strange and novel about keeping track > of an array index, so that we can modify it later. Or something like > that, I think? That doesn't sound all that nice to me. Elsewhere it > was suggested that we need some way to keep track of the list of things > that need cleanup (a list of connections IIRC?) -- perhaps in a > thread-local variable or a global or something -- and we install the > cleanup function once, and that reads from the variable. The program > can add things to the list, or remove them, at will; and we don't need > to modify the cleanup function in any way. > > -- > =C3=81lvaro Herrera Breisgau, Deutschland =E2=80=94 https://www.= EnterpriseDB.com/ > > Thanks =C3=81lvaro for the feedback. > > I removed the old handling of on_exit_nicely_list from the last patch > set and added one simple function to just update the archive handle in > shutdown_info. (shutdown_info.AHX =3D AHX;) > > For first database, we will add entry into on_exit_nicely_list array > and for rest database, we will update only shutdown_info as we already > closed connection for previous database.With this fix, we will not > touch entry of on_exit_nicely_list for each database. > > Here, I am attaching updated patches. > > > OK, looks good. here's my latest. I'm currently working on tidying up > docco and comments. > > > cheers > > > andrew > > > > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com > > Thanks Andrew for the updated patches. > > Here, I am attaching a delta patch with some more TAP-test cases. > > > Here, I am attaching an updated delta patch which has some more TAP > tests. Please include these tests also. This patch can be applied on > v20250403_0004* patch. > > > > > Thanks. I have pushed these now with a few further small tweaks. > Sorry if it is not the right place. Coverity has another resource leak alert. trivial patch attached. best regards, Ranier Vilela > --00000000000088b713063270e397 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi.

Em sex., 4 de abr. de 2025 = =C3=A0s 17:11, Andrew Dunstan <an= drew@dunslane.net> escreveu:
=20 =20 =20


On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote:
On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor <mahi6run@gmail.com> w=
rote:
On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan <andrew@dunslane.net> wrot=
e:
On 2025-04-01 Tu 1:59 AM, Mahendra Singh Thalor wrote:
On Mon, 31 Mar 2025 at 23:43, =C3=81lvaro Herrera <alvherre@alvh.no-=
ip.org> wrote:
Hi

FWIW I don't think the on_exit_nicely business is in final shape just
yet.  We're doing something super strange and novel about keeping track
of an array index, so that we can modify it later.  Or something like
that, I think?  That doesn't sound all that nice to me.  Elsewhere it
was suggested that we need some way to keep track of the list of things
that need cleanup (a list of connections IIRC?) -- perhaps in a
thread-local variable or a global or something -- and we install the
cleanup function once, and that reads from the variable.  The program
can add things to the list, or remove them, at will; and we don't need
to modify the cleanup function in any way.

--
=C3=81lvaro Herrera        Breisgau, Deutschland  =E2=80=94  https://www.EnterpriseDB.com/=

Thanks =C3=81lvaro for the feedback.

I removed the old handling of on_exit_nicely_list from the last patch
set and added one simple function to just update the archive handle in
shutdown_info.  (shutdown_info.AHX =3D AHX;)

For first database, we will add entry into on_exit_nicely_list array
and for rest database, we will update only shutdown_info as we already
closed connection for previous database.With this fix, we will not
touch entry of on_exit_nicely_list for each database.

Here, I am attaching updated patches.

OK, looks good. here's my latest. I'm currently work=
ing on tidying up
docco and comments.


cheers


andrew




--
Andrew Dunstan
EDB: https://www=
.enterprisedb.com
Thanks Andrew for the updated patches.

Here, I am attaching a delta patch with some more TAP-test cases.

Here, I am attaching an updated delta patch which has some more =
TAP
tests. Please include these tests also. This patch can be applied on
v20250403_0004* patch.



Thanks. I have pushed these now with a few further small tweaks.

=
Sorry if it is not the right place.
Cover= ity has another resource leak alert.

trivial patch= attached.

best regards,
Ranier Vilela
--00000000000088b713063270e397-- --00000000000088b714063270e399 Content-Type: application/octet-stream; name="fix_resource_leak_pg_restore.patch" Content-Disposition: attachment; filename="fix_resource_leak_pg_restore.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m9bpb60z0 ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdfZHVtcC9wZ19yZXN0b3JlLmMgYi9zcmMvYmluL3BnX2R1 bXAvcGdfcmVzdG9yZS5jCmluZGV4IDA2YzI4YWIzMTQuLmViMzEwOWQ3MTkgMTAwNjQ0Ci0tLSBh L3NyYy9iaW4vcGdfZHVtcC9wZ19yZXN0b3JlLmMKKysrIGIvc3JjL2Jpbi9wZ19kdW1wL3BnX3Jl c3RvcmUuYwpAQCAtOTA1LDYgKzkwNSw3IEBAIHJlYWRfb25lX3N0YXRlbWVudChTdHJpbmdJbmZv IGluQnVmLCBGSUxFICpwZmlsZSkKIAkJaWYgKGMgPT0gJ1xuJykKIAkJCWFwcGVuZFN0cmluZ0lu Zm9DaGFyKGluQnVmLCAoY2hhcikgJ1xuJyk7CiAJfQorCWRlc3Ryb3lTdHJpbmdJbmZvKCZxKTsK IAogCS8qIE5vIGlucHV0IGJlZm9yZSBFT0Ygc2lnbmFsIG1lYW5zIHRpbWUgdG8gcXVpdC4gKi8K IAlpZiAoYyA9PSBFT0YgJiYgaW5CdWYtPmxlbiA9PSAwKQo= --00000000000088b714063270e399--