Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Christian Kratzer
Hi, On Sat, 22 Oct 2005, Steve V wrote: On 10/22/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: [snipp] I'm using this for an auditing script, and want to use the txn ID to indicate an atomic set of changes(the pg txn ID is mapped to my own txn ID to avoid wraparound issues). I would rather not

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Tom Lane
Steve V <[EMAIL PROTECTED]> writes: > Using 8.0.4 right now. No subtransactions that I know of. The trigger > call is an AFTER I/U/D. The function called is somewhat lengthy, but > it does not explicitly intiate any transactions, and does not perform > any error trapping. I think that last asserti

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Tom Lane
Steve V <[EMAIL PROTECTED]> writes: > Well it doesn't explicitly do it, so the only thing I could think of > is that it has something to do with the pltcl spi_exec calls? Ah, you had not even mentioned that the trigger was in pltcl. spi_exec runs everything in subtransactions as of 8.0, so that it

Re: [GENERAL] pg_autovacuum (8.0.4) as Windows service ?

2005-10-23 Thread Magnus Hagander
> When installing pg_autovacuum as Windows service, should user > that makes connection be the service account or a superuser ? > For example, I have service account "postgres_service" and > database superuser "postgres". Which one should be used in > following script: > @echo off > set TARGET_D

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Christian Kratzer
Hi, On Sun, 23 Oct 2005, Christian Kratzer wrote: Hi, On Sat, 22 Oct 2005, Steve V wrote: On 10/22/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: [snipp] I'm using this for an auditing script, and want to use the txn ID to indicate an atomic set of changes(the pg txn ID is mapped to my own txn

Re: [GENERAL] out of memory for query result

2005-10-23 Thread Allen Fair
From my googling, it seems the Perl DBD driver for Postgres does *not* support the cursor (see below). I hope someone can refute this! I am otherwise looking for code to implement Postgres cursors in Perl. I can not find the "DECLARE CURSOR" defined in the Perl DBI documentation either. Thanks

[GENERAL] Recovery after server crash

2005-10-23 Thread Chris
Good afternoon, all: I recently experienced a server crash. I have a backup of my Postgesql data directory. On rebuilding my machine, I decided to go with i386 instead of my original AMD64. That means I now have a newer version of Postgresql available to me. My original was 7.4 and my new is

Re: [GENERAL] out of memory for query result

2005-10-23 Thread Douglas McNaught
Allen Fair <[EMAIL PROTECTED]> writes: > From my googling, it seems the Perl DBD driver for Postgres does > *not* support the cursor (see below). I hope someone can refute this! > > I am otherwise looking for code to implement Postgres cursors in > Perl. I can not find the "DECLARE CURSOR" defin

Re: [GENERAL] out of memory for query result

2005-10-23 Thread Martijn van Oosterhout
On Sat, Oct 22, 2005 at 06:15:59PM -0400, Allen Fair wrote: > From my googling, it seems the Perl DBD driver for Postgres does *not* > support the cursor (see below). I hope someone can refute this! > > I am otherwise looking for code to implement Postgres cursors in Perl. I > can not find the "

Re: [GENERAL] Recovery after server crash

2005-10-23 Thread Martijn van Oosterhout
On Sun, Oct 23, 2005 at 12:31:33PM -0500, Chris wrote: > Good afternoon, all: > > I recently experienced a server crash. I have a backup of my Postgesql > data directory. > > On rebuilding my machine, I decided to go with i386 instead of my > original AMD64. That means I now have a newer vers

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Steve V
> Ah, you had not even mentioned that the trigger was in pltcl. > spi_exec runs everything in subtransactions as of 8.0, so that > it can catch errors and propagate them back as Tcl errors. Okay, so are there any possible options? Would GetTopTransactionId() work, as Michael suggested further up?

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Michael Fuhr
On Sun, Oct 23, 2005 at 02:00:47PM -0700, Steve V wrote: > > Ah, you had not even mentioned that the trigger was in pltcl. > > spi_exec runs everything in subtransactions as of 8.0, so that > > it can catch errors and propagate them back as Tcl errors. > > Okay, so are there any possible options?

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Steve V
> I just did some tests with a pltcl function that uses spi_exec in > an AFTER trigger and GetTopTransactionId() returned the same value > for each of several inserts and updates that were in the same > transaction. However, I can't say whether this will work for you > without seeing your code. I

Re: [GENERAL] out of memory for query result

2005-10-23 Thread Allen
Thanks, everyone. I got it to work! Here is my solution hoping it is useful to the next programmer. PROBLEM: Perl DBI for Postgres does not implement cursors. All query results are cached in memory. For very large result sets, this give the "out of memory for query result" message. The prepa

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Michael Fuhr
On Sun, Oct 23, 2005 at 04:35:14PM -0700, Steve V wrote: > Okay, so using GetTopTransactionId() will do the trick it sounds like. > To see all of what's happening, just place the pltcl function that I > posted earlier in this thread as an AFTER trigger, and run code > similar to that which I showed

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Neil Conway
On Sun, 2005-23-10 at 16:35 -0700, Steve V wrote: > Which library is GetTopTransactionId() available in? It's defined in the backend executable, as is GetCurrentTransactionId(). A similar wrapper function to the one shown here: http://archives.postgresql.org/pgsql-general/2005-06/msg00709.php sh

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Steve V
> I haven't received that message yet, nor do I see it in the archives. > One of Tom Lane's replies appeared to quote from it -- did you send > it just to him? If you copied the list then the message might be > stuck somewhere. Yeah, I accidentally only sent it to Tom. Sorry about that. > What p

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Steve V
> It's defined in the backend executable, as is GetCurrentTransactionId(). > A similar wrapper function to the one shown here: > > http://archives.postgresql.org/pgsql-general/2005-06/msg00709.php > > should work. But I agree with the other folks in this thread who have > questioned whether this is