Re: Fwd: [GENERAL] statement id

From: Joe Conway <mail(at)joeconway(dot)com>
To: elein(at)varlena(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fwd: [GENERAL] statement id
Date: 2003-03-22 23:48:12
Message-ID: 3E7CF63C.5010801@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-03-22 23:56:13 IS OF
Previous Message Bruce Momjian 2003-03-22 23:35:59 Re: PQescapeBytea on Win32