logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: [psycopg] #175: feature request: option to not escape tabs in statement: msg#00060

Subject: Re: [psycopg] #175: feature request: option to not escape tabs in statements
Il giorno ven, 30/03/2007 alle 13.52 -0700, Tim Roberts ha scritto:
> >  i use tabs to format some complex queries, and because of that my pg log
> >  is filled with 'SELECT\x09\x09\x09\x09etc\x09\x09\x09'.  it would be much
> >  easier to read the logs and pg_stat_activity if tabs were not escaped.
> >
> >  if someone can point me to the code, i'll take a stab at a patch or new
> >  cursor class myself.
> >   
> 
> This is not necessarily as straighforward as it seems.  For example, if
> I have tabs in my data fields, I'd like to SEE those.
>     UPDATE mytable SET notes = '\t\tIndented' WHERE id=7;
> I'd rather see the escaped tabs there, so there is no question about
> exactly what I inserted. 

Btw, I will never accept a patch that modifies what the user sends to
the backend (apart from the necessary SQL quoting). If youy don't want
tabs in your logs, then don't send tabs to the backend (or remove them
before execute, writing a cursor subclass in pure python should be as
straightforward as writing a single .replace() line).

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                
fog-8fiUuRrzOP0dnm+yROfE0A@xxxxxxxxxxxxxxxx
INIT.D Developer                                           
fog-NGVKUo/i/6DYtjvyW6yDsg@xxxxxxxxxxxxxxxx
  "Yes, your honour, I have RSA encryption code tattood on my penis.
   Shall I show the jury?"                                     -- <dark>

Attachment: signature.asc
Description: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx
http://lists.initd.org/mailman/listinfo/psycopg
<Prev in Thread] Current Thread [Next in Thread>