]> granicus.if.org Git - postgresql/commit
Fix regression tests to use only global names beginning with "regress_".
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 29 Jun 2019 15:09:03 +0000 (11:09 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 29 Jun 2019 15:09:03 +0000 (11:09 -0400)
commitca129e58c01f29ef24a734313ff315933b3d5b67
treef681588f868f7004d8b702981431a85b8cdd384a
parenta1e61badf97bc446053145ba40de6db835678ce3
Fix regression tests to use only global names beginning with "regress_".

In commit 18555b132 we tentatively established a rule that regression
tests should use names containing "regression" for databases, and names
starting with "regress_" for all other globally-visible object names, so
as to circumscribe the side-effects that "make installcheck" could have on
an existing installation.  However, no enforcement mechanism was created,
so it's unsurprising that some new violations have crept in since then.

In fact, a whole new *category* of violations has crept in, to wit we now
also have globally-visible subscription and replication origin names, and
"make installcheck" could very easily clobber user-created objects of
those types.  So it's past time to do something about this.

This commit sanitizes the tests enough that they will pass (i.e. not
generate any visible warnings) with the enforcement mechanism I'll add
in the next commit.  There are some TAP tests that still trigger the
warnings, but the warnings do not cause test failure.  Since these tests
do not actually run against a pre-existing installation, there's no need
to worry whether they could conflict with user-created objects.

The problem with rolenames.sql testing special role names like "user"
is still there, and is dealt with only very cosmetically in this patch
(by hiding the warnings :-().  What we actually need to do to be safe is
to take that test script out of "make installcheck" altogether, but that
seems like material for a separate patch.

Discussion: https://postgr.es/m/16638.1468620817@sss.pgh.pa.us
12 files changed:
contrib/test_decoding/expected/replorigin.out
contrib/test_decoding/expected/rewrite.out
contrib/test_decoding/sql/replorigin.sql
contrib/test_decoding/sql/rewrite.sql
src/bin/pg_dump/t/010_dump_connstr.pl
src/bin/pg_upgrade/test.sh
src/test/regress/expected/object_address.out
src/test/regress/expected/rolenames.out
src/test/regress/expected/subscription.out
src/test/regress/sql/object_address.sql
src/test/regress/sql/rolenames.sql
src/test/regress/sql/subscription.sql