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

From Chapman Flack
Subject Re: Is querying SPITupleTable with SQL possible?
Date
Msg-id ee613d67-c22b-4c4c-a298-62b506da271c@anastigmatix.net
Whole thread Raw
In response to Re: Is querying SPITupleTable with SQL possible?  (Tom Mercha <mercha_t@hotmail.com>)
List pgsql-hackers
On 10/2/19 2:53 PM, Tom Mercha wrote:

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

You could look in the documentation for CREATE TRIGGER in PG 10
or later, specifically the clauses like REFERENCING NEW TABLE AS foo.

https://www.postgresql.org/docs/10/sql-createtrigger.html

While the trigger function is executing, it can do SPI SQL
queries exactly as if there is a table named 'foo' sitting there,
but it only "exists" for that function and only until it returns.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays
Next
From: Magnus Hagander
Date:
Subject: Re: Online checksums patch - once again