postgresqlmacportsosx-leopard

postgresql start db


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.


Solution

  • $ su -
    # su - postgres
    

    Proceed from there.