- Run a script with F5, run only the statement at the cursor with Alt + F5 (Option + F5 on Mac), and cancel with Alt + Shift + Q.
- F7 shows EXPLAIN and Shift + F7 EXPLAIN ANALYZE; F8 saves the results to a file.
- Ctrl + Space triggers auto-complete, Ctrl + / toggles comments and Ctrl + K formats SQL (Cmd on Mac).
- Shortcuts are configurable under File > Preferences (pgAdmin 4 > Preferences in desktop mode on Mac) in each tool's Keyboard shortcuts panel.
pgAdmin shortcuts in the Query Tool
These are the pgAdmin shortcuts most people need: running, explaining and cancelling queries, and working with the result grid.
| Action | Windows / Linux | macOS |
|---|---|---|
| Execute script | F5 | F5 |
| Execute query at cursor | Alt + F5 | Option + F5 |
| Cancel query | Alt + Shift + Q | Option + Shift + Q |
| EXPLAIN query | F7 | F7 |
| EXPLAIN ANALYZE query | Shift + F7 | Shift + F7 |
| Execute options | Alt + Shift + X | Option + Shift + X |
| Commit | Shift + Ctrl + M | Shift + Ctrl + M |
| Rollback | Shift + Ctrl + R | Shift + Ctrl + R |
| Download (save) results | F8 | F8 |
| Open file | Ctrl + O | Cmd + O |
| Save file | Ctrl + S | Cmd + S |
| Clear query | Ctrl + Alt + L | Ctrl + Option + L |
| Format SQL | Ctrl + K | Cmd + K |
| Edit options | Alt + Shift + N | Option + Shift + N |
| Sort/Filter | Alt + Shift + F | Option + Shift + F |
| Filter options | Alt + Shift + I | Option + Shift + I |
| Toggle case of selected text | Shift + Ctrl + U | Shift + Ctrl + U |
Result grid and data editing
| Action | Windows / Linux | macOS |
|---|---|---|
| Add row | Alt + Ctrl + A | Option + Ctrl + A |
| Copy rows | Ctrl + C | Cmd + C |
| Paste rows | Alt + Shift + P | Option + Shift + P |
| Delete rows | Alt + Shift + D | Option + Shift + D |
| Save data changes | F6 | F6 |
| Next tab | Shift + Alt + ] | Shift + Option + ] |
| Previous tab | Shift + Alt + [ | Shift + Option + [ |
| Switch panel | Shift + Alt + Tab | Shift + Option + Tab |
SQL editor shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Auto-complete | Ctrl + Space | Ctrl + Space |
| Comment/uncomment code (block) | Ctrl + / | Cmd + / |
| Find | Ctrl + F | Cmd + F |
| Replace | Ctrl + Shift + F | Option + Cmd + F |
| Go to line, column | Ctrl + L | Cmd + L |
| Indent selected text | Tab | Tab |
| Un-indent selected text | Shift + Tab | Shift + Tab |
| Undo last edit | Ctrl + Z | Cmd + Z |
| Redo last edit undone | Ctrl + R | Cmd + R |
| Select all | Ctrl + A | Cmd + A |
| Copy / paste | Ctrl + C / Ctrl + V | Cmd + C / Cmd + V |
| Move to beginning of line | Alt + Left | Option + Left |
| Move to end of line | Alt + Right | Option + Right |
| Move left one word | Ctrl + Alt + Left | Cmd + Option + Left |
| Move right one word | Ctrl + Alt + Right | Cmd + Option + Right |
Main window and Object Explorer
| Action | Windows / Linux | macOS |
|---|---|---|
| Open Query Tool | Shift + Alt + Q | Shift + Option + Q |
| View data | Shift + Alt + V | Shift + Option + V |
| Focus Object Explorer | Shift + Alt + B | Shift + Option + B |
| Toggle (collapse) Object Explorer | Ctrl + Alt + B | Ctrl + Option + B |
| Refresh Object Explorer | F5 | F5 |
| Create object | Shift + Alt + N | Shift + Option + N |
| Edit object properties | Shift + Alt + E | Shift + Option + E |
| Delete object | Shift + Alt + D | Shift + Option + D |
| Search objects | Shift + Alt + S | Shift + Option + S |
| Quick Search | Shift + Ctrl + F | Shift + Ctrl + F |
| Direct debugging | Shift + Alt + G | Shift + Option + G |
| Tabbed panel forward / backward | Shift + Alt + ] / [ | Shift + Option + ] / [ |
| Close tab panel | Shift + Alt + W | Shift + Ctrl + W |
| File / Object / Tools / Help menu | Shift + Alt + F / O / L / H | Shift + Option + F / O / L / H |
ERD Tool shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Add table | Ctrl + Alt + A | Ctrl + Option + A |
| Edit table | Ctrl + Alt + E | Ctrl + Option + E |
| Clone table | Ctrl + Alt + C | Ctrl + Option + C |
| Drop table | Ctrl + Alt + D | Ctrl + Option + D |
| One to many link | Ctrl + Alt + O | Ctrl + Option + O |
| Many to many link | Ctrl + Alt + M | Ctrl + Option + M |
| Add/edit note | Ctrl + Alt + N | Ctrl + Option + N |
| Auto align | Ctrl + Alt + L | Ctrl + Option + L |
| Show more/fewer details | Ctrl + Alt + T | Ctrl + Option + T |
| Generate SQL | Ctrl + Alt + S | Ctrl + Option + S |
| Download image | Ctrl + Alt + I | Ctrl + Option + I |
| Open / save / save as project | Ctrl + O / Ctrl + S / Shift + Ctrl + S | Ctrl + O / Ctrl + S / Shift + Ctrl + S |
| Zoom in / zoom out | Shift + Alt + + / - | Shift + Option + + / - |
| Zoom to fit | Shift + Alt + F | Shift + Option + F |
Change pgAdmin shortcuts and fix conflicts
Open File > Preferences in web mode, or Preferences/settings on the pgAdmin 4 application menu in desktop mode. Each tool node (Browser, Query Tool, Debugger, ERD Tool, Editor) has its own Keyboard shortcuts panel where you pick the modifier keys and the key for each action. The Debugger has its own set (for example Alt + Shift + T to toggle a breakpoint and Alt + Shift + I to step into), listed on the same documentation page.
A few documentation pages list different defaults for the same action (for example the ERD Tool page gives Alt + Shift + D for Show details, and the Query Tool Toolbar page gives Alt + F for Filter). This sheet follows the Keyboard Shortcuts page; your Preferences show the keys your installation actually uses.
Next: create diagrams with the pgAdmin ER diagram tutorial, export results with the export guide, or read the pgAdmin review.
Frequently asked questions
How do I run a query in pgAdmin with the keyboard?
Press F5 to execute the whole script, or Alt + F5 (Option + F5 on Mac) to execute only the query where the cursor is. Highlight part of the script first to run just that selection.
What is the pgAdmin shortcut for auto-complete?
Ctrl + Space on all platforms. If auto-complete on typing is switched off in Preferences, this shortcut is the only way to open it.
How do I comment out lines in pgAdmin?
Select the lines and press Ctrl + / (Cmd + / on Mac) to comment or uncomment them.
How do I format SQL in pgAdmin?
Press Ctrl + K (Cmd + K on Mac) or choose Format SQL from the Edit menu in the Query Tool. It formats the selection, or the whole query if nothing is selected.
Can I change pgAdmin keyboard shortcuts?
Yes. Each tool has a Keyboard shortcuts panel in Preferences where you can set the modifiers and key for each action.
Sources
- pgAdmin 4 documentation: Keyboard Shortcuts
- pgAdmin 4 documentation: Query Tool Toolbar
- pgAdmin 4 documentation: Preferences
- pgAdmin 4 documentation: Menu Bar
- pgAdmin 4 documentation: ERD Tool
- pgAdmin news: pgAdmin 4 v9.18 released
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.