postgres.git / summary / log / commit / refs

commit    89d091f602fa59326d7cdf51e134e5525ef80977
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Mon Aug 24 01:48:36 2026 +0000

    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 <boekewurm+postgres@gmail.com>
    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 */