From 89d091f602fa59326d7cdf51e134e5525ef80977 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 24 Aug 2026 10:48:36 +0900 Subject: [PATCH] Move some node-read support functions from nodes.h to readfuncs.h The functions moved in this commit have been exposed since c1ddd2361f6e, and there still seem to be a couple of projects out there that require them, as they can be more efficient than nodeRead(). Note that all these functions are only called in readfuncs.c in terms of the core code. A follow-up patch plans to improve the in-core support of pg_strtok(), making it thread-safe. This change removes the need to expose internals specific to node reads in nodes.h, which is a header with a more general purpose than readfuncs.h. Based on a suggestion by me. Author: Matthias van de Meent Discussion: https://postgr.es/m/aofW6ntfWJjk_yBL@paquier.xyz --- src/include/nodes/nodes.h | 8 +------- src/include/nodes/readfuncs.h | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 372eee20680..e6fe8577997 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -205,18 +205,12 @@ extern char *nodeToStringWithLocations(const void *obj); extern char *bmsToString(const struct Bitmapset *bms); /* - * nodes/{readfuncs.c,read.c} + * nodes/read.c */ extern void *stringToNode(const char *str); #ifdef DEBUG_NODE_TESTS_ENABLED extern void *stringToNodeWithLocations(const char *str); #endif -extern struct Bitmapset *readBitmapset(void); -extern Datum readDatum(bool typbyval); -extern bool *readBoolCols(int numCols); -extern int *readIntCols(int numCols); -extern Oid *readOidCols(int numCols); -extern int16 *readAttrNumberCols(int numCols); /* * nodes/copyfuncs.c diff --git a/src/include/nodes/readfuncs.h b/src/include/nodes/readfuncs.h index 0a5abdd9691..8ee2ddcd5c8 100644 --- a/src/include/nodes/readfuncs.h +++ b/src/include/nodes/readfuncs.h @@ -34,5 +34,11 @@ extern void *nodeRead(const char *token, int tok_len); * prototypes for functions in readfuncs.c */ extern Node *parseNodeString(void); +extern struct Bitmapset *readBitmapset(void); +extern Datum readDatum(bool typbyval); +extern bool *readBoolCols(int numCols); +extern int *readIntCols(int numCols); +extern Oid *readOidCols(int numCols); +extern int16 *readAttrNumberCols(int numCols); #endif /* READFUNCS_H */