Thread

  1. pg_upgrade output directory

    Andrew Dunstan <andrew@dunslane.net> — 2010-06-11T13:44:53Z

    Why does pg_upgrade create its output directory in the user's home 
    directory (or TMP on Windows)? I should have thought that the current 
    working directory would be a more suitable choice. At the  very least 
    there should be an option for where to create it. Also, this location 
    doesn't seem to be referred to at all in the docs.
    
    cheers
    
    andrew
    
    
  2. Re: pg_upgrade output directory

    Bruce Momjian <bruce@momjian.us> — 2010-06-12T03:58:37Z

    Andrew Dunstan wrote:
    > 
    > Why does pg_upgrade create its output directory in the user's home 
    > directory (or TMP on Windows)? I should have thought that the current 
    > working directory would be a more suitable choice. At the  very least 
    > there should be an option for where to create it. Also, this location 
    > doesn't seem to be referred to at all in the docs.
    
    Yeah, it is odd.  I did it that way because the output files need to
    exist after the utility is run, and I worried that putting them in the
    current directory might cause them to be accidentally deleted or
    overlooked.
    
    However, I might have been too conservative.  How do tools that generate
    multiple output files usually handle this situation?  Do they output in
    to a subdirectory in $HOME, or in a subdirectory of the current
    directory, or just create multiple files without a subdirectory?
    
    -- 
      Bruce Momjian  <bruce@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + None of us is going to be here forever. +
    
    
  3. Re: pg_upgrade output directory

    Greg Stark <gsstark@mit.edu> — 2010-06-12T10:57:38Z

    On Sat, Jun 12, 2010 at 4:58 AM, Bruce Momjian <bruce@momjian.us> wrote:
    > However, I might have been too conservative.  How do tools that generate
    > multiple output files usually handle this situation?  Do they output in
    > to a subdirectory in $HOME, or in a subdirectory of the current
    > directory, or just create multiple files without a subdirectory?
    
    Generally they put them in the current directory without
    subdirectories but take a parameter to specify a directory to use.
    That parameter could be mandatory though if you're afraid the current
    directory isn't a suitable place.
    
    -- 
    greg
    
    
  4. Re: pg_upgrade output directory

    Bruce Momjian <bruce@momjian.us> — 2010-06-12T17:12:33Z

    Greg Stark wrote:
    > On Sat, Jun 12, 2010 at 4:58 AM, Bruce Momjian <bruce@momjian.us> wrote:
    > > However, I might have been too conservative. ?How do tools that generate
    > > multiple output files usually handle this situation? ?Do they output in
    > > to a subdirectory in $HOME, or in a subdirectory of the current
    > > directory, or just create multiple files without a subdirectory?
    > 
    > Generally they put them in the current directory without
    > subdirectories but take a parameter to specify a directory to use.
    > That parameter could be mandatory though if you're afraid the current
    > directory isn't a suitable place.
    
    Agreed.  I have applied the attached patch which creates the files in
    the current directory.  I think that will be fine and don't see any need
    for a directory parameter.  I have kept the printing of the full path
    name in the output:
    
    	Upgrade complete
    	----------------
    	| Optimizer statistics is not transferred by pg_upgrade
    	| so consider running:
    	|       vacuumdb --all --analyze-only
    	| on the newly-upgraded cluster.
    	
    	| Running this script will delete the old cluster's data files:
    	|      	/u/pg_migrator/pg_migrator/delete_old_cluster.sh
    
    I figured this would be helpful for people on Windows who might not know
    the actual directory used for the files.  However, it does make the
    display kind of wide.  Ideas?
    
    -- 
      Bruce Momjian  <bruce@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + None of us is going to be here forever. +