pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Dilger <hornschnorter@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: inappropriate use of NameGetDatum macro
Date: Mon, 12 Sep 2016 12:39:56 -0700
Message-ID: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Friends,

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.

src/backend/commands/proclang.c, line 466.
src/backend/commands/dbcommands.c, lines 1263, 1489, 1606, 1746.

Am I overlooking some reason why the code is correct as is? If not,
I am attaching a patch that applies cleanly for me against master,
compiles, and passes the regression tests.

Thanks,

Mark Dilger

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  NameGetDatum.patch.1 (application/octet-stream, 2.1K) download

view thread (3+ messages)  latest in thread

Message-ID: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com>
Permalink:  ../EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com/
Also on:    postgresql.org/message-id/EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: hornschnorter@gmail.com
  Subject: Re: inappropriate use of NameGetDatum macro
  In-Reply-To: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com>
  References: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox