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

Re: How to form a self-defined TupleTableSlot

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Chaoyong(dot)Wang(at)emc(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to form a self-defined TupleTableSlot
Date: 2012-08-30 19:32:04
Message-ID: CA+TgmobnpJOgfFfNq5QQFo6Ed_W5r0StLFyzYa6tegKnQ=O_qw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Jul 26, 2012 at 11:39 PM,  <Chaoyong(dot)Wang(at)emc(dot)com> wrote:
> Here is my task situation:
>
> I have a TupleTableSlot, with its own TupleDesc. Now I want to extract
> several attributes to form a new TupleTableSlot, how can I define my own
> TupleDesc and the ProjectionInfo?

You might get more helpful advice if you describe more specifically
what you're trying to do.  I mean, here's one way to create a
TupleDesc (from contrib/adminpack) but it may or may not be suitable
for your purposes:

                tupdesc = CreateTemplateTupleDesc(2, false);
                TupleDescInitEntry(tupdesc, (AttrNumber) 1, "starttime",
                                                   TIMESTAMPOID, -1, 0);
                TupleDescInitEntry(tupdesc, (AttrNumber) 2, "filename",
                                                   TEXTOID, -1, 0);

As ProjectInfo, maybe ExecBuildProjectionInfo?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-08-30 19:39:00
Subject: Re: patch: shared session variables
Previous:From: Robert HaasDate: 2012-08-30 19:28:12
Subject: Re: effective_io_concurrency

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