[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Postgres installation and setup in lenny

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Postgres installation and setup in lenny
Date: Thu, 04 Sep 2008 00:45:19 +0200

> > Or cat /etc/passwd to show the homedir of postgres.
> The homdir at postgres appears to be
>       /var/lib/postgresql

Yeah, I recall. The files holding the cluster data are under


(given 8.3 is the version).

> Although I am not sure how to verify that a cluster has already been  
> initialized.

As root try running


It should list what clusters are there, running (up) or not (=down).

> I could not confirm that Postgres SQL was really  
> working. I should have thought it would have started at system boot,
Indeed it should.

> so I tried to connect to the default database 'template1':
>     su postgres
>     psql template1 -U postgres


   su - postgres

> address@hidden:~$ sudo su postgres

Try doing that step from root and try "su - postgres".

> [sudo] password for jb:
> address@hidden:/home/jb$ psql template1 -U postgres

See the "/home/jb" ? That (and a few other things I don't exactly know)
are the result of omitting the "-" from the "su" (which you couldn't be
expected to know, I suppose).

> psql: could not connect to server: No such file or directory
>       Is the server running locally and accepting
>       connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Please retry as listed above. If it stills spews out that message we indeed 
don't have
PG running. Try installing and running "rcconf" which let's you configure which 
start at which runlevel.

   apt-get install rcconf

> address@hidden:/home/jb$
> So I tried to start it manually using pg_ctl

It is usually preferable to use "/etc/init.d/postgresql-8.3 restart" to pick
up on any of the tweaks the distro made.

> So I guess the installer both fails to configure postgres to start at  
> system boot, and did not add to my path.

It appears to seem so but I don't think that's the whole truth. Again, as
root try

   su - postgres

> So I tried adding to my path so that pg_ctl would be seen, and then got
> address@hidden:/home/jb$ export PATH=/usr/lib/postgresql/8.3/ 
> bin/:$PATH
> address@hidden:/home/jb$ pg_ctl start -l logfile
> pg_ctl: no database directory specified and environment variable  
> PGDATA unset
Yep, another of the things omitting the "-" will cause (it will not run the 
and stuff for the using being su'ed to, that's why).

> So I provided a -D with /var/lib/postgresql
> address@hidden:~$ pg_ctl start -l logfile -D /var/lib/postgresql
> server starting
What you did was technically correct but entirely too complicated ;-)

> and despite that the server was supposedly starting, I cannot confirm  
> an active process
> address@hidden:~$ ps ax | grep "post"
>   5401 ?        Sl     6:29 /usr/lib/iceweasel/firefox-bin -a firefox  
> file:///usr/share/doc/postgresql-doc-8.3/html/intro-whatis.html
>   7185 pts/4    S      0:00 su postgres
>   7226 pts/3    S      0:00 su postgres
>   7342 pts/3    S+     0:00 grep post

> PS that directory which I was going to specify for initidb (which you  
> identified as not being a good place) came from the postgresql-8.3  
> documents

Yes, because they are talking about installing PostgreSQL into a distribution 
not as a
distribution-included packages but as an outside application (like we do with 
the GNUmed
database bootstrapper or when we install a GNUmed client tarball -- *locally* 
;-) In THAT
case /someplace/local/postgresql/ indeed is the right place.

GMX Kostenlose Spiele: Einfach online spielen und SpaƟ haben mit Pastry Passion!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]