Bug report #14650

Processing > Import Vector into PostGIS database > error

Added by Paolo Cavallini over 8 years ago. Updated over 8 years ago.

Status:Rejected
Priority:Normal
Assignee:-
Category:Processing/OGR
Affected QGIS version:2.14.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:22614

Description

See the attached file; others run smoothly.

Apparently the command attempts to write into spatial_ref_sys, where normally the user has only SELECT:

Algorithm Import Vector into PostGIS database (available connections) starting...
GDAL command:
ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:"host=localhost port=5432 dbname=corso password=utente active_schema=public user=utente" -lco DIM=2 /tmp/processing45330ad6bfb042f8a9bfb8be779e9668/e6179800548f427bb402f5eb1e8f62e1/OUTPUTLAYER.shp OUTPUTLAYER -overwrite -nlt MULTIPOLYGON -lco GEOMETRY_NAME=geom -lco FID=id -spat 1554733.17969 4678313.90625 1771614.78906 4924775.96094 -nlt PROMOTE_TO_MULTI
GDAL command output:
Progress turned off as fast feature count is not available.
ERROR 1: ERRORE: permission denied for relation spatial_ref_sys

ERROR 1: ERRORE: la transazione corrente è interrotta, i comandi saranno ignorati fino alla fine del blocco della transazione

ERROR 1: CREATE TABLE "public"."outputlayer" ( "id" SERIAL, PRIMARY KEY ("id"), "name" VARCHAR, "provincia" VARCHAR, "pop1951" NUMERIC, "pop1991" NUMERIC, "d_min" NUMERIC, "d_max" NUMERIC, "d_sum" NUMERIC, "d_count" NUMERIC, "d_mean" NUMERIC, "d_std" NUMERIC, "d_unique" NUMERIC, "d_range" NUMERIC, "d_var" NUMERIC, "d_median" NUMERIC, "d_mode" NUMERIC, "geom" geometry(MULTIPOLYGON,900914) )
ERRORE: la transazione corrente è interrotta, i comandi saranno ignorati fino alla fine del blocco della transazione

ERROR 1: Unable to write feature 0 from layer OUTPUTLAYER.

ERROR 1: Terminating translation prematurely after failed
translation of layer OUTPUTLAYER (use -skipfailures to skip errors)

zs2.zip (115 KB) Paolo Cavallini, 2016-04-09 12:21 PM

History

#1 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Open to Feedback

No problems whatsoever here with your data (Lin and Win) using a connection with a user that has only "select" on spatial_ref_sys.

Tested also your command from the cli, no issues. As the tool is just a frontend for ogr2ogr you must also try. If it fails and the command is correct (and the above one it is) then the problem is likely somewhere else.

#2 Updated by Paolo Cavallini over 8 years ago

  • Resolution set to up/downstream
  • Status changed from Feedback to Rejected

Right, an upstream issue. Sorry for the noise.

Also available in: Atom PDF