Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxJ0u-0002GG-1K for pgsql-general@arkaria.postgresql.org; Mon, 21 Jan 2013 15:10:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TxJ0s-0000OZ-Pw for pgsql-general@arkaria.postgresql.org; Mon, 21 Jan 2013 15:10:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxJ0k-0000KD-NF for pgsql-general@postgresql.org; Mon, 21 Jan 2013 15:10:10 +0000 Received: from col0-omc3-s4.col0.hotmail.com ([65.55.34.142]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxJ0i-0001GK-8O for pgsql-general@postgresql.org; Mon, 21 Jan 2013 15:10:10 +0000 Received: from COL002-W40 ([65.55.34.137]) by col0-omc3-s4.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 21 Jan 2013 07:10:06 -0800 X-EIP: [L2viPBgYRVbsTeljqI9rFHwVqgPy6N2j] X-Originating-Email: [udayabhanu1984@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_d99f433f-8fbb-4a2a-b026-bd6b5616ab38_" From: bhanu udaya To: Chris Travers , Albe Laurenz CC: Magnus Hagander , =?iso-8859-1?B?RnJhbudvaXMgQmVhdXNvbGVpbA==?= , "pgsql-general@postgresql.org" Subject: Re: pg_Restore Date: Mon, 21 Jan 2013 20:40:05 +0530 Importance: Normal In-Reply-To: References: , , <205AA39F-C998-4628-9AE9-430C4061CDF8@teksol.info>, , , , , MIME-Version: 1.0 X-OriginalArrivalTime: 21 Jan 2013 15:10:06.0401 (UTC) FILETIME=[65628B10:01CDF7E9] X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org --_d99f433f-8fbb-4a2a-b026-bd6b5616ab38_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2CThanks alot for all your replies. I tried all settings suggested=2C= it did not work. pg_restore is very slow. It does not come out less than 1= 1/2 hour. Can you please let me know the procedure for Template. Will it r= estore the data also . Please update. I need the database (metadata + data)= to be restored back after certain Java executions. Ex:- I have 9.5 gb dat= abase (with 500 schemas + data). This is treated as base database and it ne= eds to be restored every time after certain transactions. Thanks for your r= eply. Thanks and REgardsRadha Krishna Date: Mon=2C 21 Jan 2013 04:16:19 -0800 Subject: Re: [GENERAL] pg_Restore From: chris.travers@gmail.com To: laurenz.albe@wien.gv.at CC: udayabhanu1984@hotmail.com=3B magnus@hagander.net=3B francois@teksol.in= fo=3B pgsql-general@postgresql.org On Mon=2C Jan 21=2C 2013 at 3:39 AM=2C Albe Laurenz wrote: =0A= bhanu udaya wrote: =0A= > I tried with all the below options. It approximatly takes 1 hour 30 minut= es for restoring a 9GB =0A= > database. This much time can not be affordable as the execution of test = cases take only 10% of this =0A= > whole time and waiting 1 hour 30 minutes after every test case execution = is alot for the team. Kindly =0A= > let me know if we can reduce the database restoration time . =0A= =0A= I don't know if that helps=2C but have you tried creating a template databa= se =0A= and doing DROP DATABASE xxx=3B CREATE DATABASE xxx TEMPLATE mytemplate=3B =0A= instead of restoring a dump every time? Also for test cases=2C my preferred way is to put every test case in a tran= saction that cannot commit. This way the tests are safe to run on producti= on environments. See pgTAP for one possibility here if you are testing sto= red procedures. (Application code we run through wrappers that filter out = commits.) =0A= But also the template approach is a good one fi you cannot guarantee that t= he tests always role back. Best Wishes=2CChris Travers = --_d99f433f-8fbb-4a2a-b026-bd6b5616ab38_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello=2C
Thanks alot for all = your replies.
I tried all settings suggested=2C it did not work. pg_res= tore is very slow. It does not come out less than 1 1/2 hour. Can you pleas= e let me know the procedure for Template. Will it restore the data also . P= lease update. I need the database (metadata + data) to be restored back aft= er certain Java executions.
 =3B
Ex:- I have 9.5 gb database (wi= th 500 schemas + data). This is treated as base database and it needs to be= restored every time after certain transactions.
 =3B
Thanks for = your reply.
 =3B
Thanks and REgards
Radha Krishna

 = =3B

D= ate: Mon=2C 21 Jan 2013 04:16:19 -0800
Subject: Re: [GENERAL] pg_Restore=
From: chris.travers@gmail.com
To: laurenz.albe@wien.gv.at
CC: uda= yabhanu1984@hotmail.com=3B magnus@hagander.net=3B francois@teksol.info=3B p= gsql-general@postgresql.org



On= Mon=2C Jan 21=2C 2013 at 3:39 AM=2C Albe Laurenz <=3B<= a href=3D"mailto:laurenz.albe@wien.gv.at">laurenz.albe@wien.gv.at>=3B= wrote:
=0A=
bhanu udaya wrote:
=0A= >=3B I tried with all the below options. It approximatly takes 1 hour 30 = minutes for restoring a 9GB
=0A= >=3B database.  =3BThis much time can not be affordable as the execut= ion of test cases take only 10% of this
=0A= >=3B whole time and waiting 1 hour 30 minutes after every test case execu= tion is alot for the team.  =3BKindly
=0A= >=3B let me know if we can reduce the database restoration time .
=0A=
=0A=
I don't know if that helps=2C but have you tried creating a template = database
=0A= and doing DROP DATABASE xxx=3B CREATE DATABASE xxx TEMPLATE mytemplate=3B=0A= instead of restoring a dump every time?

Also for test cases=2C my preferred way is to put every test case in a tra= nsaction that cannot commit.  =3BThis way the tests are safe to run on = production environments.  =3BSee pgTAP for one possibility here if you = are testing stored procedures.  =3B(Application code we run through wra= ppers that filter out commits.) =3B
=0A=

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

Bes= t Wishes=2C
Chris Travers
= --_d99f433f-8fbb-4a2a-b026-bd6b5616ab38_--