"Serguei Mokhov" <sa_mokho@alcor.concordia.ca> writes:
> Is it me (who hasn't read some FAQ or a doc/man page) or
> it's a bug in the psql interactive terminal?
Both. There's a bug there, but it's not the one you think.
psql seems to forget that it's got unmatched parentheses in the
buffer after executing a \? command. Watch the prompt:
regression=# (select
regression(# \?... yadda yadda ...
regression-# 2;
ERROR: parser: parse error at or near ";"
regression=# (select
regression(# \?... yadda yadda ...
regression-# 2);?column?
---------- 2
(1 row)
In the first example, it should not have thought that it had
a complete command after "2;".
regards, tom lane