Обсуждение: cannot open pg_database

Поиск
Список
Период
Сортировка

cannot open pg_database

От
Jim Bryan
Дата:
Installing with yum, Fedora core 5.  Get error: "could
not open file "global/pg_database": No such file or
directory."   The file exists however, in
/var/lib/pgsql/data/global and contains 3 lines:
“postgres” 10793 1663 499 499
“template” 1 1663 499 499
“template0” 10792 1663 499 499

From the user-comments in manual, chapter 17.1 :
“If you get an error like
psql: FATAL: could not open file "global/pg_database":
No such file or directory
make sure that in your init.d postgresql file (if you
have one) or in the env variables for the shell that
runs your server process that PGDATA is set properly.
Then try to restart the server. If the server will not
restart, check for an already running server process
(sudo ps -af | grep postgres). Sometimes they can hang
around, secretly, and screw things up.”

As newbie, reluctant to start editing the init.d file.
 Ideas appreciated.

*****************
bash-3.1$ su -c 'pg_ctl start -D /usr/local/pgsql/data
-l serverlog' postgres
Password:
postmaster starting
bash-3.1$  psql template1
psql: FATAL:  could not open file
"global/pg_database": No such file or directory



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: cannot open pg_database

От
Roman Neuhauser
Дата:
# gooddayarizona@yahoo.com / 2006-08-19 20:18:53 -0700:
> Installing with yum, Fedora core 5.  Get error: "could
> not open file "global/pg_database": No such file or
> directory."   The file exists however, in
> /var/lib/pgsql/data/global and contains 3 lines:
> “postgres” 10793 1663 499 499
> “template” 1 1663 499 499
> “template0” 10792 1663 499 499
>
> From the user-comments in manual, chapter 17.1 :
> “If you get an error like
> psql: FATAL: could not open file "global/pg_database":
> No such file or directory
> make sure that in your init.d postgresql file (if you
> have one) or in the env variables for the shell that
> runs your server process that PGDATA is set properly.
> Then try to restart the server. If the server will not
> restart, check for an already running server process
> (sudo ps -af | grep postgres). Sometimes they can hang
> around, secretly, and screw things up.”
>
> As newbie, reluctant to start editing the init.d file.
>  Ideas appreciated.
>
> *****************
> bash-3.1$ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres
> Password:
> postmaster starting
> bash-3.1$  psql template1
> psql: FATAL:  could not open file
> "global/pg_database": No such file or directory

    what does this output?

    su -c 'ls -l /usr/local/pgsql/data/global' postgres

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

Re: cannot open pg_database

От
Tom Lane
Дата:
Jim Bryan <gooddayarizona@yahoo.com> writes:
> Installing with yum, Fedora core 5.  Get error: "could
> not open file "global/pg_database": No such file or
> directory.

It seems pretty odd that that would be the first error.

"   The file exists however, in
> /var/lib/pgsql/data/global and contains 3 lines:

OK ...

> bash-3.1$ su -c 'pg_ctl start -D /usr/local/pgsql/data
> -l serverlog' postgres

/usr/local is not /var/lib.  Perhaps you have an incomplete/corrupt
database installation under /usr/local/pgsql/data?  I don't believe
the postmaster would start if there were nothing there at all, but
it certainly doesn't try very hard to check whether every required
file is present.

            regards, tom lane

Re: cannot open pg_database

От
louis gonzales
Дата:
Also, what is you $PGDATA variable pointing to? Issue:

env | grep PG

see what that comes out with.

Roman Neuhauser wrote:

># gooddayarizona@yahoo.com / 2006-08-19 20:18:53 -0700:
>
>
>>Installing with yum, Fedora core 5.  Get error: "could
>>not open file "global/pg_database": No such file or
>>directory."   The file exists however, in
>>/var/lib/pgsql/data/global and contains 3 lines:
>>�postgres� 10793 1663 499 499
>>�template� 1 1663 499 499
>>�template0� 10792 1663 499 499
>>
>From the user-comments in manual, chapter 17.1 :
>>�If you get an error like
>>psql: FATAL: could not open file "global/pg_database":
>>No such file or directory
>>make sure that in your init.d postgresql file (if you
>>have one) or in the env variables for the shell that
>>runs your server process that PGDATA is set properly.
>>Then try to restart the server. If the server will not
>>restart, check for an already running server process
>>(sudo ps -af | grep postgres). Sometimes they can hang
>>around, secretly, and screw things up.�
>>
>>As newbie, reluctant to start editing the init.d file.
>> Ideas appreciated.
>>
>>*****************
>>bash-3.1$ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres
>>Password:
>>postmaster starting
>>bash-3.1$  psql template1
>>psql: FATAL:  could not open file
>>"global/pg_database": No such file or directory
>>
>>
>
>    what does this output?
>
>    su -c 'ls -l /usr/local/pgsql/data/global' postgres
>
>
>


--
Email:    louis.gonzales@linuxlouis.net
WebSite:  http://www.linuxlouis.net
"Open the pod bay doors HAL!" -2001: A Space Odyssey
"Good morning starshine, the Earth says hello." -Willy Wonka