8

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?

american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40

2 Answers2

14

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

M-x sql-postgres RET

phils
  • 48,657
  • 3
  • 76
  • 115
offby1
  • 300
  • 2
  • 5
7

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

phils
  • 48,657
  • 3
  • 76
  • 115