[HACKERS] Storing a query plan...

2004-08-31 Thread Katsaros Kwn/nos
Hi! I'm new to PostgreSQL (and C) and what I'm trying to do is to store a query plan on disc (in a binary file). My approach is to use SPI functions to get the query plan and then transform it into a 'storable' format (Replacing the pointers with actual values). Is there any other way to do this?

[HACKERS] Problems with SPI memory management

2004-09-15 Thread Katsaros Kwn/nos
Hi! I posted the following message to the general list but no answer.Could you please help? I have some problems with the SPI memory management (at least I think this is the problem). What I'm trying to do is to get the Query related to a select statement, alter it and produce a new SPI_plan that

Re: [HACKERS] Problems with SPI memory management

2004-09-16 Thread Katsaros Kwn/nos
On Wed, 2004-09-15 at 19:51, Tom Lane wrote: > You'd be well advised to be doing this sort of hackery in a build with > --enable-cassert. That turns on CLOBBER_FREED_MEMORY which makes > misuse of freed memory a whole lot more obvious. I did this but when I try do create a function the following

Re: [HACKERS] Problems with SPI memory management (new...)

2004-09-17 Thread Katsaros Kwn/nos
On Wed, 2004-09-15 at 19:51, Tom Lane wrote: > "Katsaros Kwn/nos" <[EMAIL PROTECTED]> writes: > > What I'm trying to do is to get the Query related to a select statement, > > alter it and produce a new SPI_plan that will execute. To do so, I > > retrieve t

Re: [HACKERS] Networking feature for postgresql...

2004-10-15 Thread Katsaros Kwn/nos
> I saw your message on the postgresql mailing lists. The TelegraphCQ > project at Berkeley is implemented using the Postgres code base as a > starting point. TelegraphCQ has a generalized mechanism for receiving > data from remote data sources, and also for on demand request-response > style queri

[HACKERS] Networking feature for postgresql...

2004-10-14 Thread Katsaros Kwn/nos
Hi, I'm trying to add a -project specific- networking feature to my postgres build (or database as function). What I want to do is to send a Query instance (as a String-retrieved through an SPI function) to other machines and (after they have executed it) to receive result tuples. It's about a med

Re: [HACKERS] [GENERAL] Networking feature for postgresql...

2004-10-14 Thread Katsaros Kwn/nos
Well, actually no :) ! Thanks for the hint! But just from curiosity, would the scenario I described work? I mean is it possible for an SPI process to run in the background while other SPI calls are made? Ntinos Katsaros On Thu, 2004-10-14 at 11:15, Richard Huxton wrote: > Katsaros Kwn/

Re: [HACKERS] [GENERAL] Networking feature for postgresql...

2004-10-16 Thread Katsaros Kwn/nos
oring procedures? On the other side, I suppose a server can serve multiple incoming queries. Regards, Ntinos Katsaros On Thu, 2004-10-14 at 11:57, Richard Huxton wrote: > Katsaros Kwn/nos wrote: > > Well, actually no :) ! Thanks for the hint! > > > > But just from curio

[HACKERS] Memory Context problems...

2004-11-07 Thread Katsaros Kwn/nos
Hi everybody, I have some problems with management of memory contexts (at least I thing so). I'll try to describe my problem in a few lines: I've written some code based on spi.c. I've created my_spi.c (and my_spi.h) which provide some more features I wanted (did not alter spi itself to keep code

Re: [HACKERS] Memory Context problems...

2004-11-08 Thread Katsaros Kwn/nos
On Sun, 2004-11-07 at 21:31, Tom Lane wrote: > "Katsaros Kwn/nos" <[EMAIL PROTECTED]> writes: > > More precisely,when I call (my_)SPI_prepare the following message comes > > exactly at the point where (my_)SPI_end_call(true) is called: > > > WARNING: pr

[HACKERS] SRF related and other questions

2004-11-20 Thread Katsaros Kwn/nos
Hi, First, I have the following question on Set Returning Functions:   Regarding the return type, there are two ways of defining it:   Either set it to:  "setof  _some_predifined_type" or set it to:  "setof records" and then define the expected results with "as(attr1 type, ..., attr_n type)"

Re: [HACKERS] SRF related and other questions

2004-11-21 Thread Katsaros Kwn/nos
On Sat, 2004-11-20 at 19:56, Joe Conway wrote: > When returning "setof record", the column definition must exist in the > query, and must match what ultimately is returned. This means that > whatever logic you use in your application to write the sql statement > must be able to derive the appro