PostgreSQL – How to Insert into View Through GUI in pgAdmin

pgadminpostgresql

I have some updateable views for inserting the data. The reason is not just "security layer", inserting into some 10 tables directly would be a pain without the view with INSTEAD OF trigger. In complete production, there will be some client app doing the inserts, but it is not ready now. A customer doesn't want to wait for the app, but also doesn't want to learn SQL just to insert few rows. Inserting the data through pgAdmin would be ideal. Unfortunately, pgAdmin shows a "new row" while inspecting data only for tables, not for views.

So is it possible to enable inserting into updateable views in pgAdmin? If not, is it possible in any other PostgreSQL GUI?

It is not just for this customer – we plan to offer the database without the client app as an opensource "demo", and we would like this demo to have some value for SQL-inept potencial customers too.

Best Answer

Sorry, no luck with pgAdmin. Per documentation:

Note that views can’t be edited and are read only by design; updatable views (using rules) are not supported at this time.

There is an item in the project's TODO list:

  • Updateable View wizard

Seems like nobody tackled that, yet. (Contributors welcome.)
There have been requests to introduce this feature in the past. You could email pgadmin-support@postgresql.org to document popular demand ...

For now, it seems like Navicat supports it.