4

Is it possible to edit POSTGIS tables directly in QGIS 2.6.1. I've been using The DB MANAGER but can only really do DDL type edits....Or create/import a brand new layer. I did see a SQL Window but that would be too complex for my customers to navigate. I believe in the past I've seen a Plugin or something to do this but from what I've read the DB Manager is the plugin of the future for Postgis.

An alternative is to pull into QGIS, Save as a shapefile and then re-publish to POSTGIS. This approach doesn't work well in our environment.

I'd like to be able to edit PostGIS directly via some type of Table Edit (similar to what I can do with shapefiles in ArcGIS).

4

Yes, you can edit both spatial and non-spatial PostGIS tables within QGIS.

  1. Make sure your PostgresSQL DB is PostGIS enabled
  2. Use the Add PostGIS layers button to first make a connection to a PostgresSQL db
  3. Next, use the Connect button to connect to DB to add both spatial and non-spatial tables
  4. Finally, select the layer in the QGIS TOC, then click the Toggle Editing button to start the edit session (you can draw new features, delete features, and open the attribute table to update record values)

Here are some links that give more details:

Working with your PostGIS Layers using QGIS

4
  • Note: Spatial tables will only show up in QGIS if they are in your database's geometry_column table. Otherwise they will be considered 'non-spatial' and, like @artwork21 posted, you'll need to select non-spatial tables in the connection window to see it.
    – Roman
    Feb 24 '15 at 19:41
  • @Roman, there is a check box that you can List all tables with no geometry and add them within QGIS via Add PostGIS tables dialog.
    – artwork21
    Feb 24 '15 at 19:51
  • Also note that you can edit postgis views in qgis if you implement instead of trigger actions in the db.
    – Jakob
    Feb 25 '15 at 7:03
  • Thanks guys, I got it working. Looks like the db user I was using only had read permissions on these objects so the toggle button wasn't even shown. I modified the db permissions and it showed up. I wouldn't of expected that behavior but seems like that was the case. But looks like everythying is good now! Thanks Feb 26 '15 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.