Re: inappropriate use of NameGetDatum macro

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Dilger <hornschnorter(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inappropriate use of NameGetDatum macro
Date: 2016-09-13 21:18:37
Message-ID: 16910.1473801517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Mark Dilger <hornschnorter(at)gmail(dot)com> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-09-13 21:52:14 Re: pg_basebackup wish list
Previous Message Petr Jelinek 2016-09-13 21:06:35 Re: autonomous transactions