[GRASS5] To: Postgresql interface programmers...

Eric G . Miller egm2 at jps.net
Fri Sep 15 00:48:54 EDT 2000


Alex,
	I wrote up a little generic pg_connect() interface that has all
the options of PQconnectdb() as individual char *.  It also takes care
of reading the GRASS environment variables.  It seems to work fine.

	However, I'm thinking if GRASS is about to enter feature freeze,
maybe better to put off dealing with the authentication issues until
later.  All the *pg code seems to work at the moment, so changing it
now's not such a good idea.  I can see the generic function handling
these questions (along with g.select.pg):

	Use username/password authentication?
		PG_USER = ...
		PG_PASS_REQ = 1
	    Crypt password ?
	    	PG_USE_CRYPT = 1
	Use database?
		PG_DBASE = ...
	Use hostname?
		PG_HOST = ...
	Use port?
		PG_PORT = ...

	If a user elects to use username and password, then prompting for a
password will always be required.  Modules or the generic interface
could provide this function.  There should be no command line
password=<foo> since that is insecure.  If PG_USE_CRYPT is set, then the
password will be sent with crypt(), otherwise plain text (not so secure,
but common).  Password authentication will make it difficult for scripts
unless the author puts the password in the script file.

	Out of all the possible environment variables, the only one that
would absolutely be required is the name of the database (we'll assume
nobody puts real data in "template1").  PostgreSQL defaults should
handle all the rest unless the system requires authentication.  No real
way to discover this except by testing in g.select.pg and catching the
"authentication required" error.

P.S.  A while back, I worked on an M4 feature test macro for
finding/testing postgresql include paths and libraries.  It /mostly/
worked.  Shall I resurrect this for GRASS?  It'll need a little more
work, since I uncovered some failure points with it (M4 macros are still
pretty alien to me).

-- 
/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