Re: row_to_json(), NULL values, and AS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neil(dot)conway(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: row_to_json(), NULL values, and AS
Date: 2018-06-15 19:34:58
Message-ID: 32293.1529091298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Neil Conway <neil(dot)conway(at)gmail(dot)com> writes:
> On Fri, Jun 15, 2018 at 7:53 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> (3) As it happens, the column interpretation is chosen when it's
>> ambiguous (cf ParseComplexProjection).
>>
>> 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.

> Interesting! Your proposed change seems quite reasonable to me.

Here's a proposed patch for that. (It needs to be applied over the
fixes in <14497(dot)1529089235(at)sss(dot)pgh(dot)pa(dot)us>, which are unrelated but
touch some of the same code.) I didn't add any test cases yet,
but probably it's desirable to have one.

I wrote the doc change on the assumption that we'd sneak this into
v11, but if anyone doesn't want to do that, I'll add it to the next
commitfest instead.

regards, tom lane

Attachment Content-Type Size
better-handling-for-ambiguous-functional-notation-1.patch text/x-diff 7.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-06-15 21:00:15 BUG #15243: make check shows errors, i.e. fails to find initdb and others
Previous Message Andrew Gierth 2018-06-15 18:47:01 Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-06-15 20:23:28 Re: [HACKERS] Statement-level rollback
Previous Message David Gershuni 2018-06-15 19:30:30 Re: Spilling hashed SetOps and aggregates to disk