Get current trasanction id

Поиск
Список
Период
Сортировка
Искать

Get current trasanction id

От:
Marek Lewczuk <newsy@lewczuk.com>
Дата:
Hello,
is there any way to get current transaction id using plpgsql or sql ?

Thanks in advance for any help.

ML

 

Re: Get current trasanction id

От:
Achilleus Mantzios <achill@matrix.gatewaynet.com>
Дата:
O Marek Lewczuk έγραψε στις Dec 27, 2004 :

> Hello,
> is there any way to get current transaction id using plpgsql or sql ?

Maybe write a C function which calls GetCurrentTransactionId().

> 
> Thanks in advance for any help.
> 
> ML
> 
>  
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 

-- 
-Achilleus

Re: [GENERAL] Get current trasanction id

От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote:

> is there any way to get current transaction id using plpgsql or sql ?

A couple of people have posted suggestions but I'll ask a question:

Why do you want the transaction ID?  What problem are you trying
to solve?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: [GENERAL] Get current trasanction id

От:
Marek Lewczuk <newsy@lewczuk.com>
Дата:
Michael Fuhr napisał(a):
> On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote:
> 
> 
>>is there any way to get current transaction id using plpgsql or sql ?
> 
> 
> A couple of people have posted suggestions but I'll ask a question:
> 
> Why do you want the transaction ID?  What problem are you trying
> to solve?
> 
Michael,
I've already solved the problem - I found somewhere on the web a very 
simple C function, which returns transaction id. I need transaction id 
for plperl functions setVar, getVar (using $_SHARED array). Functions 
can write/read variables which are available either for connection or 
transaction.

Regards,

ML

 

Re: [GENERAL] Get current trasanction id

От:
Martijn van Oosterhout <kleptog@svana.org>
Дата:
Вложения:
I'm sure there's many tricky ways, but one simple way would be to
insert a row into a table and then grab its XMIN value...

Hope this helps,

On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote:
> Hello,
> is there any way to get current transaction id using plpgsql or sql ?
> 
> Thanks in advance for any help.
> 
> ML
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
Martijn van Oosterhout      http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
FAQ