Re: [HACKERS] Getting current transaction id
On Tuesday 25 July 2006 22:05, Marko Kreen wrote: On 7/24/06, Nicolai Petri [EMAIL PROTECTED] wrote: I'm in the need for my custom written replication engine to obtain the current transaction id from a trigger function. As far as I'm told it's not possible today. Would people object much if this functionality was added for 8.2 ? Using XID directly has some drawbacks, I need similary finctionality, and decided to extend XID to 8-bytes and use that externally: http://archives.postgresql.org/pgsql-patches/2006-07/msg00157.php Would that work for you? That seems perfect for my use - I solved the wraparound issue in my code by only allowing pending transactions to stay in the queue for 1 month maximum. But I'll probably use the 64 bit counter instead if it was present. Is there any chance for this going into 8.2 ? --- Nicolai Petri ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Getting current transaction id
On 7/24/06, Nicolai Petri [EMAIL PROTECTED] wrote: I'm in the need for my custom written replication engine to obtain the current transaction id from a trigger function. As far as I'm told it's not possible today. Would people object much if this functionality was added for 8.2 ? It's the last piece of postgresql C code I have left in my application and I think it would be a nice information in general to have available for users. If not for anything else then for simple statistics. I attached the function I use with great success today. Using XID directly has some drawbacks, I need similary finctionality, and decided to extend XID to 8-bytes and use that externally: http://archives.postgresql.org/pgsql-patches/2006-07/msg00157.php Would that work for you? -- marko ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[HACKERS] Getting current transaction id
Hello all I'm in the need for my custom written replication engine to obtain the current transaction id from a trigger function. As far as I'm told it's not possible today. Would people object much if this functionality was added for 8.2 ? It's the last piece of postgresql C code I have left in my application and I think it would be a nice information in general to have available for users. If not for anything else then for simple statistics. I attached the function I use with great success today. Best regards, Nicolai Petri - PG_FUNCTION_INFO_V1(get_transaction_id); Datum get_transaction_id(PG_FUNCTION_ARGS) { TransactionId curxact; curxact=GetTopTransactionId(); return Int32GetDatum(curxact); } ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match