pg_upgrade output directory

Started by Andrew Dunstanalmost 16 years ago4 messageshackers
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

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

#2Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#1)
Re: pg_upgrade output directory

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. +

#3Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#2)
Re: pg_upgrade output directory

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#3)
Re: pg_upgrade output directory

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. +

Attachments:

/rtmp/difftext/x-diffDownload+56-84