I was listening to this song today - https://www.youtube.com/watch?v=ajy71xw351E Don't Wanna Leave You Now 🎵 🎶

and I realized how much I don't want to leave emacs.

I often do this after backgrounding (C-z) emacs,

psql datababase_name

select id from table1;

update table set foo="baa" where id=n;

I also often open up a gui sql browser (such as Navicat) and order tables by a column. I might also do LIMIT to speed up query time. Sometimes, I delete rows in a table by pressing x in the gui browser.

With Navicat, I like double clicking on a cell to edit a Postgres row in-place.

I know I will never fully replace Navicat, but how can I use emacs to do basic (Postgres) database work?

2 Answers 2


Emacs has in-built support for many databases, including Postgres.

M-x sql-postgres RET


In addition to offby1's answer (which is what you were asking for) also take note of:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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