0
votes

I have postgresql running (/opt/local/lib/postgresql90/bin).

The data base is set up @ /Users/demet8/postgres/data.

I check to make sure postgresql is running with

ps aux | grep postgres

demet8 9851 0.0 0.1 614276 1184 ?? Ss 12:40PM 0:00.24 postgres: autovacuum launcher process
demet8 9850 0.0 0.0 614020 436 ?? Ss 12:40PM 0:00.91 postgres: wal writer process
demet8 9849 0.0 0.0 614020 496 ?? Ss 12:40PM 0:01.22 postgres: writer process
demet8 9847 0.0 0.1 614020 2248 s002 S 12:40PM 0:00.61 /opt/local/lib/postgresql90/bin/postgres -D /Users/demet8/postgres/data demet8 11127 0.0 0.0 599820 468 s002 S+ 2:05PM 0:00.00 grep postgres demet8 9852 0.0 0.0 610092 368 ?? Ss 12:40PM 0:00.26 postgres: stats collector process

I go back into: /opt/local/lib/postgresql90/bin & now try to start the db with ./pg_ctl start. This is the error msg I get:

pg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information.

Any suggestions on to what I can be doing wrong. I googled around the web for answers & I haven't found a solution.

1
If it is already started why do you want to start it again? - Clodoaldo Neto
I want to be able to enter the db once it's running. I used ./pg_ctl start a couple of times to get into the db & it worked. For some reason it doesn't work now. I also tried $su - then su -postgres & the db responds back with "sorry." I'll have to keep trying until I figure this thing out. Thanks. - demet8
What do you mean by "to enter the db" and "to get into the db"? - Milen A. Radev
If you want to start an interactive session then the command is psql - Clodoaldo Neto
I wanted to get an interactive session going is what I was trying to explain & I should have clarified that better. I just figured it out. I entered ./psql postgres & it worked. Thank you for your help. - demet8

1 Answers

1
votes
$ su -
# su - postgres

Proceed from there.