Re: pg_Restore

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "bhanu udaya *EXTERN*" <udayabhanu1984(at)hotmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, François Beausoleil <francois(at)teksol(dot)info>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_Restore
Date: 2013-01-21 12:16:19
Message-ID: CAKt_Zfty6HDmEhU+-Jue+s8Q5u8vfPJrbQnNA5O4ROhtpWXKCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

On Mon, Jan 21, 2013 at 3:39 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> bhanu udaya wrote:
> > I tried with all the below options. It approximatly takes 1 hour 30
> minutes for restoring a 9GB
> > database. This much time can not be affordable as the execution of test
> cases take only 10% of this
> > whole time and waiting 1 hour 30 minutes after every test case execution
> is alot for the team. Kindly
> > let me know if we can reduce the database restoration time .
>
> I don't know if that helps, but have you tried creating a template database
> and doing DROP DATABASE xxx; CREATE DATABASE xxx TEMPLATE mytemplate;
> instead of restoring a dump every time?
>

Also for test cases, my preferred way is to put every test case in a
transaction that cannot commit. This way the tests are safe to run on
production environments. See pgTAP for one possibility here if you are
testing stored procedures. (Application code we run through wrappers that
filter out commits.)

But also the template approach is a good one fi you cannot guarantee that
the tests always role back.

Best Wishes,
Chris Travers

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Chris Ernst 2013-01-21 14:19:53 Re: pg_Restore
Previous Message dinesh kumar 2013-01-21 12:15:35 Re: pg_Restore

Browse pgsql-general by date

  From Date Subject
Next Message Marcel van Pinxteren 2013-01-21 12:22:06 Re: Case insensitive collation
Previous Message dinesh kumar 2013-01-21 12:15:35 Re: pg_Restore