Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> It returns PGRES_NONFATAL_ERROR. Why should this be an error?
Actually, you don't get a "res" object at all, because nothing happened.
The only place in libpq that returns that code is PQresultStatus itself.
Perhaps PGRES_EMPTY_QUERY would be more appropriate? Not sure where in
the chain would be best to change the behavior, though.
regards, tom lane