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 1tvHXT-0034Kf-I4 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Mar 2025 15:10:31 +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 1tvHXS-0036gY-BV for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Mar 2025 15:10:30 +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 1tvHUJ-0032L1-Cc for pgsql-hackers@lists.postgresql.org; Thu, 20 Mar 2025 15:07:15 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tvHUG-0009XA-2y for pgsql-hackers@lists.postgresql.org; Thu, 20 Mar 2025 15:07:14 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6f6ca9a3425so9941827b3.2 for ; Thu, 20 Mar 2025 08:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742483231; x=1743088031; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i30ny50EnGUSLCYlYz28TXXdAhV0UahWOm3vZN9mh4U=; b=RXEdbGrI5xe5cGH5AzKZ4pMMrqwAOxRgQowzsp5AW6ljYmp2BxTZ+hFE964a6fjLla nJKPKzIUYly9sERM+N+MD3okHJZLcjtFllvKyZBwoa1xDUvwtPYQ622IMDs32B/iWOmD LOYF0i6pNJK47mBJLAArl7nxYD2L9K5AuE4cBZNp7OhgzZPVfQuy+iduXdjDp/QfQ8yP +WbPYBd42WfWBGsOivzuzlKkcCAqImV7lr+Cf+qN8D9IwjiuNtiyGom/1W4D3Oc9Me3c 6ys4o3u07NDIN6Noa1lz4+vG/B0srGHGEH2H4RstE5YogHI6W08KtJ0eNRpsDuCGkG0d 8x4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742483231; x=1743088031; h=content-transfer-encoding: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=i30ny50EnGUSLCYlYz28TXXdAhV0UahWOm3vZN9mh4U=; b=hu3aDAeFVSAzvFagmFqm3MA5kgQltibtHF+o3xvFn6G/ViycixVZcOoQ8p84vLRhd/ QVWUlKt3CjqHZJ4nykgc9FOiCkLgn/XY893xC51lQ7NsjIBwmb2sxn/VB7ZyIciYXzDE EM7D5d6MVW336TYBaBiRlWDUZCDdruMWYOE7b81N0BLVJmhJvQ5PchvzcvokufNm/Inr erGkDYHXlGSmR9athzeSYOfEba8XOSFOzHLZ2n2vCOd4gmZFjb1ULcOAZ1X4iB4XVF5C tv1mBG/W8hxmF8szJrAMSNll4TJNVCBjWXFLhTe3VTavM/UP27+a2q+B+5Lw2VOyrOj9 3JUw== X-Forwarded-Encrypted: i=1; AJvYcCVdgRU72fwrujlmGYTk6Zbpjo1d38y58iVbxP+Y3YFY06VO09uZzkqD3He2rZ79cwViCsntdjlu08Iaz4dh@lists.postgresql.org X-Gm-Message-State: AOJu0YyzjJZl1Nbb/9G+fgZEgEZPBOHIiiE3pF2eilVgL9YqpCXOZfoO qE+LeQnv162aO6xS6v5l1tenVFMsg/G6xFe0g3QTDAXwYFCwOzUaguW41s4n0xA5K4srdH1v/iA RhiasuOuka+o11PFA+5YaAWchFhQ= X-Gm-Gg: ASbGncuKGaWF1MAl9pkS3cRCN1vYkfZMMJtqGX4hv4hFby2n/6UTpU2xHlZCh0GK6hm Kf7wQPt0PKG2eOVbh+DWxMzOMgy/Cb8vJxpl/0NSOIJGEt0LoHceUud94RDcG9aQ2Z97Jd7dnwy Aao9IPWnNFbPBZTHlPDq5ItcXO X-Google-Smtp-Source: AGHT+IE51BvHM8CS8hen17Qx9NJS44W1dkT5yTDpaQf9Sy7NQHcHhPUpzGzie8LMcR7PuFMIVYFqMNL0bhmhIUJiM5c= X-Received: by 2002:a05:690c:6e12:b0:6f9:3dd2:7941 with SMTP id 00721157ae682-7009c16845emr98081487b3.38.1742483230787; Thu, 20 Mar 2025 08:07:10 -0700 (PDT) MIME-Version: 1.0 References: <202503130842.c5lnhxalynu2@alvherre.pgsql> In-Reply-To: From: vignesh C Date: Thu, 20 Mar 2025 20:36:58 +0530 X-Gm-Features: AQ5f1JqpDXRPOtpRIIiNrN5Z4-xxuRrRxd_tdFMYKV5MQtZd4StTuHPqCR0sF1s Message-ID: Subject: Re: Test to dump and restore objects left behind by regression To: Ashutosh Bapat Cc: Alvaro Herrera , Michael Paquier , Daniel Gustafsson , Tom Lane , Peter Eisentraut , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 19 Mar 2025 at 17:13, Ashutosh Bapat wrote: > > On Thu, Mar 13, 2025 at 6:10=E2=80=AFPM Ashutosh Bapat > wrote: > > > > > > I think the fix is to explicitly pass --lc-monetary to the old cluste= r > > > and the restored cluster. 003 patch in the attached patch set does > > > that. Please check if it fixes the issue for you. > > > > > > Additionally we should check that it gets copied to the new cluster a= s > > > well. But I haven't figured out how to get those settings yet. This > > > treatment is similar to how --lc-collate and --lc-ctype are treated. = I > > > am wondering whether we should explicitly pass --lc-messages, > > > --lc-time and --lc-numeric as well. > > > > > > 2d819a08a1cbc11364e36f816b02e33e8dcc030b introduced buildin locale > > > provider and added overrides to LC_COLLATE and LC_TYPE. But it did no= t > > > override other LC_, which I think it should have. In pure upgrade > > > test, the upgraded node inherits the locale settings of the original > > > cluster, so this wasn't apparent. But with pg_dump testing, the > > > original and restored databases are independent. Hence I think we hav= e > > > to override all LC_* settings by explicitly mentioning --lc-* options > > > to initdb. Please let me know what you think about this? > > > > > Investigated this further. The problem is that the pg_regress run > creates regression database with specific properties but the restored > database does not have those properties. That led me to a better > solution. Additionally it's local to the new test. Use --create when > dumping and restoring the regression database. This way the database > properties or "configuration variable settings (as pg_dump > documentation calls them) are copied to the restored database as well. > Those properties include LC_MONETARY. Additionally now the test covers > --create option as well. > > PFA patches. Will it help the execution time if we use --jobs in case of pg_dump and pg_restore wherever supported: + $src_node->command_ok( + [ + 'pg_dump', "-F$format", '--no-sync', + '-d', $src_node->connstr('regression'), + '--create', '-f', $dump_file + ], + "pg_dump on source instance in $format format"); + + my @restore_command; + if ($format eq 'plain') + { + # Restore dump in "plain" format using `psql`. + @restore_command =3D [ 'psql', '-d', 'postgres', '-f', $dump_file ]; + } + else + { + @restore_command =3D [ + 'pg_restore', '--create', + '-d', 'postgres', $dump_file + ]; + } Should the copyright be only 2025 in this case: diff --git a/src/test/perl/PostgreSQL/Test/AdjustDump.pm b/src/test/perl/PostgreSQL/Test/AdjustDump.pm new file mode 100644 index 00000000000..74b9a60cf34 --- /dev/null +++ b/src/test/perl/PostgreSQL/Test/AdjustDump.pm @@ -0,0 +1,167 @@ + +# Copyright (c) 2024-2025, PostgreSQL Global Development Group Regards, Vignesh