Re: psql command line editing

Ben Hancock <bhancock@alm.com>

From: Ben Hancock <bhancock@alm.com>
To: pgsql-general <pgsql-general@postgresql.org>
Cc: Rich Shepard <rshepard@appl-ecosys.com>
Date: 2025-02-12T22:09:09Z
Lists: pgsql-general
On 2/12/2025 11:44, Rich Shepard wrote:
> I run psql from a urxvt virtual console, not emacs (which is where I 
> write scripts.)

As with everything in Emacs, there's a mode for that.

In case you're not aware of it, sql-mode allows you not only to interact
with psql from within Emacs, but also to write SQL queries in a buffer
and then send the whole buffer or the region.

It's not documented in the info pages, but from within Emacs, one of
these should get you started:

  C-h P sql
  M-x sql-help

Or just do: M-x sql-postgres

  - Ben