Is querying SPITupleTable with SQL possible?

2019-10-01 Thread Tom Mercha
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 state

Re: Is querying SPITupleTable with SQL possible?

2019-10-02 Thread Tom Mercha
On 02/10/2019 16:11, Tom Lane wrote: > Tom Mercha 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

Understanding TupleQueue impact and overheads?

2019-10-15 Thread Tom Mercha
I have been looking at PostgreSQL's Tuple Queue (/include/executor/tqueue.h) which provides functionality for queuing tuples between processes through shm_mq. I am still familiarising myself with the bigger picture and TupTableStores. I can see that a copy (not a reference) of a HeapTuple (obta

SPI error with non-volatile functions

2019-11-12 Thread Tom Mercha
Dear Hackers I've been using SPI to execute some queries and this time I've tried to issue CREATE TABLE commands through SPI. I've been getting the message "ERROR: CREATE TABLE AS is not allowed in a non-volatile function". I'm a bit confused because my functions are set as volatile when I got

Re: SPI error with non-volatile functions

2019-11-12 Thread Tom Mercha
On 13/11/2019 06:13, Andres Freund wrote: > Hi, > > On 2019-11-13 05:09:31 +0000, Tom Mercha wrote: >> I've been using SPI to execute some queries and this time I've tried to >> issue CREATE TABLE commands through SPI. I've been getting the message >> &

SPI Concurrency Precautions?

2020-02-17 Thread Tom Mercha
Dear Hackers I've been working on an extension and using SPI to execute some queries. I am in a situation where I have the option to issue multiple queries concurrently, ideally under same snapshot and transaction. In short, I am achieving this by creating multiple dynamic background workers,

Re: SPI Concurrency Precautions? Problems with Parallel Execution of Multiple CREATE TABLE statements

2020-02-21 Thread Tom Mercha
On 17/02/2020 21:24, Tom Mercha wrote: Dear Hackers I've been working on an extension and using SPI to execute some queries. I am in a situation where I have the option to issue multiple queries concurrently, ideally under same snapshot and transaction. In short, I am achieving th

Extending PostgreSQL with a Domain-Specific Language (DSL) - Development

2019-07-05 Thread Tom Mercha
Dear Hackers I am interested in implementing my own Domain Specific Language (DSL) using PostgreSQL internals. Originally, the plan was not to use PostgreSQL and I had developed a grammar and used ANTLRv4 for parser work and general early development. Initially, I was hoping for a scenario whe

Re: Extending PostgreSQL with a Domain-Specific Language (DSL) - Development

2019-07-05 Thread Tom Mercha
nting out this direction! I think I will indeed adopt this approach especially if directly extending PostgreSQL grammar would be difficult. Regards Tom From: Tomas Vondra Sent: 05 July 2019 20:48 To: Tom Mercha Cc: pgsql-hack...@postgresql.org Subject: Re: Extendin

Re: Extending PostgreSQL with a Domain-Specific Language (DSL) - Development

2019-07-07 Thread Tom Mercha
x27;s fine now. > > On Fri, Jul 05, 2019 at 09:37:03PM +, Tom Mercha wrote: >>> I might be missing something, but it seems like you intend to replace >>> the SQL grammar we have with something else. It's not clear to me what >>> would be the point of doing tha

Re: Extending PostgreSQL with a Domain-Specific Language (DSL) - Development

2019-07-09 Thread Tom Mercha
On 09/07/2019 23:22, Tomas Vondra wrote: > On Sun, Jul 07, 2019 at 11:06:38PM +0000, Tom Mercha wrote: >> On 06/07/2019 00:06, Tomas Vondra wrote: >>> First of all, it's pretty difficult to follow the discussion when it's >>> not clear what's the origin

Re: Extending PostgreSQL with a Domain-Specific Language (DSL) - Development

2019-07-09 Thread Tom Mercha
On 10/07/2019 02:31, David G. Johnston wrote: > On Tue, Jul 9, 2019 at 5:23 PM Tom Mercha wrote: > >> >> I understand that you never wrote any PL handler but was just thinking >> about this functionality as a follow-up to our conversation. I was just >> wonderi