Re: BUG #5867: wish: plpgsql print table for debug

Поиск
Список
Период
Сортировка
От Richard Neill
Тема Re: BUG #5867: wish: plpgsql print table for debug
Дата
Msg-id 4D6FE26B.8080706@richardneill.org
обсуждение исходный текст
Ответ на Re: BUG #5867: wish: plpgsql print table for debug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Richard Neill
Дата:
Сообщение: Re: BUG #5867: wish: plpgsql print table for debug
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #5867: wish: plpgsql print table for debug