Matt Andrews <mattandrews@xxxxxxxxxxxxx> writes: > Incidentally, I have become interested in the pg_node_tree type. I can't > find much info on it. Would that be in the source? What would be the first > steps for writing an extension for this sort of thing? pg_node_tree is just a serialization of the tree-of-Node-structs representation used inside the server. See src/include/nodes/primnodes.h and adjacent files for Node definitions. The actual serialization code is in src/backend/nodes/outfuncs.c and adjacent files. (Beware, however, that there's proposals floating around to change the serialization format.) regards, tom lane