Tom Lane wrote:
> Gerhard Häring <lists@ghaering.de> writes:
> >> I'm quite certain that libpq does not strip comments, so the complaint
> >> isn't strictly accurate...
>
> > Then why does the attached program not work?
>
> > res = PQexec(conn, "-- foobar");
> > if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
>
> Because a comment isn't an SQL command. I forget what the result status
> is in this case, but COMMAND_OK ain't it.
It returns PGRES_NONFATAL_ERROR. Why should this be an error?
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square,
Pennsylvania19073