Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cm9pn-0007Yw-6a for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2017 01:59:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cm9pm-0004DB-PO for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2017 01:59:10 +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.84_2) (envelope-from ) id 1cm9pm-0004D2-5d for pgsql-hackers@postgresql.org; Fri, 10 Mar 2017 01:59:10 +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.84_2) (envelope-from ) id 1cm9pk-0008A9-4Z for pgsql-hackers@postgresql.org; Fri, 10 Mar 2017 01:59:08 +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 v2A1x687007782; Thu, 9 Mar 2017 20:59:06 -0500 From: Tom Lane To: Michael Paquier cc: PostgreSQL mailing lists Subject: Re: [COMMITTERS] pgsql: Fix hard-coded relkind constants in pg_dump.c. In-reply-to: References: Comments: In-reply-to Michael Paquier message dated "Fri, 10 Mar 2017 09:46:32 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7780.1489111146.1@sss.pgh.pa.us> Date: Thu, 09 Mar 2017 20:59:06 -0500 Message-ID: <7781.1489111146@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Michael Paquier writes: > On Fri, Mar 10, 2017 at 9:19 AM, Tom Lane wrote: >> Existing style is mostly to inject relkind values into constructed >> query strings using %c. I did not bother to touch places that did it >> like that, but really a better technique is to stringify the RELKIND >> macro, at least in places where you'd want single quotes around the >> code character. That avoids any runtime effort and keeps the RELKIND >> symbol close to where it's used. > I have been wondering about the lack of readability with those > hardcoded relkinds in the code for some time but... Wouldn't it be > better to change as well psql's describe.c and tab_complete.c, as well > as pg_upgrade and initdb code? Yup, working on it. There's a fair number of other fields that could stand the same treatment, but for now I'm just going to touch references to relkind. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers