pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts.
Date: Thu, 13 Jan 2022 22:50:06 +0000
Message-ID: <E1n88v0-0004uE-A8@gemulon.postgresql.org> (raw)

Fix ruleutils.c's dumping of whole-row Vars in more contexts.

Commit 7745bc352 intended to ensure that whole-row Vars would be
printed with "::type" decoration in all contexts where plain
"var.*" notation would result in star-expansion, notably in
ROW() and VALUES() constructs.  However, it missed the case of
INSERT with a single-row VALUES, as reported by Timur Khanjanov.

Nosing around ruleutils.c, I found a second oversight: the
code for RowCompareExpr generates ROW() notation without benefit
of an actual RowExpr, and naturally it wasn't in sync :-(.
(The code for FieldStore also does this, but we don't expect that
to generate strictly parsable SQL anyway, so I left it alone.)

Back-patch to all supported branches.

Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3433a1fc76762675170c7d2455ea29e575918898

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 56 +++++++++++++++++++------------
src/test/regress/expected/create_view.out | 18 +++++++++-
src/test/regress/sql/create_view.sql      |  5 +++
3 files changed, 56 insertions(+), 23 deletions(-)



view thread (12+ messages)  latest in thread

Message-ID: <E1n88v0-0004uE-A8@gemulon.postgresql.org>
Permalink:  ../E1n88v0-0004uE-A8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1n88v0-0004uE-A8@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts.
  In-Reply-To: <E1n88v0-0004uE-A8@gemulon.postgresql.org>
  References: <E1n88v0-0004uE-A8@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