From: Rajesh Kumar Mallah <rmallah@trade-india.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Rajesh Kumar Mallah <mallah@trade-india.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: /* */ comments showing up in pg_stat_activity
Date: Sat, 26 Apr 2003 22:07:14 +0530 (IST)
Message-ID: <Pine.LNX.4.33.0304262157100.696-100000@localhost.localdomain> (raw)
In-Reply-To: <200304261405.h3QE55W19202@candle.pha.pa.us>
On Sat, 26 Apr 2003, Bruce Momjian wrote:
> Rajesh Kumar Mallah wrote:
> > On Saturday 26 Apr 2003 8:35 am, Tom Lane wrote:
> > > Jan Wieck <JanWieck@Yahoo.com> 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. :-) ]
>
Thanks Bruce,
But if i were to use DBD::Perl (which probably uses libpq)
is it safe to pass query indentifier in comments which u
said are not stripped by psql eg
/* AppName: Xyzt */ Select foo from bar where cw='t' ;
for years to come ?
why i ask is that i was always curious of the slow
long running queries in pg_stat_activity and not able
to figure out the source had frustrated me , now
this method if it works seems to me as a viable solution.
regds
mallah.
> 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*> */
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rmallah@trade-india.com, pgman@candle.pha.pa.us, mallah@trade-india.com, tgl@sss.pgh.pa.us
Subject: Re: /* */ comments showing up in pg_stat_activity
In-Reply-To: <Pine.LNX.4.33.0304262157100.696-100000@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox