FreemapSlovakia / freemap-mapnik

Outdoor map mainly for https://www.freemap.sk/
https://www.freemap.sk/?layers=X
Apache License 2.0
22 stars 9 forks source link

Documentation : missing permissions on database #311

Closed necarnot closed 6 months ago

necarnot commented 6 months ago

When importing additional.sql file with psql, we get the following errors :

(this is french, but you get the idea : permission denied)

postgres@freemap:~$ psql -h localhost -U freemap -d freemap -f /data/freemap-mapnik/additional.sql 
Mot de passe pour l'utilisateur freemap : 
psql:/data/freemap-mapnik/additional.sql:1: ERREUR:  l'extension « intarray » existe déjà
psql:/data/freemap-mapnik/additional.sql:3: ERREUR:  l'extension « hstore » existe déjà
psql:/data/freemap-mapnik/additional.sql:10: ERREUR:  droit refusé pour le schéma public
psql:/data/freemap-mapnik/additional.sql:17: ERREUR:  droit refusé pour le schéma public
psql:/data/freemap-mapnik/additional.sql:23: ERREUR:  droit refusé pour le schéma public
psql:/data/freemap-mapnik/additional.sql:30: ERREUR:  droit refusé pour le schéma public
psql:/data/freemap-mapnik/additional.sql:33: ERREUR:  la relation « osm_routes » n'existe pas
psql:/data/freemap-mapnik/additional.sql:35: ERREUR:  la relation « osm_routes » n'existe pas
psql:/data/freemap-mapnik/additional.sql:37: ERREUR:  la relation « osm_routes » n'existe pas
psql:/data/freemap-mapnik/additional.sql:39: ERREUR:  la relation « osm_routes » n'existe pas
psql:/data/freemap-mapnik/additional.sql:41: ERREUR:  la relation « osm_features » n'existe pas
psql:/data/freemap-mapnik/additional.sql:43: ERREUR:  la relation « osm_features » n'existe pas
psql:/data/freemap-mapnik/additional.sql:45: ERREUR:  la relation « osm_places » n'existe pas
psql:/data/freemap-mapnik/additional.sql:47: ERREUR:  la relation « osm_route_members » n'existe pas
psql:/data/freemap-mapnik/additional.sql:49: ERREUR:  la relation « osm_route_members » n'existe pas
psql:/data/freemap-mapnik/additional.sql:51: NOTICE:  la table « z_order_poi » n'existe pas, poursuite du traitement
DROP TABLE
psql:/data/freemap-mapnik/additional.sql:53: ERREUR:  droit refusé pour le schéma public
LIGNE 1 : CREATE TABLE z_order_poi (type VARCHAR PRIMARY KEY, z_order ...
                       ^
psql:/data/freemap-mapnik/additional.sql:202: ERREUR:  la relation « z_order_poi » n'existe pas
LIGNE 2 :         z_order_poi (type)
                  ^
psql:/data/freemap-mapnik/additional.sql:204: NOTICE:  la table « z_order_landuse » n'existe pas, poursuite du traitement
DROP TABLE
psql:/data/freemap-mapnik/additional.sql:206: ERREUR:  droit refusé pour le schéma public
LIGNE 1 : CREATE TABLE z_order_landuse (type VARCHAR PRIMARY KEY, z_or...
                       ^
psql:/data/freemap-mapnik/additional.sql:252: ERREUR:  la relation « z_order_landuse » n'existe pas
LIGNE 2 :         z_order_landuse (type)
                  ^

which are solved using the following command :

postgres@freemap:~$ psql 
psql (16.1 (Debian 16.1-1.pgdg120+1), serveur 15.5 (Debian 15.5-1.pgdg120+1))

postgres=# alter database freemap owner to freemap;
ALTER DATABASE
postgres=# \q
zdila commented 6 months ago

try to execute this as postgres superuser first: GRANT ALL ON SCHEMA public TO freemap;