pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Neil Conway <neil.conway@gmail.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Subject: Re: row_to_json(), NULL values, and AS
Date: Tue, 19 Jun 2018 11:11:30 -0400
Message-ID: <20877.1529421090@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYnWZVnDJofLZ1x+rPN=R=362tUfUacnyMymqk0R3Mx=g@mail.gmail.com>
References: <CAOW5sYa3Wp7KozCuzjOdw6PiOYPi6D=VvRybtH2S=2C0SVmRmA@mail.gmail.com>
	<18365.1529018904@sss.pgh.pa.us>
	<32582.1529074393@sss.pgh.pa.us>
	<CA+TgmoYnWZVnDJofLZ1x+rPN=R=362tUfUacnyMymqk0R3Mx=g@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jun 15, 2018 at 10:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm a bit hesitant to muck with this behavior, given that it's stood
>> for ~20 years.  However, if we did want to touch it, maybe the right
>> thing would be to give up the absolutist position that f(x) and x.f
>> are exactly interchangeable.  We could say instead that we prefer the
>> function interpretation if function syntax is used, and the column
>> interpretation if column syntax is used.  I don't know how likely
>> that is to break existing apps ... perhaps not very, but I wouldn't
>> risk back-patching it in any case.

> For the record, I fear that this change (committed as
> b97a3465d73bfc2a9f5bcf5def1983dbaa0a26f8) is going to break more
> things than have been foreseen in this thread.  I do not have a
> specific theory about how that's going to happen, just vague unease.

Yeah, that's why I wouldn't back-patch it.  But certainly the behavior
Neil complained of is pretty bad as well, and it's only going to get
worse as we invent more functions taking record.  I think the new
behavior is a clear improvement.  If it breaks any apps that were
relying on interpreting f(x) as a column, they can fix it by writing
x.f instead.  We inflict worse upgrade pain than that on a regular
basis.

			regards, tom lane




view thread (9+ messages)

Message-ID: <20877.1529421090@sss.pgh.pa.us>
Permalink:  ../20877.1529421090@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20877.1529421090@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, neil.conway@gmail.com
  Subject: Re: row_to_json(), NULL values, and AS
  In-Reply-To: <20877.1529421090@sss.pgh.pa.us>
  References: <CAOW5sYa3Wp7KozCuzjOdw6PiOYPi6D=VvRybtH2S=2C0SVmRmA@mail.gmail.com> <18365.1529018904@sss.pgh.pa.us> <32582.1529074393@sss.pgh.pa.us> <CA+TgmoYnWZVnDJofLZ1x+rPN=R=362tUfUacnyMymqk0R3Mx=g@mail.gmail.com> <20877.1529421090@sss.pgh.pa.us>

* 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