Backporting BackgroundPsql - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Backporting BackgroundPsql
Date
Msg-id b7c64f20-ea01-4f15-9088-0cd6832af149@iki.fi
Whole thread Raw
In response to Re: Making background psql nicer to use in tap tests  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Backporting BackgroundPsql
Re: Backporting BackgroundPsql
List pgsql-hackers
While fixing a recent bug on visibility on a standby [1], I wrote a 
regression test that uses BackgroundPsql to run some queries in a 
long-running psql session. The problem is that that was refactored in 
v17, commit 664d757531. The test I wrote for v17 doesn't work as it is 
on backbranches. Options:

1. Write the new test differently on backbranches. Before 664d757531, 
the test needs to work a lot harder to use the background psql session, 
calling pump() etc. That's doable, but as noted in the discussion that 
led to 664d757531, it's laborious and error-prone.

2. Backport commit 664d757531. This might break out-of-tree perl tests 
that use the background_psql() function. I don't know if any such tests 
exist, and they would need to be changed for v17 anyway, so that seems 
acceptable. Anyone aware of any extensions using the perl test modules?

3. Backport commit 664d757531, but keep the existing background_psql() 
function unchanged. Add a different constructor to get the v17-style 
BackgroundPsql session, something like "$node->background_psql_new()".

I'm leaning towards 3. We might need to backport more perl tests that 
use background_psql() in the future, backporting the test module will 
make that easier.

Thoughts?

[1] 
https://www.postgresql.org/message-id/6b852e98-2d49-4ca1-9e95-db419a2696e0@iki.fi

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: RFC: Additional Directory for Extensions
Next
From: Matthias van de Meent
Date:
Subject: Re: add a new explain option including_query for include query string inside the json plan output