Re: Create a separate test file for exercising system views

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create a separate test file for exercising system views
Date: 2017-01-30 05:02:12
Message-ID: CAB7nPqRg8E=T21gEJtn8widFWeovDHD6OtoPHs9w1wPp7ecasg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 30, 2017 at 6:02 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> In connection with the "pg_hba_file_settings view patch" thread, I was
> wondering where we could logically insert a regression test case for that
> view. I realized that there is no natural home for it among the existing
> regression tests, because it's not really connected to any SQL language
> feature. The same is true for a number of other built-in views, and
> unsurprisingly, most of them are not exercised anywhere :-(.
>
> Accordingly, I propose creating a new regression test file whose charter
> is to exercise the SRFs underlying system views, as per attached.
> I don't think we desperately need new tests for views that expand to
> simple SQL, but these test cases correspond directly to code coverage
> for C functions, so they seem worthwhile.
>
> I did not do anything about testing the various pg_stat_xxx views.
> Those could be added later, or maybe they deserve their own home.
> (In many cases, those would need something smarter than the basic
> count(*) technique used here, because the C functions are invoked
> in the view's SELECT list not in FROM, so the planner would throw
> away those calls.)
>
> Comments/objections?

Nice idea to group those tests in the same file. I am not noticing any
issues with the patch proposed.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rahila Syed 2017-01-30 05:38:59 Re: Improvements in psql hooks for variables
Previous Message Stephen Frost 2017-01-30 04:44:09 Re: [PATCH] Rename pg_switch_xlog to pg_switch_wal