X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3F8D49FB3F6 for ; Thu, 31 Aug 2006 14:33:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 20150-07-2 for ; Thu, 31 Aug 2006 14:33:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.228]) by postgresql.org (Postfix) with ESMTP id 496FE9FB40D for ; Thu, 31 Aug 2006 14:33:15 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id t13so713354wxc for ; Thu, 31 Aug 2006 10:33:15 -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=AZ9TlhNElhBKsbq7R3qKK29/v/s0hldVHmRB8SiXLvaik5/9o9aLuW5X2KfJ/0Pr6oLFaVmEd/VJ+XWcVcsbvI3ZNdchCXdZewLGYE7Ptgjn0Ggsh8ssY3gTDySXxBHynF/34G4BNz5Ld+LEWWeqjxbxBOJGeC1MBYgFRabtidM= Received: by 10.90.25.3 with SMTP id 3mr285764agy; Thu, 31 Aug 2006 10:33:14 -0700 (PDT) Received: by 10.90.27.1 with HTTP; Thu, 31 Aug 2006 10:33:14 -0700 (PDT) Message-ID: <1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com> Date: Thu, 31 Aug 2006 19:33:14 +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: <200608301821.k7UILIT21208@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1d4e0c10608300025s2880837bi6fe3e7566b14edde@mail.gmail.com> <200608301821.k7UILIT21208@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/190 X-Sequence-Number: 15717 On 8/30/06, Bruce Momjian wrote: > I thought about this, and because we are placing two pieces of > information on the same line, it seems "|" is the best choice. Good idea. It's far more readable with a pipe. > Oh. You want to pull the parameters out of that. I am thinking you > need something that will go over the line character by character with > some type of state machine, rather than just regex. Yes, that's what I did but I usually prefer a regex. > Additional comments? I confirm it now works with NULL. I'm just wondering if the notation is really consistent: $result = pg_execute($dbconn, "insert_query", array(null)); gives: DETAIL: prepare: INSERT INTO shop (name) VALUES($1) | bind: $1 = NULL However: $result = pg_execute($dbconn, "insert_query", array(4)); gives: DETAIL: prepare: INSERT INTO shop (name) VALUES($1) | bind: $1 = '4' But I don't think it's possible to have 4 in this case. Can you confirm? I have all the different cases parsed correctly by my parser and I can build the query from the logs so it's OK for me. In the above case, with an int, I remove the quotes if the content is numeric. It's not perfect but I suppose it will be OK most of the time. -- Guillaume