Re: [HACKERS] Regression tests vs existing users in an installation

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-06-29T17:21:48Z
Lists: pgsql-hackers

Attachments

Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> We could make the new subdirectory be something specific like
>> "src/test/modules/test_rolenames", but I think very likely we'll be
>> wanting some additional test scripts that we likewise deem unsafe to
>> run during "installcheck".  So I'd rather choose a more generic module
>> name, but I'm not sure what ... "unsafe_tests"?

> Agreed but haven't got any particularly good suggestions on names..

Hearing no better suggestions, I went with "unsafe_tests" in the
attached.

This patch just moves rolenames.sql lock-stock-and-barrel into
src/test/modules/unsafe_tests.  Another approach would be to split
the test script into a portion that doesn't violate any installcheck
rule and could be kept in the core tests, versus the unsafe tests.
I lack the interest to do that, but if somebody else is excited enough
about it, have at it.

I'm wondering whether we ought to back-patch this.  The odds that
somebody would be affected by "make installcheck" resetting the
application_name property of existing roles seem pretty small,
but it could be nasty if it did matter.  Perhaps squeezing this into
v12 is good enough.

Another idea would be to just take out the ALTER USER ALL tests
in the back branches.

Thoughts?

			regards, tom lane

Commits

  1. Move rolenames test out of the core regression tests.

  2. Add an enforcement mechanism for global object names in regression tests.

  3. Fix regression tests to use only global names beginning with "regress_".

  4. Disallow user-created replication origins named "pg_xxx".