Hi Julien,

------------------ Original ------------------
From:                                                                           
                                             "Julien Rouhaud"                   
                                                                 
<rjuju...@gmail.com&gt;;
Date:&nbsp;Wed, Mar 10, 2021 11:35 AM
To:&nbsp;"Erica Zhang"<ericazha...@qq.com&gt;;
Cc:&nbsp;"pgsql-hackers"<pgsql-hack...@postgresql.org&gt;;
Subject:&nbsp;Re: Add some tests for pg_stat_statements compatibility 
verification under contrib



Hi Erica,

On Wed, Mar 10, 2021 at 11:14:52AM +0800, Erica Zhang wrote:
&gt; Hi Julien,
&gt; Thanks a lot for the quick review. Please see my answer below in blue. 
Attached is the new patch.

Thanks!

&gt;&gt; The upgrade scripts are already tested as postgres will install 1.4 
and perform
&gt;&gt; all upgrades to reach the default version.
&gt; Thanks for pointing that the upgrades paths are covered by upgrade scripts 
tests. Since I don't need to test the upgrade, I will test the installation of 
different versions directly, any concern?

I think you should keep your previous approach.&nbsp; The result will be the 
same
but it will consume less resources for that which is always good.
Agreed!


&gt;&gt; +SELECT * FROM pg_available_extensions WHERE name = 
'pg_stat_statements' and installed_version = '1.4';
&gt;&gt; 
&gt;&gt; 
&gt;&gt; What is this supposed to test?&amp;nbsp; All those tests will break 
every time we change
&gt;&gt; the default version, which will add maintenance efforts.&amp;nbsp; It 
could be good to
&gt;&gt; have one test breaking when changing the version to remind us to add a 
test for
&gt;&gt; the new version, but not more.
&gt; Here I just want to verify that "installed" version is the expected 
version. But we do have the issue as you mentioned which will add maintenance 
efforts. 
&gt; 
&gt; So I prefer to keep one test as now which can remind us to add a new 
version. As for others, just to check the count(*) to make sure installation is 
success.
&gt; Such as SELECT count(*) FROM pg_available_extensions WHERE name = 
'pg_stat_statements' and installed_version = '1.4'; What do you think?

How about tweaking your previous query so only the last execution fails when
pg_stat_statements default version is updated?&nbsp; Something like:

SELECT installed_version = default_version, installed_version
FROM pg_available_extensions
WHERE name = 'pg_stat_statements';

This way the same query can be reused for both older versions and current
version.
Yep, it's neater to use the query as you suggested. Thanks!


Also, can you register your patch for the next commitfest at
https://commitfest.postgresql.org/33/, to make sure it won't be forgotten?

Attachment: v3_add_test_for_pg_stat_statements.patch
Description: Binary data

Reply via email to