LinuxQuestions.org
Help answer threads with 0 replies.
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
  Search this Thread
Old 04-28-2004, 09:03 PM   #1
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Rep: Reputation: 15
Postgresql problem


I have removed RH embedded postgresql and reinstalled from source following the directions from:

http://www.postgresql.org/docs/curre...stall-post.htm

this is the end result...
Code:
gmake[2]: Leaving directory `/usr/local/src/postgresql-7.4.2/src/pl'
gmake[1]: Leaving directory `/usr/local/src/postgresql-7.4.2/src'

postgreSQL installation complete.

GMAKE INSTALL FINISHES SUCCESSFULLY

[root@localhost postgresql-7.4.2]# LD_LIBRARY_PATH=/usr/local/pgsql/lib
[root@localhost postgresql-7.4.2]# export LD_LIBRARY_PATH
[root@localhost postgresql-7.4.2]# su postgres
bash-2.05b$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_NZ.UTF-8.

creating directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 100
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
creating information schema... ok
vacuuming database template1... ok
copying template1 to template0... ok

Success. You can now start the database server using:

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
or
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

INITIALISATION IS SUCCESSFUL

bash-2.05b$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
LOG: could not create IPv6 socket: Address family not supported by protocol
LOG: database system was shut down at 2004-04-29 10:51:19 NZST
LOG: checkpoint record is at 0/9B1058
LOG: redo record is at 0/9B1058; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 536; next OID: 17142
LOG: database system is ready

AT THIS POINT I DID CTRL+Z AS NOTHING ELSE HAPPENED

[1]+ Stopped /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data

POSMASTER HAS STOPPED

bash-2.05b$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
FATAL: lock file "/usr/local/pgsql/data/postmaster.pid" already exists
HINT: Is another postmaster (PID 19495) running in data directory "/usr/local/pgsql/data"?
bash-2.05b$
UNABLE TO RESTART? ANOTHER INSTANCE OF POSTMASTER RUNNING? NO!!

If someone could explain to me what is going on I would appreciate it.


Bob

Whats that other dbms my…my something……
 
Old 04-28-2004, 11:13 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Of course it is running, you've just backgrounded and
stopped it, not terminated... append an ampersand to
your command-line and redirect the output to a) a
log or b) /dev/null ...

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >/dev/null 2>&1 &

And what were you expecting to happen? You started
a server-process without detaching it, therefore, if no
errors occur, nothing will happen.


Cheers,
Tink
 
Old 04-30-2004, 08:35 PM   #3
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I have had to reinstall rh9 and have just installed postgres again from source, evrything has gone smoothly up to the point where I want to create a database.
Code:
[postgres@localhost postgres]$ creatdb testdb
-bash: creatdb: command not found
[postgres@localhost postgres]$
I set the enviroment variables
Code:
[postgres@localhost postgres]$ LD_LIBRARY_PATH=/usr/local/pgsql/lib
[postgres@localhost postgres]$ export LD_LIBRARY_PATH
I'm using "O'reillys practical postgresql" as a guide and have followed the steps
so I'm not really sure why I get the "command not found"

I have installed from postgresql-7.4.2.tar.gz untarring and unzipping then using
default ."/configure" then "make" then "make install" postgres user has been created and postgres.postgres owns /usr/local/pgsql

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
initiated db created cluster evrything fine
then
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
postmaster successfully started

Bob
 
Old 04-30-2004, 11:42 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Add a script
/etc/profile.d/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
Maybe read the PostgreSQL documentation, too,
since I know nothing about the book you're reading.



Cheers,
Tink
 
Old 05-01-2004, 12:05 AM   #5
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
Thanks for the reply,
I'm really new to linux/opensource and figured the only way to learn was to just jump in and try stuff. Will spend more time trying to digest the man pages though. I'm updating packages so will try the script then.



I tried the script and then looked at the postgresql manual for version 7.4.2 and they have changed the syntax for setting the path to...

PATH=/usr/local/pgsql/bin:$PATH

instead of

PATH=$PATH:/usr/local/pgsql/bin

once I made the change the script worked.

Bob


Last edited by BobNz; 05-01-2004 at 01:03 AM.
 
Old 05-01-2004, 03:58 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Code:
PATH=/usr/local/pgsql/bin:$PATH

PATH=$PATH:/usr/local/pgsql/bin
That would only make a difference if you happen
to have two versions installed in different locations.



Cheers,
Tink
 
Old 05-01-2004, 04:34 PM   #7
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
sorry I wasn't very clear, in the script you gave me you had

PATH=$PATH:/usr/local/pgsql/bin

That didn't work.



in the manual for postgresql 7.4.2
the path is set using

PATH=/usr/local/pgsql/bin:$PATH

once I had changed what you gave me to what the manual said everything worked.

Bob
 
Old 05-01-2004, 07:23 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That is quite clear, and the only difference is that
in my statement the path to psql is appended, in
yours it's prepended. And that only makes a difference
if somewhere in your path there's a second executable
py the same name.



Cheers,
Tink
 
Old 05-01-2004, 08:34 PM   #9
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
thats odd, as far as I know there isn't another executable in the path.

Could you clarify what you mean by executable I may have that wrong.

Bob
 
Old 05-01-2004, 09:01 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Try a "whereis createdb"

If it comes up with more than one the un-install of
the one that came with DeadRat didn't work...

If there's only one I have no explanation for
why my variant shouldn't have worked...



Cheers,
TInk
 
Old 05-01-2004, 09:20 PM   #11
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
Returned one " createdb "

curious.

any tips on the best way to approach/learn Linux/opensource?

bob

Last edited by BobNz; 05-01-2004 at 09:22 PM.
 
Old 05-02-2004, 02:43 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If you're in the Wellington-region bring the
machine to next weeks LUG meeting :)


Cheers,
Tink
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
postgresql problem eduac Linux - Software 0 08-31-2005 06:45 AM
Postgresql Problem mitrship Programming 3 07-28-2005 12:09 AM
PostgreSQL Problem r0ck Slackware 8 11-26-2004 11:02 AM
Problem with PostgreSQL !!! beyond_2000 Linux - Software 10 06-15-2004 06:46 AM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration