From d20d8fbd3e4d327dd0778a02d5661b51f4f6423a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 22 Mar 2024 09:13:35 +0100 Subject: Do not output actual value of location fields in node serialization by default This changes nodeToString() to not output the actual value of location fields in nodes, but instead it writes -1. This mirrors the fact that stringToNode() also does not read location field values but always stores -1. For most uses of nodeToString(), which is to store nodes in catalog fields, this is more useful. We don't store original query texts in catalogs, so any lingering query location values are not meaningful. For debugging purposes, there is a new nodeToStringWithLocations(), which mirrors the existing stringToNodeWithLocations(). This is used for WRITE_READ_PARSE_PLAN_TREES and nodes/print.c functions, which covers all the debugging uses. Reviewed-by: Matthias van de Meent Discussion: https://www.postgresql.org/message-id/flat/CAEze2WgrCiR3JZmWyB0YTc8HV7ewRdx13j0CqD6mVkYAW+SFGQ@mail.gmail.com --- src/include/nodes/nodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include') diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index f7a532ea0a6..855009fd6e2 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -195,6 +195,7 @@ extern void outBitmapset(struct StringInfoData *str, extern void outDatum(struct StringInfoData *str, uintptr_t value, int typlen, bool typbyval); extern char *nodeToString(const void *obj); +extern char *nodeToStringWithLocations(const void *obj); extern char *bmsToString(const struct Bitmapset *bms); /* -- cgit v1.2.3