• Tom Lane's avatar
    Fix regression tests to use only global names beginning with "regress_". · ca129e58
    Tom Lane authored
    In commit 18555b13 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
    ca129e58
replorigin.sql 3.23 KB