Re: psql slash# command - Mailing list pgsql-patches

From Sibte Abbas
Subject Re: psql slash# command
Date
Msg-id bd6a35510804101756t2023f3b3x8d0b78b536a6ba6e@mail.gmail.com
Whole thread Raw
In response to Re: psql slash# command  ("Sibte Abbas" <sibtay@gmail.com>)
List pgsql-patches
On Thu, Apr 3, 2008 at 7:54 PM, Sibte Abbas <sibtay@gmail.com> wrote:
On Sun, Mar 30, 2008 at 3:09 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:


I wonder whether it wouldn't be safer and more convenient if we defined
'\# n' as pulling command n into the edit buffer, rather than
immediately executing it.  Actual execution is only a <return> away,
but this definition would allow you to edit the command a bit more
before you execute it --- including \e to use an editor.  It also
closes the loop in terms of providing some confidence that you typed
the number you should have typed.

This makes more sense and also appears to be much safer. I will start modifying the patch as per this approach now.


Based on your feedback I have modified the attached patch as follows:

1) \# n opens command n into the edit buffer.

2) A new psql variable; SHOW_LINE_NO is added, which is consulted by the \s command.
    If it is set, \s prefixs each line of its output with an incrementing line number.

regards,
-- Sibte Abbas
Attachment

pgsql-patches by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Remove FATAL from pg_lzdecompress
Next
From: "Brendan Jurd"
Date:
Subject: Typo in README