Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-14 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> (I wonder whether we can't improve on that, at least for the case of a >> non-deferred after trigger, which'd have already been fired before we >> exit the subtransaction. The trick is how to know that there's nothing >> useful left i

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-14 Thread Alvaro Herrera
Tom Lane wrote: > (I wonder whether we can't improve on that, at least for the case of a > non-deferred after trigger, which'd have already been fired before we > exit the subtransaction. The trick is how to know that there's nothing > useful left in the subtransaction's per-transaction memory co

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-13 Thread Tom Lane
"Henry - Zen Search SA" <[EMAIL PROTECTED]> writes: > On Fri, June 13, 2008 7:05 pm, Tom Lane wrote: >> The memory overhead per subtransaction is >> not zero, though I think it's fairly small if you don't have any >> triggers pending as a result of the insert. > Two triggers are fired for each ins

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-13 Thread Henry - Zen Search SA
On Fri, June 13, 2008 7:05 pm, Tom Lane wrote: > How soon is "bang"? I'll run it again and post back. > The memory overhead per subtransaction is > not zero, though I think it's fairly small if you don't have any > triggers pending as a result of the insert. Two triggers are fired for each inser

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-13 Thread Tom Lane
"Henry - Zen Search SA" <[EMAIL PROTECTED]> writes: > One other thing: the docs mention that functions use cursors > automatically to prevent OOM errors on large selects (as in my case). > Well, the second part of my function does this: > FOR rec in SELECT * FROM bigtable > LOOP >...begin/in

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-13 Thread Henry - Zen Search SA
On Mon, June 2, 2008 6:53 pm, Tom Lane wrote: > I don't think your problem has anything to do with dblink per se. > The repeated begin/exception blocks are apparently managing to leak > some memory per iteration. I can't tell whether this represents > a known (and perhaps already fixed) bug; it ve

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-02 Thread Henry
On Mon, June 2, 2008 6:53 pm, Tom Lane wrote: > "Henry" <[EMAIL PROTECTED]> writes: >> I'm trying to code a function to copy rows from one machine to another >> using dblink and cursors: > > What PG version is this, exactly? Arg, dammit. Sorry, it's version 8.2.6 (where the function is running),

Re: [GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-02 Thread Tom Lane
"Henry" <[EMAIL PROTECTED]> writes: > I'm trying to code a function to copy rows from one machine to another > using dblink and cursors: What PG version is this, exactly? > perform dblink_connect ('dbname=db1...host=othermachine.com'); > perform dblink_open ('cur_other1', 'SELECT col1 FROM tab1')

[GENERAL] dblink() cursor error/issue (TopMemoryContext)

2008-06-02 Thread Henry
Hello all, I'm trying to code a function to copy rows from one machine to another using dblink and cursors: ... perform dblink_connect ('dbname=db1...host=othermachine.com'); perform dblink_open ('cur_other1', 'SELECT col1 FROM tab1'); loop fnd := 0; for rec in -- grab a 1000 rows at a