Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmipq-0005FA-Ln for pgsql-bugs@arkaria.postgresql.org; Sat, 20 Jun 2020 19:07:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jmipI-000776-8D for pgsql-bugs@arkaria.postgresql.org; Sat, 20 Jun 2020 19:06:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmipI-00076z-25 for pgsql-bugs@lists.postgresql.org; Sat, 20 Jun 2020 19:06:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmipA-00037l-Ja for pgsql-bugs@lists.postgresql.org; Sat, 20 Jun 2020 19:06:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05KJ6eJW1816980; Sat, 20 Jun 2020 15:06:40 -0400 From: Tom Lane To: Euler Taveira cc: pgsql-bugs@lists.postgresql.org, m.sakrejda@gmail.com Subject: Re: BUG #16502: EXPLAIN JSON format adds extra quotes around index names In-reply-to: References: <16502-57bd1c9f913ed1d1@postgresql.org> Comments: In-reply-to Euler Taveira message dated "Sat, 20 Jun 2020 15:22:17 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1816978.1592680000.1@sss.pgh.pa.us> Date: Sat, 20 Jun 2020 15:06:40 -0400 Message-ID: <1816979.1592680000@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Euler Taveira writes: > Indeed, relation names should return the same. The fact that > explain_get_index_name always calls quote_identifier is the culprit; it > should call quote_identifier only when the format is TEXT. Patch is > attached. Agreed as to the bug, but I think we ought to fix it by redefining explain_get_index_name's API as "return the bare index name always", and let the callers apply quoting. The callers seem to all have separate code paths for text format already. Furthermore, if explain_get_index_name needs to have different behavior for text format, that requirement propagates to explain_get_index_name_hook functions --- and I don't think we want to change the signature for that hook. regards, tom lane