X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2033D9FB2C4 for ; Wed, 30 Aug 2006 04:25:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 95583-04 for ; Wed, 30 Aug 2006 07:25:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by postgresql.org (Postfix) with ESMTP id 89AD79FB2C1 for ; Wed, 30 Aug 2006 04:25:35 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so148523pyd for ; Wed, 30 Aug 2006 00:25:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=s6SAkkt1U/z1BCaE+7WOZRXvrEeTeiH7gZU2d4N2+5iJu8JUib+myzXtxQxDLIUTPC9+IknEoKilc817YYije0X1df0f+eTBQsfi1dwacr7jw6l5D7Ro9G5Y9WV5v5jvQiHtcnTcXF8d+8F9CGH8TL3TdUnAGqZubov6PRYsrr8= Received: by 10.35.61.17 with SMTP id o17mr388786pyk; Wed, 30 Aug 2006 00:25:34 -0700 (PDT) Received: by 10.35.49.19 with HTTP; Wed, 30 Aug 2006 00:25:34 -0700 (PDT) Message-ID: <1d4e0c10608300025s2880837bi6fe3e7566b14edde@mail.gmail.com> Date: Wed, 30 Aug 2006 09:25:34 +0200 From: "Guillaume Smet" To: "Bruce Momjian" Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol Cc: "Tom Lane" , "Oliver Jowett" , "Dave Cramer" , "Csaba Nagy" , "Postgres JDBC" , PostgreSQL-patches In-Reply-To: <200608292010.k7TKAC204184@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1d4e0c10608290454r49ad4efel63f2c4062c13438f@mail.gmail.com> <200608292010.k7TKAC204184@momjian.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/168 X-Sequence-Number: 15695 On 8/29/06, Bruce Momjian wrote: > Good point. I thought it was clear enough, but obviously not. I had a > similar case with bind, and used a comma to separate them: > > LOG: statement: prepare sel1, SELECT $1; > LOG: statement: bind sel1, $1 = 'a''b' For this one, I must admit I prefer the colon we used before. Something like: LOG: statement: prepare sel1: SELECT $1; LOG: statement: bind sel1: $1 = 'a''b' seems better to me as after the colon, we have the details of the command which is the common sense of a colon. > I am concerned a dash isn't clear enough, and a semicolon is confusing. > Using a comma the new output is: > > LOG: duration: 0.023 ms execute sel1 > DETAIL: prepare: SELECT $1;, bind: $1 = 'a''b' A dash is clearer in this case IMHO. ;, is not very readable. But I can parse easily both forms so it's not a problem for me if you prefer a comma. > Is that OK? Patch attached and committed. I also fixed the null bind > parameter bug. It now displays $1 = NULL (no quotes used). Cool. I'll test that. > Other suggestions? I'll compile this new version and make tests in the next few days to check everything is consistent and let you know. I'm still struggling to find a regexp good enough to parse "statement: execute y ('a', 4, 'text, with a comma'::text);" :). Thanks a lot for your work on this subject. It will help us a lot when we use the JDBC driver. -- Guillaume