LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2004, 02:12 AM   #1
Hiper1
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
Postgres


I need to install postgres and create a new db.And then load a dump file.

How do I go about doing this
 
Old 12-01-2004, 03:52 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
You can do all of this at the command-line.

Firstly, install postgres and start the postmaster service.
Secondly, add a new user. Normally, you will need to be the postgres user to do this; the best command I've found to work portably is:
Code:
su -c "su postgres -c 'adduser yourloginname'"
(This is because, in some setups, you can only log in if your UNIX name matches your postgresql user name).
You will be prompted if your user should be allowed to create databases; say yes. (You can create users as well if you like).

Next, create the database:
Code:
createdb dbname
Then, load the dump file:
Code:
psql dbname < dumpfile
See www.postgresql.org/docs/ for more information.
 
Old 12-01-2004, 03:57 AM   #3
Hiper1
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Original Poster
Rep: Reputation: 0
How do I get the postmaster service running.

I am new at this
 
Old 12-01-2004, 01:49 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
This depends on your distribution. In general, you just have to install the RPM or DEB package (or run something like “apt-get postgres”) and Postgresql will be installed.

See your distribution's configuration tool (eg. yast for SuSE).

To start the service, you may find the config tool also provides an interface to this (and automating the start-up so it comes up again after rebooting). But to start it by hand you can just do
Code:
pg_ctl --start
 
Old 12-02-2004, 12:55 AM   #5
Hiper1
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Below is the error I get when trying to get a connection to my DB from another pc.

GlobalDBBind.getConnection() - A connection error has occurred FATAL no pg_hba.conf entry for host " ffff 192.168.0.199", user "postgres", database "hgoltp2d"

What does this mean, and what do I need to fix it??
 
Old 12-02-2004, 12:52 PM   #6
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
This means that you don't have access permissions from a remote machine.

The access permissions are stored in the file pg_hba.conf. You need to edit this file, add an appropriate entry for a network connection, and then run
Code:
pg_ctl reload
.

Details at http://www.postgresql.org/docs/7.4/i...TH-PG-HBA-CONF
 
Old 04-03-2005, 12:02 AM   #7
obscure-shadow
Member
 
Registered: Nov 2004
Location: Lawrence, Kansas
Distribution: SuSE 10.2 Gentoo Knoppix
Posts: 63

Rep: Reputation: 15
i have the rpm for postgresql installed, but when i do the
Code:
pg_ctl --start
it says that the pg_ctl command wasnt found..
any ideas?
 
Old 04-10-2005, 09:30 AM   #8
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Quote:
Originally posted by obscure-shadow
i have the rpm for postgresql installed, but when i do the
Code:
pg_ctl --start
it says that the pg_ctl command wasnt found..
any ideas?
Either:

1) You haven't installed postgresql-server

or

2) pg_ctl isn't on your path. Run
Code:
locate pg_ctl
to find the file, then run the command including the full path. For example:
Code:
/usr/local/bin/pg_ctl --start
 
Old 04-10-2005, 05:43 PM   #9
obscure-shadow
Member
 
Registered: Nov 2004
Location: Lawrence, Kansas
Distribution: SuSE 10.2 Gentoo Knoppix
Posts: 63

Rep: Reputation: 15
I didn't have the server installed.. you were right.
 
  


Reply



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
postgres and mysql varun_33 Linux - Software 1 02-12-2005 07:54 AM
Installing Postgres 7.3 Hiper1 Linux - Software 0 12-01-2004 01:38 AM
PostGres Installation.... gvsprasad Linux - Enterprise 1 09-01-2004 05:29 AM
postgres data jamna17 Linux - Newbie 4 04-07-2004 05:45 AM
MySQL or PostGres ?? Peds Linux - Software 5 02-17-2004 11:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:48 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