Re: Review: query result history in psql

Поиск
Список
Период
Сортировка
От ian link
Тема Re: Review: query result history in psql
Дата
Msg-id CAOOwM5++hTguczTfz+w5g1B6P49scV0Vc=tqRx4x-mRT9iP-3g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Review: query result history in psql  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Review: query result history in psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
It's better to post a review as a reply to the message which contains
the patch.
Sorry about that, I did not have the email in my inbox and couldn't figure out how to use the old message ID to send a reply. Here is the thread: http://www.postgresql.org/message-id/flat/CAEcSYXJRi++T3pevDyzAWH2yGx7kG9ZrhX8KAWtP1fXV3H02vw@mail.gmail.com#CAEcSYXJRi++T3pevDyzAWH2yGx7kG9ZrhX8KAWtP1fXV3H02vw@mail.gmail.com

The 'EscapeForCopy' was meant to mean 'Escape string in a format require by the COPY TEXT format', so 'copy' in the name refers to the escaping format, not the action performed by the function.
 
I see, that makes sense now. Keep it as you see fit, it's not a big deal in my opinion.

 Some mathematical toolkits, like Matlab or Mathematica, automatically set a variable called 'ans' (short for "answer") containing the result of the last operation. I was trying to emulate exactly this behaviour.

I've actually been using Matlab lately, which must be why the name made sense to me intuitively. I don't know if this is the best name, however. It kind of assumes that our users use Matlab/Octave/Mathematica. Maybe 'qhist' or 'hist' or something?  

The history is not erased. The history is always stored in the client's memory.
Ah, I did not pick up on that. Thank you for explaining it! That's actually a very neat way of doing it. Sorry I did not realize that at first.

I was considering such a behaviour. But since the feature is turned off by default, I decided that whoever is using it, is aware of cost. Instead of truncating the history automatically (which could lead to a nasty surprise), I decided to equip the user with \ansclean , a command erasing the history. I believe that it is better to let the user decide when history should be erased, instead of doing it automatically.

I think you are correct. However, if we turn on the feature by default (at some point in the future) the discussion should probably be re-visited. 

This is  my first submitted patch, so I can't really comment on the process. But if you could add the author's email to CC, the message would be much easier to spot. I replied after two days only because I missed the message in the flood of other pgsql-hacker messages. I think I need to scan the list more carefully...
My fault, I definitely should have CC'd you. 

As for the patch, I made a new version of the latest one you provided in the original thread. Let me know if anything breaks, but it compiles fine on my box. Thanks for the feedback!

Ian 
Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: enable new error fields in plpgsql (9.4)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Review: query result history in psql