Re: [GENERAL] Getting rows in statement-level triggers

2008-10-03 Thread Tom Lane
Artacus <[EMAIL PROTECTED]> writes: >> This will not work, or at least it will stop working after your >> installation passes 4 billion transactions. > * So what exactly happens at the 4 billion mark? txid keeps going (that's why it's a bigint). xid will wrap around. > * Why can't I cas

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-03 Thread Artacus
SELECT * FROM strand_scores WHERE xmin::text = txid_current()::text This will not work, or at least it will stop working after your installation passes 4 billion transactions. The traditional way to find out your own XID is to insert a dummy row somewhere (perhaps in a temp table) and se

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-03 Thread Alvaro Herrera
Tom Lane wrote: > The traditional way to find out your own XID is to insert a dummy row > somewhere (perhaps in a temp table) and see what its xmin is. I'm not > sure why we don't expose a more convenient way --- maybe just that > there's not been any demand for it. I think we've suggested the t

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-03 Thread Tom Lane
Artacus <[EMAIL PROTECTED]> writes: > Ok, so it took a lot of googling to figure this one out, but you can do > it with something like so. > SELECT * > FROM strand_scores > WHERE xmin::text = txid_current()::text This will not work, or at least it will stop working after your installation passes

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-02 Thread Gurjeet Singh
On Fri, Oct 3, 2008 at 11:42 AM, Artacus <[EMAIL PROTECTED]> wrote: > > So the manual says there is no way for a statement-level trigger to >> examine the row(s) modified by the statement. >> >> Is there any way to get the xmin or cmin of the transaction that fired the >> trigger? Or can I look u

Re: [GENERAL] Getting rows in statement-level triggers

2008-10-02 Thread Artacus
So the manual says there is no way for a statement-level trigger to examine the row(s) modified by the statement. Is there any way to get the xmin or cmin of the transaction that fired the trigger? Or can I look up the last xid for a table some where? Ok, so it took a lot of googling to fig

[GENERAL] Getting rows in statement-level triggers

2008-10-02 Thread Artacus
So the manual says there is no way for a statement-level trigger to examine the row(s) modified by the statement. Is there any way to get the xmin or cmin of the transaction that fired the trigger? Or can I look up the last xid for a table some where? -- Sent via pgsql-general mailing list (p