starting up database server + user postgres

Lists: pgsql-novice
From: Jennifer Liu <jennliu(at)MIT(dot)EDU>
To: pgsql-novice(at)postgresql(dot)org
Subject: starting up database server + user postgres
Date: 2003-09-01 16:06:19
Message-ID: 20030901160619.GA18230@jennliu.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi,

I'm a novice for using Postgres and Linux - any help or suggestions would be really appreciated, thanks!!! I'm having trouble logging on as the postgres user. I wanted to
create a database, so I tried...

root# /usr/local/pgsql/bin/createdb test
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
createdb: database creation failed

(so i thought i probably needed to logon as postgres, so i tried...)
root# su - postgres
su: user postgres does not exist

root# adduser postgres
adduser: group postgres exists - if you want to add this user to that group, use -g.

root# chown postgres /usr/local/pgsql/data
chown: `postgres': invalid user

I'm a little stuck....can anybody help? thanks so much!

jenn.


From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jennifer Liu <jennliu(at)MIT(dot)EDU>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: starting up database server + user postgres
Date: 2003-09-01 19:15:44
Message-ID: 20030901191544.GD1782@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Mon, Sep 01, 2003 at 12:06:19 -0400,
Jennifer Liu <jennliu(at)MIT(dot)EDU> wrote:
> Hi,
>
> I'm a novice for using Postgres and Linux - any help or suggestions would be really appreciated, thanks!!! I'm having trouble logging on as the postgres user. I wanted to
> create a database, so I tried...
>
> root# /usr/local/pgsql/bin/createdb test
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> createdb: database creation failed

This suggests the postmaster hasn't been started.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jennliu(at)MIT(dot)EDU
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: starting up database server + user postgres
Date: 2003-09-01 21:07:37
Message-ID: 11031.1062450457@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Jennifer Liu <jennliu(at)MIT(dot)EDU> writes:
> root# /usr/local/pgsql/bin/createdb test
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> createdb: database creation failed

The PG postmaster isn't running, evidently. You didn't say what Linux
distro you are using, so it's hard to give exact details about how to
start it, or to tell whether there's any preliminary setup you need to
do. It seems odd that you have a postgres group but not a postgres
user, though.

> root# chown postgres /usr/local/pgsql/data
> chown: `postgres': invalid user

Is that directory already there? If so, what user owns it? That's
probably the user you want to start the postmaster as.

regards, tom lane


From: "mathan" <mathan(at)hotpop(dot)com>
To: <jennliu(at)MIT(dot)EDU>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: starting up database server + user postgres
Date: 2003-09-02 03:47:39
Message-ID: 013a01c37104$f914e590$250110ac@MAMCO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

> I'm a novice for using Postgres and Linux - any help or suggestions would
be really appreciated, thanks!!! I'm having trouble logging on as the
postgres user. I wanted to
> create a database, so I tried...
>
> root# /usr/local/pgsql/bin/createdb test
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> createdb: database creation failed
>
> (so i thought i probably needed to logon as postgres, so i tried...)
> root# su - postgres
> su: user postgres does not exist
>
> root# adduser postgres
> adduser: group postgres exists - if you want to add this user to that
group, use -g.
>
> root# chown postgres /usr/local/pgsql/data
> chown: `postgres': invalid user
>
>
> I'm a little stuck....can anybody help? thanks so much!

Just run the following commands

# useradd postgres
# rm -rf /usr/local/pgsql/data
# mkdir /usr/local/pgsql/data
# chown postgres /usr/local/pgsql/data
#su - postgres

$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

$ /usr/local/pgsql/bin/postmaster &

It will start the postgresql daemon

$ /usr/local/pgsql/bin/createdb test

$/usr/local/pgsql/bin/psql test

Then you enter into the databare test

thanks
--mathan

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003