Thread: createuser: could not connect to database postgres: FATAL: could not open file "global/pg_database": No such file or directory

Hi All,

 

I need your help to fix this problem.

 

When I ran initdb, I got the warning error below.

Then I tried to create a user.  I got error “createuser: could not connect to database postgres: FATAL:  could not open file "global/pg_database": No such file or directory”.  Please see the out put below.

 

Thank you for your help.

Tri.

 

 

 

 

-bash-2.05b$ initdb --lc-collate=C

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.

 

The database cluster will be initialized with locales

  COLLATE:  C

  CTYPE:    en_US.UTF-8

  MESSAGES: en_US.UTF-8

  MONETARY: en_US.UTF-8

  NUMERIC:  en_US.UTF-8

  TIME:     en_US.UTF-8

The default database encoding has accordingly been set to UTF8.

 

creating directory /var/lib/pgsql/data ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers/max_fsm_pages ... 24MB/153600

creating configuration files ... ok

creating template1 database in /var/lib/pgsql/data/base/1 ... ok

initializing pg_authid ... ok

initializing dependencies ... ok

creating system views ... ok

loading system objects' descriptions ... ok

creating conversions ... ok

setting privileges on built-in objects ... ok

creating information schema ... ok

vacuuming database template1 ... ok

copying template1 to template0 ... ok

copying template1 to postgres ... ok

 

WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the -A option the

next time you run initdb.

 

Success. You can now start the database server using:

 

    postgres -D /var/lib/pgsql/data

or

    pg_ctl -D /var/lib/pgsql/data -l logfile start

 

 

 

-bash-2.05b$ pg_ctl -D /var/lib/pgsql/data -l logfile start

server starting

-bash-2.05b$ createuser -A -D -P nssb

Enter password for new role:

Enter it again:

Shall the new role be allowed to create more new roles? (y/n) n

createuser: could not connect to database postgres: FATAL:  could not open file "global/pg_database": No such file or directory

 

 

"Tri Quach" <tquach@k12.hi.us> writes:
> createuser: could not connect to database postgres: FATAL:  could not open
> file "global/pg_database": No such file or directory

So is that file present (under /var/lib/pgsql/data)?  What messages are
in the postmaster's logfile?  What PG version is this, and on what
platform?

            regards, tom lane


Thanks everyone for all your help.  After reboot the server, I was able to
recreate user and database.  I am done with the installation.

Thanks,
Tri.




-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Thursday, March 20, 2008 3:57 PM
To: Tri Quach
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] createuser: could not connect to database postgres:
FATAL: could not open file "global/pg_database": No such file or directory

"Tri Quach" <tquach@k12.hi.us> writes:
> createuser: could not connect to database postgres: FATAL:  could not open
> file "global/pg_database": No such file or directory

So is that file present (under /var/lib/pgsql/data)?  What messages are
in the postmaster's logfile?  What PG version is this, and on what
platform?

            regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

______________________________________________________________________
This email was scanned by the MessageLabs Security System contracted by the
Hawaii Dept Of Education. If you receive suspicious/phish email, forward a
copy to spamreport@k12.hi.us  This helps us monitor suspicious/phish email
getting thru. You will not receive a response from us, but rest assured the
information received will help to build additional protection. For info
about this service please visit http://www.messagelabs.com/email
______________________________________________________________________