[postgis-users] How to import SHP without superuser permission?
I tried to import SHP files into postGIS. As usual, I use shp2pgsql to create the SQL script, and then I use psql to execute the script. The postgreSQL user acccount I use with psql is the owner of the target database. However, it is not superuser. When I run psql to execute the script, I got the following error: ERROR: permission denied for relation geometry_columns I eventually decided to give superuser permission to the user account. After I gave superuser permission, the script ran without problem. Question: why did I got permission denied error? The user account is already the owner of the target database; why can't it import the data. Is there a way to import SHP files into postGIS database without superuser permission? Thanks, -Kresh ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] How to import SHP without superuser permission?
Is your user account the owner of geometry_columns? (often this is postgres) If not, then use the commands to allow permissions: GRANT ALL ON TABLE geometry_columns TO someuser; -- And while you are at it: GRANT ALL ON TABLE spatial_ref_sys TO someuser; If you have multiple users, you might want to consider using roles that are inherited by other users. This way you only need to enable the role permissions to the tables once, then each user can inherit that role. -Mike On 28 July 2010 00:56, kreshna_icehe...@yahoo.com kreshna_icehe...@yahoo.com wrote: I tried to import SHP files into postGIS. As usual, I use shp2pgsql to create the SQL script, and then I use psql to execute the script. The postgreSQL user acccount I use with psql is the owner of the target database. However, it is not superuser. When I run psql to execute the script, I got the following error: ERROR: permission denied for relation geometry_columns I eventually decided to give superuser permission to the user account. After I gave superuser permission, the script ran without problem. Question: why did I got permission denied error? The user account is already the owner of the target database; why can't it import the data. Is there a way to import SHP files into postGIS database without superuser permission? Thanks, -Kresh ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
[postgis-users] How to import SHP without superuser permission?
Even if your account is owner of database. The owner of the public scheme is postgres. Always postgres is the owner of the table geometry_columns and the spatial_ref_sys. Again in the 1.5.x version of postgis always postgres is owner of geography_columns view. You must change the ownership of this resorces or give to you account read grants on geometry_columns, spatiali_ref_sys and geography_columns. Regards, Andrea. I tried to import SHP files into postGIS. As usual, I use shp2pgsql to create the SQL script, and then I use psql to execute the script. The postgreSQL user acccount I use with psql is the owner of the target database. However, it is not superuser. When I run psql to execute the script, I got the following error: ERROR: permission denied for relation geometry_columns I eventually decided to give superuser permission to the user account. After I gave superuser permission, the script ran without problem. Question: why did I got permission denied error? The user account is already the owner of the target database; why can't it import the data. Is there a way to import SHP files into postGIS database without superuser permission? Thanks, -Kresh ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users