On Jul 13, 2009, at 2:02 PM, Tom Lane wrote:
Alvaro Herrera <alvhe...@commandprompt.com> writes:
So, the idea is to have a stack maintained by the function manager; each
called function enters an element in it containing the interesting
information about the function. We'd have another function that would return this stack as a result set. (With this arrangement, the topmost
element would always appear to be this "peek" function.)

I haven't looked at the code to see how this would actually be
implemented, so I don't have more details to offer. Does anybody have
opinions on the matter?

The performance and error recovery implications are unfavorable.
Just how badly do you need this, and for what?


The immediate goal is to be able to control debug output based on what function you're in, so that you don't get swampped by tons of debug output if you do SET client_min_messages = debug. (This is assuming you tend to write functions that have a bunch of RAISE DEBUG in them).

In this case, all we'd care about is the function that called us. There are other times when I've wanted to know what function I'm actually in, though I think that's almost always been because RAISE DEBUG doesn't provide that context.

So, if it makes it easier, we could probably get by with just the function that called us. Another possible option would be if there was a way to get our function name (which we could then pass on to the debug output function).
--
Decibel!, aka Jim C. Nasby, Database Architect  deci...@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to