Re: possibility to specify template database for pg_regress

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: possibility to specify template database for pg_regress
Date: 2017-02-08 00:29:00
Message-ID: 20170208002900.vkldujzfkwbvqqq7@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017-02-07 19:23:45 -0500, Tom Lane wrote:
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> > On Wed, Feb 8, 2017 at 12:43 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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 :-(

Can't you do that with --use-existing? I'm pretty sure I used it for
very similar issues before. And yes, the --help text for that is
misleading.

- Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-02-08 00:30:19 Re: possibility to specify template database for pg_regress
Previous Message Tom Lane 2017-02-08 00:23:45 Re: possibility to specify template database for pg_regress