pgsql: Add a regression test script dedicated to exercising system view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a regression test script dedicated to exercising system view
Date: 2017-01-30 22:15:52
Message-ID: E1cYKEq-0004b3-Ln@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a regression test script dedicated to exercising system views.

Quite a few of our built-in system views were not exercised anywhere
in the regression tests. This is perhaps not so exciting for the ones
that are simple projections/joins of system catalogs, but for the ones
that are wrappers for set-returning C functions, the omission translates
directly to lack of test coverage for those functions.

In many cases, the reason for the omission is that the view doesn't have
much to do with any specific SQL feature, so there's no natural place to
test it. To remedy that, invent a new script sysviews.sql that's dedicated
to testing SRF-based views. Move a couple of tests that did fit this
charter into the new script, and add simple "count(*)" based tests of
other views within the charter. That's enough to ensure we at least
exercise the main code path through the SRF, although it does little to
prove that the output is sane.

More could be done here, no doubt, and I hope someone will think about
how we can test these views more thoroughly. But this is a starting
point.

Discussion: https://postgr.es/m/19359.1485723741@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d002f16c6ec38f76d1ee97367ba6af3000d441d0

Modified Files
--------------
src/test/regress/expected/rangefuncs.out | 16 -----
src/test/regress/expected/sysviews.out | 113 ++++++++++++++++++++++++++++++
src/test/regress/expected/timestamptz.out | 35 ---------
src/test/regress/parallel_schedule | 2 +-
src/test/regress/serial_schedule | 1 +
src/test/regress/sql/rangefuncs.sql | 2 -
src/test/regress/sql/sysviews.sql | 48 +++++++++++++
src/test/regress/sql/timestamptz.sql | 16 -----
8 files changed, 163 insertions(+), 70 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-01-30 23:00:34 pgsql: Invent pg_hba_file_rules view to show the content of pg_hba.conf
Previous Message Tom Lane 2017-01-30 21:37:36 pgsql: Make psql reject attempts to set special variables to invalid va