On 7/24/19 10:00 AM, Andrew Dunstan wrote:
> On 7/23/19 2:12 AM, Peter Eisentraut wrote:
>> On 2019-07-22 21:16, Andrew Dunstan wrote:
>>> Modulo this issue, experimentation shows that adding '-A trust' to the
>>> line in run_build.pl where initdb is called fixes the issue. If we're
>>> going to rely on a buildfarm client fix that one seems simplest.
>> Yes, that is the right fix.  It's what the in-tree test drivers
>> (pg_regress, PostgresNode.pm) do.
>>
>
> I have done that, I will put out a new release probably right after the
> CF closes.
>
>
> I think we also need to change vcregress.pl to use trust explicitly for
> upgrade checks, just like the Unix upgrade test script does. That should
> help to future-proof us a bit.
>
>

Here's a patch along those lines that pretty much syncs up
vcregress.pl's initdb with pg_upgrade's test.sh.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 5495066b4d..05446c3f59 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -496,12 +496,28 @@ sub recoverycheck
 }
 
 # Run "initdb", then reconfigure authentication.
+# mimics what is done in src/bin/pg_upgrade/test.sh:standard_initdb()
 sub standard_initdb
 {
-	return (
-		system('initdb', '-N') == 0 and system(
-			"$topdir/$Config/pg_regress/pg_regress", '--config-auth',
-			$ENV{PGDATA}) == 0);
+	my @opts = qw(-N --wal-segsize 1 -g -A trust);
+	my $status = system('initdb',@opts);
+	if ($status == 0)
+	{
+		if (defined($ENV{TEMP_CONFIG}) && -r $ENV{TEMP_CONFIG})
+		{
+			open(my $handle, '<', $ENV{TEMP_CONFIG})
+			  || die "file $ENV{TEMP_CONFIG} not found";
+			my $contents = <$handle>;
+			close($handle);
+			open($handle, '>>', "$ENV{PGDATA}/postgresql.conf")
+			  || die "file $ENV{PGDATA}/postgresql.conf not found";
+			print $handle $contents;
+			close($handle);
+		}
+		$status = system("$topdir/$Config/pg_regress/pg_regress",
+						 '--config-auth', $ENV{PGDATA})
+	}
+	return $status;
 }
 
 # This is similar to appendShellString().  Perl system(@args) bypasses

Reply via email to