[postgis-users] MapServer postgis connection with user other than postgres

Gregory S. Williamson gsw at globexplorer.com
Tue Feb 7 03:24:06 PST 2006


In addition to creating the user in postgres itself, you will need to grant permissions for that user, e.g.

CREATE USER mms_user;  -- other options available -- see documentation
REVOKE ALL ON table_foo FROM PUBLIC;  -- now only postgres and other DB users can read/insert etc. on this table
GRANT SELECT ON table_foo TO mms_user;  -- let the new mms_user select from this table; see documentation for other options.

You will also want to add the new user to the pg_hba.conf file so that user can connect from the expected IP addresses to your database.

And finally, of course, the MMS connect string will want to have new_user instead of postgres.

If you have lots of users the GROUP can be useful in saving typing. It's best to do the REVOKE ALL FROM PUBLIC on all tables in your database (alas this needs to be done manually -- there is no command to do it magically to all tables and views) and then selectively restore permissions; make those permissions part of the process of updating the DB structure. You can also use schemas to partition information and selectively grant access to a given schema to certain users. 

If you need to have a user do inserts and updates don't forget to add permissions to any underlying sequences -- that's bitten me more than once.

HTH,

Greg WIlliamson
DBA
GlobeXplorer LLC


-----Original Message-----
From:	postgis-users-bounces at postgis.refractions.net on behalf of Stefan Overkamp
Sent:	Tue 2/7/2006 3:09 AM
To:	postgis-users at postgis.refractions.net
Cc:	
Subject:	[postgis-users] MapServer postgis connection with user other than postgres
Hi,

I would like to create a postgres-user who can be used to
establish a postgis-layer in my mapfile. It should be a user
other than the postgres superuser. e.g. only granted to select
information ...

What do I have to take into account?

Thanks

Stefan

-- 
=========================================
Dipl.Ing. Stefan Overkamp
tel: 02052 / 800 9847
GISWORKS GbR, Kamperstr. 3, 42555 Velbert
www.gisworks.info


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

!DSPAM:43e87f7c184151367185353!







More information about the postgis-users mailing list