Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Tom Lane
"Simon Riggs" <[EMAIL PROTECTED]> writes: > OK, I guess my only other question is to do with recursive/hierarchical > queries: How will we handle those? All in same context? Offhand I don't think it matters. Recursive queries are recursive in the data, not in the plan tree.

Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Simon Riggs
On Wed, 2006-12-27 at 18:05 -0500, Tom Lane wrote: > "Simon Riggs" <[EMAIL PROTECTED]> writes: > > Is it possible to allocate the subquery in a child context of the main > > query, so that it is technically a different context, yet can be freed > > simultaneously? > > That's exactly what the code

Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Tom Lane
"Simon Riggs" <[EMAIL PROTECTED]> writes: > Is it possible to allocate the subquery in a child context of the main > query, so that it is technically a different context, yet can be freed > simultaneously? That's exactly what the code *was* doing, but the problem is that we'd free the child contex

Re: [HACKERS] TupleDescs and refcounts and such, again

2006-12-27 Thread Simon Riggs
On Tue, 2006-12-26 at 10:47 -0500, Tom Lane wrote: > As you can probably guess, I'm leaning to #3, but wanted to see if > anyone had an objection or a better idea. Is it possible to allocate the subquery in a child context of the main query, so that it is technically a different context, yet can b

[HACKERS] TupleDescs and refcounts and such, again

2006-12-26 Thread Tom Lane
I looked into the bug reported by Jean-Pierre Pelletier here: http://archives.postgresql.org/pgsql-bugs/2006-12/msg00163.php The cause of the crash is a reference to an already-deallocated TupleDesc. The problem query has the structure of SELECT sum(x) FROM (complicated-subselect) GROUP B