Opened 11 years ago

Closed 5 years ago

#398 closed defect (wontfix)

Unable to connect to PostgreSQL DB in GRASS 7.0svn on Win 7

Reported by: GG1234 Owned by: osgeo4w-dev@…
Priority: minor Component: Package
Version: Keywords:
Cc:

Description

Hello,

I have been trying to connect to a postgresql database in Grass without success with the following linecode :

GRASS 7.0.svn> g.gisenv set="DEBUG=3"
GRASS 7.0.svn> db.connect driver=pg database="host=localhost,dbname=mabasepg"
D2/3: G_file_name(): path = C:\DATA\GRASS/France/Scripting
D2/3: dbDbmscap(): opendir [C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
GRASS 7.0.svn> db.login driver=pg database="host=localhost,dbname=mabasepg" user=
postgres password="mypassword"
D2/3: G_file_name(): path = C:\DATA\GRASS/France/Scripting
D2/3: dbDbmscap(): opendir [C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D3/3: db_set_login(): drv=[pg] db=[host=localhost,dbname=schift] usr=[postgres]
pwd=[mypassword]
D3/3: DB login file = <C:\Users\Cev/.grass7/dblogin>
D3/3: login file does not exist
D3/3: DB login file = <C:\Users\Cev/.grass7/dblogin>
ERREUR :Unable to set user/password

It seems it cannot store the user/password data into the storage file, maybe because of that nasty mix in "\" and "/" characters. I do not know if I am correct and if so where to change this. I guess in my environment variables bat file ?

Does someone have a clue ?

I tried with the GUI, same result.

Thanks to all, and bravo for the excellent work going on in the open source community !

Cev.

Change History (3)

comment:1 by GG1234, 11 years ago

Well, that one was short : it seems the problem arise because Win7 doesn't allow to create folders with an initial ".". I manually added it with a workaround found on "superuser.com" : put an initial AND a final "." like this : ".grass7." in Windows Explorer. Windows will accept it and delete the final dot. Then the PG connection commands worked fine.

It might be usefull to add this in the osgeo4w installer ? Should I therfore set the ticket to fixed ?

Thanks,

Cev.

comment:2 by maphew, 11 years ago

The disallowed leading dot in a file or folder name for Windows has been around since at least Windows XP. The workaround I've always used is to create the file/folder from a CMD shell instead of Windows Explorer (I didn't know about the trailing dot trick, thanks!), e.g.:

pushd %HOMEDRIVE%%HOMEPATH%
mkdir .grass7

comment:3 by jef, 5 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.