Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7B7B41337BB9 for ; Thu, 3 Mar 2011 14:48:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 67247-07 for ; Thu, 3 Mar 2011 18:48:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from chocolate.ruo3.org (87-194-171-29.bethere.co.uk [87.194.171.29]) by mail.postgresql.org (Postfix) with ESMTP id 9633C1337BB0 for ; Thu, 3 Mar 2011 14:48:48 -0400 (AST) Received: from [IPv6:::1] (chocolate.ruo3.org [127.0.0.1]) by chocolate.ruo3.org (Postfix) with ESMTP id 816FD6042B; Thu, 3 Mar 2011 18:48:47 +0000 (GMT) Message-ID: <4D6FE26B.8080706@richardneill.org> Date: Thu, 03 Mar 2011 18:48:11 +0000 From: Richard Neill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tom Lane CC: Robert Haas , Richard Neill , Richard Neill , pgsql-bugs@postgresql.org Subject: Re: BUG #5867: wish: plpgsql print table for debug References: <201102070601.p1761470087214@wwwmaster.postgresql.org> <4D6FCBEC.1060709@richardneill.org> <13356.1299177149@sss.pgh.pa.us> In-Reply-To: <13356.1299177149@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201103/72 X-Sequence-Number: 29582 > Note that doing anything more than RAISE NOTICE or equivalent would > imply a significant protocol change. You can't just shove a table out > to the client, because it'll think that that's the response to the outer > SELECT (or whatever) command that called your function. So while it'd > be kind of cool if you could invoke psql's table pretty-printing stuff > this way, the amount of work required to get there seems vastly out of > proportion to the benefit. > Dear Tom, Thanks for your help. I agree that changing the protocol would be great overhead; I'm not really suggesting that. Perhaps I should give an example of what I mean (1) Consider the following table, tbl_numbers: number | english | french | german ---------------------------------------- 1 one un ein 2 two deux zwei 3 three trois drei (2) My desired debug function would be called this: RAISE NOTICE_DEBUG ("SELECT * from tbl_numbers") (3) The resulting logfile would then contain multiple separate lines, each looking a bit like this: NOTICE: number english french german NOTICE: 1 one un ein NOTICE: 2 two deux zwei NOTICE: 3 three trois drei While pretty-printing would be nice, I agree it's not really important. It would be nice to add the same space-padding to each field for alignment, but delimiting with a single tab would be sufficient. Richard