D'Arcy J.M. Cain wrote:
> On Thursday 20 March 2003 09:05, Gerhard Häring wrote:
>
>>Why can't I send comments like
>>
>> -- a comment
>>
>>to the backend using libpq? Are these only handled in psql? Please allow to
>>send comments to the backend, as I really need them.
>
> Just curious, why?
I want to write code that works with both the pyPgSQL and PySQLite
Python DB-API modules.
I've developed PySQLite such that:
cursor.execute("-- types int, str, binary")
cursor.execute("select a, b, c from sometable")
tell PySQLite the "expected" types, so it can convert them from the
typeless SQLite engine, which always just returns strings.
My hope was that pyPgSQL would just ignore the ANSI SQL comments, but it doesn't, even if I use libpq directly.
> It's easy enough to strip them out from an input stream.
Sure, I could just hack that into pyPgSQL.
-- Gerhard