[Qgis-developer] login to postgres/postgis from QGIS

Otto Dassau dassau at gbd-consult.de
Tue Mar 3 04:04:20 PST 2015


Hi,

thanks for your help. 

the database was spatially enabled, but it was necessary to grant some
rights (create/usage) to the public schema. 

I believe that a better message should point the user to the right
direction. A added a ticket for that.

http://hub.qgis.org/issues/12304

Regards
Otto

Am Fri, 27 Feb 2015 09:29:37 +0100
schrieb Yves Jacolin <yjacolin at free.fr>:

> On Friday, February 27, 2015 8:08:13 Otto Dassau wrote:
> > Hi,
> > 
> > I cannot login to a postgis database with QGIS as a normal user
> > 'testuser'. But I can login with psql and using pgadmin3.
> > 
> > CREATE ROLE testuser LOGIN
> >   NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
> > 
> > I get following error in QGIS:
> > 
> > CET ERROR:  function postgis_version() does not exist at character 8
> > CET HINT:  No function matches the given name and argument types. You
> > might need to add explicit type casts.
> > CET STATEMENT:  SELECT postgis_version()
> > 
> > If I create another user as SUPERUSER I can login without problems. What
> > could be the reason for this?
> > 
> > Thanks a lot
> Otto,
> 
> Some tips:
> 
> Check testuser can access to the public schema and geometry_column, 
> geography_column.
> 
> Something like:
> GRANT ALL TO SCHEMA public to public;
> GRANT ALL ON ALL TABLES IN SCHEMA public TO public;
> 
> public role is a specific role which contains all user.
> 
> Y.



More information about the Qgis-developer mailing list