LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   postgresql-7.4 no workie in slackware 9.1 (https://www.linuxquestions.org/questions/linux-software-2/postgresql-7-4-no-workie-in-slackware-9-1-a-191899/)

digital bots 06-10-2004 08:21 AM

postgresql-7.4 no workie in slackware 9.1
 
i did the following
./configure
gmake
su
gmake install
adduser postgres
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 -D /usr/local/pgsql/data >logfile 2>&1 &

Then tried to test it got this

root@ggx:~/sql/postgresql-7.4# /usr/local/pgsql/bin/createdb test
createdb: could not connect to database template1: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
root@ggx:~/sql/postgresql-7.4#

during the ./configure, gmake, gmake install stages no errors were recorded. when i do this to check the status.

root@ggx:~/sql/postgresql-7.4# /usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
postmaster successfully started
root@ggx:~/sql/postgresql-7.4# /usr/bin/pg_ctl -D /usr/local/pgsql/data status
pg_ctl: postmaster or postgres not running
root@ggx:~/sql/postgresql-7.4#

Which is odd because its started then for some reason it doesnt work anymore. Can any one help me?

digital bots 06-10-2004 02:38 PM

*bump*

Tinkster 06-10-2004 03:04 PM

First of all, you just broke a rule :
Quote:

While almost every question does get an answer, we cannot guarantee a response. Please do not bump your post until 24 hours has past.
Is Postgres actually RUNNING?

ps -A | grep postmaster
less /home/postgres/logfile

If it's not you may find that you've forgotten
to add /usr/local/pgsql/lib to /etc/ld.so.conf
(don't forget to run ldconfig as root as well).

I'd also recommend putting this script
Quote:

postgres.sh
Code:

#!/bin/bash
export PGDATA=/usr/local/pgsql/data
export PATH=$PATH:/usr/local/pgsql/bin
export MANPATH=$MANPATH:/usr/local/pgsql/man


into /etc/profile.d and make it executable.

Oh, and to start postgres automatically when booting, add this line
to your rc.local
Code:

/bin/su - postgres /usr/local/pgsql/bin/pg_ctl start -l /home/postgres/logfile -D /usr/local/pgsql/data > /home/postgres/start 2>&1&
Cheers,
Tink

digital bots 06-10-2004 10:03 PM

sorry about that but i have been workin on this thing for like 2 weeks now and i just mad that i cant figure it out. I did all of the steps that you said to do and its still doesnt work.

Tinkster 06-10-2004 10:35 PM

Back to diagnostics:

Quote:

ps -A | grep postmaster
less /home/postgres/logfile
What's the output?


Cheers,
Tink

digital bots 06-11-2004 07:08 AM

root@ggx:~# ps -A | grep postmaster
root@ggx:~# less /home/postgres/logfile
/home/postgres/logfile: No such file or directory
root@ggx:~#

it seems my postgres home is
/opt/pgsql
so i did
root@ggx:~#less /opt/pgsql
FATAL: could not open file "/usr/local/pgsql/data/PG_VERSION": Permission denied

then i did this

root@ggx:~# cd /usr/local/pgsql/data/
root@ggx:/usr/local/pgsql/data# chmod 777 PG_VERSION
root@ggx:/usr/local/pgsql/data# createdb mydb
createdb: could not connect to database template1: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
root@ggx:/usr/local/pgsql/data# less /opt/pgsql/logfile
FATAL: could not open file "/usr/local/pgsql/data/PG_VERSION": Permission denied
[1]+ Stopped less /opt/pgsql/logfile
root@ggx:/usr/local/pgsql/data#

:cry:

michaelk 06-11-2004 08:22 AM

Does not look like postmaster is running.

su - postgres
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data

Should start postmaster in the foreground. BTW root does not have any privileges to create DBs or has any other admin functions for security reasons. Open up another console window and to su back to the postgres user and create a regular user as a postgresql user. The command is createuser. Then use your regular user to create the DB.



All times are GMT -5. The time now is 12:06 AM.