Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow importing data into existing tables with processing #27039

Closed
qgib opened this issue Jun 16, 2018 · 2 comments
Closed

Allow importing data into existing tables with processing #27039

qgib opened this issue Jun 16, 2018 · 2 comments
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Jun 16, 2018

Author Name: Robert Collins (@rbtcollins)
Original Redmine Issue: 19210
Affected QGIS version: 3.0.3
Redmine category:data_provider/postgis


When importing a layer that needed some schema tweaks (specifically to change the geom to a plain 'geometry' to avoid Polygon vs MultiPolygon errors... I wanted to turn off layer overwriting.

The ImportIntoPostGIS processing tool passes the overwrite option to
qgsvectorlayerexporter which passes it to
QgsPostgresProvider::createEmptyLayer

but as you can see here

if ( exists && overwrite )
and then
sql = QStringLiteral( "CREATE TABLE %1(" ) .arg( schemaTableName );
the PostGIS driver only uses the overwrite flag to skip dropping the existing table (good), but not to avoid creating a new table (bad) - and this naturally fails.

This seems to be the case even very far back in history, so perhaps this should be considered a feature request rather than a bug?

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
havatv added a commit to havatv/QGIS that referenced this issue Dec 5, 2019
@m-kuhn m-kuhn changed the title 'overwrite' flag in qgspostgresprovider createEmptyLayer ignored Allow importing data into existing tables with processing Jan 12, 2020
@m-kuhn m-kuhn added Processing Relating to QGIS Processing framework or individual Processing algorithms and removed Data Provider Related to specific vector, raster or mesh data providers labels Jan 12, 2020
@m-kuhn
Copy link
Member

m-kuhn commented Jan 12, 2020

@alexbruy alexbruy added Feature Request and removed Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Apr 19, 2020
@alexbruy
Copy link
Contributor

Already possible with master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
3 participants