pg_restore new option -m

Started by Nonamealmost 17 years ago8 messages
#1Noname
ohp@pyrenet.fr

hi,

i've been testing new -m option of pg_restore with great pleasure.
first, let me thank the developpers, it cut restoring time by half.

is it normal that -m doesn't cope well with -C?

createdb db
pg_restore -m 4 -d db db.dmp
works like a charm while

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

TIA
--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: pg_restore new option -m

ohp@pyrenet.fr writes:

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

You sure you don't get exactly the same without -m?

regards, tom lane

#3Noname
ohp@pyrenet.fr
In reply to: Tom Lane (#2)
1 attachment(s)
Re: pg_restore new option -m

hi Tom,
On Wed, 18 Feb 2009, Tom Lane wrote:

Date: Wed, 18 Feb 2009 13:41:34 -0500
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ohp@pyrenet.fr
Cc: pgsql-hackers list <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] pg_restore new option -m

ohp@pyrenet.fr writes:

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

You sure you don't get exactly the same without -m?

yes!

regards, tom lane

the pg.gz script shows the output of :
pg_restore -C -m
pg_restore -C
dropdb;createdb; pg_restore -m

regards,
--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

Attachments:

pg.gzapplication/octet-stream; name=pg.gzDownload
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#3)
Re: pg_restore new option -m

ohp@pyrenet.fr writes:

On Wed, 18 Feb 2009, Tom Lane wrote:

You sure you don't get exactly the same without -m?

yes!

We're going to need to see the test case then.

regards, tom lane

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Noname (#3)
Re: pg_restore new option -m

ohp@pyrenet.fr wrote:

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

You sure you don't get exactly the same without -m?

yes!

the pg.gz script shows the output of :
pg_restore -C -m
pg_restore -C
dropdb;createdb; pg_restore -m

OK, I'll look at it later today.

cheers

andrew

#6Noname
ohp@pyrenet.fr
In reply to: Tom Lane (#4)
Re: pg_restore new option -m

On Thu, 19 Feb 2009, Tom Lane wrote:

Date: Thu, 19 Feb 2009 10:05:32 -0500
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ohp@pyrenet.fr
Cc: pgsql-hackers list <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] pg_restore new option -m

ohp@pyrenet.fr writes:

On Wed, 18 Feb 2009, Tom Lane wrote:

You sure you don't get exactly the same without -m?

yes!

We're going to need to see the test case then.

regards, tom lane

they were included in the last mail :)
--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

#7Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: pg_restore new option -m

Tom Lane wrote:

ohp@pyrenet.fr writes:

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

You sure you don't get exactly the same without -m?

Yeah, I have reproduced this. It's because we reconnect to the wrong db
in this case (i.e. to the -d database, not the created one) in the
workers and subsequent connects.

I've applied a trivial patch to fix it.

cheers

andrew

#8Noname
ohp@pyrenet.fr
In reply to: Andrew Dunstan (#7)
Re: pg_restore new option -m

On Thu, 19 Feb 2009, Andrew Dunstan wrote:

Date: Thu, 19 Feb 2009 21:58:18 -0500
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: ohp@pyrenet.fr, pgsql-hackers list <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] pg_restore new option -m

Tom Lane wrote:

ohp@pyrenet.fr writes:

pg_restore -C -m 4 -d template1 db.dmp
gives numerous errors, mostly no such relation at index creation time.

You sure you don't get exactly the same without -m?

Yeah, I have reproduced this. It's because we reconnect to the wrong db in
this case (i.e. to the -d database, not the created one) in the workers and
subsequent connects.

I've applied a trivial patch to fix it.

works like a charm!

cheers

andrew

thanks
--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)