Thanks! Is there something similar for Oracle?
Yup! M-x sql-oracle
Also, do you know how to make it so readline can be used within
this psql process running in Emacs (so that up arrow gives me the last
command)?
Hmmm - that I don't know. I do most of my development on a Powerbook
running Debian PowerPC and I can use CTRL-SHIFT-Up-arrow to scroll
through the command buffer.