From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Magnus Hagander <magnus@hagander.net>
Subject: Re: pgsql: Add 'basebackup_to_shell' contrib module.
Date: Thu, 31 Mar 2022 12:25:38 -0400
Message-ID: <61e2e2c0-1b1c-3b48-4d5c-2fe581e63121@dunslane.net> (raw)
In-Reply-To: <639823.1648740735@sss.pgh.pa.us>
References: <20220329222504.aylyimyub6igsvpy@alap3.anarazel.de>
<CA+hUKGLUosJyfUBT+DAN8WzTi9eqaD6-rDwnWfvfsa6mfKUcvw@mail.gmail.com>
<684ed71e-0876-60c0-8e44-066ba702f0a6@dunslane.net>
<CA+TgmoYf9wE56eAc5x8g33ta1GbNEAN4CcvdhDNs+Rg4OfzaHQ@mail.gmail.com>
<20220330163024.fsbpbxwxh5oo2ktx@alap3.anarazel.de>
<CA+TgmoaZ6L37kVJPRDavbtRa+wq-vtBkd3L9s=B7d91BF-UW4Q@mail.gmail.com>
<20220330165450.3lruwky7eveddsvq@alap3.anarazel.de>
<CA+TgmobK9EEyPpVuBs7UL_1wHkgAbFdnAkrFox6h_0-5i7HM2A@mail.gmail.com>
<285252.1648671723@sss.pgh.pa.us>
<CA+TgmoYgrjwh8SVPG_hiq1U4=bxj5MaR_RQ+abvO7izm94rEXQ@mail.gmail.com>
<20220330223531.GA134543@nathanxps13>
<472639.1648684865@sss.pgh.pa.us>
<485495.1648692468@sss.pgh.pa.us>
<f48f62be-56fb-7c0b-7d09-a617b5c6e64a@dunslane.net>
<CA+TgmoZppyDsGoAYzS7+LQ9O60g9SjAu2YRUWfxLjBFohkxXfA@mail.gmail.com>
<639823.1648740735@sss.pgh.pa.us>
On 3/31/22 11:32, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Thu, Mar 31, 2022 at 10:52 AM Andrew Dunstan <andrew@dunslane.net> wrote:
>>> We should probably fix the test though, so it doesn't require Unix
>>> sockets. It should be possible, although I haven't looked yet to see how.
>> Our mutual colleague Neha Sharma pointed out this email message to me:
>> http://postgr.es/m/106926.1643842376@sss.pgh.pa.us
Yep, that's kinda what I was expecting.
>> I actually don't understand why using pg_regress --auth-extra would
>> fix it, or what that option does, or why we're even running pg_regress
>> at all in PostgreSQL::Test::Cluster::init. I think it might be to fix
>> this exact issue, but there's no SGML documentation for pg_regress,
I really don't know why this stuff is in pg_regress at all. It seems
rather odd to me and it's annoyed me for a while. But that's a fight for
another day.
> I'm not volunteering to fix that, but this comment in pg_regress.c
> is probably adequately illuminating:
>
> * Rewrite pg_hba.conf and pg_ident.conf to use SSPI authentication. Permit
> * the current OS user to authenticate as the bootstrap superuser and as any
> * user named in a --create-role option.
>
> This script is creating users manually rather than letting the TAP
> infrastructure do it, which is an antipattern.
>
>
Yeah, I think the fix is as simple as the attached.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.comAttachments:basebackup_to_shell-tap-fix.patch (text/x-patch, 877B) downloaddiff --git a/contrib/basebackup_to_shell/t/001_basic.pl b/contrib/basebackup_to_shell/t/001_basic.plindex 57534b62c8..d246a01cfa 100644--- a/contrib/basebackup_to_shell/t/001_basic.pl+++ b/contrib/basebackup_to_shell/t/001_basic.pl@@ -17,11 +17,12 @@ if (!defined $gzip || $gzip eq '')
}
my $node = PostgreSQL::Test::Cluster->new('primary');
-$node->init('allows_streaming' => 1);+$node->init('allows_streaming' => 1),+ auth_extra => [ '--create-role', 'backupuser' ]);
$node->append_conf('postgresql.conf',
"shared_preload_libraries = 'basebackup_to_shell'");
$node->start;
-$node->safe_psql('postgres', 'CREATE USER backupuser REPLICATION');+$node->safe_psql('postgres', 'ALTER USER backupuser REPLICATION');
$node->safe_psql('postgres', 'CREATE ROLE trustworthy');
# For nearly all pg_basebackup invocations some options should be specified,
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, nathandbossart@gmail.com, andres@anarazel.de, thomas.munro@gmail.com, pgsql-hackers@lists.postgresql.org, magnus@hagander.net
Subject: Re: pgsql: Add 'basebackup_to_shell' contrib module.
In-Reply-To: <61e2e2c0-1b1c-3b48-4d5c-2fe581e63121@dunslane.net>
References: <20220329222504.aylyimyub6igsvpy@alap3.anarazel.de> <CA+hUKGLUosJyfUBT+DAN8WzTi9eqaD6-rDwnWfvfsa6mfKUcvw@mail.gmail.com> <684ed71e-0876-60c0-8e44-066ba702f0a6@dunslane.net> <CA+TgmoYf9wE56eAc5x8g33ta1GbNEAN4CcvdhDNs+Rg4OfzaHQ@mail.gmail.com> <20220330163024.fsbpbxwxh5oo2ktx@alap3.anarazel.de> <CA+TgmoaZ6L37kVJPRDavbtRa+wq-vtBkd3L9s=B7d91BF-UW4Q@mail.gmail.com> <20220330165450.3lruwky7eveddsvq@alap3.anarazel.de> <CA+TgmobK9EEyPpVuBs7UL_1wHkgAbFdnAkrFox6h_0-5i7HM2A@mail.gmail.com> <285252.1648671723@sss.pgh.pa.us> <CA+TgmoYgrjwh8SVPG_hiq1U4=bxj5MaR_RQ+abvO7izm94rEXQ@mail.gmail.com> <20220330223531.GA134543@nathanxps13> <472639.1648684865@sss.pgh.pa.us> <485495.1648692468@sss.pgh.pa.us> <f48f62be-56fb-7c0b-7d09-a617b5c6e64a@dunslane.net> <CA+TgmoZppyDsGoAYzS7+LQ9O60g9SjAu2YRUWfxLjBFohkxXfA@mail.gmail.com> <639823.1648740735@sss.pgh.pa.us> <61e2e2c0-1b1c-3b48-4d5c-2fe581e63121@dunslane.net>
* 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