Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVKqS-000231-Uk for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 17:55:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVIIB-0002GN-4F for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 15:11:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVIIA-0002GD-Qa for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 15:11:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVII8-0004Bc-BL for pgsql-bugs@postgresql.org; Tue, 19 Jun 2018 15:11:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w5JFBUpp020878; Tue, 19 Jun 2018 11:11:30 -0400 From: Tom Lane To: Robert Haas cc: Neil Conway , Postgres-Bugs Subject: Re: row_to_json(), NULL values, and AS In-reply-to: References: <18365.1529018904@sss.pgh.pa.us> <32582.1529074393@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 19 Jun 2018 10:34:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20876.1529421090.1@sss.pgh.pa.us> Date: Tue, 19 Jun 2018 11:11:30 -0400 Message-ID: <20877.1529421090@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Fri, Jun 15, 2018 at 10:53 AM, Tom Lane 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