Re: Add some tests for pg_stat_statements compatibility verification under contrib

From: Erica Zhang <ericazhangy(at)qq(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add some tests for pg_stat_statements compatibility verification under contrib
Date: 2021-03-15 07:05:24
Message-ID: tencent_83A3AB77411D8D15665962774E3F93E75806@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Julien,

------------------&nbsp;Original&nbsp;------------------
From: "Julien Rouhaud" <rjuju123(at)gmail(dot)com&gt;;
Date:&nbsp;Wed, Mar 10, 2021 11:35 AM
To:&nbsp;"Erica Zhang"<ericazhangy(at)qq(dot)com&gt;;
Cc:&nbsp;"pgsql-hackers"<pgsql-hackers(at)postgresql(dot)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 Content-Type Size
v3_add_test_for_pg_stat_statements.patch application/octet-stream 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-03-15 07:25:27 Re: Consider Parallelism While Planning For REFRESH MATERIALIZED VIEW
Previous Message Bharath Rupireddy 2021-03-15 06:59:56 Re: Regression tests vs SERIALIZABLE