[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: |
James Busser |
Subject: |
Re: [Gnumed-devel] Postgres installation and setup in lenny |
Date: |
Wed, 03 Sep 2008 15:26:08 -0700 |
On 3-Sep-08, at 2:14 PM, Karsten Hilbert wrote:
making me wonder if the above something normally needed to be done
manually?
No. The data directory for PG on Debian is somewhere under /var/
postgresql/
if I recall correctly. Just su from root to postgres and check
where you are in
the directory tree.
Or cat /etc/passwd to show the homedir of postgres.
The homdir at postgres appears to be
/var/lib/postgresql
Although I am not sure how to verify that a cluster has already been
initialized. I could not confirm that Postgres SQL was really
working. I should have thought it would have started at system boot,
so I tried to connect to the default database 'template1':
su postgres
psql template1 -U postgres
but I got
address@hidden:~$ sudo su postgres
[sudo] password for jb:
address@hidden:/home/jb$ psql template1 -U postgres
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"?
address@hidden:/home/jb$
So I tried to start it manually using pg_ctl
debianhost:/home/jb# su postgres
address@hidden:/home/jb$ pg_ctl start -l logfile
bash: pg_ctl: command not found
Which I then located pg_ctl in
/usr/lib/postgresql/8.3/bin/pg_ctl
and also located
/usr/bin/pg_ctlcluster
whereas my $PATH is
address@hidden:/home/jb$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games
So I guess the installer both fails to configure postgres to start at
system boot, and did not add to my path.
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
Try "pg_ctl --help" for more information.
address@hidden:/home/jb$
So I provided a -D with /var/lib/postgresql
address@hidden:~$ pg_ctl start -l logfile -D /var/lib/postgresql
server starting
Which at least seemed to satrt the server, but when I try to connect
to template1 I get
address@hidden:~$ psql template1 -U postgres
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"?
address@hidden:~$
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
What now?
==========================
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
http://www.postgresql.org/docs/8.3/static/creating-cluster.html
[Gnumed-devel] Re: Postgres installation and setup in lenny, James Busser, 2008/09/03