\e

Category: Databases & SQL

\e

Edit the last query in your text editor

Opens $EDITOR with the previous SQL statement; saving and closing the editor runs it. \ef does the same for a function definition. Related: \i to run a file.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.