Bug report #15097
Issues when running "Import into PostGIS" in batch mode
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23039|
- when selecting layers from filesystem and the table name is left blank, to leave the tool use the input vector as name, then the absolute path of the input vector is used as table name
- "table to import parameter" is filled with "none" when the tool is opened, and there is the suggestion to leave it blank to use the layer name. But then if the user leave "none" this word is used as table name.
- "none" is used also as default for the "primary key field", if the user leave it then "none" is used as name for the PK column
- compared to the tool in DB Manager it seems to miss the source/destination CRS parameters
#4 Updated by Giovanni Manghi almost 5 years ago
Hi Victor, thanks for the fixes. I see still two issues:
1) when the table name is left blank, once imported the table in Postgis has also the ".shp" in its name. I think is necessary to strip the extensions from inputs names.
2) if the field for primary key is left blank the tool gives an error
Error importing to PostGIS Creation of data source "public"."aaa" failed: ERROR: syntax error at or near "," LINE 1: CREATE TABLE "public"."aaa"(, PRIMARY KEY () ) ^
I would suggest to fill this field out of the box with a default like "gid" or just "id".
#6 Updated by Giovanni Manghi almost 5 years ago
- Status changed from Closed to Reopened
the latest build of master on osgeo4w is 979d619 that does not contain the latest commits, among the others the latest patch for this ticket. So I applied the patch manually but at that point the tool returns "Error importing to PostGIS Creation of data source "schema_name"."" failed: ERROR: zero-length delimited identifier at or near """" LINE 1: CREATE TABLE "schema_name".""(gid serial, PRIMARY KEY (gid) ) ^" but I soon realized that this error is also shown without the patch. At this point from "master_2" I downloaded the whole Processing folder and placed in plugins folder in .qgis2: no more error but also "missing parameter value: Table to import..." when leaving the table name blank. The "primary key field" seems fixed.