pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Do not output actual value of location fields in node serializat
Date: Fri, 22 Mar 2024 08:55:56 +0000
Message-ID: <E1rnagt-0054F0-SD@gemulon.postgresql.org> (raw)

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 <boekewurm+postgres@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAEze2WgrCiR3JZmWyB0YTc8HV7ewRdx13j0CqD6mVkYAW+SFGQ@mail....

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d20d8fbd3e4d327dd0778a02d5661b51f4f6423a

Modified Files
--------------
src/backend/nodes/outfuncs.c | 37 ++++++++++++++++++++++++++++++++++---
src/backend/nodes/print.c    |  6 +++---
src/backend/tcop/postgres.c  |  6 +++---
src/include/nodes/nodes.h    |  1 +
4 files changed, 41 insertions(+), 9 deletions(-)



view thread (2+ messages)

Message-ID: <E1rnagt-0054F0-SD@gemulon.postgresql.org>
Permalink:  ../E1rnagt-0054F0-SD@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rnagt-0054F0-SD@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Do not output actual value of location fields in node serializat
  In-Reply-To: <E1rnagt-0054F0-SD@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox