I'd very much like to log in to a remote machine with ssh and via the $EDITOR environment variable (or something similar) be able to edit in my local Emacs. In this case, specifically for when I log in and run psql and use the \e psql command to edit queries. Being able to edit them in my local Emacs would be a huge bonus in my work flow.
I have a nagging suspicion that there is no way this can be done, but before giving up I thought I'd throw it out here.