Re: Fwd: [GENERAL] statement id

From: elein <elein(at)sbcglobal(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>, elein(at)varlena(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fwd: [GENERAL] statement id
Date: 2003-03-23 00:34:39
Message-ID: 200303230036.h2N0aSlK027824@pimout2-ext.prodigy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Yes, this is exactly what I'm looking for. I was
hoping the connection context information might be
available in one of the stat tables, some SQL variable
or function call.

The ability to have data persist across function calls
without having to resort to C is really very useful,
but having some context information is crucial.

elein

On Saturday 22 March 2003 15:48, Joe Conway wrote:
> elein wrote:
> > Is there any way to find out the statement context in a server function?
> > Is there anyway to find out the transaction context in a server function?
>
> [...snip...]
>
> > If this were a C function, would it be easier to have this information?
>
> I don't know anything about plpython, but I'd guess the info you're
> looking for is not available to it.
>
> In C, I think (but have not tried) you could use
> GetCurrentTransactionId() to put the current transaction id into a
> global variable, and allocate memory for other globals in
> TopTransactionContext. Then use a change in transaction id to signal a
> need to reallocate/reinitialize your globals.
>
> Not sure if this is what you were looking for, but HTH.
>
> Joe

--
----------------------------------------------------------------------------------------
elein(at)varlena(dot)com Database Consulting www.varlena.com
I have always depended on the [QA] of strangers.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2003-03-23 00:42:46 Re: IS OF
Previous Message Tom Lane 2003-03-23 00:24:56 Re: IS OF