[PATCH] Add support to psql for edit-and-execute-command - Mailing list pgsql-hackers

From Joe Wildish
Subject [PATCH] Add support to psql for edit-and-execute-command
Date
Msg-id F2CCADF3-B70D-4821-B244-181F3C00FA6A@lateraljoin.com
Whole thread Raw
Responses Re: [PATCH] Add support to psql for edit-and-execute-command
List pgsql-hackers
Hi hackers,

Attached is a small patch for adding "edit-and-execute-command" readline 
support to psql. Bash has this concept and I miss it when using psql. It 
allows you to amend the current line in an editor by pressing "v" (when 
in vi mode) or "C-x C-e" (when in emacs mode). Those are the default 
bindings from bash although of course they can be amended in inputrc.

Most of the patch is actually shifting "do_edit" from "command.c" to 
"common.c". There is a small amendment to that function to allow vi to 
launch at the correct column offset.

I noticed that there is some logic in configure for detecting certain 
readline functions. I assume this is for compatibility sake with 
libedit/editline? Rather than testing for each rl_* function I hid the 
functionality behind HAVE_READLINE_READLINE_H .. don't know if this is 
acceptable?

-Joe
Attachment

pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: [PATCH] fix GIN index search sometimes losing results
Next
From: Amit Kapila
Date:
Subject: Re: Parallel copy