Confusing behavior of psql's \e

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Confusing behavior of psql's \e
Дата
Msg-id 0ba3f2a658bac6546d9934ab6ba63a805d46a49b.camel@cybertec.at
обсуждение исходный текст
Ответы Re: Confusing behavior of psql's \e  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
If you quit the editor without saving, the current query buffer
or the last executed SQL statement get run.

This can be annoying and disruptive, and it requires you to
empty the file and save it if you don't want to execute anything.

But when editing a script, it is a clear POLA violation:

test=> \! cat q.sql
SELECT 99;

test=> SELECT 42;
 ?column? 
----------
       42
(1 row)

test=> \e q.sql
[quit the editor without saving]
 ?column? 
----------
       42
(1 row)

This is pretty bad: you either have to re-run the previous statement
or you have to empty your script file.  Both are unappealing.

I have been annoyed about this myself, and I have heard other prople
complain about it, so I propose to clear the query buffer if the
editor exits without modifying the file.

This behavior is much more intuitive for me.

Yours,
Laurenz Albe

Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Printing backtrace of postgres processes
Следующее
От: Zhihong Yu
Дата:
Сообщение: Re: runtime error copying oids field