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? Is my approach OK?
The sure thing is that it is a messy task!

I posted this message to the 'general' and 'novice' lists but the only
answer I got was from the latter:

        " I'd look at extending the outfuncs/readfuncs code to deal with
        all the node types used in plan trees, and then store text
        strings instead of binary.
        
        regards, tom lane",

which seems a little confusing to me since as I said I'm a newbie.

Thanks in advance,
ntinoas 





31 Aug 2004 20:17:59 +0300
"Katsaros Kwn/nos" <ntinos@aueb.gr>
Storing a query plan...
Hello,

If you are a newbie :) I would suggest taking a slightly simpler 
approach by using prepared queries. Prepared queries will give you the 
stored plan, albeit per connection.

E.g:

PREPARE FOO AS SELECT ....

EXECUTE FOO;

Sincerely,

Joshua D. Drake


Katsaros Kwn/nos wrote:
> 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? Is my approach OK?
> The sure thing is that it is a messy task!
> 
> I posted this message to the 'general' and 'novice' lists but the only
> answer I got was from the latter:
> 
>         " I'd look at extending the outfuncs/readfuncs code to deal with
>         all the node types used in plan trees, and then store text
>         strings instead of binary.
>         
>         regards, tom lane",
> 
> which seems a little confusing to me since as I said I'm a newbie.
> 
> Thanks in advance,
> ntinoas 
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings


-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
Tue, 31 Aug 2004 10:28:12 -0700
"Joshua D. Drake" <jd@commandprompt.com>
Re: Storing a query plan...