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 - [EMAIL PROTECTED] - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
begin:vcard
fn:Joshua D. Drake
n:Drake;Joshua D.
org:Command Prompt, Inc.
adr:;;PO Box 215;Cascade Locks;Oregon;97014;USA
email;internet:[EMAIL PROTECTED]
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We  provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored  the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to