19

I read the Q/A "How to insert a row in postgreSQL pgAdmin?" from enter link description here , but it's for pgAdmin 3.

I just installed postgreSQL 9.6.2 with pgAdmin 4, but could not find the option shown in pgAdmin 3, which you can click to have an excel-like window where you can add and update data in a table without using SQL language (as per @KarelG). Does anyone know whether it stills exist in postgreSQL 9.6.2 with pgAdmin 4? Thanks.

Carol Liu
  • 335
  • 1
  • 2
  • 5

6 Answers6

59

After editing the data, simple click on Save Data Changes (F6) icon.

Save Data Changes (F6) icon

nmkyuppie
  • 1,456
  • 1
  • 14
  • 30
10

You can select the table, use the right mouse button to select “View Data” and any of the subselections you choose.

"View Data" in pgAdmin 4

You can add new rows in the resulting grid.

To save them in the database, use the “Save” icon with the image of a floppy disk:

enter image description here

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
5

The table needs to have a primary key to become editable in pgadmin so that the column names have a pencil icon next to them instead of a padlock.

Maciek Binder
  • 81
  • 1
  • 3
4

You can right-click the table, then select View-Edit Data, and select Filtered Rows, Edit the rows and simply close on the X in the upper right. It will ask you if you want to SAVE.

  • 1
    It's silly, but since the Save button doesn't work the way it's supposed to, it was the only way. – Noumenon Nov 29 '19 at 05:26
  • P.S. You don't need to use Filtered Rows, a r.click on the table, then 'View/Edit Data' > 'All Rows' will also work. The idea seems that save/cancel works locally on each cell but nothing is truly saved yet. Then to save all your work finally, you close the currently active panel tab by hitting X in the upper right. This closes the panel tab that was created by issuing the 'View/Edit Data' > 'All Rows' in the first place. The act of closing the panel asks you if you want to save. Ideally the save button should be active and do all this, but its wrongly dimmed. – abulka Jan 17 '20 at 01:30
1

I had some trouble finding this too, but found it eventually: Right-click the table, then select "View/Edit Data", and select "Filtered Rows", then enter the condition (format: field name = ). Now it will only be showing the row you want to find and edit, and you can double-click the value, change it, then click the save-icon button to save it.

1

I had the same trouble. Trying to find out some short keys, I found using F6 key pretty useful.
Query tool -> F5
It will run the current query in the query editor.
Query tool -> Edit some cells -> F6
It will save the current changes to the database.
Check the query history to confirm what happend exactly.

Dharman
  • 30,962
  • 25
  • 85
  • 135
crazyoptimist
  • 125
  • 1
  • 14