Re: [HACKERS] possibility to specify template database for pg_regress - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] possibility to specify template database for pg_regress
Date
Msg-id 32401.1486513425@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] possibility to specify template database for pg_regress  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] possibility to specify template database for pg_regress  (Andres Freund <andres@anarazel.de>)
Re: [HACKERS] possibility to specify template database for pg_regress  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Wed, Feb 8, 2017 at 12:43 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>> Is possible to specify template database for pg_regress?
>> I have to run tests on database with thousands database objects. Using
>> template is much faster than import these objects.

> Not directly, all the databases created by pg_regress are enforced
> with template0.. Having a switch sounds useful though without seeing
> in details your use case.

I ran into a use-case just today: I wanted to run one particular
regression test script under CLOBBER_CACHE_ALWAYS, but it needed
stuff created by earlier scripts, and I didn't especially want to
run all of those scripts under CCA.  With a way to select a template,
I could've run the earlier scripts in a normal build, renamed the
ending-state regression database to something else, and then installed
a CCA-enabled executable and run a test with just the script of
interest.  The way I actually got it done was considerably hackier :-(
        regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] possibility to specify template database for pg_regress
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] possibility to specify template database for pg_regress