Re: Improved (De)Serialization Support - Mailing list pgsql-hackers

From Andy Pavlo
Subject Re: Improved (De)Serialization Support
Date
Msg-id 200802241304.42475.pavlo@cs.brown.edu
Whole thread Raw
In response to Re: Improved (De)Serialization Support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Saturday 23 February 2008 00:40, Tom Lane wrote:
> Andy Pavlo <pavlo@cs.brown.edu> writes:
> > I have added support in readfuncs.c to write out Query and PlannedStmt
> > objects using nodeToString() and then read them back in. We needed this
> > so that we could use PREPARE and write the arguments to
> > StorePreparedStatement() out to a file. We are going then read them back
> > into Postgres on a different server and use EXECUTE.
>
> Um, surely Query objects can be written/read already?

I meant specifically UpdateStmt, DeleteStmt, and InsertStmt objects. 
SelectStmt curiously was already in place.

> I'm not very excited about adding a load of code that will never be
> exercised during normal use.  That will inevitably be a hotbed of
> bit-rot.  Now, if the feature that needs it is also being proposed for
> inclusion in core, then maybe we could talk.

The research project that we are working will not be merged back into 
Postgres. The exercise of updating this part of the code for serialization 
that we need was very useful for me to understand the internals of Postgres 
better. I did spend about two days updating the out/read functions, and I 
figure that my enhancements would probably be useful for somebody else in the 
future.

At the very least you might want to consider taking my minimal changes to 
outfuncs.c, since using nodeToString() is useful for new developers to 
understand the nested structures used by the planner and optimizer.
-- 
Andy Pavlo
pavlo@cs.brown.edu


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Behaviour of rows containg not-null domains in plpgsql
Next
From: Andrew Dunstan
Date:
Subject: Re: 8.3 / 8.2.6 restore comparison