X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4FFF247632D for ; Sat, 26 Apr 2003 10:05:11 -0400 (EDT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id D79F847632C for ; Sat, 26 Apr 2003 10:05:09 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h3QE55W19202; Sat, 26 Apr 2003 10:05:05 -0400 (EDT) From: Bruce Momjian Message-Id: <200304261405.h3QE55W19202@candle.pha.pa.us> Subject: Re: /* */ comments showing up in pg_stat_activity In-Reply-To: <200304261018.43661.mallah@trade-india.com> To: Rajesh Kumar Mallah Date: Sat, 26 Apr 2003 10:05:05 -0400 (EDT) Cc: Tom Lane , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, hits=-16.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/396 X-Sequence-Number: 13097 Rajesh Kumar Mallah wrote: > On Saturday 26 Apr 2003 8:35 am, Tom Lane wrote: > > Jan Wieck writes: > > > The question back is from where does such a query with a comment come? > > > If it is a standard client like psql, it could happen someday that this > > > client does some filtering. > > > Yes its thru psql only , i run a SQL batch using > psql -e -h db -f batch.sql > > In case future version of psql strips them it would > still be nice if libpq continue supporting it > i feel it would be a nice feature for keeping track of > queries. [ After not replying to the proper question before, I will try again. :-) ] The actual stripping of comments in psql is a little more complex. For example, this will not strip: SELECT /* test */ 1; while this will strip comments: SELECT 1; /* test */ and leading comments are not stripped either: /* test */ SELECT 1; so if the comment is _inside_ a query, it will be OK, but outside and trailing, psql processes the comment itself so it can display the proper prompting: test=> /* test*> test ^ test*> */ -- 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, Pennsylvania 19073