From bcac23de73b89b001fbc628d84471a392e928d1c Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 12 Feb 2016 09:31:16 -0500 Subject: Introduce extensible node types. An extensible node is always tagged T_Extensible, but the extnodename field identifies it more specifically; it may also include arbitrary private data. Extensible nodes can be copied, tested for equality, serialized, and deserialized, but the core system doesn't know anything about them otherwise. Some extensions may find it useful to include these nodes in fdw_private or custom_private lists in lieu of arm-wrestling their data into a format that the core code can understand. Along the way, so as not to burden the authors of such extensible node types too much, expose the functions for writing serialized tokens, and for serializing and deserializing bitmapsets. KaiGai Kohei, per a design suggested by me. Reviewed by Andres Freund and by me, and further edited by me. --- src/include/nodes/nodes.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include/nodes/nodes.h') diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index cf09db4e5fe..c407fa2cd49 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -275,6 +275,11 @@ typedef enum NodeTag T_IntList, T_OidList, + /* + * TAGS FOR EXTENSIBLE NODES (extensible.h) + */ + T_ExtensibleNode, + /* * TAGS FOR STATEMENT NODES (mostly in parsenodes.h) */ @@ -527,10 +532,17 @@ extern PGDLLIMPORT Node *newNodeMacroHolder; */ extern char *nodeToString(const void *obj); +struct Bitmapset; /* not to include bitmapset.h here */ +struct StringInfoData; /* not to include stringinfo.h here */ +extern void outToken(struct StringInfoData *str, const char *s); +extern void outBitmapset(struct StringInfoData *str, + const struct Bitmapset *bms); + /* * nodes/{readfuncs.c,read.c} */ extern void *stringToNode(char *str); +extern struct Bitmapset *readBitmapset(void); /* * nodes/copyfuncs.c -- cgit v1.2.3