It's better to post a review as a reply to the message which contains
the patch.
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