X-Original-To: pgsql-interfaces@postgresql.org Received: from mail.ghaering.de (mail.ghaering.de [213.133.123.170]) by postgresql.org (Postfix) with ESMTP id E063A475CA9 for ; Thu, 20 Mar 2003 10:57:59 -0500 (EST) Received: from ghaering.de (mail.opus-gmbh.net [217.6.134.138]) by mail.ghaering.de (Postfix) with ESMTP id 13656420063; Thu, 20 Mar 2003 16:59:37 +0100 (CET) Message-ID: <3E79E47B.5090602@ghaering.de> Date: Thu, 20 Mar 2003 16:55:39 +0100 From: =?ISO-8859-1?Q?Gerhard_H=E4ring?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Cc: darcy@druid.net Subject: Re: I want to send comments to the backend! References: <200303200955.32768.darcy@druid.net> In-Reply-To: <200303200955.32768.darcy@druid.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Archive-Number: 200303/94 X-Sequence-Number: 3843 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