pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: initdb recommendations
Date: Wed, 24 Jul 2019 16:02:41 -0400
Message-ID: <ce6ae109-02f4-9cb4-0d67-94f8fbd87f3f@2ndQuadrant.com> (raw )
In-Reply-To: <654cbc96-0b32-6d00-09a8-5caf5d051103@2ndQuadrant.com >
References: <bec17f0a-ddb1-8b95-5e69-368d9d0a3390@postgresql.org >
<f27d3170-76cf-4afb-1e1a-b1059295ec8d@2ndquadrant.com >
<CABUevExMizVYea9zaHBte66u9KipEgfwcsaE9spfqK9iYRST_g@mail.gmail.com >
<20190406180839.GA1921989@rfd.leadboat.com >
<96389374-9454-d26d-6f79-7c7b15ec14bd@2ndquadrant.com >
<fcd8848c-618c-23d1-2b39-77b13cb2d0a1@2ndquadrant.com >
<CAOBaU_bTm5M-787dAw=E3OQ13ag_BqOboVWz9xkjQk1=__MwDQ@mail.gmail.com >
<91f8272f-117f-2a04-862b-871a7b86eeed@2ndquadrant.com >
<CAOBaU_Y9quphKH98xCgiAXgTYk5xcfTWcyKO-y3o_UJOk0s2uQ@mail.gmail.com >
<7b6c4220-e5ef-2a13-18ad-af596c52b71a@2ndquadrant.com >
<23654.1563804669@sss.pgh.pa.us >
<7886.1563812705@sss.pgh.pa.us >
<27724.1563813541@sss.pgh.pa.us >
<b0d28521-998d-58ce-f097-a186e23db9b8@2ndQuadrant.com >
<4bfcca1d-220c-850d-a3e2-5f44261331c2@2ndquadrant.com >
<654cbc96-0b32-6d00-09a8-5caf5d051103@2ndQuadrant.com >
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
Attachments:
pg_upgrade_sync_msvc_initdb_with_test.patch (text/x-patch, 1.2K) download
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
view thread (61+ messages) latest in thread
Message-ID: <ce6ae109-02f4-9cb4-0d67-94f8fbd87f3f@2ndQuadrant.com>
Permalink: ../ce6ae109-02f4-9cb4-0d67-94f8fbd87f3f@2ndQuadrant.com/
Also on: postgresql.org/message-id/ce6ae109-02f4-9cb4-0d67-94f8fbd87f3f@2ndQuadrant.com
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: andrew.dunstan@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: initdb recommendations
In-Reply-To: <ce6ae109-02f4-9cb4-0d67-94f8fbd87f3f@2ndQuadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox