Skip site navigation (1) Skip section navigation (2)

Re: Common Table Expressions (WITH RECURSIVE) patch

From: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
To: "Dimitri Fontaine" <dfontaine(at)hi-media(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Greg Stark" <greg(dot)stark(at)enterprisedb(dot)com>, "Jeff Davis" <pgsql(at)j-davis(dot)com>, "Tatsuo Ishii" <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Date: 2008-10-01 00:59:37
Message-ID: e08cc0400809301759p2fdb53dawc5f8213dbf2dae39@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

2008/10/1 Dimitri Fontaine <dfontaine(at)hi-media(dot)com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Le 30 sept. 08 à 20:03, Tom Lane a écrit :
>>
>>        set_read_position(tupstore, &local_read_position);
>>        tuple = tuplestore_gettuple(tupstore, ...);
>>        get_read_position(tupstore, &local_read_position);
>>
>> rather than just tuplestore_gettuple.  The set/get functions will be
>> cheap enough that this is no big deal.  (Or maybe we should just
>> provide a wrapper function that does this sequence?)
>
> It seems to me to share some ideas with the MemoryContext concept: what
> about a TupstoreContext associated with tuplestore, you get a common default
> one if you don't register your own, and use
>        tuplestore_gettuple(MyTupstoreContext, ...);
>
> Maybe some other API would benefit from the idea?
>

I'm just working on tuplestore recording multiple positions for my
window function project. Attached patch is still in progress but seems
it works in a situation.

From my work, the setting/getting read position and delegate savig
positions to the caller will probably have problems, because of memory
control for saving positions and tuplestore status changing (memory ->
BufFile). Instead, I decided it'd better that we can indicate the row
number by integer.

Regards,

-- 
Hitoshi Harada

Attachment: tuplestore.c.diff
Description: text/x-patch (6.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Darren WeberDate: 2008-10-01 01:10:56
Subject: Has anyone built pgbash-7.3 against postgreSQL-8.3?
Previous:From: Gurjeet SinghDate: 2008-10-01 00:44:43
Subject: Re: FSM rewrite committed, loose ends

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group