Re: Limit eartdistance regression testcase to the public schema

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Limit eartdistance regression testcase to the public schema
Date: 2025-09-28 07:00:28
Message-ID: CAN4CZFOLoXksPDTPPaXdr11eQ9E=wfT+qiXs1FRO1sWHYA9ugQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> why do you have other stuff in the search_path? That seems
> to cause all kinds of risks of accidentally interfering with
> assorted test cases.

That was a workaround that seemed to work with everything, except the
earthdistance testcase.

* If I create the extension in the public schema, that interferes with
multiple postgres tests
* If I create the extension in a specific schema, that doesn't change
any postgres test outputs, but then I can't run the existing tests of
the extension itself on the same installation, as it expects the
extension in the search path
* If I create the extension in a specific schema, and add it to the
search path, only the earthdistance testcase has failures

> I think this is breaking the test, because part of the point is
> to check that there's not anything installed outside the public
> schema (until we tell it to, further down).

I see. Further down the next checks specifically only test the
`public` and `c` schemas, but `c` doesn't exist at this point, it is
only created later. This seemed like an easy and safe fix based on
this, I assumed it is also okay to limit the earlier test to the same
schemas. Is there a reason why the later checks are more specific,
shouldn't we remove the `public.*` from the later tests then?

There are of course other solutions to my problem, I mainly chose this
approach because it looked logical to unify these checks.

On Fri, Sep 26, 2025 at 7:16 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> writes:
> > I attached a simple patch to the test case that modifies it to only
> > list objects from the public schema. Part of the test case is already
> > limited to the public schema, this patch just aligns the rest to do
> > the same.
>
> > What do you think?
>
> I think this is breaking the test, because part of the point is
> to check that there's not anything installed outside the public
> schema (until we tell it to, further down).
>
> Admittedly, this only checks schemas that are in the search_path,
> but why do you have other stuff in the search_path? That seems
> to cause all kinds of risks of accidentally interfering with
> assorted test cases.
>
> regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-09-28 08:18:39 Why cannot alter column type when a view depends on it?
Previous Message Chao Li 2025-09-28 03:21:10 Re: Mark function arguments of type "Datum *" as "const Datum *" where possible