pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Be pickier about converting between Name and Datum.
Date: Tue, 13 Sep 2016 21:17:53 +0000
Message-ID: <E1bjv5V-0001s9-N8@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Be pickier about converting between Name and Datum.

We were misapplying NameGetDatum() to plain C strings in some places.
This worked, because it was just a pointer cast anyway, but it's a type
cheat in some sense.  Use CStringGetDatum instead, and modify the
NameGetDatum macro so it won't compile if applied to something that's
not a pointer to NameData.  This should result in no changes to
generated code, but it is logically cleaner.

Mark Dilger, tweaked a bit by me

Discussion: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/55c3391d1e6a201b5b891781d21fe682a8c64fe6

Modified Files
--------------
src/backend/commands/dbcommands.c | 8 ++++----
src/backend/commands/proclang.c   | 2 +-
src/backend/commands/typecmds.c   | 2 +-
src/include/postgres.h            | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)


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


Message-ID: <E1bjv5V-0001s9-N8@gemulon.postgresql.org>
Permalink:  ../E1bjv5V-0001s9-N8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bjv5V-0001s9-N8@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Be pickier about converting between Name and Datum.
  In-Reply-To: <E1bjv5V-0001s9-N8@gemulon.postgresql.org>
  References: <E1bjv5V-0001s9-N8@gemulon.postgresql.org>

* 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