public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Gregory Shearman <zekeyg@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] pg_upgrade91 - You must have read and write access   in the current  directory
Date: Tue, 6 Dec 2011 09:24:30 +1100	[thread overview]
Message-ID: <20111205222430.GA6582@pacific.net.au> (raw)
In-Reply-To: <i4L9i-1nZ-67@gated-at.bofh.it>

In linux.gentoo.user, you wrote:
> On 12/05/11 21:56, Gregory Shearman wrote:
>>hmmm...
>>
>>Which directory are you running the command from? I ran mine from
>>/var/lib/postgresql which has the properties:
>>
>>drwxr-xr-x 4 postgres root
>>
>>I don't recall using the command "pg_upgrade91", but I see that it is a
>>symlink to /usr/lib/postgresql-9.1/bin/pg_upgrade
>>
>>This is the command that worked for me:
>>
>>pg_upgrade -u postgres -d /var/lib/postgresql/9.0/data -D \\
>>/var/lib/postgresql/9.1/data -b /usr/lib/postgresql-9.0/bin -B \\
>>/usr/lib/postgresql-9.1/bin
>>
>>For more information do (as postgres user)
>>
>>$ pg_upgrade --help
>>
> I definitely wasn't in that directory I just "su postgres" and run the command.
>
> I just recreate the databases by hand and populated them with backup data.

I see. That's a shame.

Usually, the HOME directory of the postgres user is set to
/var/lib/postgresql.

If you just do "su postgres" you'll remain in the directory from which
you ran the command.

What you *must* do is run:

$ su - postgres

Notice the '-'?

This makes the su to the user a *login*, so that you'll be in the HOME
directory of the postgres user.

Try it yourself. Do an 'ls' after "su postgres" and then do an 'ls'
after "su - postgres"

See "man su" for more information.

-- 
Regards,
Gregory.



       reply	other threads:[~2011-12-05 22:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <i4EAO-6Xu-5@gated-at.bofh.it>
     [not found] ` <i4EAO-6Xu-7@gated-at.bofh.it>
     [not found]   ` <i4EAO-6Xu-9@gated-at.bofh.it>
     [not found]     ` <i4EAO-6Xu-3@gated-at.bofh.it>
     [not found]       ` <i4L9i-1nZ-67@gated-at.bofh.it>
2011-12-05 22:24         ` Gregory Shearman [this message]
     [not found] <i4wMV-1QN-5@gated-at.bofh.it>
     [not found] ` <i4wMV-1QN-3@gated-at.bofh.it>
     [not found]   ` <i4xpD-34S-7@gated-at.bofh.it>
2011-12-05 10:56     ` [gentoo-user] pg_upgrade91 - You must have read and write access in the current directory Gregory Shearman
2011-12-05 17:59       ` Joseph
     [not found] <i4w0x-w6-7@gated-at.bofh.it>
2011-12-05  2:37 ` Gregory Shearman
2011-12-05  3:25   ` Joseph
2011-12-05  1:52 Joseph

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111205222430.GA6582@pacific.net.au \
    --to=zekeyg@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox