Re: [PATCH] "\ef " in psql

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Re: [PATCH] "\ef " in psql
Дата
Msg-id 37ed240d0809051943h1acb62a9jf457f4c0341f3d23@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] "\ef " in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] "\ef " in psql
Список pgsql-hackers
On Sat, Sep 6, 2008 at 10:10 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> * the way you had it set up, the CREATE OR REPLACE FUNCTION command
> would be sent to the backend instantaneously upon return from the
> editor, with no opportunity for the user to decide he didn't want his
> changes applied.  This seemed unacceptably dangerous to me.  I changed
> the exit code to PSQL_CMD_NEWEDIT instead of PSQL_CMD_SEND, which causes
> the command to wait in the query buffer.

The principle of least astonishment suggests that \ef should behave in
the same way as \e.

With \e (which I use a lot), the command(s) are immediately executed
by the backend as soon as you write and exit from the editor.  I don't
find that dangerous, and anyone who uses \e will already be very much
accustomed to it.  If \ef did something different, it would just be
weird.

If you're not sure you want to execute the contents of your \e editor
session after all, you can always delete the semicolon, or everything
in the file, before quitting.

Cheers,
BJ


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: PostgreSQL SSL problem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: New FSM allocation policy