pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Richard Neill <rn214@richardneill.org>
Cc: Richard Neill <postgresql@richardneill.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5867: wish: plpgsql print table for debug
Date: Thu, 03 Mar 2011 13:32:29 -0500
Message-ID: <13356.1299177149@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinU5FwUNoGWtybEghbTw7_HH0msWrfeOfVtmsK+@mail.gmail.com>
References: <201102070601.p1761470087214@wwwmaster.postgresql.org>
	<AANLkTimrzAYxjqFaKRjmVvXiVt_YuAVG54C9EcNW95db@mail.gmail.com>
	<4D6FCBEC.1060709@richardneill.org>
	<AANLkTinU5FwUNoGWtybEghbTw7_HH0msWrfeOfVtmsK+@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Mar 3, 2011 at 12:12 PM, Richard Neill <rn214@richardneill.org> wrote:
>> Do you not think it would be really amazingly useful? After all, in C, the
>> single most useful debugging tool is "fprintf(stderr,...)", and yet
>> postgresql doesn't have an equivalent that can operate on the most common
>> data format. [I'm stretching the analogy a bit here, but it seems to me that
>> a multi-row table is to postgresql as int is to C.]

> Sure it does.  You can pass the tuple to RAISE NOTICE easily enough.
> It won't have all the same bells and whistles psql would supply, but
> it prints out well enough for debugging.  Or at least it's never
> bothered me.

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.

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <13356.1299177149@sss.pgh.pa.us>
Permalink:  ../13356.1299177149@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13356.1299177149@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, rn214@richardneill.org, postgresql@richardneill.org
  Subject: Re: BUG #5867: wish: plpgsql print table for debug
  In-Reply-To: <13356.1299177149@sss.pgh.pa.us>
  References: <201102070601.p1761470087214@wwwmaster.postgresql.org> <AANLkTimrzAYxjqFaKRjmVvXiVt_YuAVG54C9EcNW95db@mail.gmail.com> <4D6FCBEC.1060709@richardneill.org> <AANLkTinU5FwUNoGWtybEghbTw7_HH0msWrfeOfVtmsK+@mail.gmail.com> <13356.1299177149@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox