Tom Lane wrote: > So I looked into this, and found that persuading psql to let backslash > commands cross line boundaries is a much bigger deal than just fixing the > lexer. The problem is that MainLoop would need to grow an understanding > of having received only a partial backslash command and needing to go back > to readline() for another line. And probably HandleSlashCmds would need > to be changed to stop parsing and back out without doing anything when it > hits backslash-newline. It's do-able no doubt, but it's not going to be a > small and simple patch.
FWIW, I would love to see this in some future release: particularly for \copy lines with large queries, the limitation that only single-line input is accepted is very annoying -- much more so when the query comes pasted from some other input, or when you have a file with a query and just want to add a quick \copy prefix. (Hmm, a much simpler alternative would be to allow \g-like syntax, i.e. the query is already in the query buffer and the \copy line just specifies the output file. In fact, for queries in history this is much more convenient than the current syntax ...) -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers