[Qgis-user] Insert Selected Fields From ESRI Shape-File To PostGIS Geometry Table

Richard Duivenvoorde rdmailings at duif.net
Tue Jun 6 10:42:12 PDT 2017


On 06-06-17 16:53, Osahon Oduware wrote:
> Hi,
> 
> I added an ESRI Shape file as a layer in QGIS (version 2.14) using the
> "Add vector layer" tool. Now, I want to import selected fields
> (including the geometry) from this shape-file layer into an existing
> PostGIS Geometry table.
> 
> I have tried using the import layer/file tool in the Database Manager
> menu, but this seems to be only able to create an existing table which
> doesn't suit my need as described above.
> 
> I learnt GeoMedia does something similar to what I am trying to
> accomplish i.e. it automatically loads the matching fields in the shape
> file layer into the corresponding fields in the database table.
> 
> Please, I need someone to direct me on how to accomplish this.


I would create a copy of the shape file by using 'Save As' in the Layer
panel.

Then load your copy in QGIS, and make that layer editable.
In the attribute tabel, of that layer there is a button to delete
columns. (only when in edit-mode you can select attributes to remove).

The result is a shapefile with only the attributes you need.

Then I would use QGIS-Browser (or the panel) to load the db by drag and
drop, or the Database Manager to load it in the db.

Hope this helps,

Richard Duivenvoorde

ps please do not cross post to different email lists



More information about the Qgis-user mailing list