Re: Is querying SPITupleTable with SQL possible?

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Tom Mercha <mercha_t(at)hotmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is querying SPITupleTable with SQL possible?
Date: 2019-10-02 18:59:24
Message-ID: ee613d67-c22b-4c4c-a298-62b506da271c@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2019-10-02 18:59:27 Re: Online checksums patch - once again
Previous Message Tom Lane 2019-10-02 18:55:39 Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays