Be pickier about converting between Name and Datum.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 55c3391d1e6a201b5b891781d21fe682a8c64fe6
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2016-09-13T21:17:48Z
Releases: 10.0
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>

Files