Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PostgreSQL on linux

Status
Not open for further replies.

Eluminary

Technical User
Apr 6, 2007
1
US
OK I rarly use linux but I have a CSCE 492 project that requires me to use it for a few things

Basically I need to run a wildfire server with an external PostgreSQL database and I'm having trouble getting PostgreSQL server running

I got the postgresql 8.2.3.tar.bz2

I extracted that and got

/acct/s1/schafert/postgresql-8.2.3/.configure
and
gmake

to work from here I'm kinda stuck I don't know what I need to do.

I need to create a db I have the table definitions written out

I think basically I need to set enviroment variables and some paths but I can't seem to get them to work correctly
 
Hi

So you say PostgreSQL is installed successfully ?

Then you only have to :

Initialize PostgreSQL data directory

The [tt]initdb[/tt] tool must create the files and directories needed for the data storage in the designated directory. It must be executed before the server is started.
Code:
initdb -D [green][i]/var/lib/postgresql/data[/i][/green]

Start PostgreSQL

PostgreSQL can be started in two ways :
[ul]
[li]as daemon, in background, with [tt]pg_ctl[/tt]
Code:
postmaster -D [green][i]/var/lib/postgres/data[/i][/green]
[/li]
[li]single user mode, in foreground, with [tt]postmaster[/tt]
Code:
pg_ctl start -D [green][i]/var/lib/postgresql/data[/i][/green] -L [green][i]/var/log/postgresql[/i][/green] -o -i
[/li]
[/ul]
Check in /etc/init.d/ to see if you already have a startup script for PostgeSQL. If not, you can write one easily using the examples in man [tt]pg_ctl[/tt]

Use PostgreSQL

Use the [tt]psql[/tt] utility to access the databases. Some statements can be executed with dedicated tools too : [tt]createdb[/tt], [tt]dropdb[/tt], [tt]vacuumdb[/tt].

For dump manipulation there are separate tools : [tt]pg_dump[/tt], [tt]pg_dumpall[/tt], [tt]pg_restore[/tt]. Note that compressed dumps can be handled only by [tt]pg_restore[/tt], but plain dumps can be loaded with [tt]psql[/tt] too.

Try the above steps and when in doubt, ask again.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top