RE: Is querying SPITupleTable with SQL possible?

Поиск
Список
Период
Сортировка
От Wu, Fei
Тема RE: Is querying SPITupleTable with SQL possible?
Дата
Msg-id 369f002f1f5f4abca40e8db9b86293a6@G08CNEXMBPEKD06.g08.fujitsu.local
обсуждение исходный текст
Ответ на Re: Is querying SPITupleTable with SQL possible?  (Tom Mercha <mercha_t@hotmail.com>)
Ответы Re: Is querying SPITupleTable with SQL possible?  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi,
I have had see your discussion about node EphemeralNamedRelation with the Community.
Now, I want to use this node in SQL(for test), I have saw the manual but could not understand,
can you show me a example on how to use it in SQL?

Thanks a lot~

Regards, wu fei

-----Original Message-----
From: Tom Mercha [mailto:mercha_t@hotmail.com] 
Sent: 2019年10月3日 2:53
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Is querying SPITupleTable with SQL possible?

On 02/10/2019 16:11, Tom Lane wrote:
> Tom Mercha <mercha_t@hotmail.com> writes:
>> 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);
> 
> It's possible you could use the "transition table" (aka
> EphemeralNamedRelation) infrastructure for this, though I'm not sure 
> if it's really a close fit, or whether it's been built out enough to 
> support this usage.  From memory, it wants to work with tuplestores, 
> which are a bit heavier-weight than SPITupleTables.
> 
>             regards, tom lane
> 

Thanks for this feedback! The EphemeralNamedRelation seems that it could be a good fit for what I'm looking for.

However, I'm not quite so sure how I can query over the EphemeralNamedRelation using SQL? Could someone indicate where
Ican find an example?
 

Regards
Tom





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: How is this possible "publication does not exist"
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Read Uncommitted