Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EAD9D1337B34 for ; Mon, 7 Feb 2011 02:01:05 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 01065-07 for ; Mon, 7 Feb 2011 06:01:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 4EADD13364DE for ; Mon, 7 Feb 2011 02:01:05 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p17614SA087215 for ; Mon, 7 Feb 2011 06:01:04 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p1761470087214; Mon, 7 Feb 2011 06:01:04 GMT (envelope-from www) Date: Mon, 7 Feb 2011 06:01:04 GMT Message-Id: <201102070601.p1761470087214@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5867: wish: plpgsql print table for debug From: "Richard Neill" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201102/67 X-Sequence-Number: 29339 The following bug has been logged online: Bug reference: 5867 Logged by: Richard Neill Email address: postgresql@richardneill.org PostgreSQL version: 9.03 Operating system: Linux Description: wish: plpgsql print table for debug Details: When debugging a plpgsql function, it would be really amazingly useful to be able to do a regular psql-style SELECT, and have the result printed to screen. Something like: Raise Notice table 'SELECT .... ' and then plpgsql would run the query and dump the result to screen, using its helpful formatting. As far as I can see, this isn't possible (though there are a lot of people searching for how to do it), and the only workaround is to manually handle the looping and formatting, raising lots of individual notices. This makes debugging much harder than it should be.