X-Original-To: pgsql-interfaces@postgresql.org Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by postgresql.org (Postfix) with ESMTP id 3FAE5474E4F for ; Fri, 21 Mar 2003 17:24:13 -0500 (EST) Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) by sabre.velocet.net (Postfix) with ESMTP id 51CB8137F38; Fri, 21 Mar 2003 17:24:12 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 18wUvn-0000fL-00; Fri, 21 Mar 2003 17:24:07 -0500 To: pgsql-interfaces@postgresql.org Subject: Re: I want to send comments to the backend! References: <200303201522.h2KFMpp24991@candle.pha.pa.us> <23655.1048175249@sss.pgh.pa.us> In-Reply-To: <23655.1048175249@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 21 Mar 2003 17:24:07 -0500 Message-ID: <87isuc73zs.fsf@stark.dyndns.tv> Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200303/120 X-Sequence-Number: 3869 Tom Lane writes: > I think he's complaining that psql strips out the comments before > sending stuff to the backend. Unfortunately, most of the world probably > considers that a feature, not a bug. I don't know why this user wants them but I can give one example of why one might want to have comments get processed by the backend: In my previous project we had the database wrapper functions insert the file and line number where the call to the wrapper functions were made in sql comments in the query. This was **invaluable** for tracking down problems when the only evidence was information in the logs or query cache. It was so valuable and so easy that I definitely intend to reimplement it on my current project and on any future projects. > I'm quite certain that libpq does not strip comments, so the complaint > isn't strictly accurate... Happy news. But a plea to any interface implementors: *Please* don't even consider stripping comments from queries, It would be most annoying for at least this user. -- greg