On Mon, Apr 25, 2022 at 10:05:08AM -0400, Tom Lane wrote:
> Alvaro Herrera <alvhe...@alvh.no-ip.org> writes:
> > Hmm, so 027_stream_regress.pl is not prepared to deal with any unlogged
> > tables that may be left in the regression database (which is what my
> > spgist addition did).  I first tried doing a TRUNCATE of the unlogged
> > table, but that doesn't work either, and it turns out that the
> > regression database does not have any UNLOGGED relations.  Maybe that's
> > something we need to cater for, eventually, but for now dropping the
> > table suffices.  I have pushed that.
> 
> It does seem like the onus should be on 027_stream_regress.pl to
> deal with that, rather than restricting what the core tests can
> leave behind.

Yeah.  Using "pg_dumpall --no-unlogged-table-data", as attached, suffices.

> Maybe we could have it look for unlogged tables and drop them
> before making the dumps?  Although I don't understand why
> TRUNCATE wouldn't do the job equally well.

After TRUNCATE, one still gets a setval for sequences and a zero-row COPY for
tables.  When dumping a standby or using --no-unlogged-table-data, those
commands are absent.
Author:     Noah Misch <n...@leadboat.com>
Commit:     Noah Misch <n...@leadboat.com>

    Use --no-unlogged-table-data in t/027_stream_regress.pl.
    
    This removes the need to drop unlogged relations in the src/test/regress
    suite, like commit dec8ad367e46180f826d5b6dc820fbecba1b71d2 did.
    
    Reviewed by FIXME.
    
    Discussion: https://postgr.es/m/39945.1650895...@sss.pgh.pa.us

diff --git a/src/test/recovery/t/027_stream_regress.pl 
b/src/test/recovery/t/027_stream_regress.pl
index fdb4ea0..7982ac0 100644
--- a/src/test/recovery/t/027_stream_regress.pl
+++ b/src/test/recovery/t/027_stream_regress.pl
@@ -100,7 +100,8 @@ $node_primary->wait_for_catchup($node_standby_1, 'replay',
 command_ok(
        [
                'pg_dumpall', '-f', $outputdir . '/primary.dump',
-               '--no-sync', '-p', $node_primary->port
+               '--no-sync',  '-p', $node_primary->port,
+               '--no-unlogged-table-data'    # if unlogged, standby has schema 
only
        ],
        'dump primary server');
 command_ok(

Reply via email to