Thread

  1. pg_restore new option -m

    ohp@pyrenet.fr — 2009-02-18T17:55:53Z

    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)
    
    
  2. Re: pg_restore new option -m

    Tom Lane <tgl@sss.pgh.pa.us> — 2009-02-18T18:41:34Z

    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
    
    
  3. Re: pg_restore new option -m

    ohp@pyrenet.fr — 2009-02-19T14:20:08Z

    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)
  4. Re: pg_restore new option -m

    Tom Lane <tgl@sss.pgh.pa.us> — 2009-02-19T15:05:32Z

    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
    
    
  5. Re: pg_restore new option -m

    Andrew Dunstan <andrew@dunslane.net> — 2009-02-19T15:07:03Z

    
    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
    
    
  6. Re: pg_restore new option -m

    ohp@pyrenet.fr — 2009-02-19T16:01:27Z

    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)
    
    
  7. Re: pg_restore new option -m

    Andrew Dunstan <andrew@dunslane.net> — 2009-02-20T02:58:18Z

    
    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
    
    
    
    
    
  8. Re: pg_restore new option -m

    ohp@pyrenet.fr — 2009-02-20T13:44:06Z

    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)