Re: dblink() cursor error/issue (TopMemoryContext)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Henry - Zen Search SA <henry(at)zen(dot)co(dot)za>, pgsql-general(at)postgresql(dot)org
Subject: Re: dblink() cursor error/issue (TopMemoryContext)
Date: 2008-06-14 22:34:54
Message-ID: 20080614223454.GE8519@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 context ...)

I think this would require us to be smarter about what pfree's are
leaving the context empty. Whether this requires us to troll the
freelist and aggregate contiguous elements, or something even more
complex, I don't know. The fact that this adds a bit more complexity to
pfree() worries me.

Perhaps we could have something like MemoryContextDefrag that we would
invoke at subtransaction end. If the context is truly empty it can
leave it in the initial empty state, which I think is enough for the
subxact code to know that it can remove it.

Unless I'm misunderstanding the issue completely.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message D. Dante Lorenso 2008-06-14 23:00:32 Need Tool to sync databases with 8.3.1
Previous Message Tom Lane 2008-06-14 18:35:38 Re: why sequential scan is used on indexed column ???