LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-10-2004, 08:21 AM   #1
digital bots
Member
 
Registered: Feb 2002
Distribution: Slack 10.1
Posts: 215

Rep: Reputation: 30
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?
 
Old 06-10-2004, 02:38 PM   #2
digital bots
Member
 
Registered: Feb 2002
Distribution: Slack 10.1
Posts: 215

Original Poster
Rep: Reputation: 30
*bump*
 
Old 06-10-2004, 03:04 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
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

Last edited by Tinkster; 06-10-2004 at 03:05 PM.
 
Old 06-10-2004, 10:03 PM   #4
digital bots
Member
 
Registered: Feb 2002
Distribution: Slack 10.1
Posts: 215

Original Poster
Rep: Reputation: 30
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.
 
Old 06-10-2004, 10:35 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Back to diagnostics:

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


Cheers,
Tink
 
Old 06-11-2004, 07:08 AM   #6
digital bots
Member
 
Registered: Feb 2002
Distribution: Slack 10.1
Posts: 215

Original Poster
Rep: Reputation: 30
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#


Last edited by digital bots; 06-11-2004 at 07:24 AM.
 
Old 06-11-2004, 08:22 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,535

Rep: Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675
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.


Last edited by michaelk; 06-11-2004 at 08:23 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use PostgreSQL on slackware (10.1) tuamtium Linux - Newbie 1 08-14-2005 01:46 AM
postgresql on slackware 10 dublinclontarf Slackware 6 08-13-2004 12:04 PM
Slackware Postgresql and PHP squirreldogger Slackware 2 11-21-2003 05:19 PM
slackware 9.0 -- no postgresql... alixx Slackware 1 07-12-2003 12:12 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM


All times are GMT -5. The time now is 11:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration