[GRASSLIST:5976] Re: Postgress and GRASS CD

Piero Cavalieri grasspiero at tiscali.it
Tue Apr 8 18:51:23 EDT 2003


Schuyler Fishman wrote:

> I am having difficulty using postgres and grass gis. Is it installed 
> with the cd?
> I get the following error message
>
> The following databases are in the Unix catalogue:
> Error: select Postgres: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"?
>
I don't know about the CD and about GRASS Postgres modules, however It 
seems to be a Postgres server configuration
problem (which is completely indipendent from GRASS).
If so, you should read the file "pg_hba.conf" (which  is the main 
configuration file) and a bit of the html guide (that comes
with the package - you should have in your distro) (I have in 
"/usr/share/doc/postgresql-docs-7.2/admin.html" but you could have in 
another dir, (chapter 3 report your error)).
I have Postgres running via TCP/IP (locally - with loopback address)(if 
you are using Win. I suppose that Unix socket doesn't work :-) ), so 
supposing that you want to have the database in a dir diffrent from the 
default (for example in your ~) and you want to authenticate to the 
server with 'password' authentication method (It seems to me that 
pgaccess works only with this auth. method (if you want to use a GUI for 
the client)), this is how I have done (after a bit of 'try and error' - 
probable you could do in less steps) :

FIRST TIME:    
° create dir for db_cluster (if you dont' use the default)
° root$ chown postgres db_cluster
° postgres$ initdb -D <cluster_dir> 
        => pg_hba.conf, ecc.
° in pg_hba.conf:
    host all 127.0.0.1 255.255.255.255 trust
° httpd up:
  root$ apachectl start   (if not running)
° postgres server up:
  postgres$ postmaster -D <cluster_dir>  -i                           
(the -i option is needed only if you use TCP/IP, as here)
° postgres$ createuser -h localhost <new_user_name>
° shutdown postmaster
° in pg_hba.conf:
  #host all 127.0.0.1 255.255.255.255 trust
   host all 127.0.0.1 255.255.255.255 password passwords_file
° postgres$ pg_password <new_passwords_file>         (postgres passwords 
are different from login passwords, and if I remamber, they             
                                                                        
      are encrypted, 'pg_password' utility menage them)
° server up:
  postgres$ postmaster -D <cluster_dir> -i
° graphical front to client side (if you want):
  user_you$ pgacces->Database ->open: template1
                        user: <that_created_with_createuser>
                        password: <that_created_with_pg_password>
           ->Database->new: <new_database>               
NEXT TIMES:
° httpd up:
  root$ apachectl start
° Postgres up:
  postgres$ postmaster -D <cluster_dir> -i
° graphical front to client side:
  user_you$ pgacces->Database ->open: <database>
                        user: <your_user>
                        password: <your_password>
  If you don't remamber the db_name:
  open: template1->Tables->pg_database (open and view available dbs)
  close
  open: known_db_name          







More information about the grass-user mailing list