Is querying SPITupleTable with SQL possible? - Mailing list pgsql-hackers

From Tom Mercha
Subject Is querying SPITupleTable with SQL possible?
Date
Msg-id AM0PR04MB473728B53DDB36FC30C1A090F49C0@AM0PR04MB4737.eurprd04.prod.outlook.com
Whole thread Raw
Responses Re: Is querying SPITupleTable with SQL possible?
List pgsql-hackers
Dear Hackers

I am using PostgreSQL's SPI to execute a simple SQL query (SELECT * FROM 
...) via SPI_exec. As a a result, I get an SPITupleTable with the 
results of my query.

Now that I have the SPITupleTable, I was wondering if it would be 
possible to later query over it further in my SQL statements using SPI, 
for example, something a bit similar to SPI_Exec ("Select * FROM 
:mySPITupleTable", 0);

My motivation is to treat, and use the SPITupleTable as 'intermediate' 
or 'temporary' tables which I would discard early - I want to apply a 
series of manipulations to my SPITupleTable before I would finally store 
it in the tablespace. Therefore, minimization of any overheads is also 
very important. I understand that I could introduce a CREATE TABLE to my 
SQL query and reference a table in that way, but I am under the 
impression that it would incur unnecessary overheads?

So, I would be grateful if anyone could help me understand how to 
manipulate the SPITupleTable further with SQL or indicate if it is at 
all possible. In the case that it is not possible, I would also be 
interested in alternatives and discussion on overheads.

Thanks in advance.

Best,
Tom

pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Peripatus: Can someone look?
Next
From: Amit Kapila
Date:
Subject: Re: dropdb --force