Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjv7g-0006dR-Cy for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2016 21:20:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bjv7f-0001rR-VN for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2016 21:20:08 +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 1bjv6H-0007gp-OX for pgsql-hackers@postgresql.org; Tue, 13 Sep 2016 21:18:41 +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 1bjv6E-0004ri-Pj for pgsql-hackers@postgresql.org; Tue, 13 Sep 2016 21:18:40 +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 u8DLIbk5016911; Tue, 13 Sep 2016 17:18:37 -0400 From: Tom Lane To: Mark Dilger cc: PostgreSQL-development Subject: Re: inappropriate use of NameGetDatum macro In-reply-to: <13677.1473710134@sss.pgh.pa.us> References: <13677.1473710134@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 12 Sep 2016 15:55:34 -0400" Date: Tue, 13 Sep 2016 17:18:37 -0400 Message-ID: <16910.1473801517@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) 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 I wrote: > Mark Dilger writes: >> there are several places in the code where variables defined as >> (char *) or as (const char *) are passed to the NameGetDatum() >> macro. I believe it would be better form to use CStringGetDatum() >> in these locations. I am aware that these two macros are internally >> the same. > I'm tempted to propose that we redefine NameGetDatum as > #define NameGetDatum(X) CStringGetDatum(NameStr(*(X))) Pushed with that change. 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