Be pickier about converting between Name and Datum.
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/dbcommands.c | modified | +4 −4 |
| src/backend/commands/proclang.c | modified | +1 −1 |
| src/backend/commands/typecmds.c | modified | +1 −1 |
| src/include/postgres.h | modified | +1 −1 |