From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Richard Neill <rn214(at)richardneill(dot)org>, Richard Neill <postgresql(at)richardneill(dot)org>, pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #5867: wish: plpgsql print table for debug |
Date: | 2011-03-03 18:32:29 |
Message-ID: | 13356.1299177149@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Mar 3, 2011 at 12:12 PM, Richard Neill <rn214(at)richardneill(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Neill | 2011-03-03 18:35:56 | Re: BUG #5867: wish: plpgsql print table for debug |
Previous Message | Robert Haas | 2011-03-03 18:31:55 | Re: BUG #5903: Turkish encoding problem |