pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Muir <wsmuir@islandnet.com>
To: pgsql-interfaces@postgresql.org
Subject: SPI question...
Date: Tue, 12 Dec 2000 14:15:05 -0700
Message-ID: <000201c06480$999f0160$0a00a8c0@lan> (raw)

I'm working on a module which uses the SPI... I'm not making sense of the
docs for this...

Where I differ from the example in the Programmers dox, is I'm wanting to
pull together information from more than one table in my db.

In the documentation, the algorithm section for "SPI_exec" seems to have the
text as in the same section for "SPI_finish"...

Anyways, if someone could clarify for me,

1)  if more than one query plan is executed, are the result tupletables
available at the same time, or are the tupletables overwritten each time a
plan is executed?  Is there a way of protecting the results?

2) if the tupletables do stack up, how does one explicitly dispose of them?


Re: memory management..  as I understand it the difference between upper and
context memory: upper is like global or static memory, remains intact;
context is scoped to the C function it was constructed in, and is
automatically disposed of when the context is disposed of.

I am a novice C programmer and am pretty much learning C as a useful
side-effect of implementing this solution. so:

3) is the context referring to anything going on inside the connection? or
are we talking when a C function containing the declarations for TupleDesc
and SPITupleTable returns and discards its local variables?

Thank you,
Scott..





Message-ID: <000201c06480$999f0160$0a00a8c0@lan>
Permalink:  ../000201c06480$999f0160$0a00a8c0@lan/
Also on:    postgresql.org/message-id/000201c06480$999f0160$0a00a8c0@lan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: wsmuir@islandnet.com
  Subject: Re: SPI question...
  In-Reply-To: <000201c06480$999f0160$0a00a8c0@lan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox