Re: postgres db deleted and recreated... "No directory,

Поиск
Список
Период
Сортировка
От John Purser
Тема Re: postgres db deleted and recreated... "No directory,
Дата
Msg-id 20060506114743.8fb0cae2.jmpurser@gmail.com
обсуждение исходный текст
Ответ на postgres db deleted and recreated... "No directory, logging in with HOME=/" error...  (<operationsengineer1@yahoo.com>)
Ответы Re: postgres db deleted and recreated... "No directory, logging in with HOME=/" error...  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
On Sat, 6 May 2006 10:11:55 -0700 (PDT)
<operationsengineer1@yahoo.com> wrote:

> well, i dropped the "postgres" db in order to create a
> "rails" db.  i tried to do some stuff and i kept
> getting the error that postgres didn't exist.  then i
> remembered that was likely because it was the default
> db required to work with other dbs.
>
> ooops!
>
> i had created a postgres db earlier, so i thought
> deleting postgres would only impact what i had
> previously created (i think postgres already existed
> in the distro, now that i look back).
>
> anyway, i recreated postgres, but when i "su -
> postgres"... i get the following error:
>
> No directory, logging in with HOME=/
>
> i think i must've deleted a directory when i deleted
> postgres and it wasn't recreated when i recreated
> postgres.
>
> what can i do, if anything, to get back on track after
> delting and recreating the postgres db?  i'm running
> simply mepis, which is based on debian.
>
> as always, tia...
> ---------------------------(end of
> broadcast)--------------------------- TIP 5: don't forget to increase
> your free space map settings

I think you're getting an error from linux (assuming you're on linux)
not postgres.  When you su - postrgres it tries to sign you in as user
postgres and if this is an installation from a distro package there
probably isn't a directory call /home/postgres.  So linux is logging
you in with / as your "home" directory.

Remember that postgres and linux accounts are seperate.  You can long
in as "joe" to linux and then log into postgres in postgreSQL with the
command:
psql -U postgres

If you REALLY need to su to postgres then you might want to create
a /home/postgres directory:
mkdir -p /home/postgres      #as root
chown postgres:postgres     /home/postgres   #as root
Then look at your password file to make sure postgres is set up as a
real user.  Open up a text editor as root and see if there's a line
like:
postgres:x:1001:1001:postgresql:/home/postgres:/bin/bash
This tells Linux that there is a user named postgres, who's password is
held in the shadow password file, his user ID is 1001, his group ID is
1001 and his HOME DIRECTORY is /home/postgres and he uses the bash
shell.

But again, you DON'T need to be logged in as postgres ON LINUX to
access the postgres database ON POSTGRESQL.

Hope this gets you off on the right foot.

John Purser


--
Q:    How many journalists does it take to screw in a light bulb?
A:    Three.  One to report it as an inspired government program to
bring light to the people, one to report it as a diabolical government
plot to deprive the poor of darkness, and one to win a Pulitzer prize
for reporting that Electric Company hired a light bulb-assassin to break
    the bulb in the first place.

В списке pgsql-novice по дате отправления:

Предыдущее
От:
Дата:
Сообщение: postgres db deleted and recreated... "No directory, logging in with HOME=/" error...
Следующее
От:
Дата:
Сообщение: Re: postgres db deleted and recreated... "No directory, logging in with HOME=/" error...