David Johnston's recent gripe reminded me of the problem we've been working around for many years, that readline and libedit don't agree on the return code convention for write_history(). We've attempted to work around that by supposing that if errno becomes set to nonzero during write_history() then there was a failure, regardless of whether the library returned a failure code or not. Well, this was always fragile, and I suspect that it may be broken in David's environment.
But: it turns out that "they don't agree" is obsolete information! libedit fixed their code to agree with readline back around 2006; they both now do "0 if ok, errno code if not". I would imagine therefore that just about any Linux distribution in current use is shipping a libedit that works "correctly". I poked into Apple's source code and found that OS X has this fixed in 10.5 (Leopard) and later, so there also it's fairly likely that nobody's still using old libedit. (Um, well, prairiedog. But I could install readline on that.) So it seems like we could change our code to rely on the readline return convention instead of doing something that neither library promises to work. Thoughts? Should we back-patch that, or not? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers