Re: row_to_json(), NULL values, and AS
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Neil Conway <neil.conway@gmail.com>
Cc: pgsql-bugs@postgresql.org
Date: 2018-06-15T19:34:58Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- better-handling-for-ambiguous-functional-notation-1.patch (text/x-diff) patch
Neil Conway <neil.conway@gmail.com> writes: > On Fri, Jun 15, 2018 at 7:53 AM Tom Lane <tgl@sss.pgh.pa.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.1529089235@sss.pgh.pa.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
Commits
-
Remove obsolete prohibition on function name matching a column name.
- 45e98ee73062 11.0 landed
-
Consider syntactic form when disambiguating function vs column reference.
- b97a3465d73b 11.0 landed