[GRASSLIST:5977] Re: Postgress and GRASS CD

John Chesnut jchesnut at slonet.org
Tue Apr 8 19:01:40 EDT 2003


Can some one who has experience getting  Postgres interoperating with 
Grass on Mac OSX please post step by step instructions.

The initdb command will create a "data" directory, but the postgres 
server fails on startup. The initdb command requires su as the 
"postgres" user
	su postgres
	/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
complete successfully.

Several issues are apparent

1. Postmaster does not successufully start using the terminal command 
postmaster (eg.

	 sudo -u postgres /usr/local/pgsql/bin/postmaster -i -D 
/usr/local/pgsql/data

this reports the error
	FATAL:  no such group 'pgsql'
	/usr/local/pgsql/bin/postmaster: cannot create UNIX stream port
my interpretation:  some parts of postmaster need write permission 
with group pgsql which is not created by MacOSX

2, attempting to open the postmaster with the command
	 sudo -u pgsql /usr/local/pgsql/bin/postmaster -i -D 
/usr/local/pgsql/data
yield the error
	FATAL 1:  cannot open /usr/local/pgsql/data/PG_VERSION: 
Permission denied
my interpretation:  requires read permission of user "postgres" which 
is lacking for user pgsql

(I created the alternative user pgsql in an attempt to start postmaster)

3. attempting to start postmaster using the pg_ctl script as either 
user postgres or pgsql yields a similar error.

	sudo -u root sudo -u pgsql /usr/local/pgsql/bin/pg_ctl start 
-D /usr/local/pgsql/data
this returns a message
	postmaster successfully started
	FATAL 1:  cannot open /usr/local/pgsql/data/PG_VERSION: 
Permission denied
same error as 2.

Evidently getting the postmaster/postgres server running need 
alterations of permissions and groups, but no documentation is 
available that explains how to create a "pgsql" group and associate 
it with a "postgres" user.

Changing the /usr/local/pgsql/data directory permissions to 777 or 
766 yields an fatal error that permissions are incorrect: so simply 
expanding permissions doesn't work. The error reported is:
FATAL 1:  data directory /usr/local/pgsql/data has group or world 
access; permissions should be u=rwx (0700)

trying to create a user from within postgres as in
	sudo -u postgres /usr/local/pgsql/bin/createuser jchesnut
fails because
	psql: could not connect to server: No such file or directory
       		 Is the server running locally and accepting
        		connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
my interpretation:  postmaster / postgres must be running before the 
createuser command can be issued.  postgres wont run because of the 
fatal errors listed above.


Please help, if you know how to get postgres running under OSX







More information about the grass-user mailing list