[GRASS5] To: Postgresql interface programmers...
Eric G . Miller
egm2 at jps.net
Wed Sep 13 04:22:06 EDT 2000
Hi all,
I've been looking at some of the PostgreSQL interface code and I have a
couple comments/suggestion/questions. First, there is no way to ever
specify a password. If I wanted to connect to a remote machine, I'd
have to resort to the unsecure 'export PGPASSWORD=fiddlesticks' (or
whatever the variable's called). I realize a password can't be securely
stored in ~/.grass5rc, but perhaps a flag could? Also, the code always
assumes the postgres username matches the system user name. This
doesn't have to be the case (though it often is).
Also somewhat problematic is, g.select.pg set host to 'localhost' if no
host is specified. This causes libpq to use TCP sockets rather than
UNIX sockets. It may be on a system, you don't want the TCP sockets
open for postgres (or at least not without a user/passwd authentication
since ident sucks). I would ask that people let "PGHOST" be NULL. Or if
you use PQconnectdb(), it can be a zero length string. Also, I noticed
several instances where code looked like:
if((pghost = G_getenv("PGHOST")) == NULL) pghost = NULL;
Unless I'm mistaken, that will *always* fail if PGHOST is unset. My
reading is you need to use 'G__getenv()'. The second assignment is, of
course, redundant.
Anyway, I hope I don't sound like I'm lecturing (it's late, I'm tired,
some other lame excuse...). I'd be happy to rewrite module interfaces,
but I suspect some authors wouldn't like that. I have a little bit of
experience writing for PostgreSQL so I'd be more than happy to work on
stuff in this area.
--
/bin/sh ~/.signature:
Command not found
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'
More information about the grass-dev
mailing list