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 1w1pLZ-000djn-2Q for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2026 17:33:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1pLX-005DLB-39 for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2026 17:33:48 +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 1w1pLX-005DL2-28 for pgsql-hackers@lists.postgresql.org; Sun, 15 Mar 2026 17:33:48 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w1pLW-00000000GyZ-1TwM for pgsql-hackers@postgresql.org; Sun, 15 Mar 2026 17:33:47 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-8cd71fb9f06so240798785a.2 for ; Sun, 15 Mar 2026 10:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773596026; cv=none; d=google.com; s=arc-20240605; b=bhlPrqMVDgjbudUaHhhHpmSLrRtmL/B3364Bh5WdZpUc7GI3mD+HEXBXmXOnVebJk9 h83sxaYmadDGKAFRJNKBvAoGGpYW0yLvUH/Y41+cA/VlGFHxO8etyh3JeWtX5EDntO/8 LHrakJ+341PVWcOQP5KDyBSxP7aoBLVo3250FK+dJRD54VGxEFGMJXLeBe8K0eiCli+P RJUqkH2Gmwxc9AfWvopmPZ+08tbPb0+hYboaH5wFJxPmZYKgoOdwDSgyQkJnRgWWIyQG 2n7dx3g7T2ygVEbn4+A9cqdZi36Y6g4fF7EAMRbMTcYHzCMDRiGggROqHsLHnoaApUxe ZW3w== 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=eV300fGD0XN5y6UsydcFzQv1Xnp/XZKntJWjltXmVfs=; fh=MbtE6UpCj2vausx7fUGwp04eAyd5cnrF9UVvW8jmwuE=; b=lxljfejm6rivYWQTUV42/6OwEpnzbxKKClQOWdL82JRxWtzEB7ZZDaY+miINB0Qaed UgeIXXVgRIVqTuWu6JHIAKYdchYbCimyUaZCyqoPPG6QqUwljfRjQK12OYkjDTuVeV1n lXSMVEyl/b3PRJdKYZsXhi9nmWZoncz0y8lx56T2/ltlKJqXS/VnjLhH0DPFgA/sFAUi lCFidC6pO2qCQLKgOgwDgq500JX3O++WhcCIcV+GfbSXWFA429hTZhBSpNxt/ZkeClpc rUCEqHlZP1zgcC+Gsn4dGH2Wq0IY8INX34wrppSPF5UVAaNJk8I80G/XGntQPNI4fA3M l7oA==; darn=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=1773596026; x=1774200826; darn=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=eV300fGD0XN5y6UsydcFzQv1Xnp/XZKntJWjltXmVfs=; b=IaF1Pu8jseip3pRCTHf7cnw7qchRTXw8vVsb8H6+UXZFU+oFy/waUHP881niY2UEO/ /W7/m1861ZDmYw8WZTYh3rHAsg/ZSn1MIevPWxVS1U/dGO/a9tLsS6xQznSMLRMsAigA Koxrwxc1qmmuqr8TQYitD/Niku6oWJE+S2ExJWkR/AwDrMDwvyPBu4hpB5QtaKtZMDye Z4VLlpY2Gih2SV3Ivppnw+lvtCQ11yOFnZfNjLCTEE1P31n1A5BHN60U543XoMO42z0/ x1+1Z6+6cnkWZ0MLmAQYDWq3AYAOqkfUVEC0VYCkEUGm5BqIRACfwuXd0UHhcjurW5AM P3WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773596026; x=1774200826; 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=eV300fGD0XN5y6UsydcFzQv1Xnp/XZKntJWjltXmVfs=; b=p7VAT7n+aMSyR8GYFTKtapieCw/vhEpqox7uVWbeT5fH06QE3I6FWV8jV1oY7ZSxms juJ3u8lqczyO23Beuz5Swmo+1Xf6HDBxyuwhc+/14S50n6u3uY7Mvv+UCp0BSXmgX1/0 CSAcvIKe70pSCF60TCLbkf0E9e7LVNa6L0o/BJqVnfMk5HAHMpxkSMuXvd1KiHHj9Ljg 0MF9jRQLQBHPQGpWy6228OCNI01RS8rMNudKyw2G3i8ehaa8e0KB+lhybYCLyJ5WES0g xqRJmjA0wfLFNcV9CL2wNbw4hQHCrFCzs50LvLeSedOubvnbNIjm8gVTRKSUKbYob0XD an+w== X-Gm-Message-State: AOJu0YygJR7tmq5KsO3XpLWhLedi6eAgYIgutpSYYvpXlDvN46LGklNW QXIAB8CMB0oEOHn1GHjXmv9Dm1wXPOqY+YirTEPMpphMWKjGL/iOT62iTshnqhpqTkPUuRpCA10 SVYW28AIqhx4pTUWk1XvmuIKWCUjHrLaR9A== X-Gm-Gg: ATEYQzwHjLGEbt3LgYywIleC934knWTm8FA78mFHdj54IlZxgy1on4aqPmjpNJGVNUU 5SNnd2aC6dZvbPH6nVwnFbZFEC3UAOSHmh+mYHsc3u8YgzyiM4knfAfT0VQ02/4JhW2QHzBljkd rgBFzXCU67FKaPA2XUG/FiwLtwbR3wh77JUObEzO2NCMo3ELejOyTAxJchWYa+yPUlRw/M+94oz 8BBBamFoBqDKbhSSpVw7fmbofi2t8ofJNzJIuJzhoLKGAmGxWap8oTfzVSKffVco0tGxpNQJVxC UIsdvERXQQ== X-Received: by 2002:a05:622a:1346:b0:509:2ce4:28d5 with SMTP id d75a77b69052e-50957e7c068mr134225811cf.72.1773596025784; Sun, 15 Mar 2026 10:33:45 -0700 (PDT) MIME-Version: 1.0 References: <599d493e-01f7-4f74-bcc7-242b1dd1e025@dunslane.net> In-Reply-To: <599d493e-01f7-4f74-bcc7-242b1dd1e025@dunslane.net> From: Mahendra Singh Thalor Date: Sun, 15 Mar 2026 23:03:34 +0530 X-Gm-Features: AaiRm53x2NZPsdJqi6fzmHYIggTm3jXe0nldZfXHQ69MPwcdoB7VmZEqTZymW-Y Message-ID: Subject: Re: pg_restore: remove unnecessary code from restore_all_databases function To: Andrew Dunstan Cc: PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 15 Mar 2026 at 21:46, Andrew Dunstan wrote: > > > On 2026-03-14 Sa 11:48 PM, Mahendra Singh Thalor wrote: > > Hi hackers, > > > > +++ b/src/bin/pg_dump/pg_restore.c > > @@ -1268,16 +1268,6 @@ restore_all_databases(const char *inputFileSpec, > > */ > > memcpy(tmpopts, original_opts, sizeof(RestoreOptions)); > > > > - /* > > - * We need to reset override_dbname so that objects > > can be restored > > - * into an already created database. (used with > > -d/--dbname option) > > - */ > > - if (tmpopts->cparams.override_dbname) > > - { > > - pfree(tmpopts->cparams.override_dbname); > > - tmpopts->cparams.override_dbname = NULL; > > - } > > - > > > > In commit 77152d26efefde2eed4, we added some functions and we missed > > to remove some unnecessary lines. Those lines are not needed as we are > > using memcpy to get the original copy before these lines. > > > > Here, I am attaching a patch to fix this. Please review it. > > > Thanks. Pushed. > > > cheers > > > andrew > > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com > Thanks Andrew for committing this. -- Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com