Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-17 Thread Jim Nasby
On 2/14/17 2:49 PM, Pavel Stehule wrote: > Tom's use case might be more easily served by specifying a > template database. I don't think Pavel ever posted his use case. Wait, that's precisely what Pavel asked? I would to use regress test environment in my current case. 99% code in

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Pavel Stehule
Dne 14. 2. 2017 21:35 napsal uživatel "Andres Freund" : On 2017-02-14 14:29:56 -0600, Jim Nasby wrote: > On 2/14/17 1:59 PM, Andres Freund wrote: > > > AFAIK if you're doing make check (as opposed to installcheck) it's > > > significantly more complicated than that since you'd

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Andres Freund
On 2017-02-14 14:29:56 -0600, Jim Nasby wrote: > On 2/14/17 1:59 PM, Andres Freund wrote: > > > AFAIK if you're doing make check (as opposed to installcheck) it's > > > significantly more complicated than that since you'd have to create a temp > > > cluster/install yourself. > > > > But in that

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Jim Nasby
On 2/14/17 1:59 PM, Andres Freund wrote: AFAIK if you're doing make check (as opposed to installcheck) it's significantly more complicated than that since you'd have to create a temp cluster/install yourself. > But in that case you can't have useful templates in the regression test either, so

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Andres Freund
On 2017-02-14 12:33:35 -0600, Jim Nasby wrote: > On 2/13/17 8:50 PM, Andres Freund wrote: > > On 2017-02-14 11:46:52 +0900, Michael Paquier wrote: > > > > I still fail to see why --use-existing as suggested in > > > >

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Jim Nasby
On 2/13/17 8:50 PM, Andres Freund wrote: On 2017-02-14 11:46:52 +0900, Michael Paquier wrote: I still fail to see why --use-existing as suggested in https://www.postgresql.org/message-id/20170208002900.vkldujzfkwbvq...@alap3.anarazel.de isn't sufficient. Some tests create objects without

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-14 Thread Pavel Stehule
2017-02-14 3:36 GMT+01:00 Andres Freund : > On 2017-02-13 20:59:43 +0100, Pavel Stehule wrote: > > Hi > > > > 2017-02-13 6:46 GMT+01:00 Michael Paquier : > > > > > On Sat, Feb 11, 2017 at 3:03 PM, Pavel Stehule < > pavel.steh...@gmail.com> > > >

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-13 Thread Pavel Stehule
2017-02-14 3:50 GMT+01:00 Andres Freund : > On 2017-02-14 11:46:52 +0900, Michael Paquier wrote: > > > I still fail to see why --use-existing as suggested in > > > https://www.postgresql.org/message-id/20170208002900. > vkldujzfkwbvq...@alap3.anarazel.de > > > isn't

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-13 Thread Andres Freund
On 2017-02-14 11:46:52 +0900, Michael Paquier wrote: > > I still fail to see why --use-existing as suggested in > > https://www.postgresql.org/message-id/20170208002900.vkldujzfkwbvq...@alap3.anarazel.de > > isn't sufficient. > > Some tests create objects without removing them, meaning that >

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-13 Thread Michael Paquier
On Tue, Feb 14, 2017 at 11:36 AM, Andres Freund wrote: > On 2017-02-13 20:59:43 +0100, Pavel Stehule wrote: >> Hi >> >> 2017-02-13 6:46 GMT+01:00 Michael Paquier : >> >> > On Sat, Feb 11, 2017 at 3:03 PM, Pavel Stehule >> >

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-13 Thread Andres Freund
On 2017-02-13 20:59:43 +0100, Pavel Stehule wrote: > Hi > > 2017-02-13 6:46 GMT+01:00 Michael Paquier : > > > On Sat, Feb 11, 2017 at 3:03 PM, Pavel Stehule > > wrote: > > > here is new update - check is done before any creating > > > > It may

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-13 Thread Pavel Stehule
Hi 2017-02-13 6:46 GMT+01:00 Michael Paquier : > On Sat, Feb 11, 2017 at 3:03 PM, Pavel Stehule > wrote: > > here is new update - check is done before any creating > > It may be better to do any checks before dropping existing databases > as

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-12 Thread Michael Paquier
On Sat, Feb 11, 2017 at 3:03 PM, Pavel Stehule wrote: > here is new update - check is done before any creating It may be better to do any checks before dropping existing databases as well... It would be as well just simpler to complain with a single error message like

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-10 Thread Pavel Stehule
Hi 2017-02-10 6:00 GMT+01:00 Michael Paquier : > On Thu, Feb 9, 2017 at 5:13 AM, Pavel Stehule > wrote: > > here is a patch > > Thanks. > > - for (sl = dblist; sl; sl = sl->next) > - create_database(sl->str); > + if

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-09 Thread Michael Paquier
On Thu, Feb 9, 2017 at 5:13 AM, Pavel Stehule wrote: > here is a patch Thanks. - for (sl = dblist; sl; sl = sl->next) - create_database(sl->str); + if (templatelist != NULL) + { + _stringlist *tl; + + for (sl = dblist, tl

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-08 Thread Pavel Stehule
Hi 2017-02-08 8:33 GMT+01:00 Pavel Stehule : > > > 2017-02-08 8:30 GMT+01:00 Michael Paquier : > >> On Wed, Feb 8, 2017 at 4:24 PM, Pavel Stehule >> wrote: >> > What is sense for list of databases? >> >> ECPG uses it

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Pavel Stehule
2017-02-08 8:30 GMT+01:00 Michael Paquier : > On Wed, Feb 8, 2017 at 4:24 PM, Pavel Stehule > wrote: > > What is sense for list of databases? > > ECPG uses it for example, see 0992259. > > > Some option --template can be great - with backpatch

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Michael Paquier
On Wed, Feb 8, 2017 at 4:24 PM, Pavel Stehule wrote: > What is sense for list of databases? ECPG uses it for example, see 0992259. > Some option --template can be great - with backpatch if it is possible. That's not really complicated to patch... That could be a nice

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Pavel Stehule
2017-02-08 1:30 GMT+01:00 Michael Paquier : > On Wed, Feb 8, 2017 at 9:23 AM, Tom Lane wrote: > > 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

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Michael Paquier
On Wed, Feb 8, 2017 at 9:23 AM, Tom Lane wrote: > 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

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Andres Freund
On 2017-02-07 19:23:45 -0500, Tom Lane wrote: > Michael Paquier writes: > > On Wed, Feb 8, 2017 at 12:43 AM, Pavel Stehule > > wrote: > >> Is possible to specify template database for pg_regress? > >> I have to run tests on database with

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Tom Lane
Michael Paquier writes: > On Wed, Feb 8, 2017 at 12:43 AM, Pavel Stehule > 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

Re: [HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Michael Paquier
On Wed, Feb 8, 2017 at 12:43 AM, Pavel Stehule 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

[HACKERS] possibility to specify template database for pg_regress

2017-02-07 Thread Pavel Stehule
Hi 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. Regards Pavel